|
@@ -1860,7 +1860,11 @@ class Portal(DBPortal, BasePortal):
|
|
async def backfill(self, source: u.User, backfill_request: Backfill) -> None:
|
|
async def backfill(self, source: u.User, backfill_request: Backfill) -> None:
|
|
try:
|
|
try:
|
|
last_message_ig_timestamp = await self._backfill(source, backfill_request)
|
|
last_message_ig_timestamp = await self._backfill(source, backfill_request)
|
|
- if last_message_ig_timestamp is not None:
|
|
|
|
|
|
+ if (
|
|
|
|
+ last_message_ig_timestamp is not None
|
|
|
|
+ and not self.bridge.homeserver_software.is_hungry
|
|
|
|
+ and self.config["bridge.backfill.msc2716"]
|
|
|
|
+ ):
|
|
await self.send_post_backfill_dummy(last_message_ig_timestamp)
|
|
await self.send_post_backfill_dummy(last_message_ig_timestamp)
|
|
finally:
|
|
finally:
|
|
# Always sleep after the backfill request is finished processing, even if it errors.
|
|
# Always sleep after the backfill request is finished processing, even if it errors.
|
|
@@ -2147,8 +2151,10 @@ class Portal(DBPortal, BasePortal):
|
|
if not batch_messages:
|
|
if not batch_messages:
|
|
return None
|
|
return None
|
|
|
|
|
|
- if not self.bridge.homeserver_software.is_hungry and (
|
|
|
|
- forward or self.next_batch_id is None
|
|
|
|
|
|
+ if (
|
|
|
|
+ not self.bridge.homeserver_software.is_hungry
|
|
|
|
+ and self.config["bridge.backfill.msc2716"]
|
|
|
|
+ and (forward or self.next_batch_id is None)
|
|
):
|
|
):
|
|
self.log.debug("Sending dummy event to avoid forward extremity errors")
|
|
self.log.debug("Sending dummy event to avoid forward extremity errors")
|
|
await self.az.intent.send_message_event(
|
|
await self.az.intent.send_message_event(
|
|
@@ -2269,6 +2275,8 @@ class Portal(DBPortal, BasePortal):
|
|
last_message_ig_timestamp: int,
|
|
last_message_ig_timestamp: int,
|
|
base_insertion_event_id: EventID | None = None,
|
|
base_insertion_event_id: EventID | None = None,
|
|
):
|
|
):
|
|
|
|
+ if not self.config["bridge.backfill.msc2716"]:
|
|
|
|
+ return
|
|
assert self.mxid
|
|
assert self.mxid
|
|
|
|
|
|
if not base_insertion_event_id:
|
|
if not base_insertion_event_id:
|