pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/chat/matrix-synapse chat/matrix-synapse: Add a variabl...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5f89ed594d33
branches:  trunk
changeset: 454081:5f89ed594d33
user:      js <js%pkgsrc.org@localhost>
date:      Sun Jun 06 09:40:34 2021 +0000

description:
chat/matrix-synapse: Add a variable for the default creator power level

diffstat:

 chat/matrix-synapse/Makefile                               |  10 ++++++-
 chat/matrix-synapse/distinfo                               |   3 +-
 chat/matrix-synapse/patches/patch-synapse_handlers_room.py |  19 ++++++++++++++
 3 files changed, 30 insertions(+), 2 deletions(-)

diffs (62 lines):

diff -r 3f536f303047 -r 5f89ed594d33 chat/matrix-synapse/Makefile
--- a/chat/matrix-synapse/Makefile      Sun Jun 06 09:32:36 2021 +0000
+++ b/chat/matrix-synapse/Makefile      Sun Jun 06 09:40:34 2021 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.25 2021/06/05 15:28:02 js Exp $
+# $NetBSD: Makefile,v 1.26 2021/06/06 09:40:34 js Exp $
 
 DISTNAME=      matrix-synapse-1.35.1
+PKGREVISION=   1
 CATEGORIES=    chat
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=matrix-org/}
 EGG_NAME=      matrix_synapse-${PKGVERSION_NOREV}
@@ -74,6 +75,13 @@
 MESSAGE_SUBST+=        PYTHONBIN=${PYTHONBIN:Q}
 MESSAGE_SUBST+=        SYNAPSE_DATA=${SYNAPSE_DATA:Q}
 
+SYNAPSE_DEFAULT_CREATOR_PL?=   100
+SUBST_CLASSES+=                        pl
+SUBST_STAGE.pl=                        post-patch
+SUBST_FILES.pl=                        synapse/handlers/room.py
+SUBST_VARS.pl=                 SYNAPSE_DEFAULT_CREATOR_PL
+BUILD_DEFS+=                   SYNAPSE_DEFAULT_CREATOR_PL
+
 .include "../../lang/python/egg.mk"
 .include "../../lang/python/versioned_dependencies.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r 3f536f303047 -r 5f89ed594d33 chat/matrix-synapse/distinfo
--- a/chat/matrix-synapse/distinfo      Sun Jun 06 09:32:36 2021 +0000
+++ b/chat/matrix-synapse/distinfo      Sun Jun 06 09:40:34 2021 +0000
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.17 2021/06/05 15:28:02 js Exp $
+$NetBSD: distinfo,v 1.18 2021/06/06 09:40:34 js Exp $
 
 SHA1 (matrix-synapse-1.35.1.tar.gz) = db4bda55f94b523176a2322665390b637d75618d
 RMD160 (matrix-synapse-1.35.1.tar.gz) = 3493881a1038319eae27a5b6f8e161a214294f69
 SHA512 (matrix-synapse-1.35.1.tar.gz) = 02a7a23f8d004c3e7d1af6904f4fac5d403335a7f089b80af367a833c292d0f970938f62a87f87a94ebee5acb41c87d50e337a8a38b0294657731155e7bfa3b3
 Size (matrix-synapse-1.35.1.tar.gz) = 7301793 bytes
+SHA1 (patch-synapse_handlers_room.py) = 5c4a5ff4773b9ae4a8ce2b66ac7cd8aa678627ca
 SHA1 (patch-synapse_python_dependencies.py) = 914ae3a34a9367b2d479d393ddc7a07cbff65b36
diff -r 3f536f303047 -r 5f89ed594d33 chat/matrix-synapse/patches/patch-synapse_handlers_room.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/chat/matrix-synapse/patches/patch-synapse_handlers_room.py        Sun Jun 06 09:40:34 2021 +0000
@@ -0,0 +1,19 @@
+$NetBSD: patch-synapse_handlers_room.py,v 1.1 2021/06/06 09:40:34 js Exp $
+
+This patch allows changing the default power level for the creator of a new
+room. It's useful to set this higher than 100 so that the creator of the room
+can give admin to others while still retaining the ability to revoke admin from
+someone. In the past, this turned out to be the only thing that could recover a
+room in which a bridge with admin permissions went wild and kicked everybody.
+
+--- synapse/handlers/room.py.orig      2021-06-03 12:24:19.000000000 +0000
++++ synapse/handlers/room.py
+@@ -936,7 +936,7 @@ class RoomCreationHandler(BaseHandler):
+             )
+         else:
+             power_level_content = {
+-                "users": {creator_id: 100},
++                "users": {creator_id: @SYNAPSE_DEFAULT_CREATOR_PL@},
+                 "users_default": 0,
+                 "events": {
+                     EventTypes.Name: 50,



Home | Main Index | Thread Index | Old Index