Do not show profile name changes for blocked users.
parent
9440dfb66c
commit
5255a527f9
|
@ -383,9 +383,12 @@ public class RetrieveProfileJob extends BaseJob {
|
|||
Log.i(TAG, "Profile name updated. Writing new value.");
|
||||
DatabaseFactory.getRecipientDatabase(context).setProfileName(recipient.getId(), ProfileName.fromSerialized(plaintextProfileName));
|
||||
|
||||
if (!(recipient.isGroup() || recipient.isLocalNumber() || TextUtils.isEmpty(previousProfileName))) {
|
||||
//noinspection ConstantConditions
|
||||
if (!recipient.isBlocked() && !recipient.isGroup() && !recipient.isLocalNumber() && !TextUtils.isEmpty(previousProfileName)) {
|
||||
Log.i(TAG, "Writing a profile name change event.");
|
||||
DatabaseFactory.getSmsDatabase(context).insertProfileNameChangeMessages(recipient, newProfileName, previousProfileName);
|
||||
} else {
|
||||
Log.i(TAG, String.format(Locale.US, "Name changed, but wasn't relevant to write an event. blocked: %b, group: %b, self: %b, firstSet: %b",
|
||||
recipient.isBlocked(), recipient.isGroup(), recipient.isLocalNumber(), TextUtils.isEmpty(previousProfileName)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue