use of org.thoughtcrime.securesms.notifications.MessageNotifier in project Signal-Android by signalapp.
the class MessageContentProcessor method handleSynchronizeReadMessage.
private void handleSynchronizeReadMessage(@NonNull List<ReadMessage> readMessages, long envelopeTimestamp, @NonNull Recipient senderRecipient) {
log(envelopeTimestamp, "Synchronize read message. Count: " + readMessages.size() + ", Timestamps: " + readMessages.stream().map(ReadMessage::getTimestamp));
Map<Long, Long> threadToLatestRead = new HashMap<>();
SignalDatabase.mmsSms().setTimestampRead(senderRecipient, readMessages, envelopeTimestamp, threadToLatestRead);
List<MessageDatabase.MarkedMessageInfo> markedMessages = SignalDatabase.threads().setReadSince(threadToLatestRead, false);
if (Util.hasItems(markedMessages)) {
Log.i(TAG, "Updating past messages: " + markedMessages.size());
MarkReadReceiver.process(context, markedMessages);
}
MessageNotifier messageNotifier = ApplicationDependencies.getMessageNotifier();
messageNotifier.setLastDesktopActivityTimestamp(envelopeTimestamp);
messageNotifier.cancelDelayedNotifications();
messageNotifier.updateNotification(context);
}
Aggregations