diff options
author | Kegan Dougal <kegan@matrix.org> | 2014-08-22 15:59:15 +0100 |
---|---|---|
committer | Kegan Dougal <kegan@matrix.org> | 2014-08-22 15:59:15 +0100 |
commit | f690b7b8279551b5cab782e2e4cd5811fc9d3789 (patch) | |
tree | 1963927a804cd2acaf9c82620f09dc26fc88807e /synapse/api | |
parent | Updater command line client to new IS API (diff) | |
download | synapse-f690b7b8279551b5cab782e2e4cd5811fc9d3789.tar.xz |
Impl: /rooms/roomid/state/eventtype/state_key - Renamed RoomTopicRestServlet to RoomStateEventRestServlet. Support generic state event sending.
Diffstat (limited to '')
-rw-r--r-- | synapse/api/auth.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py index 31852b29a5..ae61319a2c 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py @@ -44,15 +44,15 @@ class Auth(object): be raised only if raises=True. """ try: - if event.type in [RoomTopicEvent.TYPE, MessageEvent.TYPE, - FeedbackEvent.TYPE]: - yield self.check_joined_room(event.room_id, event.user_id) - defer.returnValue(True) - elif event.type == RoomMemberEvent.TYPE: - allowed = yield self.is_membership_change_allowed(event) - defer.returnValue(allowed) + if hasattr(event, "room_id"): + if event.type == RoomMemberEvent.TYPE: + allowed = yield self.is_membership_change_allowed(event) + defer.returnValue(allowed) + else: + yield self.check_joined_room(event.room_id, event.user_id) + defer.returnValue(True) else: - raise AuthError(500, "Unknown event type %s" % event.type) + raise AuthError(500, "Unknown event: %s" % event) except AuthError as e: logger.info("Event auth check failed on event %s with msg: %s", event, e.msg) |