chore: Message API improvements (#2396)

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Sojan Jose 2021-06-08 01:11:06 +05:30 committed by GitHub
parent 1ebab21cfa
commit 0a087c95fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 39 additions and 6 deletions

View file

@ -152,7 +152,10 @@ export default {
return !messageType ? 'left' : 'right';
},
readableTime() {
return this.messageStamp(this.data.created_at, 'LLL d, h:mm a');
return this.messageStamp(
this.contentAttributes.external_created_at || this.data.created_at,
'LLL d, h:mm a'
);
},
isBubble() {
return [0, 1, 3].includes(this.data.message_type);
@ -205,7 +208,7 @@ export default {
},
isSentByBot() {
if (this.isPending) return false;
return !this.sender.type || this.sender.type === 'bot';
return !this.sender.type || this.sender.type === 'agent_bot';
},
},
};