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