From 04dd65687b2fb8926dfffb6c404835d529c7b1d7 Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Thu, 16 Nov 2023 19:43:35 +0530 Subject: [PATCH] feat: Changes to include delivery reports for all channels (#8329) --- .../widgets/conversation/bubble/Actions.vue | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/app/javascript/dashboard/components/widgets/conversation/bubble/Actions.vue b/app/javascript/dashboard/components/widgets/conversation/bubble/Actions.vue index 4ee7aaa9d..416af5d06 100644 --- a/app/javascript/dashboard/components/widgets/conversation/bubble/Actions.vue +++ b/app/javascript/dashboard/components/widgets/conversation/bubble/Actions.vue @@ -192,7 +192,7 @@ export default { if (!this.showStatusIndicators) { return false; } - + // Messages will be marked as sent for the Email channel if they have a source ID. if (this.isAnEmailChannel) { return !!this.sourceId; } @@ -201,11 +201,12 @@ export default { this.isAWhatsAppChannel || this.isATwilioChannel || this.isAFacebookInbox || - this.isASmsInbox + this.isASmsInbox || + this.isATelegramChannel ) { return this.sourceId && this.isSent; } - // There is no source id for the line channel + // All messages will be mark as sent for the Line channel, as there is no source ID. if (this.isALineChannel) { return true; } @@ -216,15 +217,15 @@ export default { if (!this.showStatusIndicators) { return false; } - if ( this.isAWhatsAppChannel || this.isATwilioChannel || - this.isASmsInbox + this.isASmsInbox || + this.isAFacebookInbox ) { return this.sourceId && this.isDelivered; } - // We will consider messages as delivered for web widget inbox and API inbox if they are sent + // All messages marked as delivered for the web widget inbox and API inbox once they are sent. if (this.isAWebWidgetInbox || this.isAPIInbox) { return this.isSent; } @@ -238,12 +239,6 @@ export default { if (!this.showStatusIndicators) { return false; } - - if (this.isAWebWidgetInbox || this.isAPIInbox) { - const { contact_last_seen_at: contactLastSeenAt } = this.currentChat; - return contactLastSeenAt >= this.createdAt; - } - if ( this.isAWhatsAppChannel || this.isATwilioChannel || @@ -252,6 +247,10 @@ export default { return this.sourceId && this.isRead; } + if (this.isAWebWidgetInbox || this.isAPIInbox) { + return this.isRead; + } + return false; }, },