summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2023-10-12 08:56:10 -0400
committerGitHub <noreply@github.com>2023-10-12 08:56:10 -0400
commit4cc729d48006964438e28c5489d7abfb9e3380df (patch)
treeb43273462c6160dfb64e1f6d185b83e855c2d35e /synapse/handlers
parentUpdate complement.sh to match new public API shape (#16466) (diff)
downloadsynapse-4cc729d48006964438e28c5489d7abfb9e3380df.tar.xz
Revert "Drop unused tables & unneeded access token ID for events. (#16268)" (#16465)
This reverts commit cabd57746004fe2dacc11aa8d373854a3d25e306.

There are additional usages of these tables
which need to be removed first.
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/message.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index 8de4b8e816..41a35ce510 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -693,9 +693,13 @@ class EventCreationHandler:
         if require_consent and not is_exempt:
             await self.assert_accepted_privacy_policy(requester)
 
-        # Save the the device ID and the transaction ID in the event internal metadata.
-        # This is useful to determine if we should echo the transaction_id in events.
+        # Save the access token ID, the device ID and the transaction ID in the event
+        # internal metadata. This is useful to determine if we should echo the
+        # transaction_id in events.
         # See `synapse.events.utils.EventClientSerializer.serialize_event`
+        if requester.access_token_id is not None:
+            builder.internal_metadata.token_id = requester.access_token_id
+
         if requester.device_id is not None:
             builder.internal_metadata.device_id = requester.device_id