- if stanza.GetHeader().Type == "subscribe" {
- xmppout <- botdata.makeXMPPPresence(stanza.GetHeader().From, "subscribed")
+ switch stanza.GetHeader().Type {
+ case "subscribe":
+ xmppout <- botdata.makeXMPPPresence(stanza.GetHeader().From, "subscribed")
+ jabber_events <- JabberEvent{stanza.GetHeader().From, true, R3NoChange, false}
+ xmppout <- botdata.makeXMPPPresence(stanza.GetHeader().From, "subscribe")
+ case "unsubscribe", "unsubscribed":
+ jabber_events <- JabberEvent{stanza.GetHeader().From, false, R3NoInfo, false}
+ botdata.jid_lastauthtime_[stanza.GetHeader().From] = 0 //logout
+ xmppout <- botdata.makeXMPPPresence(stanza.GetHeader().From, "unsubscribe")
+ case "unavailable":
+ jabber_events <- JabberEvent{stanza.GetHeader().From, false, R3NoChange, false}
+ botdata.jid_lastauthtime_[stanza.GetHeader().From] = 0 //logout
+ default:
+ jabber_events <- JabberEvent{stanza.GetHeader().From, true, R3NoChange, false}