forked from chteufleur/go-xmpp4steam
Add usefull XMPP type
This commit is contained in:
parent
cec14b399f
commit
95a589c802
13
xmpp/xmpp.go
13
xmpp/xmpp.go
|
|
@ -16,9 +16,14 @@ const (
|
||||||
Status_do_not_disturb = "dnd"
|
Status_do_not_disturb = "dnd"
|
||||||
Status_extended_away = "xa"
|
Status_extended_away = "xa"
|
||||||
|
|
||||||
Type_available = ""
|
Type_available = ""
|
||||||
Type_unavailable = "unavailable"
|
Type_unavailable = "unavailable"
|
||||||
Type_subscribe = "subscribe"
|
Type_subscribe = "subscribe"
|
||||||
|
Type_subscribed = "subscribed"
|
||||||
|
Type_unsubscribe = "unsubscribe"
|
||||||
|
Type_unsubscribed = "unsubscribed"
|
||||||
|
Type_probe = "probe"
|
||||||
|
Type_error = "error"
|
||||||
|
|
||||||
ActionConnexion = "action_xmpp_connexion"
|
ActionConnexion = "action_xmpp_connexion"
|
||||||
ActionDeconnexion = "action_xmpp_deconnexion"
|
ActionDeconnexion = "action_xmpp_deconnexion"
|
||||||
|
|
@ -60,7 +65,7 @@ func mainXMPP() {
|
||||||
for x := range comp.In {
|
for x := range comp.In {
|
||||||
switch v := x.(type) {
|
switch v := x.(type) {
|
||||||
case *xmpp.Presence:
|
case *xmpp.Presence:
|
||||||
if strings.SplitN(v.From, "/", 2)[0] == PreferedJID && v.To == JidStr && v.Type != "probe" {
|
if strings.SplitN(v.From, "/", 2)[0] == PreferedJID && v.To == JidStr && v.Type != Type_probe {
|
||||||
if v.Type == Type_unavailable {
|
if v.Type == Type_unavailable {
|
||||||
log.Printf("%sPresence reçut unavailable", LogDebug)
|
log.Printf("%sPresence reçut unavailable", LogDebug)
|
||||||
Disconnect()
|
Disconnect()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue