mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-25 14:27:21 +00:00
Fix reply showing up in RSS feed notifications.
This commit is contained in:
parent
152ddf013b
commit
49be17b969
@ -326,16 +326,19 @@ public class MessageNotifier {
|
|||||||
|
|
||||||
|
|
||||||
// We can only reply if we are friends with the user or we're messaging a group
|
// 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 isGroup = recipient.isGroupRecipient();
|
||||||
boolean isFriends = DatabaseFactory.getLokiThreadDatabase(context).getFriendRequestStatus(threadId) == LokiThreadFriendRequestStatus.FRIENDS;
|
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 we're not friends then we need to check if we're friends with any of the linked devices
|
||||||
if (!isGroup && !isFriends) {
|
if (!isFriends) {
|
||||||
Promise<Boolean, Exception> promise = PromiseUtil.timeout(MultiDeviceUtilities.isFriendsWithAnyLinkedDevice(context, recipient), 5000);
|
Promise<Boolean, Exception> promise = PromiseUtil.timeout(MultiDeviceUtilities.isFriendsWithAnyLinkedDevice(context, recipient), 5000);
|
||||||
isFriends = PromiseUtil.get(promise, false);
|
isFriends = PromiseUtil.get(promise, false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
boolean canReply = isGroup || isFriends;
|
boolean canReply = (isGroup && !isRSS) || isFriends;
|
||||||
|
|
||||||
PendingIntent quickReplyIntent = canReply ? notificationState.getQuickReplyIntent(context, recipient) : null;
|
PendingIntent quickReplyIntent = canReply ? notificationState.getQuickReplyIntent(context, recipient) : null;
|
||||||
PendingIntent remoteReplyIntent = canReply ? notificationState.getRemoteReplyIntent(context, recipient, replyMethod) : null;
|
PendingIntent remoteReplyIntent = canReply ? notificationState.getRemoteReplyIntent(context, recipient, replyMethod) : null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user