summary refs log tree commit diff
path: root/synapse/handlers/auth.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/handlers/auth.py')
-rw-r--r--synapse/handlers/auth.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py
index 0f80dfdc43..231829aff8 100644
--- a/synapse/handlers/auth.py
+++ b/synapse/handlers/auth.py
@@ -1371,6 +1371,17 @@ class AuthHandler(BaseHandler):
                 access_token=access_token,
             )
 
+
+        # Inform interested appservices
+        self.hs.get_application_service_handler().notify_synthetic_event(
+            "m.user.logout",
+            user_id,
+            { 
+                "user_id": user_info.user_id,
+                "device_id": user_info.device_id,
+            }
+        )
+
         # delete pushers associated with this access token
         if user_info.token_id is not None:
             await self.hs.get_pusherpool().remove_pushers_by_access_token(
@@ -1408,6 +1419,16 @@ class AuthHandler(BaseHandler):
             user_id, (token_id for _, token_id, _ in tokens_and_devices)
         )
 
+        # Inform interested appservices
+        self.hs.get_application_service_handler().notify_synthetic_event(
+            "m.user.logout",
+            user_id,
+            { 
+                "user_id": user_id,
+                "device_id": device_id,
+            }
+        )
+
     async def add_threepid(
         self, user_id: str, medium: str, address: str, validated_at: int
     ) -> None: