mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Merge pull request #337 from matrix-org/markjh/v2_sync_joining
Don't mark newly joined room timelines as limited in an incremental sync
This commit is contained in:
commit
0f432ba551
@ -154,7 +154,8 @@ def serialize_event(e, time_now_ms, as_client_event=True,
|
|||||||
|
|
||||||
if "redacted_because" in e.unsigned:
|
if "redacted_because" in e.unsigned:
|
||||||
d["unsigned"]["redacted_because"] = serialize_event(
|
d["unsigned"]["redacted_because"] = serialize_event(
|
||||||
e.unsigned["redacted_because"], time_now_ms
|
e.unsigned["redacted_because"], time_now_ms,
|
||||||
|
event_format=event_format
|
||||||
)
|
)
|
||||||
|
|
||||||
if token_id is not None:
|
if token_id is not None:
|
||||||
|
@ -387,7 +387,7 @@ class SyncHandler(BaseHandler):
|
|||||||
else:
|
else:
|
||||||
prev_batch = now_token
|
prev_batch = now_token
|
||||||
|
|
||||||
state = yield self.check_joined_room(
|
state, limited = yield self.check_joined_room(
|
||||||
sync_config, room_id, state
|
sync_config, room_id, state
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -396,7 +396,7 @@ class SyncHandler(BaseHandler):
|
|||||||
timeline=TimelineBatch(
|
timeline=TimelineBatch(
|
||||||
events=recents,
|
events=recents,
|
||||||
prev_batch=prev_batch,
|
prev_batch=prev_batch,
|
||||||
limited=False,
|
limited=limited,
|
||||||
),
|
),
|
||||||
state=state,
|
state=state,
|
||||||
ephemeral=typing_by_room.get(room_id, [])
|
ephemeral=typing_by_room.get(room_id, [])
|
||||||
@ -520,7 +520,7 @@ class SyncHandler(BaseHandler):
|
|||||||
current_state=current_state_events,
|
current_state=current_state_events,
|
||||||
)
|
)
|
||||||
|
|
||||||
state_events_delta = yield self.check_joined_room(
|
state_events_delta, _ = yield self.check_joined_room(
|
||||||
sync_config, room_id, state_events_delta
|
sync_config, room_id, state_events_delta
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -627,6 +627,7 @@ class SyncHandler(BaseHandler):
|
|||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def check_joined_room(self, sync_config, room_id, state_delta):
|
def check_joined_room(self, sync_config, room_id, state_delta):
|
||||||
joined = False
|
joined = False
|
||||||
|
limited = False
|
||||||
for event in state_delta:
|
for event in state_delta:
|
||||||
if (
|
if (
|
||||||
event.type == EventTypes.Member
|
event.type == EventTypes.Member
|
||||||
@ -638,5 +639,6 @@ class SyncHandler(BaseHandler):
|
|||||||
if joined:
|
if joined:
|
||||||
res = yield self.state_handler.get_current_state(room_id)
|
res = yield self.state_handler.get_current_state(room_id)
|
||||||
state_delta = res.values()
|
state_delta = res.values()
|
||||||
|
limited = True
|
||||||
|
|
||||||
defer.returnValue(state_delta)
|
defer.returnValue((state_delta, limited))
|
||||||
|
Loading…
Reference in New Issue
Block a user