diff --git a/js/models/conversations.js b/js/models/conversations.js index ca4965cff..ce16f3960 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -1094,7 +1094,7 @@ ); const options = this.getSendOptions(); - options.messageType = message.attributes.type; + options.messageType = message.get('type'); // Add the message sending on another queue so that our UI doesn't get blocked this.queueMessageSend(async () => diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index 3349e1dd2..cf9b1fc0b 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -164,7 +164,7 @@ color: this.model.getColor(), avatarPath: this.model.getAvatarPath(), isVerified: this.model.isVerified(), - isKeysPending: this.model.isFriend() === false, + isKeysPending: !this.model.isFriend(), isMe: this.model.isMe(), isBlocked: this.model.isBlocked(), isGroup: !this.model.isPrivate(), diff --git a/libtextsecure/message_receiver.js b/libtextsecure/message_receiver.js index a070275d8..c4bea25b5 100644 --- a/libtextsecure/message_receiver.js +++ b/libtextsecure/message_receiver.js @@ -987,6 +987,8 @@ MessageReceiver.prototype.extend({ } if (envelope.type === textsecure.protobuf.Envelope.Type.FRIEND_REQUEST) { conversation.onFriendRequestReceived(); + } else { + conversation.onFriendRequestAccepted(); } if (content.preKeyBundleMessage) { @@ -1010,9 +1012,6 @@ MessageReceiver.prototype.extend({ return this.handleReceiptMessage(envelope, content.receiptMessage); this.removeFromCache(envelope); - // TODO: The empty friend request response could get lost - // Need to trigger this event whenever a message is received in the pending state - conversation.onFriendRequestAccepted(); return null; }, handleCallMessage(envelope) {