mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-02 15:16:53 +00:00
Clear presence only if the connection’s displacement listener is still present
This commit is contained in:
1 parent
407070c9fc
commit
8c7975d89a
2 files changed
+7
-3
No files matched your search
+4
-3
@@ -235,11 +235,12 @@ public class ClientPresenceManager extends RedisClusterPubSubAdapter<String, Str
|
||||
|
||||
public boolean clearPresence(final UUID accountUuid, final long deviceId, final DisplacedPresenceListener listener) {
|
||||
final String presenceKey = getPresenceKey(accountUuid, deviceId);
|
||||
if (!displacementListenersByPresenceKey.remove(presenceKey, listener)) {
|
||||
if (displacementListenersByPresenceKey.remove(presenceKey, listener)) {
|
||||
return clearPresence(presenceKey);
|
||||
} else {
|
||||
displacementListenerAlreadyRemovedCounter.increment();
|
||||
return false;
|
||||
}
|
||||
return clearPresence(presenceKey);
|
||||
|
||||
}
|
||||
|
||||
private boolean clearPresence(final String presenceKey) {
|
||||
|
||||
Reference in new issue
Block a user