Skip to content

Commit

Permalink
feat: Add delivery reports for API channel (chatwoot#8116)
Browse files Browse the repository at this point in the history
  • Loading branch information
muhsin-k authored Oct 18, 2023
1 parent eabe548 commit 04c874f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def toggle_typing
def update_last_seen
@conversation.contact_last_seen_at = DateTime.now.utc
@conversation.save!
::Conversations::MarkMessagesAsReadJob.perform_later(@conversation)
head :ok
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ export default {
if (this.isAWhatsAppChannel || this.isATwilioChannel) {
return this.sourceId && this.isDelivered;
}
// We will consider messages as delivered for web widget inbox if they are sent
if (this.isAWebWidgetInbox) {
// We will consider messages as delivered for web widget inbox and API inbox if they are sent
if (this.isAWebWidgetInbox || this.isAPIInbox) {
return this.isSent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@

it 'updates the last seen of the conversation contact' do
contact_last_seen_at = conversation.contact_last_seen_at
expect(Conversations::MarkMessagesAsReadJob).to receive(:perform_later).with(conversation)
post update_last_seen_path

expect(response).to have_http_status(:success)
Expand Down

0 comments on commit 04c874f

Please sign in to comment.