Send message status in friend request props.

pull/33/head
Mikunj 7 years ago
parent 757216fe80
commit 7530836110

@ -989,6 +989,7 @@
if (friendRequestSent) return; if (friendRequestSent) return;
} }
// Send the friend request!
messageWithSchema = await upgradeMessageSchema({ messageWithSchema = await upgradeMessageSchema({
type: 'friend-request', type: 'friend-request',
body, body,

@ -334,6 +334,7 @@
text: this.createNonBreakingLastSeparator(this.get('body')), text: this.createNonBreakingLastSeparator(this.get('body')),
source: this.findAndFormatContact(source), source: this.findAndFormatContact(source),
target: this.findAndFormatContact(target), target: this.findAndFormatContact(target),
status: this.getMessagePropStatus(),
direction, direction,
friendStatus, friendStatus,
onAccept, onAccept,
@ -416,7 +417,14 @@
if (this.hasErrors()) { if (this.hasErrors()) {
return 'error'; return 'error';
} }
if (!this.isOutgoing()) {
// Handle friend request statuses
const isFriendRequest = this.isFriendRequest();
const isOutgoingFriendRequest = isFriendRequest && this.get('direction') === 'outgoing';
const isOutgoing = this.isOutgoing() || isOutgoingFriendRequest;
// Only return the status on outgoing messages
if (!isOutgoing()) {
return null; return null;
} }

Loading…
Cancel
Save