diff --git a/libtextsecure/message_receiver.js b/libtextsecure/message_receiver.js index 6146f86dc..5d6fca573 100644 --- a/libtextsecure/message_receiver.js +++ b/libtextsecure/message_receiver.js @@ -1366,7 +1366,11 @@ MessageReceiver.prototype.extend({ } } - if (friendRequest) { + // If we got a friend request message or + // if we're not friends with the current user that sent this private message + // Check to see if we need to auto accept their friend request + const isGroupMessage = !!groupId; + if (friendRequest || (!isGroupMessage && !conversation.isFriend())) { if (isMe) { window.log.info('refusing to add a friend request to ourselves'); throw new Error('Cannot add a friend request for ourselves!');