Fix m.emote with a quote
This commit is contained in:
@@ -254,11 +254,11 @@ class Portal:
|
|||||||
def handle_matrix_message(self, sender, message, event_id):
|
def handle_matrix_message(self, sender, message, event_id):
|
||||||
type = message["msgtype"]
|
type = message["msgtype"]
|
||||||
if type in {"m.text", "m.emote"}:
|
if type in {"m.text", "m.emote"}:
|
||||||
if type == "m.emote":
|
|
||||||
message["body"] = f"/me " + message["body"]
|
|
||||||
if "format" in message and message["format"] == "org.matrix.custom.html":
|
if "format" in message and message["format"] == "org.matrix.custom.html":
|
||||||
message, entities = formatter.matrix_to_telegram(message["formatted_body"],
|
message, entities = formatter.matrix_to_telegram(message["formatted_body"],
|
||||||
sender.tgid)
|
sender.tgid)
|
||||||
|
if type == "m.emote":
|
||||||
|
message = "/me " + message
|
||||||
reply_to = None
|
reply_to = None
|
||||||
if len(entities) > 0 and isinstance(entities[0], formatter.MessageEntityReply):
|
if len(entities) > 0 and isinstance(entities[0], formatter.MessageEntityReply):
|
||||||
reply = entities.pop(0)
|
reply = entities.pop(0)
|
||||||
@@ -267,6 +267,8 @@ class Portal:
|
|||||||
response = sender.send_message(self.peer, message, entities=entities,
|
response = sender.send_message(self.peer, message, entities=entities,
|
||||||
reply_to=reply_to)
|
reply_to=reply_to)
|
||||||
else:
|
else:
|
||||||
|
if type == "m.emote":
|
||||||
|
message["body"] = "/me " + message["body"]
|
||||||
response = sender.send_message(self.peer, message["body"])
|
response = sender.send_message(self.peer, message["body"])
|
||||||
elif type in {"m.image", "m.file", "m.audio", "m.video"}:
|
elif type in {"m.image", "m.file", "m.audio", "m.video"}:
|
||||||
file = self.main_intent.download_file(message["url"])
|
file = self.main_intent.download_file(message["url"])
|
||||||
|
|||||||
Reference in New Issue
Block a user