session-specific notification badge
fix sk22#470
This commit is contained in:
parent
797642b972
commit
58b000927a
@ -86,7 +86,7 @@ public class PushNotificationReceiver extends BroadcastReceiver{
|
|||||||
}
|
}
|
||||||
String accountID=account.getID();
|
String accountID=account.getID();
|
||||||
PushNotification pn=AccountSessionManager.getInstance().getAccount(accountID).getPushSubscriptionManager().decryptNotification(k, p, s);
|
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+"")
|
new GetNotificationByID(pn.notificationId+"")
|
||||||
.setCallback(new Callback<>(){
|
.setCallback(new Callback<>(){
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
package org.joinmastodon.android.events;
|
package org.joinmastodon.android.events;
|
||||||
|
|
||||||
public class NotificationReceivedEvent {
|
public class NotificationReceivedEvent {
|
||||||
public String id;
|
public String account, id;
|
||||||
public NotificationReceivedEvent(String id) {
|
public NotificationReceivedEvent(String account, String id) {
|
||||||
|
this.account = account;
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -323,7 +323,7 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene
|
|||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onNotificationReceived(NotificationReceivedEvent notificationReceivedEvent) {
|
public void onNotificationReceived(NotificationReceivedEvent notificationReceivedEvent) {
|
||||||
setNotificationBadge(true);
|
if (notificationReceivedEvent.account.equals(accountID)) setNotificationBadge(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
|
Loading…
Reference in New Issue
Block a user