diff options
author | Brendan Abolivier <babolivier@matrix.org> | 2021-10-18 18:26:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-18 18:26:52 +0200 |
commit | 73743b8ad194c6e833432110b7d0cd1ba2ad1e6a (patch) | |
tree | 6280b6d87a7f75c6644b7d2c94c9266f97456849 /docs/modules/presence_router_callbacks.md | |
parent | `_run_push_actions_and_persist_event`: handle no min_depth (#11014) (diff) | |
download | synapse-73743b8ad194c6e833432110b7d0cd1ba2ad1e6a.tar.xz |
Document Synapse's behaviour when dealing with multiple modules (#11096)
Document Synapse's behaviour when multiple modules register the same callback/web resource/etc. Co-authored-by: reivilibre <oliverw@matrix.org>
Diffstat (limited to 'docs/modules/presence_router_callbacks.md')
-rw-r--r-- | docs/modules/presence_router_callbacks.md | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/modules/presence_router_callbacks.md b/docs/modules/presence_router_callbacks.md index 4abcc9af47..349e185bd6 100644 --- a/docs/modules/presence_router_callbacks.md +++ b/docs/modules/presence_router_callbacks.md @@ -24,6 +24,10 @@ must return a dictionary that maps from Matrix user IDs (which can be local or r Synapse will then attempt to send the specified presence updates to each user when possible. +If multiple modules implement this callback, Synapse merges all the dictionaries returned +by the callbacks. If multiple callbacks return a dictionary containing the same key, +Synapse concatenates the sets associated with this key from each dictionary. + ### `get_interested_users` ```python @@ -44,6 +48,12 @@ query. The returned users can be local or remote. Alternatively the callback can return `synapse.module_api.PRESENCE_ALL_USERS` to indicate that the user should receive updates from all known users. +If multiple modules implement this callback, they will be considered in order. Synapse +calls each callback one by one, and use a concatenation of all the `set`s returned by the +callbacks. If one callback returns `synapse.module_api.PRESENCE_ALL_USERS`, Synapse uses +this value instead. If this happens, Synapse does not call any of the subsequent +implementations of this callback. + ## Example The example below is a module that implements both presence router callbacks, and ensures |