mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-22 20:21:28 +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) {
|
private Recipients getRecipientsFor(String address) {
|
||||||
try {
|
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) {
|
} catch (RecipientFormattingException e) {
|
||||||
Log.w("EncryptingSmsDatabase", e);
|
Log.w("EncryptingSmsDatabase", e);
|
||||||
return new Recipients(new Recipient("Unknown", "Unknown", null,
|
return new Recipients(new Recipient("Unknown", "Unknown", null,
|
||||||
|
@ -64,11 +64,11 @@ public class Recipients implements Parcelable {
|
|||||||
this.recipients.addAll(recipients.getRecipientsList());
|
this.recipients.addAll(recipients.getRecipientsList());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Recipients truncateToSingleRecipient() {
|
// public Recipients truncateToSingleRecipient() {
|
||||||
assert(!this.recipients.isEmpty());
|
// assert(!this.recipients.isEmpty());
|
||||||
this.recipients = this.recipients.subList(0, 1);
|
// this.recipients = this.recipients.subList(0, 1);
|
||||||
return this;
|
// return this;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public void addListener(RecipientModifiedListener listener) {
|
public void addListener(RecipientModifiedListener listener) {
|
||||||
for (Recipient recipient : recipients) {
|
for (Recipient recipient : recipients) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user