// By now we should have returned or have a RQ-JID
assert presenceJID.isResourceQualifiedJID();
// Get the user (if any)
User user = sarosSession.getUser(presenceJID);
if (user == null)
return; // PresenceJID does not identify a user in the project
assert user.getJID().strictlyEquals(presenceJID);
if (presence.isAvailable()) {
if (user.getConnectionState() != UserConnectionState.ONLINE) {
user.setConnectionState(User.UserConnectionState.ONLINE);
}
user.setAway(presence.isAway());
}
if (!presence.isAvailable()
&& user.getConnectionState() != UserConnectionState.OFFLINE)
user.setConnectionState(User.UserConnectionState.OFFLINE);
}