From 5694ea07449ace97775b8b4a5a83afe9a46c34bc Mon Sep 17 00:00:00 2001 From: Christopher Poile Date: Wed, 6 Sep 2023 17:19:20 -0400 Subject: [PATCH] MM-53924 - Android should use category to allow replies (#7534) --- .../com/mattermost/helpers/CustomPushNotificationHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/java/com/mattermost/helpers/CustomPushNotificationHelper.java b/android/app/src/main/java/com/mattermost/helpers/CustomPushNotificationHelper.java index 488cd8e8e..0cb97ffc3 100644 --- a/android/app/src/main/java/com/mattermost/helpers/CustomPushNotificationHelper.java +++ b/android/app/src/main/java/com/mattermost/helpers/CustomPushNotificationHelper.java @@ -52,6 +52,7 @@ public class CustomPushNotificationHelper { public static final String PUSH_TYPE_MESSAGE = "message"; public static final String PUSH_TYPE_CLEAR = "clear"; public static final String PUSH_TYPE_SESSION = "session"; + public static final String CATEGORY_CAN_REPLY = "CAN_REPLY"; private static NotificationChannel mHighImportanceChannel; private static NotificationChannel mMinImportanceChannel; @@ -132,8 +133,9 @@ public class CustomPushNotificationHelper { private static void addNotificationReplyAction(Context context, NotificationCompat.Builder notification, Bundle bundle, int notificationId) { String postId = bundle.getString("post_id"); String serverUrl = bundle.getString("server_url"); + boolean canReply = bundle.containsKey("category") && bundle.getString("category").equals(CATEGORY_CAN_REPLY); - if (android.text.TextUtils.isEmpty(postId) || serverUrl == null) { + if (android.text.TextUtils.isEmpty(postId) || serverUrl == null || !canReply) { return; }