mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 09:49:30 +01:00
Show contact profile photo instead of system contact.
This commit is contained in:
committed by
Greyson Parrelli
parent
cee2702fdf
commit
2d20ceea01
@@ -34,12 +34,14 @@ import org.thoughtcrime.securesms.database.RecipientDatabase.UnidentifiedAccessM
|
||||
import org.thoughtcrime.securesms.database.RecipientDatabase.VibrateState;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.groups.GroupId;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.notifications.NotificationChannels;
|
||||
import org.thoughtcrime.securesms.phonenumbers.NumberUtil;
|
||||
import org.thoughtcrime.securesms.phonenumbers.PhoneNumberFormatter;
|
||||
import org.thoughtcrime.securesms.profiles.ProfileName;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.thoughtcrime.securesms.util.StringUtil;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.whispersystems.libsignal.util.guava.Optional;
|
||||
import org.whispersystems.libsignal.util.guava.Preconditions;
|
||||
@@ -729,11 +731,12 @@ public class Recipient {
|
||||
}
|
||||
|
||||
public @Nullable ContactPhoto getContactPhoto() {
|
||||
if (isSelf) return null;
|
||||
else if (isGroupInternal() && groupAvatarId.isPresent()) return new GroupRecordContactPhoto(groupId, groupAvatarId.get());
|
||||
else if (systemContactPhoto != null) return new SystemContactPhoto(id, systemContactPhoto, 0);
|
||||
else if (profileAvatar != null && hasProfileImage) return new ProfileContactPhoto(this, profileAvatar);
|
||||
else return null;
|
||||
if (isSelf) return null;
|
||||
else if (isGroupInternal() && groupAvatarId.isPresent()) return new GroupRecordContactPhoto(groupId, groupAvatarId.get());
|
||||
else if (systemContactPhoto != null && SignalStore.settings().isPreferSystemContactPhotos()) return new SystemContactPhoto(id, systemContactPhoto, 0);
|
||||
else if (profileAvatar != null && hasProfileImage) return new ProfileContactPhoto(this, profileAvatar);
|
||||
else if (systemContactPhoto != null) return new SystemContactPhoto(id, systemContactPhoto, 0);
|
||||
else return null;
|
||||
}
|
||||
|
||||
public @Nullable Uri getMessageRingtone() {
|
||||
|
||||
Reference in New Issue
Block a user