From b1e8ea2b60116e9e5f6a056010a1a57740aaf01a Mon Sep 17 00:00:00 2001 From: erikjohnston Date: Fri, 27 Oct 2023 09:05:11 +0000 Subject: deploy: c02406ac711095eedbeeff229af8e368f77196aa --- develop/modules/account_data_callbacks.html | 6 +- develop/modules/account_validity_callbacks.html | 2 +- ...add_extra_fields_to_client_events_unsigned.html | 210 +++++++++++++++++++++ .../background_update_controller_callbacks.html | 2 +- develop/modules/index.html | 2 +- .../modules/password_auth_provider_callbacks.html | 2 +- develop/modules/porting_legacy_module.html | 6 +- develop/modules/presence_router_callbacks.html | 2 +- develop/modules/spam_checker_callbacks.html | 2 +- develop/modules/third_party_rules_callbacks.html | 2 +- develop/modules/writing_a_module.html | 2 +- 11 files changed, 224 insertions(+), 14 deletions(-) create mode 100644 develop/modules/add_extra_fields_to_client_events_unsigned.html (limited to 'develop/modules') diff --git a/develop/modules/account_data_callbacks.html b/develop/modules/account_data_callbacks.html index c50b180e92..9004174bb1 100644 --- a/develop/modules/account_data_callbacks.html +++ b/develop/modules/account_data_callbacks.html @@ -76,7 +76,7 @@ @@ -245,7 +245,7 @@ class CustomAccountDataModule: -
@@ -257,7 +257,7 @@ class CustomAccountDataModule: - diff --git a/develop/modules/account_validity_callbacks.html b/develop/modules/account_validity_callbacks.html index 543e8d6634..eb23bf6f0b 100644 --- a/develop/modules/account_validity_callbacks.html +++ b/develop/modules/account_validity_callbacks.html @@ -76,7 +76,7 @@ diff --git a/develop/modules/add_extra_fields_to_client_events_unsigned.html b/develop/modules/add_extra_fields_to_client_events_unsigned.html new file mode 100644 index 0000000000..b23940d4bd --- /dev/null +++ b/develop/modules/add_extra_fields_to_client_events_unsigned.html @@ -0,0 +1,210 @@ + + + + + + Add extra fields to client events unsigned section callbacks - Synapse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+
+ +
+ +
+ +

Add extra fields to client events unsigned section callbacks

+

First introduced in Synapse v1.96.0

+

This callback allows modules to add extra fields to the unsigned section of +events when they get sent down to clients.

+

These get called every time an event is to be sent to clients, so care should +be taken to ensure with respect to performance.

+

API

+

To register the callback, use +register_add_extra_fields_to_unsigned_client_event_callbacks on the +ModuleApi.

+

The callback should be of the form

+
async def add_field_to_unsigned(
+    event: EventBase,
+) -> JsonDict:
+
+

where the extra fields to add to the event's unsigned section is returned. +(Modules must not attempt to modify the event directly).

+

This cannot be used to alter the "core" fields in the unsigned section emitted +by Synapse itself.

+

If multiple such callbacks try to add the same field to an event's unsigned +section, the last-registered callback wins.

+ +
+ + +
+
+ + + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/develop/modules/background_update_controller_callbacks.html b/develop/modules/background_update_controller_callbacks.html index 4b30f6bc9c..62851e877b 100644 --- a/develop/modules/background_update_controller_callbacks.html +++ b/develop/modules/background_update_controller_callbacks.html @@ -76,7 +76,7 @@ diff --git a/develop/modules/index.html b/develop/modules/index.html index af253fedf7..d56942176c 100644 --- a/develop/modules/index.html +++ b/develop/modules/index.html @@ -76,7 +76,7 @@ diff --git a/develop/modules/password_auth_provider_callbacks.html b/develop/modules/password_auth_provider_callbacks.html index bf3acec439..941dc90d12 100644 --- a/develop/modules/password_auth_provider_callbacks.html +++ b/develop/modules/password_auth_provider_callbacks.html @@ -76,7 +76,7 @@ diff --git a/develop/modules/porting_legacy_module.html b/develop/modules/porting_legacy_module.html index d803d76acc..b19e5c6612 100644 --- a/develop/modules/porting_legacy_module.html +++ b/develop/modules/porting_legacy_module.html @@ -76,7 +76,7 @@ @@ -168,7 +168,7 @@ for more info).