Refactor the message modification in redactions.
This commit is contained in:
parent
c12c9b6eb9
commit
0743bca542
1 changed files with 8 additions and 5 deletions
|
@ -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")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue