From 5bf002629d92610c152ee3ef9bd2ca7b71fd5cbc Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Mon, 19 Aug 2019 15:46:46 +0800 Subject: Fixed cannot mark message as read after clicking the notification. --- .../ml/docilealligator/infinityforreddit/PullNotificationWorker.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PullNotificationWorker.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PullNotificationWorker.java index 5e306572..b9be2633 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/PullNotificationWorker.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PullNotificationWorker.java @@ -55,8 +55,6 @@ public class PullNotificationWorker extends Worker { try { Log.i("workmanager", "before response"); - String currentAccountName = redditDataRoomDatabase.accountDao().getCurrentAccount().getUsername(); - List accounts = redditDataRoomDatabase.accountDao().getAllAccounts(); for(int accountIndex = 0; accountIndex < accounts.size(); accountIndex++) { Account account = accounts.get(accountIndex); @@ -119,6 +117,7 @@ public class PullNotificationWorker extends Worker { Uri uri = LinkResolverActivity.getRedditUriByPath(message.getContext()); intent.setData(uri); intent.putExtra(LinkResolverActivity.EXTRA_NEW_ACCOUNT_NAME, accountName); + intent.putExtra(LinkResolverActivity.EXTRA_MESSAGE_FULLNAME, message.getFullname()); PendingIntent pendingIntent = PendingIntent.getActivity(context, accountIndex * 6, intent, PendingIntent.FLAG_UPDATE_CURRENT); builder.setContentIntent(pendingIntent); } else if(kind.equals(Message.TYPE_ACCOUNT)) { @@ -131,6 +130,7 @@ public class PullNotificationWorker extends Worker { Uri uri = LinkResolverActivity.getRedditUriByPath(message.getContext()); intent.setData(uri); intent.putExtra(LinkResolverActivity.EXTRA_NEW_ACCOUNT_NAME, accountName); + intent.putExtra(LinkResolverActivity.EXTRA_MESSAGE_FULLNAME, message.getFullname()); PendingIntent pendingIntent = PendingIntent.getActivity(context, accountIndex * 6 + 2, intent, PendingIntent.FLAG_UPDATE_CURRENT); builder.setContentIntent(pendingIntent); } else if(kind.equals(Message.TYPE_MESSAGE)) { -- cgit v1.2.3