fixed not updating user status and implemented easier to read structure

This commit is contained in:
delvh
2020-02-05 21:32:53 +01:00
parent ad8c9b654f
commit 053b7eec1f
4 changed files with 31 additions and 38 deletions

View File

@ -10,7 +10,7 @@ import envoy.data.Contacts;
import envoy.data.LoginCredentials;
import envoy.data.Message.MessageStatus;
import envoy.data.User;
import envoy.event.UserStatusChangeEvent;
import envoy.data.User.UserStatus;
import envoy.server.ConnectionManager;
import envoy.server.ObjectProcessor;
import envoy.server.data.Message;
@ -48,7 +48,8 @@ public class LoginCredentialProcessor implements ObjectProcessor<LoginCredential
// notifies contacts of this users online-going and updates his status in the
// database
UserStatusChangeProcessor.updateUserStatus(new UserStatusChangeEvent(user.toCommonUser()));
user.setStatus(UserStatus.ONLINE);
UserStatusChangeProcessor.updateUserStatus(user);
// Create contacts
Contacts contacts = new Contacts(user.getId(),