Exemplo n.º 1
0
        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;
                }
            }
        }
Exemplo n.º 2
0
 public void changePriority(Session session) {
     if (activeSession.getPriority() < session.getPriority()) {
         activeSession = session;
     }
 }
Exemplo n.º 3
0
        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();
        }