Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
a158c36a
Commit
a158c36a
authored
8 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Comment
parent
6957bfdc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/handlers/sync.py
+8
-3
8 additions, 3 deletions
synapse/handlers/sync.py
with
8 additions
and
3 deletions
synapse/handlers/sync.py
+
8
−
3
View file @
a158c36a
...
@@ -764,6 +764,8 @@ class SyncHandler(object):
...
@@ -764,6 +764,8 @@ class SyncHandler(object):
)
)
sync_result_builder
.
now_token
=
now_token
sync_result_builder
.
now_token
=
now_token
# We check up front if anything has changed, if it hasn't then there is
# no point in going futher.
since_token
=
sync_result_builder
.
since_token
since_token
=
sync_result_builder
.
since_token
if
not
sync_result_builder
.
full_state
:
if
not
sync_result_builder
.
full_state
:
if
since_token
and
not
ephemeral_by_room
and
not
account_data_by_room
:
if
since_token
and
not
ephemeral_by_room
and
not
account_data_by_room
:
...
@@ -830,11 +832,14 @@ class SyncHandler(object):
...
@@ -830,11 +832,14 @@ class SyncHandler(object):
@defer.inlineCallbacks
@defer.inlineCallbacks
def
_have_rooms_changed
(
self
,
sync_result_builder
):
def
_have_rooms_changed
(
self
,
sync_result_builder
):
"""
Returns whether any rooms have changed since the sync. Must be an
incremental sync
"""
user_id
=
sync_result_builder
.
sync_config
.
user
.
to_string
()
user_id
=
sync_result_builder
.
sync_config
.
user
.
to_string
()
since_token
=
sync_result_builder
.
since_token
since_token
=
sync_result_builder
.
since_token
now_token
=
sync_result_builder
.
now_token
now_token
=
sync_result_builder
.
now_token
#
assert since_token
assert
since_token
# Get a list of membership change events that have happened.
# Get a list of membership change events that have happened.
rooms_changed
=
yield
self
.
store
.
get_membership_changes_for_user
(
rooms_changed
=
yield
self
.
store
.
get_membership_changes_for_user
(
...
@@ -851,9 +856,9 @@ class SyncHandler(object):
...
@@ -851,9 +856,9 @@ class SyncHandler(object):
else
:
else
:
joined_room_ids
=
yield
self
.
store
.
get_rooms_for_user
(
user_id
)
joined_room_ids
=
yield
self
.
store
.
get_rooms_for_user
(
user_id
)
stre
m
a_id
=
RoomStreamToken
.
parse_stream_token
(
since_token
.
room_key
).
stream
strea
m
_id
=
RoomStreamToken
.
parse_stream_token
(
since_token
.
room_key
).
stream
for
room_id
in
joined_room_ids
:
for
room_id
in
joined_room_ids
:
if
self
.
store
.
has_room_changed_since
(
room_id
,
stre
m
a_id
):
if
self
.
store
.
has_room_changed_since
(
room_id
,
strea
m
_id
):
defer
.
returnValue
(
True
)
defer
.
returnValue
(
True
)
defer
.
returnValue
(
False
)
defer
.
returnValue
(
False
)
...
...
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