mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-10-31 19:17:48 +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 | ||||
|     @agent = @conversation.assignee | ||||
|  | ||||
|     recap_messages = @conversation.messages.where('created_at < ?', message_queued_time).order(created_at: :asc).last(10) | ||||
|     new_messages = @conversation.messages.where('created_at >= ?', message_queued_time) | ||||
|     recap_messages = @conversation.messages.chat.where('created_at < ?', message_queued_time).last(10) | ||||
|     new_messages = @conversation.messages.chat.where('created_at >= ?', message_queued_time) | ||||
|  | ||||
|     @messages = recap_messages + new_messages | ||||
|     @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 | ||||
|   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) } | ||||
|  | ||||
|   belongs_to :account | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 sony-mathew
					sony-mathew