mirror of
https://github.com/oxen-io/session-android.git
synced 2023-12-14 02:53:01 +01:00
0a8c62e0e3
1) Refactor the master secret reset logic to properly interact with services. 2) Add support for "BigText" and "Inbox" style notifications. 3) Decrypt message bodies when unlocked, display 'encrypted' when locked.
39 lines
953 B
Java
39 lines
953 B
Java
package org.thoughtcrime.securesms.notifications;
|
|
|
|
import android.graphics.Bitmap;
|
|
|
|
import java.util.HashSet;
|
|
import java.util.LinkedList;
|
|
import java.util.List;
|
|
import java.util.Set;
|
|
|
|
public class NotificationState {
|
|
|
|
private final LinkedList<NotificationItem> notifications = new LinkedList<NotificationItem>();
|
|
private final Set<Long> threads = new HashSet<Long>();
|
|
|
|
private int notificationCount = 0;
|
|
|
|
public void addNotification(NotificationItem item) {
|
|
notifications.addFirst(item);
|
|
threads.add(item.getThreadId());
|
|
notificationCount++;
|
|
}
|
|
|
|
public boolean hasMultipleThreads() {
|
|
return threads.size() > 1;
|
|
}
|
|
|
|
public int getMessageCount() {
|
|
return notificationCount;
|
|
}
|
|
|
|
public List<NotificationItem> getNotifications() {
|
|
return notifications;
|
|
}
|
|
|
|
public Bitmap getContactPhoto() {
|
|
return notifications.get(0).getRecipients().getPrimaryRecipient().getContactPhoto();
|
|
}
|
|
|
|
}
|