From 49df4425ea193d29099a68115b1c134d24eee6f0 Mon Sep 17 00:00:00 2001 From: Tillmann Baumgart Date: Wed, 16 Dec 2020 22:39:07 +0100 Subject: [PATCH] set closed_at if conversation is closed after reply --- app/Http/Controllers/ConversationsController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Http/Controllers/ConversationsController.php b/app/Http/Controllers/ConversationsController.php index 45ddcbaf..67991727 100644 --- a/app/Http/Controllers/ConversationsController.php +++ b/app/Http/Controllers/ConversationsController.php @@ -648,6 +648,11 @@ class ConversationsController extends Controller $prev_status = $conversation->status; $conversation->status = $request->status; + if (Conversation::STATUS_CLOSED === $conversation->status) { + $conversation->closed_by_user_id = $request->user_id; + $conversation->closed_at = date('Y-m-d H:i:s'); + } + // We need to set state, as it may have been a draft $conversation->state = Conversation::STATE_PUBLISHED; // Set assignee