session-specific notification badge

fix sk22#470
This commit is contained in:
sk 2023-03-21 10:03:31 +01:00 committed by LucasGGamerM
parent 5395855775
commit 5a9a3eb140
3 changed files with 5 additions and 4 deletions

View file

@ -85,7 +85,7 @@ public class PushNotificationReceiver extends BroadcastReceiver{
}
String accountID=account.getID();
PushNotification pn=AccountSessionManager.getInstance().getAccount(accountID).getPushSubscriptionManager().decryptNotification(k, p, s);
E.post(new NotificationReceivedEvent(pn.notificationId+""));
E.post(new NotificationReceivedEvent(accountID, pn.notificationId+""));
new GetNotificationByID(pn.notificationId+"")
.setCallback(new Callback<>(){
@Override

View file

@ -1,8 +1,9 @@
package org.joinmastodon.android.events;
public class NotificationReceivedEvent {
public String id;
public NotificationReceivedEvent(String id) {
public String account, id;
public NotificationReceivedEvent(String account, String id) {
this.account = account;
this.id = id;
}
}

View file

@ -400,7 +400,7 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene
@Subscribe
public void onNotificationReceived(NotificationReceivedEvent notificationReceivedEvent) {
setNotificationBadge(true);
if (notificationReceivedEvent.account.equals(accountID)) setNotificationBadge(true);
}
@Subscribe