Skip to content

Commit

Permalink
perf: 优化发送消息接口
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Jan 14, 2024
1 parent 9a69d20 commit 80af981
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/Http/Controllers/Api/DialogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ public function msg__sendtext()
//
$result = [];
$dialogIds = $dialog_ids ? explode(',', $dialog_ids) : [$dialog_id ?: 0];
foreach($dialogIds as $dialog_id) {
foreach ($dialogIds as $dialog_id) {
//
WebSocketDialog::checkDialog($dialog_id);
//
Expand Down Expand Up @@ -919,13 +919,13 @@ public function msg__sendtext()
'ext' => $ext,
];
$result = WebSocketDialogMsg::sendMsg($action, $dialog_id, 'file', $fileData, $user->userid, false, false, $silence);
} else {
$msgData = ['text' => $text];
if ($markdown) {
$msgData['type'] = 'md';
}
$result = WebSocketDialogMsg::sendMsg($action, $dialog_id, 'text', $msgData, $user->userid, false, false, $silence);
}
//
$msgData = ['text' => $text];
if ($markdown) {
$msgData['type'] = 'md';
}
$result = WebSocketDialogMsg::sendMsg($action, $dialog_id, 'text', $msgData, $user->userid, false, false, $silence);
}
return $result;
}
Expand Down

0 comments on commit 80af981

Please sign in to comment.