package eu.siacs.conversations.entities; import java.util.Hashtable; import java.util.Iterator; import java.util.Map.Entry; import eu.siacs.conversations.xml.Element; public class Presences { public static final int CHAT = -1; public static final int ONLINE = 0; public static final int AWAY = 1; public static final int XA = 2; public static final int DND = 3; public static final int OFFLINE = 4; private Hashtable presences = new Hashtable(); public Hashtable getPresences() { return this.presences; } public void updatePresence(String resource, int status) { this.presences.put(resource, status); } public void removePresence(String resource) { this.presences.remove(resource); } public void clearPresences() { this.presences.clear(); } public int getMostAvailableStatus() { int status = OFFLINE; Iterator> it = presences.entrySet().iterator(); while (it.hasNext()) { Entry entry = it.next(); if (entry.getValue()