mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 13:46:47 +00:00
Delete old username mapping when setting new one
This commit is contained in:
1 parent
99760ba6a0
commit
82486a873a
1 file changed
+2
@@ -112,6 +112,8 @@ public class UsernamesManager {
|
||||
try (Jedis jedis = cacheClient.getWriteResource();
|
||||
Timer.Context ignored = redisSetTimer.time())
|
||||
{
|
||||
Optional.ofNullable(jedis.get(getUuidMapKey(uuid))).ifPresent(oldUsername -> jedis.del(getUsernameMapKey(oldUsername)));
|
||||
|
||||
jedis.set(getUuidMapKey(uuid), username);
|
||||
jedis.set(getUsernameMapKey(username), uuid.toString());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user