Add redact echo before we receive RedactionEvent
This commit is contained in:
parent
f8fe5d812b
commit
af861ac13a
|
@ -884,10 +884,19 @@ class MatrixClient(nio.AsyncClient):
|
||||||
Returns a list of sucessful redacts.
|
Returns a list of sucessful redacts.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return await asyncio.gather(*[
|
model = self.models[self.user_id, room_id, "events"]
|
||||||
self.room_redact(room_id, ev_id, reason)
|
gather_list = []
|
||||||
for ev_id in event_ids
|
|
||||||
])
|
for event in model._sorted_data:
|
||||||
|
if event.event_id in event_ids:
|
||||||
|
event.is_local_echo = True
|
||||||
|
event.content = "Removing..."
|
||||||
|
event.event_type = nio.RedactedEvent
|
||||||
|
gather_list.append(
|
||||||
|
self.room_redact(room_id, event.event_id, reason),
|
||||||
|
)
|
||||||
|
|
||||||
|
return await asyncio.gather(*gather_list)
|
||||||
|
|
||||||
|
|
||||||
async def generate_thumbnail(
|
async def generate_thumbnail(
|
||||||
|
|
|
@ -172,7 +172,10 @@ class NioCallbacks:
|
||||||
event = existing
|
event = existing
|
||||||
break
|
break
|
||||||
|
|
||||||
if not (event and event.event_type is not nio.RedactedEvent):
|
if not (
|
||||||
|
event and
|
||||||
|
(event.event_type is not nio.RedactedEvent or event.is_local_echo)
|
||||||
|
):
|
||||||
return
|
return
|
||||||
|
|
||||||
event.source.source["content"] = {}
|
event.source.source["content"] = {}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user