mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-03 12:02:18 +00:00
Refactor contact photo logic to not reuse drawables.
// FREEBIE
This commit is contained in:
@@ -345,7 +345,7 @@ public class MmsDatabase extends MessagingDatabase {
|
||||
? Util.toIsoString(notification.getFrom().getTextString())
|
||||
: "";
|
||||
Recipients recipients = RecipientFactory.getRecipientsFromString(context, fromString, false);
|
||||
if (recipients.isEmpty()) recipients = RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(context), false);
|
||||
if (recipients.isEmpty()) recipients = RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(), false);
|
||||
return DatabaseFactory.getThreadDatabase(context).getThreadIdFor(recipients);
|
||||
}
|
||||
|
||||
@@ -1054,13 +1054,13 @@ public class MmsDatabase extends MessagingDatabase {
|
||||
|
||||
private Recipients getRecipientsFor(String address) {
|
||||
if (TextUtils.isEmpty(address) || address.equals("insert-address-token")) {
|
||||
return RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(context), false);
|
||||
return RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(), false);
|
||||
}
|
||||
|
||||
Recipients recipients = RecipientFactory.getRecipientsFromString(context, address, false);
|
||||
|
||||
if (recipients == null || recipients.isEmpty()) {
|
||||
return RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(context), false);
|
||||
return RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(), false);
|
||||
}
|
||||
|
||||
return recipients;
|
||||
|
||||
@@ -368,7 +368,7 @@ public class SmsDatabase extends MessagingDatabase {
|
||||
recipients = RecipientFactory.getRecipientsFromString(context, message.getSender(), true);
|
||||
} else {
|
||||
Log.w(TAG, "Sender is null, returning unknown recipient");
|
||||
recipients = RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(context), false);
|
||||
recipients = RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(), false);
|
||||
}
|
||||
|
||||
Recipients groupRecipients;
|
||||
@@ -615,13 +615,13 @@ public class SmsDatabase extends MessagingDatabase {
|
||||
Recipients recipients = RecipientFactory.getRecipientsFromString(context, address, false);
|
||||
|
||||
if (recipients == null || recipients.isEmpty()) {
|
||||
return RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(context), false);
|
||||
return RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(), false);
|
||||
}
|
||||
|
||||
return recipients;
|
||||
} else {
|
||||
Log.w(TAG, "getRecipientsFor() address is null");
|
||||
return RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(context), false);
|
||||
return RecipientFactory.getRecipientsFor(context, Recipient.getUnknownRecipient(), false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user