feat(notifications/action): only show actions if necessary
This commit is contained in:
parent
55d2ca4a93
commit
360cd7b5df
|
@ -199,14 +199,21 @@ public class PushNotificationReceiver extends BroadcastReceiver{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (notification != null) {
|
||||||
switch (pn.notificationType) {
|
switch (pn.notificationType) {
|
||||||
case MENTION -> {
|
case MENTION -> {
|
||||||
builder.addAction(buildNotificationAction(context, accountID, notification, context.getString(R.string.sk_notification_action_favorite), NotificationAction.FAVORITE));
|
if(!notification.status.favourited)
|
||||||
builder.addAction(buildNotificationAction(context, accountID, notification, context.getString(R.string.sk_notification_action_bookmark), NotificationAction.BOOKMARK));
|
builder.addAction(buildNotificationAction(context, accountID, notification, context.getString(R.string.sk_notification_action_favorite), NotificationAction.FAVORITE));
|
||||||
if (notification != null && notification.status.visibility != StatusPrivacy.DIRECT)
|
if(!notification.status.bookmarked)
|
||||||
builder.addAction(buildNotificationAction(context, accountID, notification, context.getString(R.string.sk_notification_action_boost), NotificationAction.REBLOG));
|
builder.addAction(buildNotificationAction(context, accountID, notification, context.getString(R.string.sk_notification_action_bookmark), NotificationAction.BOOKMARK));
|
||||||
|
if(notification.status.visibility != StatusPrivacy.DIRECT)
|
||||||
|
builder.addAction(buildNotificationAction(context, accountID, notification, context.getString(R.string.sk_notification_action_boost), NotificationAction.REBLOG));
|
||||||
}
|
}
|
||||||
// case FOLLOW -> builder.addAction(buildNotificationAction(context, accountID, notification, null, "Refollow", NotificationAction.FAVORITE));
|
case FOLLOW -> {
|
||||||
|
// if ( notification != null && notification.status.account.)
|
||||||
|
builder.addAction(buildNotificationAction(context, accountID, notification, context.getString(R.string.sk_notification_action_follow), NotificationAction.FAVORITE));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nm.notify(accountID, GlobalUserPreferences.keepOnlyLatestNotification ? NOTIFICATION_ID : notificationId++, builder.build());
|
nm.notify(accountID, GlobalUserPreferences.keepOnlyLatestNotification ? NOTIFICATION_ID : notificationId++, builder.build());
|
||||||
|
|
|
@ -265,4 +265,5 @@
|
||||||
<string name="sk_notification_action_favorite">Favorite</string>
|
<string name="sk_notification_action_favorite">Favorite</string>
|
||||||
<string name="sk_notification_action_bookmark">Bookmark</string>
|
<string name="sk_notification_action_bookmark">Bookmark</string>
|
||||||
<string name="sk_notification_action_boost">Boost</string>
|
<string name="sk_notification_action_boost">Boost</string>
|
||||||
|
<string name="sk_notification_action_follow">Refollow</string>
|
||||||
</resources>
|
</resources>
|
Loading…
Reference in New Issue