summary refs log tree commit diff
path: root/synapse/appservice/__init__.py
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2015-04-01 14:05:24 +0100
committerKegan Dougal <kegan@matrix.org>2015-04-01 14:05:24 +0100
commit813e54bd5b332e4514ecfea71d33d27f106fe5ff (patch)
treed31732038d54fda3f776f23b023b022b73850ca7 /synapse/appservice/__init__.py
parentMerge pull request #116 from matrix-org/application-services-registration-script (diff)
downloadsynapse-813e54bd5b332e4514ecfea71d33d27f106fe5ff.tar.xz
Fix more AS sender ID thinkos.
Specifically, the ASes own user ID wasn't being treated as 'exclusive' so
a human could nab it. Also, the HS would needlessly send user queries to the
AS for its own user ID.
Diffstat (limited to 'synapse/appservice/__init__.py')
-rw-r--r--synapse/appservice/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/appservice/__init__.py b/synapse/appservice/__init__.py
index ab0a6955f0..63a18b802b 100644
--- a/synapse/appservice/__init__.py
+++ b/synapse/appservice/__init__.py
@@ -211,7 +211,10 @@ class ApplicationService(object):
         return self._matches_regex(room_id, ApplicationService.NS_ROOMS)
 
     def is_exclusive_user(self, user_id):
-        return self._is_exclusive(ApplicationService.NS_USERS, user_id)
+        return (
+            self._is_exclusive(ApplicationService.NS_USERS, user_id)
+            or user_id == self.sender
+        )
 
     def is_exclusive_alias(self, alias):
         return self._is_exclusive(ApplicationService.NS_ALIASES, alias)