chore: Refactor MarkMessagesAsReadJob based on conversation id and time stamp (#8217)
- Mark all messages as read by providing the conversation ID and timestamp. - For Instagram, ensure all previous messages that weren't marked as failed are now marked as read. This is because the read events are only triggered for the most recent message and not for any previous ones.
This commit is contained in:
@@ -4,12 +4,7 @@ class Instagram::ReadStatusService
|
||||
def perform
|
||||
return if instagram_channel.blank?
|
||||
|
||||
process_status if message.present?
|
||||
end
|
||||
|
||||
def process_status
|
||||
@message.status = 'read'
|
||||
@message.save!
|
||||
::Conversations::MarkMessagesAsReadJob.perform_later(message.conversation.id, message.created_at) if message.present?
|
||||
end
|
||||
|
||||
def instagram_id
|
||||
|
||||
Reference in New Issue
Block a user