style(notifications-actions/reply): clean-up

This commit is contained in:
FineFindus
2023-03-03 23:49:45 +01:00
parent cbcdf09bfe
commit 1124bab96b

View File

@@ -12,12 +12,9 @@ import android.content.Intent;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.service.notification.StatusBarNotification;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import androidx.annotation.RequiresApi;
import org.joinmastodon.android.api.MastodonAPIController; import org.joinmastodon.android.api.MastodonAPIController;
import org.joinmastodon.android.api.requests.notifications.GetNotificationByID; import org.joinmastodon.android.api.requests.notifications.GetNotificationByID;
import org.joinmastodon.android.api.requests.statuses.CreateStatus; import org.joinmastodon.android.api.requests.statuses.CreateStatus;
@@ -281,7 +278,7 @@ public class PushNotificationReceiver extends BroadcastReceiver{
req.spoilerText = "re: " + notification.status.spoilerText; req.spoilerText = "re: " + notification.status.spoilerText;
} }
// new CreateStatus(req, UUID.randomUUID().toString()).exec(accountID); new CreateStatus(req, UUID.randomUUID().toString()).exec(accountID);
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Notification.Builder builder = android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O ? Notification.Builder builder = android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O ?
@@ -293,8 +290,6 @@ public class PushNotificationReceiver extends BroadcastReceiver{
Notification repliedNotification = builder.setSmallIcon(R.drawable.ic_ntf_logo) Notification repliedNotification = builder.setSmallIcon(R.drawable.ic_ntf_logo)
.setContentText(context.getString(R.string.sk_notification_action_replied, notification.status.account.getDisplayUsername())) .setContentText(context.getString(R.string.sk_notification_action_replied, notification.status.account.getDisplayUsername()))
.build(); .build();
// notificationManager.cancel(accountID, notificationId);
// notificationManager.notify(notificationId, repliedNotification);
notificationManager.notify(accountID, notificationId, repliedNotification); notificationManager.notify(accountID, notificationId, repliedNotification);
} }
} }