Support contact messages
This commit is contained in:
parent
00f6e41e71
commit
ab1af45247
|
@ -469,6 +469,20 @@ func (c *Client) messageToText(message *client.Message) string {
|
|||
formatter.SortEntities(animation.Caption.Entities),
|
||||
markupFunction,
|
||||
)
|
||||
case client.TypeMessageContact:
|
||||
contact, _ := message.Content.(*client.MessageContact)
|
||||
var jid string
|
||||
if contact.Contact.UserId != 0 {
|
||||
jid = fmt.Sprintf("%v@%s", contact.Contact.UserId, gateway.Jid.Bare())
|
||||
}
|
||||
return fmt.Sprintf(
|
||||
"*%s %s*\n%s\n%s\n%s",
|
||||
contact.Contact.FirstName,
|
||||
contact.Contact.LastName,
|
||||
contact.Contact.PhoneNumber,
|
||||
contact.Contact.Vcard,
|
||||
jid,
|
||||
)
|
||||
}
|
||||
|
||||
return fmt.Sprintf("unknown message (%s)", message.Content.MessageContentType())
|
||||
|
|
Loading…
Reference in a new issue