From 891c05210e947db28ce231266893206b4d22eec0 Mon Sep 17 00:00:00 2001 From: AsamK Date: Sat, 4 Sep 2021 10:48:22 +0200 Subject: [PATCH] Improve comment in SessionStore --- .../asamk/signal/manager/storage/sessions/SessionStore.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/sessions/SessionStore.java b/lib/src/main/java/org/asamk/signal/manager/storage/sessions/SessionStore.java index 1b94642a..bae4fdf3 100644 --- a/lib/src/main/java/org/asamk/signal/manager/storage/sessions/SessionStore.java +++ b/lib/src/main/java/org/asamk/signal/manager/storage/sessions/SessionStore.java @@ -179,7 +179,8 @@ public class SessionStore implements SignalServiceSessionStore { public void mergeRecipients(RecipientId recipientId, RecipientId toBeMergedRecipientId) { synchronized (cachedSessions) { - final var otherHasSession = getKeysLocked(toBeMergedRecipientId).size() > 0; + final var keys = getKeysLocked(toBeMergedRecipientId); + final var otherHasSession = keys.size() > 0; if (!otherHasSession) { return; } @@ -189,8 +190,7 @@ public class SessionStore implements SignalServiceSessionStore { logger.debug("To be merged recipient had sessions, deleting."); deleteAllSessions(toBeMergedRecipientId); } else { - logger.debug("To be merged recipient had sessions, re-assigning to the new recipient."); - final var keys = getKeysLocked(toBeMergedRecipientId); + logger.debug("Only to be merged recipient had sessions, re-assigning to the new recipient."); for (var key : keys) { final var session = loadSessionLocked(key); deleteSessionLocked(key);