If we received a regular message and we're not friends with a user then check to see if we should auto accept the request

pull/834/head
Mikunj Varsani 6 years ago
parent 68f1ba543b
commit 746456200a

@ -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!');

Loading…
Cancel
Save