Do not reject presence server user if local inactive

This commit is contained in:
Arnaud Vergnet 2021-01-12 10:37:14 +01:00
parent bc50fdec44
commit 93cf550a9b

View file

@ -49,8 +49,14 @@ public class UserList {
newPresenceUsers.forEach((userInfo -> {
final PeerUser savedUser = userHashmap.get(userInfo.id);
if (savedUser != null) {
Log.v(getClass().getSimpleName(), "Received user from presence server already known");
if (savedUser.isActive()) {
Log.v(getClass().getSimpleName(), "Received user from presence server already known and connected");
} else {
Log.v(getClass().getSimpleName(), "Received user from presence server already known and connected");
savedUser.init(proxyConnection, userInfo.id, userInfo.getUsername(), null);
}
} else {
Log.v(getClass().getSimpleName(), "Received new user from presence server");
final PeerUser user = new PeerUser();
user.init(proxyConnection, userInfo.id, userInfo.getUsername(), null);
userHashmap.put(user.id, user);