Send captions in a different message and improve other things

This commit is contained in:
Tulir Asokan
2018-08-27 23:15:05 +03:00
parent b978930c88
commit dad2fc29ab
3 changed files with 43 additions and 12 deletions

View File

@ -80,7 +80,11 @@ func (user *User) newWhatsAppFormatMaps() (map[*regexp.Regexp]string, map[*regex
mentionRegex: func(str string) string {
jid := str[1:] + whatsappExt.NewUserSuffix
puppet := user.GetPuppetByJID(jid)
return fmt.Sprintf(`<a href="https://matrix.to/#/%s">%s</a>`, puppet.MXID, puppet.Displayname)
mxid := puppet.MXID
if jid == user.JID() {
mxid = user.ID
}
return fmt.Sprintf(`<a href="https://matrix.to/#/%s">%s</a>`, mxid, puppet.Displayname)
},
}
}