mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Clear thread notification automatically after blocking new ones
This commit is contained in:
@@ -79,12 +79,6 @@ public class ForumActivity extends
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
viewModel.clearForumPostNotification();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int request, int result,
|
||||
@Nullable Intent data) {
|
||||
|
||||
@@ -116,7 +116,7 @@ class ForumViewModel extends ThreadListViewModel<ForumPostItem> {
|
||||
}
|
||||
}
|
||||
|
||||
void clearForumPostNotification() {
|
||||
protected void clearNotifications() {
|
||||
notificationManager.clearForumPostNotification(groupId);
|
||||
}
|
||||
|
||||
|
||||
@@ -84,12 +84,6 @@ public class GroupActivity extends
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
viewModel.clearGroupMessageNotifications();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu items for use in the action bar
|
||||
|
||||
@@ -138,7 +138,7 @@ class GroupViewModel extends ThreadListViewModel<GroupMessageItem> {
|
||||
loadPrivateGroup(groupId);
|
||||
}
|
||||
|
||||
public void clearGroupMessageNotifications() {
|
||||
protected void clearNotifications() {
|
||||
notificationManager.clearGroupMessageNotification(groupId);
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ public abstract class ThreadListActivity<I extends ThreadItem, A extends ThreadI
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
getViewModel().blockNotifications();
|
||||
getViewModel().blockAndClearNotifications();
|
||||
list.startPeriodicUpdate();
|
||||
}
|
||||
|
||||
|
||||
@@ -124,8 +124,11 @@ public abstract class ThreadListViewModel<I extends ThreadItem>
|
||||
loadSharingContacts();
|
||||
}
|
||||
|
||||
public void blockNotifications() {
|
||||
protected abstract void clearNotifications();
|
||||
|
||||
public void blockAndClearNotifications() {
|
||||
notificationManager.blockNotification(groupId);
|
||||
clearNotifications();
|
||||
}
|
||||
|
||||
public void unblockNotifications() {
|
||||
|
||||
Reference in New Issue
Block a user