mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 20:15:21 +00:00
Mark muted messages as read when in thread
Fixes #3562 Closes #3643 // FREEBIE
This commit is contained in:
parent
5704fad7cc
commit
72b9c37ec8
@ -50,10 +50,8 @@ import org.thoughtcrime.securesms.recipients.Recipient;
|
|||||||
import org.thoughtcrime.securesms.recipients.RecipientFactory;
|
import org.thoughtcrime.securesms.recipients.RecipientFactory;
|
||||||
import org.thoughtcrime.securesms.recipients.Recipients;
|
import org.thoughtcrime.securesms.recipients.Recipients;
|
||||||
import org.thoughtcrime.securesms.service.KeyCachingService;
|
import org.thoughtcrime.securesms.service.KeyCachingService;
|
||||||
import org.thoughtcrime.securesms.util.ListenableFutureTask;
|
|
||||||
import org.thoughtcrime.securesms.util.SpanUtil;
|
import org.thoughtcrime.securesms.util.SpanUtil;
|
||||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||||
import org.thoughtcrime.securesms.util.concurrent.ListenableFuture;
|
|
||||||
import org.whispersystems.textsecure.api.messages.TextSecureEnvelope;
|
import org.whispersystems.textsecure.api.messages.TextSecureEnvelope;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -120,8 +118,15 @@ public class MessageNotifier {
|
|||||||
boolean includePushDatabase,
|
boolean includePushDatabase,
|
||||||
long threadId)
|
long threadId)
|
||||||
{
|
{
|
||||||
Recipients recipients = DatabaseFactory.getThreadDatabase(context)
|
boolean isVisible = visibleThread == threadId;
|
||||||
.getRecipientsForThreadId(threadId);
|
|
||||||
|
ThreadDatabase threads = DatabaseFactory.getThreadDatabase(context);
|
||||||
|
Recipients recipients = DatabaseFactory.getThreadDatabase(context)
|
||||||
|
.getRecipientsForThreadId(threadId);
|
||||||
|
|
||||||
|
if (isVisible) {
|
||||||
|
threads.setRead(threadId);
|
||||||
|
}
|
||||||
|
|
||||||
if (!TextSecurePreferences.isNotificationsEnabled(context) ||
|
if (!TextSecurePreferences.isNotificationsEnabled(context) ||
|
||||||
(recipients != null && recipients.isMuted()))
|
(recipients != null && recipients.isMuted()))
|
||||||
@ -129,9 +134,7 @@ public class MessageNotifier {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (visibleThread == threadId) {
|
if (isVisible) {
|
||||||
ThreadDatabase threads = DatabaseFactory.getThreadDatabase(context);
|
|
||||||
threads.setRead(threadId);
|
|
||||||
sendInThreadNotification(context, threads.getRecipientsForThreadId(threadId));
|
sendInThreadNotification(context, threads.getRecipientsForThreadId(threadId));
|
||||||
} else {
|
} else {
|
||||||
updateNotification(context, masterSecret, true, includePushDatabase, 0);
|
updateNotification(context, masterSecret, true, includePushDatabase, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user