diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2020-07-09 10:40:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-09 10:40:19 +0100 |
commit | 2ab0b021f153f527aa40080fe6e522df3ff976bc (patch) | |
tree | 625594f1b0c6d3e3deef280e91ecb76cbee5af31 /synapse/storage/data_stores | |
parent | Add `HomeServer.signing_key` property (#7805) (diff) | |
download | synapse-2ab0b021f153f527aa40080fe6e522df3ff976bc.tar.xz |
Generate real events when we reject invites (#7804)
Fixes #2181. The basic premise is that, when we fail to reject an invite via the remote server, we can generate our own out-of-band leave event and persist it as an outlier, so that we have something to send to the client.
Diffstat (limited to 'synapse/storage/data_stores')
-rw-r--r-- | synapse/storage/data_stores/main/events.py | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/synapse/storage/data_stores/main/events.py b/synapse/storage/data_stores/main/events.py index a18317366c..230fb5cd7f 100644 --- a/synapse/storage/data_stores/main/events.py +++ b/synapse/storage/data_stores/main/events.py @@ -1541,23 +1541,3 @@ class PersistEventsStore: if not ev.internal_metadata.is_outlier() ], ) - - async def locally_reject_invite(self, user_id: str, room_id: str) -> int: - """Mark the invite has having been rejected even though we failed to - create a leave event for it. - """ - - def f(txn, stream_ordering): - # Clear this entry from `local_current_membership`. - # Ideally we'd point to a leave event, but we don't have one, so - # nevermind. - self.db.simple_delete_txn( - txn, - table="local_current_membership", - keyvalues={"room_id": room_id, "user_id": user_id}, - ) - - with self._stream_id_gen.get_next() as stream_ordering: - await self.db.runInteraction("locally_reject_invite", f, stream_ordering) - - return stream_ordering |