aboutsummaryrefslogtreecommitdiff
path: root/telegram/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'telegram/utils.go')
-rw-r--r--telegram/utils.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/telegram/utils.go b/telegram/utils.go
index ee7b4e8..5b0e2ca 100644
--- a/telegram/utils.go
+++ b/telegram/utils.go
@@ -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())