From 1b1e1ed5659a748c567d6eeeea44433d37ec23ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 1 Nov 2020 13:25:42 +0100 Subject: [PATCH] Add missing transaction to WhisperCommand --- files/lib/system/command/WhisperCommand.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/files/lib/system/command/WhisperCommand.class.php b/files/lib/system/command/WhisperCommand.class.php index 351f4b6..3918fe5 100644 --- a/files/lib/system/command/WhisperCommand.class.php +++ b/files/lib/system/command/WhisperCommand.class.php @@ -1,11 +1,11 @@ getMessageObjectTypeID('be.bastelstu.chat.messageType.whisper'); $recipient = $this->assertUser($this->assertParameter($parameters, 'username')); $this->setText($this->assertParameter($parameters, 'text')); + + WCF::getDB()->beginTransaction(); $message = (new MessageAction([ ], 'create', [ 'data' => [ 'roomID' => $room->roomID , 'userID' => $user->userID , 'username' => $user->username @@ -79,5 +80,6 @@ class WhisperCommand extends AbstractInputProcessedCommand implements ICommand { 'hasEmbeddedObjects' => 1 ]); } + WCF::getDB()->commitTransaction(); } }