package extensions import ( "encoding/xml" "strconv" "time" "gosrc.io/xmpp/stanza" // side-effect: register Jingle stanza types with stanza.TypeRegistry _ "dev.narayana.im/narayana/telegabber/xmpp/jingle" ) // 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"` } // IqVcardTemp is from XEP-0054 type IqVcardTemp struct { XMLName xml.Name `xml:"vcard-temp vCard"` Fn IqVcardFn Nickname IqVcardNickname N IqVcardN Tel IqVcardTel Photo IqVcardPhoto Desc IqVcardDesc ResultSet *stanza.ResultSet `xml:"set,omitempty"` } // IqVcardFn is vCard/FN type IqVcardFn struct { XMLName xml.Name `xml:"FN"` Text string `xml:",chardata"` } // IqVcardNickname is vCard/NICKNAME type IqVcardNickname struct { XMLName xml.Name `xml:"NICKNAME"` Text string `xml:",chardata"` } // IqVcardN is vCard/N type IqVcardN struct { XMLName xml.Name `xml:"N"` Family IqVcardNFamily Given IqVcardNGiven Middle IqVcardNMiddle } // IqVcardNFamily is vCard/N/FAMILY type IqVcardNFamily struct { XMLName xml.Name `xml:"FAMILY"` Text string `xml:",chardata"` } // IqVcardNGiven is vCard/N/GIVEN type IqVcardNGiven struct { XMLName xml.Name `xml:"GIVEN"` Text string `xml:",chardata"` } // IqVcardNMiddle is vCard/N/MIDDLE type IqVcardNMiddle struct { XMLName xml.Name `xml:"MIDDLE"` Text string `xml:",chardata"` } // IqVcardTel is vCard/TEL type IqVcardTel struct { XMLName xml.Name `xml:"TEL"` Number IqVcardTelNumber } // IqVcardTelNumber is vCard/TEL/NUMBER type IqVcardTelNumber struct { XMLName xml.Name `xml:"NUMBER"` Text string `xml:",chardata"` } // IqVcardPhoto is vCard/PHOTO type IqVcardPhoto struct { XMLName xml.Name `xml:"PHOTO"` Type IqVcardPhotoType Binval IqVcardPhotoBinval } // IqVcardPhotoType is vCard/PHOTO/TYPE type IqVcardPhotoType struct { XMLName xml.Name `xml:"TYPE"` Text string `xml:",chardata"` } // IqVcardPhotoBinval is vCard/PHOTO/BINVAL type IqVcardPhotoBinval struct { XMLName xml.Name `xml:"BINVAL"` Text string `xml:",chardata"` } // IqVcardDesc is vCard/DESC type IqVcardDesc struct { XMLName xml.Name `xml:"DESC"` Text string `xml:",chardata"` } // Reply is from XEP-0461 type Reply struct { XMLName xml.Name `xml:"urn:xmpp:reply:0 reply"` To string `xml:"to,attr"` Id string `xml:"id,attr"` } // Fallback is from XEP-0428 type Fallback struct { XMLName xml.Name `xml:"urn:xmpp:fallback:0 fallback"` For string `xml:"for,attr"` Body []FallbackBody `xml:"urn:xmpp:fallback:0 body"` Subject []FallbackSubject `xml:"urn:xmpp:fallback:0 subject"` } // FallbackBody is from XEP-0428 type FallbackBody struct { XMLName xml.Name `xml:"urn:xmpp:fallback:0 body"` Start string `xml:"start,attr"` End string `xml:"end,attr"` } // FallbackSubject is from XEP-0428 type FallbackSubject struct { XMLName xml.Name `xml:"urn:xmpp:fallback:0 subject"` Start string `xml:"start,attr"` End string `xml:"end,attr"` } // CarbonReceived is from XEP-0280 type CarbonReceived struct { XMLName xml.Name `xml:"urn:xmpp:carbons:2 received"` Forwarded stanza.Forwarded `xml:"urn:xmpp:forward:0 forwarded"` } // CarbonSent is from XEP-0280 type CarbonSent struct { XMLName xml.Name `xml:"urn:xmpp:carbons:2 sent"` Forwarded stanza.Forwarded `xml:"urn:xmpp:forward:0 forwarded"` } // ComponentPrivilege is from XEP-0356 type ComponentPrivilege1 struct { XMLName xml.Name `xml:"urn:xmpp:privilege:1 privilege"` Perms []ComponentPerm `xml:"perm"` Forwarded stanza.Forwarded `xml:"urn:xmpp:forward:0 forwarded"` } // ComponentPrivilege is from XEP-0356 type ComponentPrivilege2 struct { XMLName xml.Name `xml:"urn:xmpp:privilege:2 privilege"` Perms []ComponentPerm `xml:"perm"` Forwarded stanza.Forwarded `xml:"urn:xmpp:forward:0 forwarded"` } // ComponentPerm is from XEP-0356 type ComponentPerm struct { XMLName xml.Name `xml:"perm"` Access string `xml:"access,attr"` Type string `xml:"type,attr"` Push bool `xml:"push,attr"` } // ClientMessage is a jabber:client NS message compatible with Prosody's XEP-0356 implementation type ClientMessage struct { XMLName xml.Name `xml:"jabber:client message"` stanza.Attrs Subject string `xml:"subject,omitempty"` Body string `xml:"body,omitempty"` Thread string `xml:"thread,omitempty"` Error stanza.Err `xml:"error,omitempty"` Extensions []stanza.MsgExtension `xml:",omitempty"` } // Replace is from XEP-0308 type Replace struct { XMLName xml.Name `xml:"urn:xmpp:message-correct:0 replace"` Id string `xml:"id,attr"` } // QueryRegister is from XEP-0077 type QueryRegister struct { XMLName xml.Name `xml:"jabber:iq:register query"` Instructions string `xml:"instructions"` Username string `xml:"username"` Registered *QueryRegisterRegistered `xml:"registered"` Remove *QueryRegisterRemove `xml:"remove"` ResultSet *stanza.ResultSet `xml:"set,omitempty"` } // QueryRegisterRegistered is a child element from XEP-0077 type QueryRegisterRegistered struct { XMLName xml.Name `xml:"registered"` } // QueryRegisterRemove is a child element from XEP-0077 type QueryRegisterRemove struct { XMLName xml.Name `xml:"remove"` } // MessageXLegacyInviteExtension is from JEP-0045 type MessageXLegacyInviteExtension struct { XMLName xml.Name `xml:"jabber:x:conference x"` Jid string `xml:"jid,attr"` } // MessageXMucUserExtension is from XEP-0045 type MessageXMucUserExtension struct { XMLName xml.Name `xml:"http://jabber.org/protocol/muc#user x"` Invite *MessageXMucUserInvite `xml:"invite,omitempty"` Status *MessageXMucUserStatus `xml:"status,omitempty"` Item PresenceXMucUserItem `xml:"item,omitempty"` Password string `xml:"password,omitempty"` } // MessageXMucUserInvite is from XEP-0045 type MessageXMucUserInvite struct { XMLName xml.Name `xml:"invite"` From string `xml:"from,attr"` Reason string `xml:"reason,omitempty"` Continue MessageXMucUserInviteContinue } // MessageXMucUserInviteContinue is from XEP-0045 type MessageXMucUserInviteContinue struct { XMLName xml.Name `xml:"continue"` Thread string `xml:"thread,attr,omitempty"` } // MessageXMucUserStatus is from XEP-0486 type MessageXMucUserStatus struct { XMLName xml.Name `xml:"status"` Code string `xml:"code,attr"` } // PresenceXMucUserExtension is from XEP-0045 type PresenceXMucUserExtension struct { XMLName xml.Name `xml:"http://jabber.org/protocol/muc#user x"` Item PresenceXMucUserItem Destroy *MucDestroy Statuses []PresenceXMucUserStatus } // PresenceXMucUserItem is from XEP-0045 type PresenceXMucUserItem struct { XMLName xml.Name `xml:"item"` Affiliation string `xml:"affiliation,attr"` Jid *string `xml:"jid,attr"` Nick string `xml:"nick,attr,omitempty"` Role string `xml:"role,attr"` } // PresenceXMucUserStatus is from XEP-0045 type PresenceXMucUserStatus struct { XMLName xml.Name `xml:"status"` Code uint16 `xml:"code,attr"` } // MessageDelay is from XEP-0203 type MessageDelay struct { XMLName xml.Name `xml:"urn:xmpp:delay delay"` From string `xml:"from,attr,omitempty"` Stamp string `xml:"stamp,attr"` } func NewMessageDelay(timestamp int64, from string) MessageDelay { return MessageDelay{ From: from, Stamp: TimestampToRFC3339(timestamp), } } func TimestampToRFC3339(timestamp int64) string { return time.Unix(timestamp, 0).UTC().Format(time.RFC3339) } // MessageDelayLegacy is from XEP-0203 type MessageDelayLegacy struct { XMLName xml.Name `xml:"jabber:x:delay x"` From string `xml:"from,attr"` Stamp string `xml:"stamp,attr"` } func NewMessageDelayLegacy(timestamp int64, from string) MessageDelayLegacy { return MessageDelayLegacy{ From: from, Stamp: time.Unix(timestamp, 0).UTC().Format("20060102T15:04:05"), } } // MessageAddresses is from XEP-0033 type MessageAddresses struct { XMLName xml.Name `xml:"http://jabber.org/protocol/address addresses"` Addresses []MessageAddress } // MessageAddress is from XEP-0033 type MessageAddress struct { XMLName xml.Name `xml:"address"` Type string `xml:"type,attr"` Jid string `xml:"jid,attr"` } // MessageStanzaId is from XEP-0359 type MessageStanzaId struct { XMLName xml.Name `xml:"urn:xmpp:sid:0 stanza-id"` Id string `xml:"id,attr"` By string `xml:"by,attr"` } // MessageOriginId is from XEP-0359 type MessageOriginId struct { XMLName xml.Name `xml:"urn:xmpp:sid:0 origin-id"` Id string `xml:"id,attr"` } // EmptySubject is a dummy for MUCs to circumvent omitempty. Not registered as it would conflict with Subject field type EmptySubject struct { XMLName xml.Name `xml:"subject"` } // QueryMucAdmin is from XEP-0045 type QueryMucAdmin struct { XMLName xml.Name `xml:"http://jabber.org/protocol/muc#admin query"` Items []*QueryMucAdminItem `xml:"item"` ResultSet *stanza.ResultSet `xml:"set,omitempty"` } // QueryMucAdminItem is a child element from XEP-0045 type QueryMucAdminItem struct { XMLName xml.Name `xml:"item"` Jid string `xml:"jid,attr,omitempty"` Nick string `xml:"nick,attr,omitempty"` Role string `xml:"role,attr,omitempty"` Affiliation string `xml:"affiliation,attr,omitempty"` Reason string `xml:"reason,omitempty"` } // QueryMucOwner is from XEP-0045 type QueryMucOwner struct { XMLName xml.Name `xml:"http://jabber.org/protocol/muc#owner query"` Form *stanza.Form `xml:"jabber:x:data x,omitempty"` Destroy *MucDestroy `xml:"destroy,omitempty"` ResultSet *stanza.ResultSet `xml:"set,omitempty"` } // MucDestroy is a child element from XEP-0045 type MucDestroy struct { XMLName xml.Name `xml:"destroy"` Jid string `xml:"jid,attr,omitempty"` Reason string `xml:"reason,omitempty"` } // MAM2Query is from XEP-0313 type MAM2Query struct { XMLName xml.Name `xml:"urn:xmpp:mam:2 query"` Form *stanza.Form `xml:"jabber:x:data x"` QueryId string `xml:"queryid,attr,omitempty"` ResultSet *stanza.ResultSet `xml:"set,omitempty"` FlipPage *FlipPage `xml:"flip-page"` } // MAM1Query is from XEP-0313 type MAM1Query struct { XMLName xml.Name `xml:"urn:xmpp:mam:1 query"` Form *stanza.Form `xml:"jabber:x:data x"` QueryId string `xml:"queryid,attr,omitempty"` ResultSet *stanza.ResultSet `xml:"set,omitempty"` } // MAM0Query is from XEP-0313 type MAM0Query struct { XMLName xml.Name `xml:"urn:xmpp:mam:0 query"` Form *stanza.Form `xml:"jabber:x:data x"` QueryId string `xml:"queryid,attr,omitempty"` ResultSet *stanza.ResultSet `xml:"set,omitempty"` } type MAMQuery interface { Namespace() string GetForm() *stanza.Form GetQueryId() string GetSet() *stanza.ResultSet GetFlipPage() *FlipPage } // FlipPage is an extended element from XEP-0313 type FlipPage struct { XMLName xml.Name `xml:"flip-page"` } // ForwardedMessage is from XEP-0297 (go-xmpp lacks Delay) type ForwardedMessage struct { XMLName xml.Name `xml:"urn:xmpp:forward:0 forwarded"` Message *ClientMessage `xml:"jabber:client message"` Delay *MessageDelay `xml:"urn:xmpp:delay delay,omitempty"` } // MAM2MessageResult is from XEP-0313 type MAM2MessageResult struct { XMLName xml.Name `xml:"urn:xmpp:mam:2 result"` Forwarded *ForwardedMessage `xml:"urn:xmpp:forward:0 forwarded,omitempty"` QueryId string `xml:"queryid,attr,omitempty"` Id string `xml:"id,attr,omitempty"` } // MAM1MessageResult is from XEP-0313 type MAM1MessageResult struct { XMLName xml.Name `xml:"urn:xmpp:mam:1 result"` Forwarded *ForwardedMessage `xml:"urn:xmpp:forward:0 forwarded,omitempty"` QueryId string `xml:"queryid,attr,omitempty"` Id string `xml:"id,attr,omitempty"` } // MAM0MessageResult is from XEP-0313 type MAM0MessageResult struct { XMLName xml.Name `xml:"urn:xmpp:mam:0 result"` Forwarded *ForwardedMessage `xml:"urn:xmpp:forward:0 forwarded,omitempty"` QueryId string `xml:"queryid,attr,omitempty"` Id string `xml:"id,attr,omitempty"` } // MAM2Fin is from XEP-0313 type MAM2Fin struct { XMLName xml.Name `xml:"urn:xmpp:mam:2 fin"` ResultSet *stanza.ResultSet `xml:"set,omitempty"` Complete bool `xml:"complete,attr,omitempty"` Stable bool `xml:"stable,attr"` } // MAM1Fin is from XEP-0313 type MAM1Fin struct { XMLName xml.Name `xml:"urn:xmpp:mam:1 fin"` ResultSet *stanza.ResultSet `xml:"set,omitempty"` Complete bool `xml:"complete,attr,omitempty"` Stable bool `xml:"stable,attr"` } // MAM0Fin is from XEP-0313 type MAM0Fin struct { XMLName xml.Name `xml:"urn:xmpp:mam:0 fin"` ResultSet *stanza.ResultSet `xml:"set,omitempty"` Complete bool `xml:"complete,attr,omitempty"` Stable bool `xml:"stable,attr"` } // MAM2Metadata is from XEP-0313 type MAM2Metadata struct { XMLName xml.Name `xml:"urn:xmpp:mam:2 metadata"` Start *MAM2MetadataStart `xml:"start"` End *MAM2MetadataEnd `xml:"end"` ResultSet *stanza.ResultSet `xml:"set,omitempty"` } // MAM2MetadataStart is from XEP-0313 type MAM2MetadataStart struct { XMLName xml.Name `xml:"start"` Id string `xml:"id,attr,omitempty"` Timestamp string `xml:"timestamp,attr,omitempty"` } // MAM2MetadataEnd is from XEP-0313 type MAM2MetadataEnd struct { XMLName xml.Name `xml:"end"` Id string `xml:"id,attr,omitempty"` Timestamp string `xml:"timestamp,attr,omitempty"` } // EntityTime is from XEP-0202 type EntityTime struct { XMLName xml.Name `xml:"urn:xmpp:time time"` Tzo string `xml:"tzo"` Utc string `xml:"utc"` ResultSet *stanza.ResultSet `xml:"set,omitempty"` } // 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 } // Namespace is a namespace! func (c IqVcardTemp) Namespace() string { return c.XMLName.Space } // GetSet getsets! func (c IqVcardTemp) GetSet() *stanza.ResultSet { return c.ResultSet } // Namespace is a namespace! func (c Reply) Namespace() string { return c.XMLName.Space } // Namespace is a namespace! func (c Fallback) Namespace() string { return c.XMLName.Space } // Namespace is a namespace! func (c CarbonReceived) Namespace() string { return c.XMLName.Space } // Namespace is a namespace! func (c CarbonSent) Namespace() string { return c.XMLName.Space } // Namespace is a namespace! func (c ComponentPrivilege1) Namespace() string { return c.XMLName.Space } // Namespace is a namespace! func (c ComponentPrivilege2) Namespace() string { return c.XMLName.Space } // Namespace is a namespace! func (c Replace) Namespace() string { return c.XMLName.Space } // Namespace is a namespace! func (c QueryRegister) Namespace() string { return c.XMLName.Space } // GetSet getsets! func (c QueryRegister) GetSet() *stanza.ResultSet { return c.ResultSet } // Namespace is a namespace! func (c PresenceXMucUserExtension) Namespace() string { return c.XMLName.Space } // Namespace is a namespace! func (c MessageDelay) Namespace() string { return c.XMLName.Space } // Namespace is a namespace! func (c MessageDelayLegacy) Namespace() string { return c.XMLName.Space } // Namespace is a namespace! func (c EntityTime) Namespace() string { return c.XMLName.Space } // GetSet getsets! func (c EntityTime) GetSet() *stanza.ResultSet { return c.ResultSet } // Name is a packet name func (ClientMessage) Name() string { return "message" } // Namespace is a namespace! func (c QueryMucAdmin) Namespace() string { return c.XMLName.Space } // GetSet getsets! func (c QueryMucAdmin) GetSet() *stanza.ResultSet { return c.ResultSet } // Namespace is a namespace! func (c QueryMucOwner) Namespace() string { return c.XMLName.Space } // GetSet getsets! func (c QueryMucOwner) GetSet() *stanza.ResultSet { return c.ResultSet } // Namespace is a namespace! func (c MAM2Query) Namespace() string { return c.XMLName.Space } // GetForm obtains the query form func (c MAM2Query) GetForm() *stanza.Form { return c.Form } // GetQueryId obtains the query id func (c MAM2Query) GetQueryId() string { return c.QueryId } // GetSet getsets! func (c MAM2Query) GetSet() *stanza.ResultSet { return c.ResultSet } // GetFlipPage obtains the flip-page element func (c MAM2Query) GetFlipPage() *FlipPage { return c.FlipPage } // Namespace is a namespace! func (c MAM1Query) Namespace() string { return c.XMLName.Space } // GetForm obtains the query form func (c MAM1Query) GetForm() *stanza.Form { return c.Form } // GetQueryId obtains the query id func (c MAM1Query) GetQueryId() string { return c.QueryId } // GetSet getsets! func (c MAM1Query) GetSet() *stanza.ResultSet { return c.ResultSet } // GetFlipPage is a stub as it's not supported in this MAM version func (c MAM1Query) GetFlipPage() *FlipPage { return nil } // Namespace is a namespace! func (c MAM0Query) Namespace() string { return c.XMLName.Space } // GetForm obtains the query form func (c MAM0Query) GetForm() *stanza.Form { return c.Form } // GetQueryId obtains the query id func (c MAM0Query) GetQueryId() string { return c.QueryId } // GetSet getsets! func (c MAM0Query) GetSet() *stanza.ResultSet { return c.ResultSet } // GetFlipPage is a stub as it's not supported in this MAM version func (c MAM0Query) GetFlipPage() *FlipPage { return nil } // Namespace is a namespace! func (c MAM2Fin) Namespace() string { return c.XMLName.Space } // GetSet getsets! func (c MAM2Fin) GetSet() *stanza.ResultSet { return c.ResultSet } // Namespace is a namespace! func (c MAM1Fin) Namespace() string { return c.XMLName.Space } // GetSet getsets! func (c MAM1Fin) GetSet() *stanza.ResultSet { return c.ResultSet } // Namespace is a namespace! func (c MAM0Fin) Namespace() string { return c.XMLName.Space } // GetSet getsets! func (c MAM0Fin) GetSet() *stanza.ResultSet { return c.ResultSet } // Namespace is a namespace! func (c MAM2Metadata) Namespace() string { return c.XMLName.Space } // GetSet getsets! func (c MAM2Metadata) GetSet() *stanza.ResultSet { return c.ResultSet } // NewReplyFallback initializes a fallback range func NewReplyFallback(start uint64, end uint64) Fallback { return Fallback{ For: "urn:xmpp:reply:0", Body: []FallbackBody{ FallbackBody{ Start: strconv.FormatUint(start, 10), End: strconv.FormatUint(end, 10), }, }, } } 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{}) // iq vcard request stanza.TypeRegistry.MapExtension(stanza.PKTIQ, xml.Name{ "vcard-temp", "vCard", }, IqVcardTemp{}) // reply stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{ "urn:xmpp:reply:0", "reply", }, Reply{}) // fallback stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{ "urn:xmpp:fallback:0", "fallback", }, Fallback{}) // carbon received stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{ "urn:xmpp:carbons:2", "received", }, CarbonReceived{}) // carbon sent stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{ "urn:xmpp:carbons:2", "sent", }, CarbonSent{}) // component privilege v1 stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{ "urn:xmpp:privilege:1", "privilege", }, ComponentPrivilege1{}) // component privilege v2 stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{ "urn:xmpp:privilege:2", "privilege", }, ComponentPrivilege2{}) // message edit stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{ "urn:xmpp:message-correct:0", "replace", }, Replace{}) // register query stanza.TypeRegistry.MapExtension(stanza.PKTIQ, xml.Name{ "jabber:iq:register", "query", }, QueryRegister{}) // message muc user stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{ "http://jabber.org/protocol/muc#user", "x", }, MessageXMucUserExtension{}) // presence muc user stanza.TypeRegistry.MapExtension(stanza.PKTPresence, xml.Name{ "http://jabber.org/protocol/muc#user", "x", }, PresenceXMucUserExtension{}) // message delay stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{ "urn:xmpp:delay", "delay", }, MessageDelay{}) // legacy message delay stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{ "jabber:x:delay", "x", }, MessageDelayLegacy{}) // message addresses stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{ "http://jabber.org/protocol/address", "addresses", }, MessageAddresses{}) // stable stanza id stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{ "urn:xmpp:sid:0", "stanza-id", }, MessageStanzaId{}) // message addresses stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{ "urn:xmpp:sid:0", "origin-id", }, MessageOriginId{}) // muc admin query stanza.TypeRegistry.MapExtension(stanza.PKTIQ, xml.Name{ "http://jabber.org/protocol/muc#admin", "query", }, QueryMucAdmin{}) // muc owner query stanza.TypeRegistry.MapExtension(stanza.PKTIQ, xml.Name{ "http://jabber.org/protocol/muc#owner", "query", }, QueryMucOwner{}) // MAM2 query stanza.TypeRegistry.MapExtension(stanza.PKTIQ, xml.Name{ "urn:xmpp:mam:2", "query", }, MAM2Query{}) // MAM1 query stanza.TypeRegistry.MapExtension(stanza.PKTIQ, xml.Name{ "urn:xmpp:mam:1", "query", }, MAM1Query{}) // MAM0 query stanza.TypeRegistry.MapExtension(stanza.PKTIQ, xml.Name{ "urn:xmpp:mam:0", "query", }, MAM0Query{}) // MAM2 message result stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{ "urn:xmpp:mam:2", "result", }, MAM2MessageResult{}) // MAM1 message result stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{ "urn:xmpp:mam:1", "result", }, MAM1MessageResult{}) // MAM0 message result stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{ "urn:xmpp:mam:0", "result", }, MAM0MessageResult{}) // MAM2 fin stanza.TypeRegistry.MapExtension(stanza.PKTIQ, xml.Name{ "urn:xmpp:mam:2", "fin", }, MAM2Fin{}) // MAM1 fin stanza.TypeRegistry.MapExtension(stanza.PKTIQ, xml.Name{ "urn:xmpp:mam:1", "fin", }, MAM1Fin{}) // MAM0 fin stanza.TypeRegistry.MapExtension(stanza.PKTIQ, xml.Name{ "urn:xmpp:mam:0", "fin", }, MAM0Fin{}) // MAM2 metadata stanza.TypeRegistry.MapExtension(stanza.PKTIQ, xml.Name{ "urn:xmpp:mam:2", "metadata", }, MAM2Metadata{}) // entity time stanza.TypeRegistry.MapExtension(stanza.PKTIQ, xml.Name{ "urn:xmpp:time", "time", }, EntityTime{}) }