Mercurial > prosody-hg
comparison plugins/muc/mod_muc.lua @ 13496:3e6d5738ea09
MUC: Don't default component admins to being room owners
This change has various technical and social benefits. If ownership of a MUC
is really needed, it can be gained using the 'Set affiliation' ad-hoc command
or prosodyctl shell.
Example client incompatibility with the old behaviour:
- https://github.com/monal-im/Monal/issues/1085
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 18 Jun 2024 15:08:30 +0100 |
| parents | 47e1df2d0a37 |
| children | 404d3644ac4a |
comparison
equal
deleted
inserted
replaced
| 13495:47e1df2d0a37 | 13496:3e6d5738ea09 |
|---|---|
| 123 }); | 123 }); |
| 124 module:default_permissions("prosody:guest", { | 124 module:default_permissions("prosody:guest", { |
| 125 ":list-rooms"; | 125 ":list-rooms"; |
| 126 }); | 126 }); |
| 127 | 127 |
| 128 if module:get_option_boolean("component_admins_as_room_owners", true) then | 128 if module:get_option_boolean("component_admins_as_room_owners", false) then |
| 129 -- Monkey patch to make server admins room owners | 129 -- Monkey patch to make server admins room owners |
| 130 local _get_affiliation = room_mt.get_affiliation; | 130 local _get_affiliation = room_mt.get_affiliation; |
| 131 function room_mt:get_affiliation(jid) | 131 function room_mt:get_affiliation(jid) |
| 132 if module:could(":automatic-ownership", jid) then return "owner"; end | 132 if module:could(":automatic-ownership", jid) then return "owner"; end |
| 133 return _get_affiliation(self, jid); | 133 return _get_affiliation(self, jid); |
