Explorar o código

Add italics for bridging emotes

Tulir Asokan %!s(int64=2) %!d(string=hai) anos
pai
achega
a67d6d2af7
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      portal.go

+ 3 - 0
portal.go

@@ -1530,6 +1530,9 @@ func (portal *Portal) handleMatrixMessage(sender *User, evt *event.Event) {
 	switch content.MsgType {
 	case event.MsgText, event.MsgEmote, event.MsgNotice:
 		sendReq.Content, sendReq.AllowedMentions = portal.parseMatrixHTML(content)
+		if content.MsgType == event.MsgEmote {
+			sendReq.Content = fmt.Sprintf("_%s_", sendReq.Content)
+		}
 	case event.MsgAudio, event.MsgFile, event.MsgImage, event.MsgVideo:
 		data, err := downloadMatrixAttachment(portal.MainIntent(), content)
 		if err != nil {