From 7aae2c5c6965e1fd9b22ac627231b7663c2c7bd1 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Sun, 3 Mar 2024 09:14:27 +0100 Subject: [PATCH] fix(ChatManager): Add missing verbs Signed-off-by: provokateurin --- lib/Chat/ChatManager.php | 3 +++ lib/Chat/Parser/SystemMessage.php | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/Chat/ChatManager.php b/lib/Chat/ChatManager.php index fc145c8858d..a4e7ee63d55 100644 --- a/lib/Chat/ChatManager.php +++ b/lib/Chat/ChatManager.php @@ -84,6 +84,9 @@ class ChatManager { public const VERB_MESSAGE_DELETED = 'comment_deleted'; public const VERB_REACTION = 'reaction'; public const VERB_REACTION_DELETED = 'reaction_deleted'; + public const VERB_VOICE_MESSAGE = 'voice-message'; + public const VERB_RECORD_AUDIO = 'record-audio'; + public const VERB_RECORD_VIDEO = 'record-video'; protected ICache $cache; protected ICache $unreadCountCache; diff --git a/lib/Chat/Parser/SystemMessage.php b/lib/Chat/Parser/SystemMessage.php index d7f48e61106..33a38f0d10c 100644 --- a/lib/Chat/Parser/SystemMessage.php +++ b/lib/Chat/Parser/SystemMessage.php @@ -490,11 +490,11 @@ protected function parseMessage(Message $chatMessage): void { $metaData = $parameters['metaData'] ?? []; if (isset($metaData['messageType'])) { if ($metaData['messageType'] === 'voice-message') { - $chatMessage->setMessageType('voice-message'); + $chatMessage->setMessageType(ChatManager::VERB_VOICE_MESSAGE); } elseif ($metaData['messageType'] === 'record-audio') { - $chatMessage->setMessageType('record-audio'); + $chatMessage->setMessageType(ChatManager::VERB_RECORD_AUDIO); } elseif ($metaData['messageType'] === 'record-video') { - $chatMessage->setMessageType('record-video'); + $chatMessage->setMessageType(ChatManager::VERB_RECORD_VIDEO); } else { $chatMessage->setMessageType(ChatManager::VERB_MESSAGE); }