mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:06:07 -04:00
Implement and use new batched get missing pdu
This commit is contained in:
parent
0ac2a79faa
commit
db215b7e00
6 changed files with 143 additions and 99 deletions
|
@ -439,6 +439,25 @@ class FederationClient(FederationBase):
|
|||
|
||||
defer.returnValue(ret)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def get_missing_events(self, destination, room_id, earliest_events,
|
||||
latest_events, limit, min_depth):
|
||||
content = yield self.transport_layer.get_missing_events(
|
||||
destination, room_id, earliest_events, latest_events, limit,
|
||||
min_depth,
|
||||
)
|
||||
|
||||
events = [
|
||||
self.event_from_pdu_json(e)
|
||||
for e in content.get("events", [])
|
||||
]
|
||||
|
||||
signed_events = yield self._check_sigs_and_hash_and_fetch(
|
||||
destination, events, outlier=True
|
||||
)
|
||||
|
||||
defer.returnValue(signed_events)
|
||||
|
||||
def event_from_pdu_json(self, pdu_json, outlier=False):
|
||||
event = FrozenEvent(
|
||||
pdu_json
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue