feat: Changes to include delivery reports for all channels (#8329)

This commit is contained in:
Muhsin Keloth
2023-11-16 19:43:35 +05:30
committed by GitHub
parent 5f503b1a57
commit 04dd65687b

View File

@@ -192,7 +192,7 @@ export default {
if (!this.showStatusIndicators) { if (!this.showStatusIndicators) {
return false; return false;
} }
// Messages will be marked as sent for the Email channel if they have a source ID.
if (this.isAnEmailChannel) { if (this.isAnEmailChannel) {
return !!this.sourceId; return !!this.sourceId;
} }
@@ -201,11 +201,12 @@ export default {
this.isAWhatsAppChannel || this.isAWhatsAppChannel ||
this.isATwilioChannel || this.isATwilioChannel ||
this.isAFacebookInbox || this.isAFacebookInbox ||
this.isASmsInbox this.isASmsInbox ||
this.isATelegramChannel
) { ) {
return this.sourceId && this.isSent; 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) { if (this.isALineChannel) {
return true; return true;
} }
@@ -216,15 +217,15 @@ export default {
if (!this.showStatusIndicators) { if (!this.showStatusIndicators) {
return false; return false;
} }
if ( if (
this.isAWhatsAppChannel || this.isAWhatsAppChannel ||
this.isATwilioChannel || this.isATwilioChannel ||
this.isASmsInbox this.isASmsInbox ||
this.isAFacebookInbox
) { ) {
return this.sourceId && this.isDelivered; 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) { if (this.isAWebWidgetInbox || this.isAPIInbox) {
return this.isSent; return this.isSent;
} }
@@ -238,12 +239,6 @@ export default {
if (!this.showStatusIndicators) { if (!this.showStatusIndicators) {
return false; return false;
} }
if (this.isAWebWidgetInbox || this.isAPIInbox) {
const { contact_last_seen_at: contactLastSeenAt } = this.currentChat;
return contactLastSeenAt >= this.createdAt;
}
if ( if (
this.isAWhatsAppChannel || this.isAWhatsAppChannel ||
this.isATwilioChannel || this.isATwilioChannel ||
@@ -252,6 +247,10 @@ export default {
return this.sourceId && this.isRead; return this.sourceId && this.isRead;
} }
if (this.isAWebWidgetInbox || this.isAPIInbox) {
return this.isRead;
}
return false; return false;
}, },
}, },