1
0
mirror of https://github.com/freescout-helpdesk/freescout.git synced 2024-11-24 03:12:46 +01:00

In SendReplyToCustomer listener do not include messages added after the event has been fired - closes #2462

This commit is contained in:
FreeScout 2022-12-15 22:32:36 -08:00
parent 5271ba6fbf
commit ac19634172

View File

@ -35,6 +35,15 @@ class SendReplyToCustomer
return;
}
// Remove threads added after this event had fired.
foreach ($replies as $i => $reply) {
if ($reply->id == $event->thread->id) {
break;
} else {
$replies->forget($i);
}
}
// Chat conversation.
if ($conversation->isChat()) {
\Helper::backgroundAction('chat_conversation.send_reply', [$conversation, $replies, $conversation->customer], now()->addSeconds(Conversation::UNDO_TIMOUT));