Search in sources :

Example 1 with MessageLogEntry

use of org.thoughtcrime.securesms.database.model.MessageLogEntry in project Signal-Android by WhisperSystems.

the class MessageContentProcessor method handleRetryReceipt.

private void handleRetryReceipt(@NonNull SignalServiceContent content, @NonNull DecryptionErrorMessage decryptionErrorMessage, @NonNull Recipient senderRecipient) {
    if (!FeatureFlags.retryReceipts()) {
        warn(String.valueOf(content.getTimestamp()), "[RetryReceipt] Feature flag disabled, skipping retry receipt.");
        return;
    }
    if (decryptionErrorMessage.getDeviceId() != SignalStore.account().getDeviceId()) {
        log(String.valueOf(content.getTimestamp()), "[RetryReceipt] Received a DecryptionErrorMessage targeting a linked device. Ignoring.");
        return;
    }
    long sentTimestamp = decryptionErrorMessage.getTimestamp();
    warn(content.getTimestamp(), "[RetryReceipt] Received a retry receipt from " + formatSender(senderRecipient, content) + " for message with timestamp " + sentTimestamp + ".");
    if (!senderRecipient.hasServiceId()) {
        warn(content.getTimestamp(), "[RetryReceipt] Requester " + senderRecipient.getId() + " somehow has no UUID! timestamp: " + sentTimestamp);
        return;
    }
    MessageLogEntry messageLogEntry = SignalDatabase.messageLog().getLogEntry(senderRecipient.getId(), content.getSenderDevice(), sentTimestamp);
    if (decryptionErrorMessage.getRatchetKey().isPresent()) {
        handleIndividualRetryReceipt(senderRecipient, messageLogEntry, content, decryptionErrorMessage);
    } else {
        handleSenderKeyRetryReceipt(senderRecipient, messageLogEntry, content, decryptionErrorMessage);
    }
}
Also used : MessageLogEntry(org.thoughtcrime.securesms.database.model.MessageLogEntry)

Example 2 with MessageLogEntry

use of org.thoughtcrime.securesms.database.model.MessageLogEntry in project Signal-Android by signalapp.

the class MessageContentProcessor method handleRetryReceipt.

private void handleRetryReceipt(@NonNull SignalServiceContent content, @NonNull DecryptionErrorMessage decryptionErrorMessage, @NonNull Recipient senderRecipient) {
    if (!FeatureFlags.retryReceipts()) {
        warn(String.valueOf(content.getTimestamp()), "[RetryReceipt] Feature flag disabled, skipping retry receipt.");
        return;
    }
    if (decryptionErrorMessage.getDeviceId() != SignalStore.account().getDeviceId()) {
        log(String.valueOf(content.getTimestamp()), "[RetryReceipt] Received a DecryptionErrorMessage targeting a linked device. Ignoring.");
        return;
    }
    long sentTimestamp = decryptionErrorMessage.getTimestamp();
    warn(content.getTimestamp(), "[RetryReceipt] Received a retry receipt from " + formatSender(senderRecipient, content) + " for message with timestamp " + sentTimestamp + ".");
    if (!senderRecipient.hasServiceId()) {
        warn(content.getTimestamp(), "[RetryReceipt] Requester " + senderRecipient.getId() + " somehow has no UUID! timestamp: " + sentTimestamp);
        return;
    }
    MessageLogEntry messageLogEntry = SignalDatabase.messageLog().getLogEntry(senderRecipient.getId(), content.getSenderDevice(), sentTimestamp);
    if (decryptionErrorMessage.getRatchetKey().isPresent()) {
        handleIndividualRetryReceipt(senderRecipient, messageLogEntry, content, decryptionErrorMessage);
    } else {
        handleSenderKeyRetryReceipt(senderRecipient, messageLogEntry, content, decryptionErrorMessage);
    }
}
Also used : MessageLogEntry(org.thoughtcrime.securesms.database.model.MessageLogEntry)

Aggregations

MessageLogEntry (org.thoughtcrime.securesms.database.model.MessageLogEntry)2