aboutsummaryrefslogtreecommitdiff
path: root/xmpp/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp/extensions')
-rw-r--r--xmpp/extensions/extensions.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/xmpp/extensions/extensions.go b/xmpp/extensions/extensions.go
index 2d547af..dd90e35 100644
--- a/xmpp/extensions/extensions.go
+++ b/xmpp/extensions/extensions.go
@@ -7,8 +7,8 @@ import (
"gosrc.io/xmpp/stanza"
)
-// PresenceNickExtension is from XEP-0172
-type PresenceNickExtension struct {
+// NickExtension is from XEP-0172
+type NickExtension struct {
XMLName xml.Name `xml:"http://jabber.org/protocol/nick nick"`
Text string `xml:",chardata"`
}
@@ -187,7 +187,7 @@ type Replace struct {
}
// Namespace is a namespace!
-func (c PresenceNickExtension) Namespace() string {
+func (c NickExtension) Namespace() string {
return c.XMLName.Space
}
@@ -259,7 +259,13 @@ func init() {
stanza.TypeRegistry.MapExtension(stanza.PKTPresence, xml.Name{
"http://jabber.org/protocol/nick",
"nick",
- }, PresenceNickExtension{})
+ }, NickExtension{})
+
+ // message nick
+ stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{
+ "http://jabber.org/protocol/nick",
+ "nick",
+ }, NickExtension{})
// presence vcard update
stanza.TypeRegistry.MapExtension(stanza.PKTPresence, xml.Name{