mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
Block forum post notifications while viewing forum list
This commit is contained in:
@@ -109,7 +109,8 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
||||
@Nullable
|
||||
private GroupId blockedGroup = null;
|
||||
private boolean blockSignInReminder = false;
|
||||
private boolean blockGroups = false, blockBlogs = false;
|
||||
private boolean blockForums = false, blockGroups = false,
|
||||
blockBlogs = false;
|
||||
private long lastSound = 0;
|
||||
|
||||
private volatile Settings settings = new Settings();
|
||||
@@ -453,6 +454,7 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
||||
|
||||
@UiThread
|
||||
private void showForumPostNotification(GroupId g) {
|
||||
if (blockForums) return;
|
||||
if (g.equals(blockedGroup)) return;
|
||||
forumCounts.add(g);
|
||||
updateForumPostNotification(true);
|
||||
@@ -682,10 +684,19 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void blockAllForumPostNotifications() {
|
||||
androidExecutor.runOnUiThread((Runnable) () -> blockForums = true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unblockAllForumPostNotifications() {
|
||||
androidExecutor.runOnUiThread((Runnable) () -> blockForums = false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void blockAllGroupMessageNotifications() {
|
||||
androidExecutor.runOnUiThread((Runnable) () -> blockGroups = true);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -92,11 +92,11 @@ class ForumListViewModel extends DbViewModel implements EventListener {
|
||||
}
|
||||
|
||||
void blockAllForumPostNotifications() {
|
||||
// TODO
|
||||
notificationManager.blockAllForumPostNotifications();
|
||||
}
|
||||
|
||||
void unblockAllForumPostNotifications() {
|
||||
// TODO
|
||||
notificationManager.unblockAllForumPostNotifications();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -82,6 +82,10 @@ public interface AndroidNotificationManager {
|
||||
|
||||
void unblockNotification(GroupId g);
|
||||
|
||||
void blockAllForumPostNotifications();
|
||||
|
||||
void unblockAllForumPostNotifications();
|
||||
|
||||
void blockAllGroupMessageNotifications();
|
||||
|
||||
void unblockAllGroupMessageNotifications();
|
||||
|
||||
Reference in New Issue
Block a user