Skip to content

Commit

Permalink
fix(ChatManager): Add missing verbs
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <kate@provokateurin.de>
  • Loading branch information
provokateurin committed Mar 3, 2024
1 parent 48f4235 commit 7aae2c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lib/Chat/ChatManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions lib/Chat/Parser/SystemMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 7aae2c5

Please sign in to comment.