1
0
Fork 0

Add usefull XMPP type

This commit is contained in:
chteufleur 2015-10-23 17:05:16 +02:00
parent cec14b399f
commit 95a589c802
1 changed files with 9 additions and 4 deletions

View File

@ -19,6 +19,11 @@ const (
Type_available = ""
Type_unavailable = "unavailable"
Type_subscribe = "subscribe"
Type_subscribed = "subscribed"
Type_unsubscribe = "unsubscribe"
Type_unsubscribed = "unsubscribed"
Type_probe = "probe"
Type_error = "error"
ActionConnexion = "action_xmpp_connexion"
ActionDeconnexion = "action_xmpp_deconnexion"
@ -60,7 +65,7 @@ func mainXMPP() {
for x := range comp.In {
switch v := x.(type) {
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 {
log.Printf("%sPresence reçut unavailable", LogDebug)
Disconnect()