public static void updateNotification(Context context, MasterSecret masterSecret, long threadId) { Recipients recipients = DatabaseFactory.getThreadDatabase(context).getRecipientsForThreadId(threadId); if (!SMSSecurePreferences.isNotificationsEnabled(context) || (recipients != null && recipients.isMuted())) { return; } if (visibleThread == threadId) { ThreadDatabase threads = DatabaseFactory.getThreadDatabase(context); threads.setRead(threadId); sendInThreadNotification(context, threads.getRecipientsForThreadId(threadId)); } else { updateNotification(context, masterSecret, true, 0); } }
private ThreadRecord getThreadRecord(@NonNull Cursor cursor) { return threadDatabase.readerFor(cursor, masterCipher).getCurrent(); }