mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 03:57:52 +00:00
Bug: Fixed private note being sent to customer (#837)
This commit is contained in:
@@ -9,8 +9,8 @@ class ConversationReplyMailer < ApplicationMailer
|
|||||||
@contact = @conversation.contact
|
@contact = @conversation.contact
|
||||||
@agent = @conversation.assignee
|
@agent = @conversation.assignee
|
||||||
|
|
||||||
recap_messages = @conversation.messages.where('created_at < ?', message_queued_time).order(created_at: :asc).last(10)
|
recap_messages = @conversation.messages.chat.where('created_at < ?', message_queued_time).last(10)
|
||||||
new_messages = @conversation.messages.where('created_at >= ?', message_queued_time)
|
new_messages = @conversation.messages.chat.where('created_at >= ?', message_queued_time)
|
||||||
|
|
||||||
@messages = recap_messages + new_messages
|
@messages = recap_messages + new_messages
|
||||||
@messages = @messages.select(&:reportable?)
|
@messages = @messages.select(&:reportable?)
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class Message < ApplicationRecord
|
|||||||
|
|
||||||
# .succ is a hack to avoid https://makandracards.com/makandra/1057-why-two-ruby-time-objects-are-not-equal-although-they-appear-to-be
|
# .succ is a hack to avoid https://makandracards.com/makandra/1057-why-two-ruby-time-objects-are-not-equal-although-they-appear-to-be
|
||||||
scope :unread_since, ->(datetime) { where('EXTRACT(EPOCH FROM created_at) > (?)', datetime.to_i.succ) }
|
scope :unread_since, ->(datetime) { where('EXTRACT(EPOCH FROM created_at) > (?)', datetime.to_i.succ) }
|
||||||
scope :chat, -> { where.not(message_type: :activity).where.not(private: true) }
|
scope :chat, -> { where.not(message_type: :activity).where(private: false) }
|
||||||
default_scope { order(created_at: :asc) }
|
default_scope { order(created_at: :asc) }
|
||||||
|
|
||||||
belongs_to :account
|
belongs_to :account
|
||||||
|
|||||||
Reference in New Issue
Block a user