mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-06 22:59:22 +01:00
Pass client info to the sync_config
This commit is contained in:
parent
8498d348d8
commit
4a67834bc8
2 changed files with 4 additions and 3 deletions
|
@ -28,7 +28,7 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
SyncConfig = collections.namedtuple("SyncConfig", [
|
SyncConfig = collections.namedtuple("SyncConfig", [
|
||||||
"user",
|
"user",
|
||||||
"device",
|
"client_info",
|
||||||
"limit",
|
"limit",
|
||||||
"gap",
|
"gap",
|
||||||
"sort",
|
"sort",
|
||||||
|
@ -288,12 +288,13 @@ class SyncHandler(BaseHandler):
|
||||||
room_key = now_token.room_key
|
room_key = now_token.room_key
|
||||||
|
|
||||||
while limited and len(recents) < sync_config.limit and max_repeat:
|
while limited and len(recents) < sync_config.limit and max_repeat:
|
||||||
events, (room_key,_) = yield self.store.get_recent_events_for_room(
|
events, keys = yield self.store.get_recent_events_for_room(
|
||||||
room_id,
|
room_id,
|
||||||
limit=load_limit + 1,
|
limit=load_limit + 1,
|
||||||
from_token=since_token.room_key if since_token else None,
|
from_token=since_token.room_key if since_token else None,
|
||||||
end_token=room_key,
|
end_token=room_key,
|
||||||
)
|
)
|
||||||
|
(room_key, _) = keys
|
||||||
loaded_recents = sync_config.filter.filter_room_events(events)
|
loaded_recents = sync_config.filter.filter_room_events(events)
|
||||||
loaded_recents.extend(recents)
|
loaded_recents.extend(recents)
|
||||||
recents = loaded_recents
|
recents = loaded_recents
|
||||||
|
|
|
@ -123,7 +123,7 @@ class SyncRestServlet(RestServlet):
|
||||||
|
|
||||||
sync_config = SyncConfig(
|
sync_config = SyncConfig(
|
||||||
user=user,
|
user=user,
|
||||||
device="TODO", # TODO(mjark) Get the device_id from access_token
|
client_info=client,
|
||||||
gap=gap,
|
gap=gap,
|
||||||
limit=limit,
|
limit=limit,
|
||||||
sort=sort,
|
sort=sort,
|
||||||
|
|
Loading…
Reference in a new issue