mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 08:09:12 +01:00
Move to defined from_recipient_id and to_recipient_id columns on message table.
This commit is contained in:
committed by
Cody Henthorne
parent
d079f85eca
commit
279ad7945e
@@ -93,13 +93,13 @@ public class AttachmentUtil {
|
||||
try {
|
||||
MessageRecord message = SignalDatabase.messages().getMessageRecord(attachment.getMmsId());
|
||||
|
||||
Recipient individualRecipient = message.getRecipient();
|
||||
Recipient threadRecipient = SignalDatabase.threads().getRecipientForThreadId(message.getThreadId());
|
||||
Recipient fromRecipient = message.getFromRecipient();
|
||||
Recipient toRecipient = message.getToRecipient();
|
||||
|
||||
if (threadRecipient != null && threadRecipient.isGroup()) {
|
||||
return threadRecipient.isProfileSharing() || isTrustedIndividual(individualRecipient, message);
|
||||
if (toRecipient != null && toRecipient.isGroup()) {
|
||||
return toRecipient.isProfileSharing() || isTrustedIndividual(fromRecipient, message);
|
||||
} else {
|
||||
return isTrustedIndividual(individualRecipient, message);
|
||||
return isTrustedIndividual(fromRecipient, message);
|
||||
}
|
||||
} catch (NoSuchMessageException e) {
|
||||
Log.w(TAG, "Message could not be found! Assuming not a trusted contact.");
|
||||
|
||||
@@ -28,7 +28,7 @@ public final class RemoteDeleteUtil {
|
||||
boolean isValidIncomingOutgoing = (selfIsDeleteSender && targetMessage.isOutgoing()) ||
|
||||
(!selfIsDeleteSender && !targetMessage.isOutgoing());
|
||||
|
||||
boolean isValidSender = targetMessage.getIndividualRecipient().getId().equals(deleteSenderId) || selfIsDeleteSender && targetMessage.isOutgoing();
|
||||
boolean isValidSender = targetMessage.getFromRecipient().getId().equals(deleteSenderId) || selfIsDeleteSender && targetMessage.isOutgoing();
|
||||
|
||||
long messageTimestamp = selfIsDeleteSender && targetMessage.isOutgoing() ? targetMessage.getDateSent()
|
||||
: targetMessage.getServerTimestamp();
|
||||
@@ -47,11 +47,11 @@ public final class RemoteDeleteUtil {
|
||||
return !message.isUpdate() &&
|
||||
message.isOutgoing() &&
|
||||
message.isPush() &&
|
||||
(!message.getRecipient().isGroup() || message.getRecipient().isActiveGroup()) &&
|
||||
(!message.getToRecipient().isGroup() || message.getToRecipient().isActiveGroup()) &&
|
||||
!message.isRemoteDelete() &&
|
||||
!MessageRecordUtil.hasGiftBadge(message) &&
|
||||
!message.isPaymentNotification() &&
|
||||
(((currentTime - message.getDateSent()) < SEND_THRESHOLD) || message.getRecipient().isSelf());
|
||||
(((currentTime - message.getDateSent()) < SEND_THRESHOLD) || message.getToRecipient().isSelf());
|
||||
}
|
||||
|
||||
private static boolean isSelf(@NonNull RecipientId recipientId) {
|
||||
|
||||
Reference in New Issue
Block a user