summary refs log tree commit diff
path: root/synapse/events/third_party_rules.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Make `_get_state_map_for_room` not break when room state events don't ↵David Teller2022-07-071-8/+1
| | | | | contain an event id. (#13174) Method `_get_state_map_for_room` seems to break in presence of some ill-formed events in the database. Reimplementing this method to use `get_current_state`, which is more robust to such events.
* Wait for lazy join to complete when getting current state (#12872)Erik Johnston2022-06-011-1/+2
|
* Implement cancellation support/protection for module callbacks (#12568)Sean Quah2022-05-091-6/+30
| | | | | | | | | | | | There's no guarantee that module callbacks will handle cancellation appropriately. Protect module callbacks with read semantics from cancellation and avoid swallowing `CancelledError`s that arise. Other module callbacks, such as the `on_*` callbacks, are presumed to live on code paths that involve writes and aren't cancellation-friendly. These module callbacks have been left alone. Signed-off-by: Sean Quah <seanq@element.io>
* Add a callback to react to 3PID associations (#12302)Brendan Abolivier2022-03-311-0/+26
|
* Add third_party module callbacks to check if a user can delete a room and ↵Will Hunt2022-03-091-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | deactivate a user (#12028) * Add check_can_deactivate_user * Add check_can_shutdown_rooms * Documentation * callbacks, not functions * Various suggested tweaks * Add tests for test_check_can_shutdown_room and test_check_can_deactivate_user * Update check_can_deactivate_user to not take a Requester * Fix check_can_shutdown_room docs * Renegade and use `by_admin` instead of `admin_user_id` * fix lint * Update docs/modules/third_party_rules_callbacks.md Co-authored-by: Brendan Abolivier <babolivier@matrix.org> * Update docs/modules/third_party_rules_callbacks.md Co-authored-by: Brendan Abolivier <babolivier@matrix.org> * Update docs/modules/third_party_rules_callbacks.md Co-authored-by: Brendan Abolivier <babolivier@matrix.org> * Update docs/modules/third_party_rules_callbacks.md Co-authored-by: Brendan Abolivier <babolivier@matrix.org> Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
* Correctly register deactivation and profile update module callbacks (#12141)Brendan Abolivier2022-03-031-3/+7
|
* Add module callbacks called for reacting to deactivation status change and ↵Brendan Abolivier2022-03-011-3/+53
| | | | profile update (#12062)
* Remove `HomeServer.get_datastore()` (#12031)Richard van der Hoff2022-02-231-1/+1
| | | | | | | The presence of this method was confusing, and mostly present for backwards compatibility. Let's get rid of it. Part of #11733
* Make `check_event_allowed` module API callback not fail open (accept events) ↵reivilibre2021-11-011-4/+5
| | | | when an exception is raised (#11033)
* Implement an `on_new_event` callback (#11126)Brendan Abolivier2021-10-261-0/+31
| | | Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
* Add type hints to synapse.events.*. (#11066)Patrick Cloke2021-10-131-12/+13
| | | Except `synapse/events/__init__.py`, which will be done in a follow-up.
* Pass through `SynapseError`s that are raised from experimental ↵reivilibre2021-10-111-0/+9
| | | | | `check_event_allowed` callback of the module API (#11042) Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
* Use direct references for configuration variables (part 5). (#10897)Patrick Cloke2021-09-241-2/+2
|
* Port the ThirdPartyEventRules module interface to the new generic interface ↵Brendan Abolivier2021-07-201-42/+203
| | | | | (#10386) Port the third-party event rules interface to the generic module interface introduced in v1.37.0
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-141-1/+0
| | | | | | | Part of #9744 Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now. `Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>`
* Add type hints to misc. files. (#9676)Patrick Cloke2021-03-241-7/+8
|
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-161-1/+2
| | | | | | | - Update black version to the latest - Run black auto formatting over the codebase - Run autoformatting according to [`docs/code_style.md `](https://github.com/matrix-org/synapse/blob/80d6dc9783aa80886a133756028984dbf8920168/docs/code_style.md) - Update `code_style.md` docs around installing black to use the correct version
* guard against accidental modificationRichard van der Hoff2020-10-131-3/+4
|
* Allow ThirdPartyRules modules to replace event contentRichard van der Hoff2020-10-131-3/+9
| | | | Support returning a new event dict from `check_event_allowed`.
* Combine `SpamCheckerApi` with the more generic `ModuleApi`. (#8464)Richard van der Hoff2020-10-071-2/+1
| | | | | Lots of different module apis is not easy to maintain. Rather than adding yet another ModuleApi(hs, hs.get_auth_handler()) incantation, first add an hs.get_module_api() method and use it where possible.
* Additional tests for third-party event rules (#8468)Richard van der Hoff2020-10-061-5/+7
| | | | | | | | | * Optimise and test state fetching for 3p event rules Getting all the events at once is much more efficient than getting them individually * Test that 3p event rules can modify events
* Fix third-party event modules for `check_visibility_can_be_modified` checkRichard van der Hoff2020-10-051-1/+3
| | | | | | PR #8292 tried to maintain backwards compat with modules which don't provide a `check_visibility_can_be_modified` method, but the tests weren't being run, and the check didn't work.
* Allow ThirdPartyEventRules modules to manipulate public room state (#8292)Andrew Morgan2020-10-051-6/+45
| | | | | This PR allows `ThirdPartyEventRules` modules to view, manipulate and block changes to the state of whether a room is published in the public rooms directory. While the idea of whether a room is in the public rooms list is not kept within an event in the room, `ThirdPartyEventRules` generally deal with controlling which modifications can happen to a room. Public rooms fits within that idea, even if its toggle state isn't controlled through a state event.
* Stop sub-classing object (#8249)Patrick Cloke2020-09-041-1/+1
|
* Convert a synapse.events to async/await. (#7949)Patrick Cloke2020-07-271-25/+30
|
* Third party event rules Update (#6781)PeerD2020-02-061-3/+4
|
* Change EventContext to use the Storage class (#6564)Erik Johnston2019-12-201-1/+1
|
* Replace returnValue with return (#5736)Amber Brown2019-07-231-4/+4
|
* Run Black. (#5482)Amber Brown2019-06-201-3/+2
|
* Make check_threepid_can_be_invited asyncBrendan Abolivier2019-06-171-0/+1
|
* Add third party rules hook for 3PID invitesBrendan Abolivier2019-06-171-1/+31
|
* Add third party rules hook into create roomErik Johnston2019-06-171-3/+24
|
* Add plugin APIs for implementations of custom event rules.Brendan Abolivier2019-06-141-0/+62