Compare commits
No commits in common. "dacdc4ac04acc450e1d107f6e90c9ae3522ee1ff" and "6859516f81098d97e9baa021d2ae534e50b15712" have entirely different histories.
dacdc4ac04
...
6859516f81
|
|
@ -1,27 +0,0 @@
|
||||||
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"`
|
|
||||||
}
|
|
||||||
|
|
@ -76,14 +76,7 @@ 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.
|
||||||
|
|
|
||||||
|
|
@ -195,12 +195,12 @@ func (x *XMPP) receiver() {
|
||||||
case "presence":
|
case "presence":
|
||||||
v = &Presence{}
|
v = &Presence{}
|
||||||
default:
|
default:
|
||||||
log.Println("Error. Unexected element: %T %v", start, start)
|
log.Fatal("Unexected element: %T %v", start, start)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = x.stream.Decode(v, start)
|
err = x.stream.Decode(v, start)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("Error. Failed to decode element. ", err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
filtered := false
|
filtered := false
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue