Refactor the message modification in redactions.

This commit is contained in:
poljar (Damir Jelić) 2018-02-25 15:29:07 +01:00
parent c12c9b6eb9
commit 0743bca542

View file

@ -470,13 +470,16 @@ class RoomRedactionEvent(RoomEvent):
censor=censor, censor=censor,
reason=reason) reason=reason)
new_message = ""
if OPTIONS.redaction_type == RedactType.STRIKETHROUGH: if OPTIONS.redaction_type == RedactType.STRIKETHROUGH:
message = string_strikethrough(message) new_message = string_strikethrough(message)
message = message + " " + redaction_msg
elif OPTIONS.redaction_type == RedactType.DELETE:
message = redaction_msg
elif OPTIONS.redaction_type == RedactType.NOTICE: elif OPTIONS.redaction_type == RedactType.NOTICE:
message = message + " " + redaction_msg new_message = message
elif OPTIONS.redaction_type == RedactType.DELETE:
pass
message = " ".join(s for s in [new_message, redaction_msg] if s)
tags.append("matrix_redacted") tags.append("matrix_redacted")