aboutsummaryrefslogtreecommitdiff
path: root/xmpp/handlers.go
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2023-08-01 04:25:24 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2023-08-01 04:25:24 +0300
commitef831fc9725601a94149ce94c3fb686afc77e0a5 (patch)
tree4046e57e03097d9af33cde558056cd5393fa77f4 /xmpp/handlers.go
parent748366ad6a9dc4b2a269d5499ae1d5d7e8526762 (diff)
Migrate to TDLib 1.8.14 (multiple usernames support)
Diffstat (limited to 'xmpp/handlers.go')
-rw-r--r--xmpp/handlers.go8
1 files changed, 4 insertions, 4 deletions
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,
},
},
})