Redacted messages should have their HTML removed (#67)
This commit is contained in:
@@ -389,7 +389,7 @@ impl MessageEvent {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn redact(&mut self, redaction: SyncRoomRedactionEvent, version: &RoomVersionId) {
|
||||
fn redact(&mut self, redaction: SyncRoomRedactionEvent, version: &RoomVersionId) {
|
||||
match self {
|
||||
MessageEvent::EncryptedOriginal(_) => return,
|
||||
MessageEvent::EncryptedRedacted(_) => return,
|
||||
@@ -808,6 +808,11 @@ impl Message {
|
||||
|
||||
Span::styled(sender, style).into()
|
||||
}
|
||||
|
||||
pub fn redact(&mut self, redaction: SyncRoomRedactionEvent, version: &RoomVersionId) {
|
||||
self.event.redact(redaction, version);
|
||||
self.html = None;
|
||||
}
|
||||
}
|
||||
|
||||
impl From<RoomEncryptedEvent> for Message {
|
||||
|
||||
@@ -774,7 +774,7 @@ impl ClientWorker {
|
||||
Some(EventLocation::Message(key)) => {
|
||||
if let Some(msg) = info.messages.get_mut(key) {
|
||||
let ev = SyncRoomRedactionEvent::Original(ev);
|
||||
msg.event.redact(ev, room_version);
|
||||
msg.redact(ev, room_version);
|
||||
}
|
||||
},
|
||||
Some(EventLocation::Reaction(event_id)) => {
|
||||
|
||||
Reference in New Issue
Block a user