mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-09 14:18:34 +00:00
Ensure recipient models are up-to-date.
This commit is contained in:
parent
c2459d0a31
commit
be4daff0f3
@ -84,7 +84,7 @@ public abstract class DisplayRecord {
|
|||||||
public abstract SpannableString getDisplayBody(@NonNull Context context);
|
public abstract SpannableString getDisplayBody(@NonNull Context context);
|
||||||
|
|
||||||
public Recipient getRecipient() {
|
public Recipient getRecipient() {
|
||||||
return recipient;
|
return recipient.live().get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getDateSent() {
|
public long getDateSent() {
|
||||||
|
@ -188,7 +188,7 @@ public abstract class MessageRecord extends DisplayRecord {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Recipient getIndividualRecipient() {
|
public Recipient getIndividualRecipient() {
|
||||||
return individualRecipient;
|
return individualRecipient.live().get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRecipientDeviceId() {
|
public int getRecipientDeviceId() {
|
||||||
|
@ -444,8 +444,8 @@ public class MessageNotifier {
|
|||||||
while ((record = reader.getNext()) != null) {
|
while ((record = reader.getNext()) != null) {
|
||||||
long id = record.getId();
|
long id = record.getId();
|
||||||
boolean mms = record.isMms() || record.isMmsNotification();
|
boolean mms = record.isMms() || record.isMmsNotification();
|
||||||
Recipient recipient = record.getIndividualRecipient();
|
Recipient recipient = record.getIndividualRecipient().resolve();
|
||||||
Recipient conversationRecipient = record.getRecipient();
|
Recipient conversationRecipient = record.getRecipient().resolve();
|
||||||
long threadId = record.getThreadId();
|
long threadId = record.getThreadId();
|
||||||
CharSequence body = record.getDisplayBody(context);
|
CharSequence body = record.getDisplayBody(context);
|
||||||
Recipient threadRecipients = null;
|
Recipient threadRecipients = null;
|
||||||
|
@ -262,15 +262,16 @@ public class Recipient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isGroup() {
|
public boolean isGroup() {
|
||||||
return address != null && address.isGroup();
|
return requireAddress().isGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isMmsGroup() {
|
public boolean isMmsGroup() {
|
||||||
return address != null && address.isMmsGroup();
|
return requireAddress().isMmsGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPushGroup() {
|
public boolean isPushGroup() {
|
||||||
return address != null && address.isGroup() && !address.isMmsGroup();
|
Address address = requireAddress();
|
||||||
|
return address.isGroup() && !address.isMmsGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
public @NonNull List<Recipient> getParticipants() {
|
public @NonNull List<Recipient> getParticipants() {
|
||||||
@ -278,9 +279,7 @@ public class Recipient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public @NonNull String toShortString() {
|
public @NonNull String toShortString() {
|
||||||
return getName() == null ? address == null ? ""
|
return Optional.fromNullable(getName()).or(Optional.of(requireAddress().serialize())).get();
|
||||||
: address.serialize()
|
|
||||||
: getName();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public @NonNull Drawable getFallbackContactPhotoDrawable(Context context, boolean inverted) {
|
public @NonNull Drawable getFallbackContactPhotoDrawable(Context context, boolean inverted) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user