Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
456017e0
Commit
456017e0
authored
10 years ago
by
Mark Haines
Browse files
Options
Downloads
Patches
Plain Diff
SPEC-7: Don't stamp event contents with 'hsob_ts'
parent
be2a9a8d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/handlers/message.py
+3
-13
3 additions, 13 deletions
synapse/handlers/message.py
with
3 additions
and
13 deletions
synapse/handlers/message.py
+
3
−
13
View file @
456017e0
...
...
@@ -64,7 +64,7 @@ class MessageHandler(BaseHandler):
defer
.
returnValue
(
None
)
@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.
Args:
...
...
@@ -72,7 +72,6 @@ class MessageHandler(BaseHandler):
suppress_auth (bool) : True to suppress auth for this message. This
is primarily so the home server can inject messages into rooms at
will.
stamp_event (bool) : True to stamp event content with server keys.
Raises:
SynapseError if something went wrong.
"""
...
...
@@ -82,9 +81,6 @@ class MessageHandler(BaseHandler):
user
=
self
.
hs
.
parse_userid
(
event
.
user_id
)
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
)
if
not
suppress_auth
:
...
...
@@ -132,7 +128,7 @@ class MessageHandler(BaseHandler):
defer
.
returnValue
(
chunk
)
@defer.inlineCallbacks
def
store_room_data
(
self
,
event
=
None
,
stamp_event
=
True
):
def
store_room_data
(
self
,
event
=
None
):
"""
Stores data for a room.
Args:
...
...
@@ -151,9 +147,6 @@ class MessageHandler(BaseHandler):
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
.
_on_new_room_event
(
event
,
snapshot
)
...
...
@@ -221,10 +214,7 @@ class MessageHandler(BaseHandler):
defer
.
returnValue
(
None
)
@defer.inlineCallbacks
def
send_feedback
(
self
,
event
,
stamp_event
=
True
):
if
stamp_event
:
event
.
content
[
"
hsob_ts
"
]
=
int
(
self
.
clock
.
time_msec
())
def
send_feedback
(
self
,
event
):
snapshot
=
yield
self
.
store
.
snapshot_room
(
event
.
room_id
,
event
.
user_id
)
yield
self
.
auth
.
check
(
event
,
snapshot
,
raises
=
True
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment