Now its fixed for good. That was easier than I thought

(cherry picked from commit 2076818220)
This commit is contained in:
LucasGGamerM 2023-01-11 11:19:30 -03:00
parent cca2fc4199
commit f17eb9ebdc
2 changed files with 3 additions and 3 deletions

View File

@ -56,7 +56,7 @@ public class MainActivity extends FragmentStackActivity{
fragment.setArguments(args); fragment.setArguments(args);
showFragmentClearingBackStack(fragment); showFragmentClearingBackStack(fragment);
if(intent.getBooleanExtra("fromNotification", false) && intent.hasExtra("notification")){ if(intent.getBooleanExtra("fromNotification", false) && intent.hasExtra("notification")){
Notification notification=Parcels.unwrap(intent.getParcelableExtra("notification"+intent.getParcelableExtra("notificationID"))); Notification notification=Parcels.unwrap(intent.getParcelableExtra("notification"));
showFragmentForNotification(notification, session.getID()); showFragmentForNotification(notification, session.getID());
}else if(intent.getBooleanExtra("compose", false)){ }else if(intent.getBooleanExtra("compose", false)){
showCompose(); showCompose();

View File

@ -136,12 +136,12 @@ public class PushNotificationReceiver extends BroadcastReceiver{
contentIntent.putExtra("accountID", accountID); contentIntent.putExtra("accountID", accountID);
contentIntent.putExtra("notificationID", notificationID); contentIntent.putExtra("notificationID", notificationID);
if(notification!=null){ if(notification!=null){
contentIntent.putExtra("notification" + notificationID, Parcels.wrap(notification)); contentIntent.putExtra("notification", Parcels.wrap(notification));
} }
builder.setContentTitle(pn.title) builder.setContentTitle(pn.title)
.setContentText(pn.body) .setContentText(pn.body)
.setStyle(new Notification.BigTextStyle().bigText(pn.body)) .setStyle(new Notification.BigTextStyle().bigText(pn.body))
.setContentIntent(PendingIntent.getActivity(context, accountID.hashCode() & 0xFFFF, contentIntent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT)) .setContentIntent(PendingIntent.getActivity(context, notificationID, contentIntent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT))
.setWhen(notification==null ? System.currentTimeMillis() : notification.createdAt.toEpochMilli()) .setWhen(notification==null ? System.currentTimeMillis() : notification.createdAt.toEpochMilli())
.setShowWhen(true) .setShowWhen(true)
.setCategory(Notification.CATEGORY_SOCIAL) .setCategory(Notification.CATEGORY_SOCIAL)