diff --git a/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java b/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java index 317bda2f3..12d795b03 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java +++ b/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java @@ -21,6 +21,7 @@ import android.text.TextUtils; import android.util.Log; import org.joinmastodon.android.api.MastodonAPIController; +import org.joinmastodon.android.api.requests.accounts.RemoveFromFollowers; import org.joinmastodon.android.api.requests.accounts.SetAccountFollowed; import org.joinmastodon.android.api.requests.notifications.GetNotificationByID; import org.joinmastodon.android.api.requests.statuses.CreateStatus; @@ -153,6 +154,7 @@ public class PushNotificationReceiver extends BroadcastReceiver{ case UNBOOST -> new SetStatusReblogged(statusID, false, preferences.postingDefaultVisibility).exec(accountID); case REPLY -> handleReplyAction(context, accountID, intent, notification, notificationId, preferences); case FOLLOW_BACK -> new SetAccountFollowed(notification.account.id, true, true, false).exec(accountID); + case REMOVE_FOLLOWER -> new RemoveFromFollowers(notification.account.id).exec(accountID); default -> Log.w(TAG, "onReceive: Failed to get NotificationAction"); } } @@ -283,6 +285,7 @@ public class PushNotificationReceiver extends BroadcastReceiver{ } case FOLLOW -> { builder.addAction(buildNotificationAction(context, id, accountID, notification, context.getString(R.string.follow_back), NotificationAction.FOLLOW_BACK)); + builder.addAction(buildNotificationAction(context, id, accountID, notification, context.getString(R.string.mo_notification_action_remove_follower), NotificationAction.REMOVE_FOLLOWER)); } } } diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/requests/accounts/RemoveFromFollowers.java b/mastodon/src/main/java/org/joinmastodon/android/api/requests/accounts/RemoveFromFollowers.java index f6b61333e..7e165a781 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/api/requests/accounts/RemoveFromFollowers.java +++ b/mastodon/src/main/java/org/joinmastodon/android/api/requests/accounts/RemoveFromFollowers.java @@ -5,7 +5,7 @@ import org.joinmastodon.android.model.Relationship; public class RemoveFromFollowers extends MastodonAPIRequest{ public RemoveFromFollowers(String id){ - super(HttpMethod.POST, "/follow_requests/"+id+"/reject", Relationship.class); + super(HttpMethod.POST, "/accounts/"+id+"/remove_from_followers", Relationship.class); setRequestBody(new Object()); } } diff --git a/mastodon/src/main/java/org/joinmastodon/android/model/NotificationAction.java b/mastodon/src/main/java/org/joinmastodon/android/model/NotificationAction.java index 52b936243..4b1e2da6c 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/model/NotificationAction.java +++ b/mastodon/src/main/java/org/joinmastodon/android/model/NotificationAction.java @@ -6,5 +6,6 @@ public enum NotificationAction { UNBOOST, BOOKMARK, REPLY, - FOLLOW_BACK + FOLLOW_BACK, + REMOVE_FOLLOWER } diff --git a/mastodon/src/main/res/values/strings_mo.xml b/mastodon/src/main/res/values/strings_mo.xml index 3276df793..1482800b3 100644 --- a/mastodon/src/main/res/values/strings_mo.xml +++ b/mastodon/src/main/res/values/strings_mo.xml @@ -139,4 +139,6 @@ Something went wrong while loading this post. If the problem persists, please report it on our Issues page along with the error details. Copy details Read + + Remove from Followers \ No newline at end of file