Ejemplo n.º 1
0
 private void SessionAvailable(object sender, XmppSessionArgs e)
 {
     if (e.Session.Jid.Server == jid.Server)
     {
         SendRosterPresences(e.Session);
         SendOfflinePresences(e.Session);
         SendOfflineMessages(e.Session);
     }
 }
Ejemplo n.º 2
0
        private void SessionUnavailable(object sender, XmppSessionArgs e)
        {
            if (e.Session.Jid.Server == jid.Server)
            {
                try
                {
                    offlineStore.SaveLastActivity(e.Session.Jid, new LastActivity(e.Session.Presence != null ? e.Session.Presence.Status : null));
                }
                catch { }

                if (e.Session.Available)
                {
                    var presence = new Presence() { Type = PresenceType.unavailable, From = e.Session.Jid, };
                    handlerManager.ProcessStreamElement(presence, e.Session.Stream);
                }
            }
        }