Add support for chatstates notification (XEP-0085)

This commit is contained in:
Chteufleur 2016-09-04 14:52:07 +02:00
parent 97363908e1
commit dacdc4ac04
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,27 @@
package xmpp
import (
"encoding/xml"
)
const (
NSChatStatesNotification = "http://jabber.org/protocol/chatstates"
)
// XEP-0085: Chat States Notification
type Active struct {
XMLName xml.Name `xml:"http://jabber.org/protocol/chatstates active"`
}
type Composing struct {
XMLName xml.Name `xml:"http://jabber.org/protocol/chatstates composing"`
}
type Paused struct {
XMLName xml.Name `xml:"http://jabber.org/protocol/chatstates paused"`
}
type Inactive struct {
XMLName xml.Name `xml:"http://jabber.org/protocol/chatstates inactive"`
}
type Gone struct {
XMLName xml.Name `xml:"http://jabber.org/protocol/chatstates gone"`
}

View File

@ -76,7 +76,14 @@ type Message struct {
Body string `xml:"body,omitempty"` Body string `xml:"body,omitempty"`
Thread string `xml:"thread,omitempty"` Thread string `xml:"thread,omitempty"`
Error *Error `xml:"error"` Error *Error `xml:"error"`
Confir *Confirm `xml:"confirm"`
Confir *Confirm `xml:"confirm"` // XEP-0070
Active *Active `xml:"active"` // XEP-0085
Composing *Composing `xml:"composing"` // XEP-0085
Paused *Paused `xml:"paused"` // XEP-0085
Inactive *Inactive `xml:"inactive"` // XEP-0085
Gone *Gone `xml:"gone"` // XEP-0085
} }
// XMPP <presence/> stanza. // XMPP <presence/> stanza.