Merge pull request #82 from Mikunj/fix/friend-status

Bug fixes
This commit is contained in:
Beaudan Campbell-Brown 2018-12-10 14:11:41 +11:00 committed by GitHub
commit 94d3ae7b5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -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,
});

View File

@ -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 {

View File

@ -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 => {