diff options
author | Kegan Dougal <kegan@matrix.org> | 2015-04-01 10:19:17 +0100 |
---|---|---|
committer | Kegan Dougal <kegan@matrix.org> | 2015-04-01 10:19:17 +0100 |
commit | 9fa8bda09915b83aab1b5de1760dceafe1d87e07 (patch) | |
tree | 3c8d7e4bc69871ac1316a5763d885e5f7a9ba7d7 | |
parent | Add same user_id char checks as registration. (diff) | |
parent | Fix thinko whereby events *for the AS specifically* were not passed on. (diff) | |
download | synapse-9fa8bda09915b83aab1b5de1760dceafe1d87e07.tar.xz |
Merge branch 'develop' into application-services-registration-script
-rw-r--r-- | CHANGES.rst | 7 | ||||
-rw-r--r-- | synapse/appservice/__init__.py | 5 | ||||
-rw-r--r-- | tests/appservice/test_appservice.py | 13 |
3 files changed, 24 insertions, 1 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index da31af9606..cf6c984d50 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,10 @@ +Changes in synapse vX +===================== + +* Changed config option from ``disable_registration`` to + ``enable_registration``. Old option will be ignored. + + Changes in synapse v0.8.1 (2015-03-18) ====================================== diff --git a/synapse/appservice/__init__.py b/synapse/appservice/__init__.py index a8108c1efb..ab0a6955f0 100644 --- a/synapse/appservice/__init__.py +++ b/synapse/appservice/__init__.py @@ -199,7 +199,10 @@ class ApplicationService(object): return self._matches_user(event, member_list) def is_interested_in_user(self, user_id): - return self._matches_regex(user_id, ApplicationService.NS_USERS) + return ( + self._matches_regex(user_id, ApplicationService.NS_USERS) + or user_id == self.sender + ) def is_interested_in_alias(self, alias): return self._matches_regex(alias, ApplicationService.NS_ALIASES) diff --git a/tests/appservice/test_appservice.py b/tests/appservice/test_appservice.py index eb7becf725..62149d6902 100644 --- a/tests/appservice/test_appservice.py +++ b/tests/appservice/test_appservice.py @@ -199,6 +199,19 @@ class ApplicationServiceTestCase(unittest.TestCase): aliases_for_event=["#xmpp_barfoo:matrix.org"] )) + def test_interested_in_self(self): + # make sure invites get through + self.service.sender = "@appservice:name" + self.service.namespaces[ApplicationService.NS_USERS].append( + _regex("@irc_.*") + ) + self.event.type = "m.room.member" + self.event.content = { + "membership": "invite" + } + self.event.state_key = self.service.sender + self.assertTrue(self.service.is_interested(self.event)) + def test_member_list_match(self): self.service.namespaces[ApplicationService.NS_USERS].append( _regex("@irc_.*") |