diff --git a/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt b/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt index 8b48c4bc55..c9af201639 100644 --- a/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt @@ -325,7 +325,6 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje override fun onResume() { super.onResume() - NotificationHelper.clearNotificationsForActiveAccount(this, accountManager) val currentEmojiPack = preferences.getString(EMOJI_PREFERENCE, "") if (currentEmojiPack != selectedEmojiPack) { Log.d( @@ -667,10 +666,6 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje onTabSelectedListener = object : OnTabSelectedListener { override fun onTabSelected(tab: TabLayout.Tab) { - if (tab.position == notificationTabPosition) { - NotificationHelper.clearNotificationsForActiveAccount(this@MainActivity, accountManager) - } - binding.mainToolbar.title = tabs[tab.position].title(this@MainActivity) } diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java index 7d381c4bb0..880cb9fc3e 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java @@ -63,6 +63,7 @@ import com.keylesspalace.tusky.appstore.PinEvent; import com.keylesspalace.tusky.appstore.PreferenceChangedEvent; import com.keylesspalace.tusky.appstore.ReblogEvent; +import com.keylesspalace.tusky.components.notifications.NotificationHelper; import com.keylesspalace.tusky.databinding.FragmentTimelineNotificationsBinding; import com.keylesspalace.tusky.db.AccountEntity; import com.keylesspalace.tusky.db.AccountManager; @@ -1211,6 +1212,9 @@ public Object getChangePayload(@NonNull NotificationViewData oldItem, @NonNull N @Override public void onResume() { super.onResume(); + + NotificationHelper.clearNotificationsForActiveAccount(requireContext(), accountManager); + String rawAccountNotificationFilter = accountManager.getActiveAccount().getNotificationsFilter(); Set accountNotificationFilter = NotificationTypeConverterKt.deserialize(rawAccountNotificationFilter); if (!notificationFilter.equals(accountNotificationFilter)) { diff --git a/app/src/main/java/com/keylesspalace/tusky/receiver/SendStatusBroadcastReceiver.kt b/app/src/main/java/com/keylesspalace/tusky/receiver/SendStatusBroadcastReceiver.kt index 0ac30b1089..dbeff4068d 100644 --- a/app/src/main/java/com/keylesspalace/tusky/receiver/SendStatusBroadcastReceiver.kt +++ b/app/src/main/java/com/keylesspalace/tusky/receiver/SendStatusBroadcastReceiver.kt @@ -117,7 +117,8 @@ class SendStatusBroadcastReceiver : BroadcastReceiver() { builder.setCategory(NotificationCompat.CATEGORY_SOCIAL) builder.setOnlyAlertOnce(true) - notificationManager.notify(notificationId, builder.build()) + // There is a separate "I am sending" notification, so simply remove the handled one. + notificationManager.cancel(notificationId) } } }