From 49be17b969cc44de9782846833df5dc6b44d2bd8 Mon Sep 17 00:00:00 2001 From: Mikunj Varsani Date: Thu, 12 Mar 2020 12:05:08 +1100 Subject: [PATCH] Fix reply showing up in RSS feed notifications. --- .../notifications/MessageNotifier.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java b/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java index d92cc0c141..7125d0e413 100644 --- a/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java +++ b/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java @@ -326,16 +326,19 @@ public class MessageNotifier { // We can only reply if we are friends with the user or we're messaging a group - boolean isGroup = recipient.isGroupRecipient() && !recipient.getAddress().isRSSFeed(); - boolean isFriends = DatabaseFactory.getLokiThreadDatabase(context).getFriendRequestStatus(threadId) == LokiThreadFriendRequestStatus.FRIENDS; - - // If we're not friends then we need to check if we're friends with any of the linked devices - if (!isGroup && !isFriends) { - Promise promise = PromiseUtil.timeout(MultiDeviceUtilities.isFriendsWithAnyLinkedDevice(context, recipient), 5000); - isFriends = PromiseUtil.get(promise, false); + boolean isGroup = recipient.isGroupRecipient(); + boolean isRSS = isGroup && recipient.getAddress().isRSSFeed(); + boolean isFriends = false; + if (!isGroup) { + isFriends = DatabaseFactory.getLokiThreadDatabase(context).getFriendRequestStatus(threadId) == LokiThreadFriendRequestStatus.FRIENDS; + // If we're not friends then we need to check if we're friends with any of the linked devices + if (!isFriends) { + Promise promise = PromiseUtil.timeout(MultiDeviceUtilities.isFriendsWithAnyLinkedDevice(context, recipient), 5000); + isFriends = PromiseUtil.get(promise, false); + } } - boolean canReply = isGroup || isFriends; + boolean canReply = (isGroup && !isRSS) || isFriends; PendingIntent quickReplyIntent = canReply ? notificationState.getQuickReplyIntent(context, recipient) : null; PendingIntent remoteReplyIntent = canReply ? notificationState.getRemoteReplyIntent(context, recipient, replyMethod) : null;