private AdditionalClientRosterEntry updatePresenceForMatchingEntry(
org.eclipse.ecf.presence.roster.RosterEntry entry, XMPPID fromID,
IPresence newPresence) {
final IUser user = entry.getUser();
XMPPID oldID = (XMPPID) user.getID();
// If the username/host part matches that means we either have to update
// the resource, or create a new client
if (oldID.equals(fromID)) {
if (newPresence.getType() == IPresence.Type.UNAVAILABLE) {
return removeEntryFromRoster(oldID, entry, newPresence, user);
} else {
// set the new presence state
entry.setPresence(newPresence);
// and notify with roster update
rosterManager.notifyRosterUpdate(entry);
}
} else if (oldID.getUsernameAtHost().equals(fromID.getUsernameAtHost())) {
if (oldID.getResourceName() == null) {
oldID.setResourceName(fromID.getResourceName());
// set the new presence state
entry.setPresence(newPresence);
// and notify with roster update
rosterManager.notifyRosterUpdate(entry);
} else if (fromID.getResourceName() != null