Added status update for when a client goes offline
This commit is contained in:
@ -37,6 +37,7 @@ public class LoginCredentialProcessor implements ObjectProcessor<LoginCredential
|
||||
|
||||
@Override
|
||||
public void process(LoginCredentials input, long socketId, ObjectWriteProxy writeProxy) throws IOException {
|
||||
UserStatusChangeProcessor.setWriteProxy(writeProxy);
|
||||
System.out.println(String.format("Received login credentials %s from socket ID %d", input, socketId));
|
||||
|
||||
envoy.server.data.User user = getUser(input);
|
||||
@ -45,7 +46,7 @@ public class LoginCredentialProcessor implements ObjectProcessor<LoginCredential
|
||||
if (user == null) return;
|
||||
// notifies contacts of this users online-going and updates his status in the
|
||||
// database
|
||||
UserStatusChangeProcessor.updateUserStatus(new UserStatusChangeEvent(user.toCommonUser()), writeProxy);
|
||||
UserStatusChangeProcessor.updateUserStatus(new UserStatusChangeEvent(user.toCommonUser()));
|
||||
|
||||
ConnectionManager.getInstance().registerUser(user.getId(), socketId);
|
||||
|
||||
|
Reference in New Issue
Block a user