Do not send to blocked recipients.

This commit is contained in:
clauz9
2022-02-25 21:23:58 +02:00
committed by Alex Hart
parent 4b07da4978
commit eb12395b8e
13 changed files with 45 additions and 12 deletions

View File

@@ -25,6 +25,7 @@ final class MessageDetails {
private final Collection<RecipientDeliveryStatus> read;
private final Collection<RecipientDeliveryStatus> notSent;
private final Collection<RecipientDeliveryStatus> viewed;
private final Collection<RecipientDeliveryStatus> skipped;
MessageDetails(@NonNull ConversationMessage conversationMessage, @NonNull List<RecipientDeliveryStatus> recipients) {
this.conversationMessage = conversationMessage;
@@ -35,6 +36,7 @@ final class MessageDetails {
read = new TreeSet<>(RECIPIENT_COMPARATOR);
notSent = new TreeSet<>(RECIPIENT_COMPARATOR);
viewed = new TreeSet<>(RECIPIENT_COMPARATOR);
skipped = new TreeSet<>(RECIPIENT_COMPARATOR);
if (conversationMessage.getMessageRecord().getRecipient().isSelf()) {
read.addAll(recipients);
@@ -58,6 +60,9 @@ final class MessageDetails {
break;
case VIEWED:
viewed.add(status);
break;
case SKIPPED:
skipped.add(status);
}
}
} else {
@@ -77,6 +82,8 @@ final class MessageDetails {
return sent;
}
@NonNull Collection<RecipientDeliveryStatus> getSkipped() {return skipped;}
@NonNull Collection<RecipientDeliveryStatus> getDelivered() {
return delivered;
}

View File

@@ -138,6 +138,7 @@ public final class MessageDetailsFragment extends FullScreenDialogFragment {
addRecipients(list, RecipientHeader.DELIVERED, details.getDelivered());
addRecipients(list, RecipientHeader.SENT_TO, details.getSent());
addRecipients(list, RecipientHeader.PENDING, details.getPending());
addRecipients(list, RecipientHeader.SKIPPED, details.getSkipped());
} else {
addRecipients(list, RecipientHeader.SENT_FROM, details.getSent());
}

View File

@@ -132,6 +132,7 @@ final class MessageDetailsRepository {
else if (groupStatus == GroupReceiptDatabase.STATUS_UNDELIVERED) return RecipientDeliveryStatus.Status.PENDING;
else if (groupStatus == GroupReceiptDatabase.STATUS_UNKNOWN) return RecipientDeliveryStatus.Status.UNKNOWN;
else if (groupStatus == GroupReceiptDatabase.STATUS_VIEWED) return RecipientDeliveryStatus.Status.VIEWED;
else if (groupStatus == GroupReceiptDatabase.STATUS_SKIPPED) return RecipientDeliveryStatus.Status.SKIPPED;
throw new AssertionError();
}
}

View File

@@ -11,7 +11,7 @@ import org.thoughtcrime.securesms.recipients.Recipient;
final class RecipientDeliveryStatus {
enum Status {
UNKNOWN, PENDING, SENT, DELIVERED, READ, VIEWED
UNKNOWN, PENDING, SENT, DELIVERED, READ, VIEWED, SKIPPED,
}
private final MessageRecord messageRecord;

View File

@@ -11,6 +11,7 @@ enum RecipientHeader {
DELIVERED(R.string.message_details_recipient_header__delivered_to),
READ(R.string.message_details_recipient_header__read_by),
NOT_SENT(R.string.message_details_recipient_header__not_sent),
SKIPPED(R.string.message_details_recipient_header__skipped),
VIEWED(R.string.message_details_recipient_header__viewed);
private final int headerText;