public void removeSession(Session session) { resources.Remove(session.getJID().getResource()); activeSession = null; foreach (Session sess in resources.Values) { if (sess.getPriority() > activeSession.getPriority()) { activeSession = sess; } } }
public void changePriority(Session session) { if (activeSession.getPriority() < session.getPriority()) { activeSession = session; } }
public void addSession(Session session) { resources.Add(session.getJID().getResource(), session); // key, value if (activeSession == null) { activeSession = session; } else if (activeSession.getPriority() < session.getPriority()) { activeSession = session; } //isprakjanje na Roster (ne e spored stadard) Packet packet = new Packet("iq"); packet["type"] = "set"; JabberID jidTo = session.getJID(); packet.To = jidTo.User + "@" + jidTo.Domain; getRoster().getPacket().setParent(packet); MessageHandler.deliverPacket(packet); // kraj na isprakjanje a roster deliverMessages(); }