mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-25 15:37:32 +00:00
Show contact profile photo instead of system contact.
This commit is contained in:

committed by
Greyson Parrelli

parent
cee2702fdf
commit
2d20ceea01
@@ -24,17 +24,19 @@ public final class SignalAccountRecord implements SignalRecord {
|
||||
private final Optional<String> avatarUrlPath;
|
||||
private final Optional<byte[]> profileKey;
|
||||
private final List<PinnedConversation> pinnedConversations;
|
||||
private final boolean preferContactAvatars;
|
||||
|
||||
public SignalAccountRecord(StorageId id, AccountRecord proto) {
|
||||
this.id = id;
|
||||
this.proto = proto;
|
||||
this.hasUnknownFields = ProtoUtil.hasUnknownFields(proto);
|
||||
|
||||
this.givenName = OptionalUtil.absentIfEmpty(proto.getGivenName());
|
||||
this.familyName = OptionalUtil.absentIfEmpty(proto.getFamilyName());
|
||||
this.profileKey = OptionalUtil.absentIfEmpty(proto.getProfileKey());
|
||||
this.avatarUrlPath = OptionalUtil.absentIfEmpty(proto.getAvatarUrlPath());
|
||||
this.pinnedConversations = new ArrayList<>(proto.getPinnedConversationsCount());
|
||||
this.givenName = OptionalUtil.absentIfEmpty(proto.getGivenName());
|
||||
this.familyName = OptionalUtil.absentIfEmpty(proto.getFamilyName());
|
||||
this.profileKey = OptionalUtil.absentIfEmpty(proto.getProfileKey());
|
||||
this.avatarUrlPath = OptionalUtil.absentIfEmpty(proto.getAvatarUrlPath());
|
||||
this.pinnedConversations = new ArrayList<>(proto.getPinnedConversationsCount());
|
||||
this.preferContactAvatars = proto.getPreferContactAvatars();
|
||||
|
||||
for (AccountRecord.PinnedConversation conversation : proto.getPinnedConversationsList()) {
|
||||
pinnedConversations.add(PinnedConversation.fromRemote(conversation));
|
||||
@@ -106,6 +108,10 @@ public final class SignalAccountRecord implements SignalRecord {
|
||||
return pinnedConversations;
|
||||
}
|
||||
|
||||
public boolean isPreferContactAvatars() {
|
||||
return preferContactAvatars;
|
||||
}
|
||||
|
||||
AccountRecord toProto() {
|
||||
return proto;
|
||||
}
|
||||
@@ -300,6 +306,12 @@ public final class SignalAccountRecord implements SignalRecord {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setPreferContactAvatars(boolean preferContactAvatars) {
|
||||
builder.setPreferContactAvatars(preferContactAvatars);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public SignalAccountRecord build() {
|
||||
AccountRecord proto = builder.build();
|
||||
|
||||
|
@@ -134,4 +134,5 @@ message AccountRecord {
|
||||
PhoneNumberSharingMode phoneNumberSharingMode = 12;
|
||||
bool unlistedPhoneNumber = 13;
|
||||
repeated PinnedConversation pinnedConversations = 14;
|
||||
bool preferContactAvatars = 15;
|
||||
}
|
||||
|
Reference in New Issue
Block a user