mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Only store our own profile key in contact list, if a contact entry already exists
This commit is contained in:
parent
6665dc0e48
commit
20bf605e36
1 changed files with 13 additions and 7 deletions
|
@ -1342,18 +1342,24 @@ public class Manager implements Signal {
|
|||
}
|
||||
}
|
||||
if (message.getProfileKey().isPresent() && message.getProfileKey().get().length == 32) {
|
||||
if (source.equals(account.getSelfAddress())) {
|
||||
if (source.matches(account.getSelfAddress())) {
|
||||
try {
|
||||
this.account.setProfileKey(new ProfileKey(message.getProfileKey().get()));
|
||||
} catch (InvalidInputException ignored) {
|
||||
}
|
||||
ContactInfo contact = account.getContactStore().getContact(source);
|
||||
if (contact != null) {
|
||||
contact.profileKey = Base64.encodeBytes(message.getProfileKey().get());
|
||||
account.getContactStore().updateContact(contact);
|
||||
}
|
||||
} else {
|
||||
ContactInfo contact = account.getContactStore().getContact(source);
|
||||
if (contact == null) {
|
||||
contact = new ContactInfo(source);
|
||||
}
|
||||
contact.profileKey = Base64.encodeBytes(message.getProfileKey().get());
|
||||
account.getContactStore().updateContact(contact);
|
||||
}
|
||||
ContactInfo contact = account.getContactStore().getContact(source);
|
||||
if (contact == null) {
|
||||
contact = new ContactInfo(source);
|
||||
}
|
||||
contact.profileKey = Base64.encodeBytes(message.getProfileKey().get());
|
||||
account.getContactStore().updateContact(contact);
|
||||
}
|
||||
if (message.getPreviews().isPresent()) {
|
||||
final List<SignalServiceDataMessage.Preview> previews = message.getPreviews().get();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue