Populate conversation menu

This commit is contained in:
nielsandriesse
2021-06-07 09:48:01 +10:00
parent 3a4ab06df4
commit d465fecf4c
12 changed files with 180 additions and 30 deletions

View File

@@ -410,10 +410,19 @@ public class Recipient implements RecipientModifiedListener {
return address.isGroup();
}
public boolean isContactRecipient() {
return address.isContact();
}
public boolean isOpenGroupRecipient() {
return address.isOpenGroup();
}
public boolean isClosedGroupRecipient() {
return address.isClosedGroup();
}
@Deprecated
public boolean isPushGroupRecipient() {
return address.isGroup();
}
@@ -455,13 +464,6 @@ public class Recipient implements RecipientModifiedListener {
return (new TransparentContactPhoto()).asDrawable(context, getColor().toAvatarColor(context), inverted);
}
// public synchronized @NonNull FallbackContactPhoto getFallbackContactPhoto() {
// // TODO: I believe this is now completely unused
// if (isResolving()) return new TransparentContactPhoto();
// else if (isGroupRecipient()) return new GeneratedContactPhoto(name, R.drawable.ic_profile_default);
// else { return new TransparentContactPhoto(); }
// }
public synchronized @Nullable ContactPhoto getContactPhoto() {
if (isLocalNumber) return new ProfileContactPhoto(address, String.valueOf(TextSecurePreferences.getProfileAvatarId(context)));
else if (isGroupRecipient() && groupAvatarId != null) return new GroupRecordContactPhoto(address, groupAvatarId);