Only store our own profile key in contact list, if a contact entry already exists
This commit is contained in:
parent
6665dc0e48
commit
20bf605e36
@ -1342,12 +1342,17 @@ 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);
|
||||
@ -1355,6 +1360,7 @@ public class Manager implements Signal {
|
||||
contact.profileKey = Base64.encodeBytes(message.getProfileKey().get());
|
||||
account.getContactStore().updateContact(contact);
|
||||
}
|
||||
}
|
||||
if (message.getPreviews().isPresent()) {
|
||||
final List<SignalServiceDataMessage.Preview> previews = message.getPreviews().get();
|
||||
for (SignalServiceDataMessage.Preview preview : previews) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user