SPEC-7: Don't stamp event contents with 'hsob_ts'

pull/9/head
Mark Haines 2014-10-17 16:55:05 +01:00
parent be2a9a8d1a
commit 456017e0ae
1 changed files with 3 additions and 13 deletions

View File

@ -64,7 +64,7 @@ class MessageHandler(BaseHandler):
defer.returnValue(None) defer.returnValue(None)
@defer.inlineCallbacks @defer.inlineCallbacks
def send_message(self, event=None, suppress_auth=False, stamp_event=True): def send_message(self, event=None, suppress_auth=False):
""" Send a message. """ Send a message.
Args: Args:
@ -72,7 +72,6 @@ class MessageHandler(BaseHandler):
suppress_auth (bool) : True to suppress auth for this message. This suppress_auth (bool) : True to suppress auth for this message. This
is primarily so the home server can inject messages into rooms at is primarily so the home server can inject messages into rooms at
will. will.
stamp_event (bool) : True to stamp event content with server keys.
Raises: Raises:
SynapseError if something went wrong. SynapseError if something went wrong.
""" """
@ -82,9 +81,6 @@ class MessageHandler(BaseHandler):
user = self.hs.parse_userid(event.user_id) user = self.hs.parse_userid(event.user_id)
assert user.is_mine, "User must be our own: %s" % (user,) assert user.is_mine, "User must be our own: %s" % (user,)
if stamp_event:
event.content["hsob_ts"] = int(self.clock.time_msec())
snapshot = yield self.store.snapshot_room(event.room_id, event.user_id) snapshot = yield self.store.snapshot_room(event.room_id, event.user_id)
if not suppress_auth: if not suppress_auth:
@ -132,7 +128,7 @@ class MessageHandler(BaseHandler):
defer.returnValue(chunk) defer.returnValue(chunk)
@defer.inlineCallbacks @defer.inlineCallbacks
def store_room_data(self, event=None, stamp_event=True): def store_room_data(self, event=None):
""" Stores data for a room. """ Stores data for a room.
Args: Args:
@ -151,9 +147,6 @@ class MessageHandler(BaseHandler):
yield self.auth.check(event, snapshot, raises=True) yield self.auth.check(event, snapshot, raises=True)
if stamp_event:
event.content["hsob_ts"] = int(self.clock.time_msec())
yield self.state_handler.handle_new_event(event, snapshot) yield self.state_handler.handle_new_event(event, snapshot)
yield self._on_new_room_event(event, snapshot) yield self._on_new_room_event(event, snapshot)
@ -221,10 +214,7 @@ class MessageHandler(BaseHandler):
defer.returnValue(None) defer.returnValue(None)
@defer.inlineCallbacks @defer.inlineCallbacks
def send_feedback(self, event, stamp_event=True): def send_feedback(self, event):
if stamp_event:
event.content["hsob_ts"] = int(self.clock.time_msec())
snapshot = yield self.store.snapshot_room(event.room_id, event.user_id) snapshot = yield self.store.snapshot_room(event.room_id, event.user_id)
yield self.auth.check(event, snapshot, raises=True) yield self.auth.check(event, snapshot, raises=True)