forked from chteufleur/go-xmpp4steam
Send subscribe presence
This commit is contained in:
parent
c88585fc5a
commit
cec14b399f
6
main.go
6
main.go
|
|
@ -152,8 +152,6 @@ func gatewaySteamXmppPresence() {
|
||||||
stat := <-steam.ChanPresenceSteam
|
stat := <-steam.ChanPresenceSteam
|
||||||
gameName := <-steam.ChanPresence
|
gameName := <-steam.ChanPresence
|
||||||
|
|
||||||
SetSteamId[steamId] = struct{}{}
|
|
||||||
|
|
||||||
var status string
|
var status string
|
||||||
var tpye string
|
var tpye string
|
||||||
switch stat {
|
switch stat {
|
||||||
|
|
@ -178,6 +176,10 @@ func gatewaySteamXmppPresence() {
|
||||||
tpye = xmpp.Type_available
|
tpye = xmpp.Type_available
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if _, ok := SetSteamId[steamId]; !ok {
|
||||||
|
xmpp.SendPresenceFrom(status, xmpp.Type_subscribe, steamId+"@"+xmpp.JidStr, gameName)
|
||||||
|
SetSteamId[steamId] = struct{}{}
|
||||||
|
}
|
||||||
xmpp.SendPresenceFrom(status, tpye, steamId+"@"+xmpp.JidStr, gameName)
|
xmpp.SendPresenceFrom(status, tpye, steamId+"@"+xmpp.JidStr, gameName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ const (
|
||||||
|
|
||||||
Type_available = ""
|
Type_available = ""
|
||||||
Type_unavailable = "unavailable"
|
Type_unavailable = "unavailable"
|
||||||
|
Type_subscribe = "subscribe"
|
||||||
|
|
||||||
ActionConnexion = "action_xmpp_connexion"
|
ActionConnexion = "action_xmpp_connexion"
|
||||||
ActionDeconnexion = "action_xmpp_deconnexion"
|
ActionDeconnexion = "action_xmpp_deconnexion"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue