mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-11 16:33:39 +00:00
Properly return unknown recipient from SMS db on empty.
This commit is contained in:
parent
018f5eccf3
commit
3df67a1643
@ -434,7 +434,14 @@ public class SmsDatabase extends Database implements MmsSmsColumns {
|
||||
|
||||
private Recipients getRecipientsFor(String address) {
|
||||
try {
|
||||
return RecipientFactory.getRecipientsFromString(context, address, false);
|
||||
Recipients recipients = RecipientFactory.getRecipientsFromString(context, address, false);
|
||||
|
||||
if (recipients == null || recipients.isEmpty()) {
|
||||
return new Recipients(new Recipient("Unknown", "Unknown", null,
|
||||
ContactPhotoFactory.getDefaultContactPhoto(context)));
|
||||
}
|
||||
|
||||
return recipients;
|
||||
} catch (RecipientFormattingException e) {
|
||||
Log.w("EncryptingSmsDatabase", e);
|
||||
return new Recipients(new Recipient("Unknown", "Unknown", null,
|
||||
|
@ -64,11 +64,11 @@ public class Recipients implements Parcelable {
|
||||
this.recipients.addAll(recipients.getRecipientsList());
|
||||
}
|
||||
|
||||
public Recipients truncateToSingleRecipient() {
|
||||
assert(!this.recipients.isEmpty());
|
||||
this.recipients = this.recipients.subList(0, 1);
|
||||
return this;
|
||||
}
|
||||
// public Recipients truncateToSingleRecipient() {
|
||||
// assert(!this.recipients.isEmpty());
|
||||
// this.recipients = this.recipients.subList(0, 1);
|
||||
// return this;
|
||||
// }
|
||||
|
||||
public void addListener(RecipientModifiedListener listener) {
|
||||
for (Recipient recipient : recipients) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user