2019-06-26 15:14:52 +00:00
|
|
|
package stanza
|
2019-06-22 09:13:33 +00:00
|
|
|
|
2019-11-28 16:15:15 +00:00
|
|
|
import "strings"
|
|
|
|
|
2019-06-22 09:13:33 +00:00
|
|
|
type StanzaType string
|
|
|
|
|
|
|
|
// RFC 6120: part of A.5 Client Namespace and A.6 Server Namespace
|
|
|
|
const (
|
|
|
|
IQTypeError StanzaType = "error"
|
|
|
|
IQTypeGet StanzaType = "get"
|
|
|
|
IQTypeResult StanzaType = "result"
|
|
|
|
IQTypeSet StanzaType = "set"
|
|
|
|
|
|
|
|
MessageTypeChat StanzaType = "chat"
|
|
|
|
MessageTypeError StanzaType = "error"
|
|
|
|
MessageTypeGroupchat StanzaType = "groupchat"
|
|
|
|
MessageTypeHeadline StanzaType = "headline"
|
|
|
|
MessageTypeNormal StanzaType = "normal" // Default
|
|
|
|
|
|
|
|
PresenceTypeError StanzaType = "error"
|
|
|
|
PresenceTypeProbe StanzaType = "probe"
|
|
|
|
PresenceTypeSubscribe StanzaType = "subscribe"
|
|
|
|
PresenceTypeSubscribed StanzaType = "subscribed"
|
|
|
|
PresenceTypeUnavailable StanzaType = "unavailable"
|
|
|
|
PresenceTypeUnsubscribe StanzaType = "unsubscribe"
|
|
|
|
PresenceTypeUnsubscribed StanzaType = "unsubscribed"
|
|
|
|
)
|
2019-11-28 16:15:15 +00:00
|
|
|
|
|
|
|
func (s StanzaType) IsEmpty() bool {
|
|
|
|
return len(strings.TrimSpace(string(s))) == 0
|
|
|
|
}
|