|
|
|
@ -50,10 +50,8 @@ import org.thoughtcrime.securesms.recipients.Recipient;
|
|
|
|
|
import org.thoughtcrime.securesms.recipients.RecipientFactory;
|
|
|
|
|
import org.thoughtcrime.securesms.recipients.Recipients;
|
|
|
|
|
import org.thoughtcrime.securesms.service.KeyCachingService;
|
|
|
|
|
import org.thoughtcrime.securesms.util.ListenableFutureTask;
|
|
|
|
|
import org.thoughtcrime.securesms.util.SpanUtil;
|
|
|
|
|
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
|
|
|
|
import org.thoughtcrime.securesms.util.concurrent.ListenableFuture;
|
|
|
|
|
import org.whispersystems.textsecure.api.messages.TextSecureEnvelope;
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
@ -120,8 +118,15 @@ public class MessageNotifier {
|
|
|
|
|
boolean includePushDatabase,
|
|
|
|
|
long threadId)
|
|
|
|
|
{
|
|
|
|
|
Recipients recipients = DatabaseFactory.getThreadDatabase(context)
|
|
|
|
|
.getRecipientsForThreadId(threadId);
|
|
|
|
|
boolean isVisible = visibleThread == threadId;
|
|
|
|
|
|
|
|
|
|
ThreadDatabase threads = DatabaseFactory.getThreadDatabase(context);
|
|
|
|
|
Recipients recipients = DatabaseFactory.getThreadDatabase(context)
|
|
|
|
|
.getRecipientsForThreadId(threadId);
|
|
|
|
|
|
|
|
|
|
if (isVisible) {
|
|
|
|
|
threads.setRead(threadId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!TextSecurePreferences.isNotificationsEnabled(context) ||
|
|
|
|
|
(recipients != null && recipients.isMuted()))
|
|
|
|
@ -129,9 +134,7 @@ public class MessageNotifier {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (visibleThread == threadId) {
|
|
|
|
|
ThreadDatabase threads = DatabaseFactory.getThreadDatabase(context);
|
|
|
|
|
threads.setRead(threadId);
|
|
|
|
|
if (isVisible) {
|
|
|
|
|
sendInThreadNotification(context, threads.getRecipientsForThreadId(threadId));
|
|
|
|
|
} else {
|
|
|
|
|
updateNotification(context, masterSecret, true, includePushDatabase, 0);
|
|
|
|
|