diff --git a/js/models/conversations.js b/js/models/conversations.js index 2fc0b9480..5635bdfd0 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -1876,6 +1876,12 @@ timestamp: null, active_at: null, }); + + // Reset our friend status if we're not friends + if (!this.isFriend()) { + this.set({ friendRequestStatus: FriendRequestStatusEnum.none }); + } + await window.Signal.Data.updateConversation(this.id, this.attributes, { Conversation: Whisper.Conversation, }); diff --git a/js/models/messages.js b/js/models/messages.js index 23ee2fb3c..f2735349f 100644 --- a/js/models/messages.js +++ b/js/models/messages.js @@ -1402,7 +1402,7 @@ message.set({ friendStatus: 'accepted' }); await conversation.onFriendRequestAccepted(); window.libloki.sendFriendRequestAccepted(message.get('source')); - } else if (conversation.isFriendRequestStatusNone()) { + } else if (!conversation.isFriend()) { await conversation.onFriendRequestReceived(); } } else { diff --git a/libtextsecure/outgoing_message.js b/libtextsecure/outgoing_message.js index e32056d22..7de94ee32 100644 --- a/libtextsecure/outgoing_message.js +++ b/libtextsecure/outgoing_message.js @@ -121,7 +121,7 @@ OutgoingMessage.prototype = { } return builder.processPreKey(device).then(async () => { // TODO: only remove the keys that were used above! - await window.libloki.removePreKeyBundleForNumber(number); + await window.libloki.removeContactPreKeyBundle(number); return true; } ).catch(error => {