From d6f6207ebb3d5256256a7810a3d3d0bdc8ba04a5 Mon Sep 17 00:00:00 2001 From: bodqhrohro Date: Mon, 25 Nov 2019 00:20:07 +0200 Subject: Refactoring: move SendPresence to xmpp/gateway package --- xmpp/extensions.go | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 xmpp/extensions.go (limited to 'xmpp/extensions.go') diff --git a/xmpp/extensions.go b/xmpp/extensions.go deleted file mode 100644 index 2270431..0000000 --- a/xmpp/extensions.go +++ /dev/null @@ -1,49 +0,0 @@ -package xmpp - -import ( - "encoding/xml" - - "gosrc.io/xmpp/stanza" -) - -// PresenceNickExtension is from XEP-0172 -type PresenceNickExtension struct { - XMLName xml.Name `xml:"http://jabber.org/protocol/nick nick"` - Text string `xml:",chardata"` -} - -// PresenceXVCardUpdateExtension is from XEP-0153 -type PresenceXVCardUpdateExtension struct { - XMLName xml.Name `xml:"vcard-temp:x:update x"` - Photo PresenceXVCardUpdatePhoto -} - -// PresenceXVCardUpdatePhoto is from XEP-0153 -type PresenceXVCardUpdatePhoto struct { - XMLName xml.Name `xml:"photo"` - Text string `xml:",chardata"` -} - -// Namespace is a namespace! -func (c PresenceNickExtension) Namespace() string { - return c.XMLName.Space -} - -// Namespace is a namespace! -func (c PresenceXVCardUpdateExtension) Namespace() string { - return c.XMLName.Space -} - -func init() { - // presence nick - stanza.TypeRegistry.MapExtension(stanza.PKTPresence, xml.Name{ - "http://jabber.org/protocol/nick", - "nick", - }, PresenceNickExtension{}) - - // presence vcard update - stanza.TypeRegistry.MapExtension(stanza.PKTPresence, xml.Name{ - "vcard-temp:x:update", - "x", - }, PresenceXVCardUpdateExtension{}) -} -- cgit v1.2.3