// If an "available" packet, add it to the presence map. Each presence map will hold
// for a particular user a map with the presence packets saved for each resource.
if (presence.getType() == Presence.Type.available) {
// Ignore the presence packet unless it has an agent status extension.
AgentStatus agentStatus = (AgentStatus)presence.getExtension(
AgentStatus.ELEMENT_NAME, AgentStatus.NAMESPACE);
if (agentStatus == null) {
return;
}
// Ensure that this presence is coming from an Agent of the same workgroup
// of this Agent
else if (!workgroupJID.equals(agentStatus.getWorkgroupJID())) {
return;
}
Map<String, Presence> userPresences;
// Get the user presence map
if (presenceMap.get(key) == null) {