Do not show profile name changes for blocked users.

master
Greyson Parrelli 2020-07-17 16:58:33 -04:00
parent 9440dfb66c
commit 5255a527f9
1 changed files with 5 additions and 2 deletions

View File

@ -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)));
}
}