summary refs log tree commit diff
path: root/synapse/third_party_rules (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Override any missing default power level keys with DINUM's defaults when ↵Andrew Morgan2020-10-291-18/+37
| | | | | | | creating a room (#68) The createRoom flow in DINUM's Synapse (through the AccessRules module which has hooks for all of this) already rejects a power levels content dict if it doesn't have high enough power levels to satisfy DINUM's [requirements](https://github.com/matrix-org/synapse-dinsic/blob/ac50ed353b5fdbdf9f853be0d94b6fccaf33973e/synapse/third_party_rules/access_rules.py#L233-L252). This PR ensures that any keys that aren't provided are replaced with the defaults, instead of just assuming the whole dict was correct (and thus those keys were set to mainline Synapse's default instead).
* "Freeze" a room when the last admin of that room leaves (#59)Andrew Morgan2020-10-131-3/+171
| | | | | | | | If the last admin of a room departs, and thus the room no longer has any admins within it, we "freeze" the room. Freezing a room means that the power level required to do anything in the room (sending messages, inviting others etc) will require power level 100. At the moment, an admin can come back and unfreeze the room manually. The plan is to eventually make unfreezing of the room automatic on admin rejoin, though that will be in a separate PR. This *could* work in mainline, however if the admin who leaves is on a homeserver without this functionality, then the room isn't frozen. I imagine this would probably be pretty confusing to people. Part of this feature was allowing Synapse modules to send events, which has been implemented in mainline at https://github.com/matrix-org/synapse/pull/8479, and cherry-picked to the `dinsic` fork in 62c7b10. The actual freezing logic has been implemented here in the RoomAccessRules module.
* Make AccessRules use the public rooms directory instead of checking a room's ↵Andrew Morgan2020-09-181-43/+103
| | | | | | | join rules on rule change (#63) This PR switches several conditions regarding room access rules to check against the status of the room's inclusion in the public room list instead of its join rules. The code includes a snapshot of https://github.com/matrix-org/synapse/pull/8292, which will likely change in time and need merging in again.
* Override the power levels defaults, enforce mod requirement for invites, ↵Andrew Morgan2020-09-111-2/+66
| | | | | | | | | | admin requirements for unknown state events (#61) This PR modifies the `RoomAccessRules` module, an implementation of `ThirdPartyEventRules`, to both: * Modify the default power levels when creating a room to set: - `invite` to be minimum PL50 - `state_default` to be minimum PL100 * Enforce this when creating the room.
* RoomAccessRules cleanup (#62)Andrew Morgan2020-09-101-115/+182
| | | | | | | Various cleanups of the DINUM-specific `RoomAccessRules` module, including: * Type hints * Docstring cleanups * Some code cleanups
* Re-add third_party_rules/__init__.pyAndrew Morgan2020-04-151-0/+14
| | | | Accidentally deleted in https://github.com/matrix-org/synapse-dinsic/commit/6c058e32063b606b473f415ae6b68000f036ff94#diff-2a9df128248ff0ce75eb3f836469110a
* Have ThirdPartyEventRules return True on successAndrew Morgan2020-03-231-1/+3
|
* Remove unnecessary parentheses around return statements (#5931)Andrew Morgan2020-02-241-14/+0
|
* Dinsic Blacking with black==18.6b2Andrew Morgan2020-02-111-30/+23
|
* Allow membership events which membership isn't join or invite in restricted ↵Brendan Abolivier2019-09-261-1/+9
| | | | rooms
* Process revocations in _on_membership_or_invite_directBrendan Abolivier2019-09-091-18/+11
|
* TypoBrendan Abolivier2019-09-061-1/+1
|
* Only filter on 3PID invite tokensBrendan Abolivier2019-09-061-6/+6
|
* Merge branch 'dinsic' into babolivier/dinsic-3pid-inviteBrendan Abolivier2019-09-061-0/+48
|\
| * LintBrendan Abolivier2019-09-051-2/+0
| |
| * Forbid changing the name, avatar or topic of a direct roomBrendan Abolivier2019-09-051-0/+50
| |
* | Don't process revoked/redacted events as part of the room's membership infoBrendan Abolivier2019-09-061-2/+2
| |
* | Don't treat 3PID revokation as a new 3PID inviteBrendan Abolivier2019-09-061-7/+19
|/
* Explain rationaleBrendan Abolivier2019-08-011-0/+4
|
* Incorporate reviewBrendan Abolivier2019-07-301-15/+13
|
* Merge ifsBrendan Abolivier2019-07-251-5/+4
|
* DocBrendan Abolivier2019-07-251-2/+14
|
* Only check the join rule on room creation if an access rule is also providedBrendan Abolivier2019-07-251-12/+12
|
* Implement restrictions on new eventsBrendan Abolivier2019-07-241-1/+40
|
* Implement restriction on public room creationBrendan Abolivier2019-07-241-11/+30
|
* There's no third_party_signed property in an invite's contentBrendan Abolivier2019-07-171-6/+3
|
* Fix check of the association between a 3PID invite and the subsequent ↵Brendan Abolivier2019-07-171-1/+7
| | | | m.room.member event in the 3rd party rules
* Merge branch 'babolivier/power-levels' of github.com:matrix-org/synapse into ↵Brendan Abolivier2019-07-031-0/+1
|\ | | | | | | babolivier/power-levels
| * Update synapse/third_party_rules/access_rules.pyBrendan Abolivier2019-07-031-0/+1
| | | | | | Co-Authored-By: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* | Incorporate reviewBrendan Abolivier2019-07-031-6/+10
|/
* Incorporate reviewBrendan Abolivier2019-07-031-8/+12
|
* Change the rule for applying PL restrictionsBrendan Abolivier2019-07-031-3/+7
|
* Default return value for events we're not interested inBrendan Abolivier2019-07-031-0/+2
|
* Refactor part of the access rules moduleBrendan Abolivier2019-07-031-33/+47
| | | | Since we're not processing only membership events and 3PID invites anymore, it's nice to know which function is supposed to process what.
* Implement restrictions for power levelsBrendan Abolivier2019-07-031-0/+57
|
* Don't process 3PIDs in _apply_restrictedBrendan Abolivier2019-06-181-1/+3
|
* LintBrendan Abolivier2019-06-181-1/+0
|
* Incorporate reviewBrendan Abolivier2019-06-181-78/+69
|
* FixesBrendan Abolivier2019-06-181-0/+5
|
* DocstringsBrendan Abolivier2019-06-171-27/+154
|
* Rename into RoomAccessRulesBrendan Abolivier2019-06-172-0/+262