From ef831fc9725601a94149ce94c3fb686afc77e0a5 Mon Sep 17 00:00:00 2001 From: Bohdan Horbeshko Date: Mon, 31 Jul 2023 21:25:24 -0400 Subject: Migrate to TDLib 1.8.14 (multiple usernames support) --- xmpp/handlers.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xmpp') diff --git a/xmpp/handlers.go b/xmpp/handlers.go index c5ec029..fd1afad 100644 --- a/xmpp/handlers.go +++ b/xmpp/handlers.go @@ -481,7 +481,7 @@ func makeVCardPayload(typ byte, id string, info telegram.VCardInfo, session *tel vcard.Photo.Type.Text = "image/jpeg" vcard.Photo.Binval.Text = base64Photo } - vcard.Nickname.Text = info.Nickname + vcard.Nickname.Text = strings.Join(info.Nicknames, ",") vcard.N.Given.Text = info.Given vcard.N.Family.Text = info.Family vcard.Tel.Number.Text = info.Tel @@ -512,13 +512,13 @@ func makeVCardPayload(typ byte, id string, info telegram.VCardInfo, session *tel }, }) } - if info.Nickname != "" { + for _, nickname := range info.Nicknames { nodes = append(nodes, stanza.Node{ XMLName: xml.Name{Local: "nickname"}, Nodes: []stanza.Node{ stanza.Node{ XMLName: xml.Name{Local: "text"}, - Content: info.Nickname, + Content: nickname, }, }, }, stanza.Node{ @@ -526,7 +526,7 @@ func makeVCardPayload(typ byte, id string, info telegram.VCardInfo, session *tel Nodes: []stanza.Node{ stanza.Node{ XMLName: xml.Name{Local: "uri"}, - Content: "https://t.me/" + info.Nickname, + Content: "https://t.me/" + nickname, }, }, }) -- cgit v1.2.3