mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Reset profile key credentials when new profile key is changed
This commit is contained in:
parent
ab95e635ce
commit
8217541d5e
1 changed files with 9 additions and 1 deletions
|
@ -226,7 +226,15 @@ public class RecipientStore implements ContactsStore, ProfileStore {
|
|||
public void storeProfileKey(final RecipientId recipientId, final ProfileKey profileKey) {
|
||||
synchronized (recipients) {
|
||||
final var recipient = recipients.get(recipientId);
|
||||
storeRecipientLocked(recipientId, Recipient.newBuilder(recipient).withProfileKey(profileKey).build());
|
||||
if (profileKey.equals(recipient.getProfileKey())) {
|
||||
return;
|
||||
}
|
||||
|
||||
final var newRecipient = Recipient.newBuilder(recipient)
|
||||
.withProfileKey(profileKey)
|
||||
.withProfileKeyCredential(null)
|
||||
.build();
|
||||
storeRecipientLocked(recipientId, newRecipient);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue