mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 19:35:50 +00:00
perf: 优化发送消息接口
This commit is contained in:
parent
9a69d20949
commit
80af98111b
@ -872,7 +872,7 @@ class DialogController extends AbstractController
|
|||||||
//
|
//
|
||||||
$result = [];
|
$result = [];
|
||||||
$dialogIds = $dialog_ids ? explode(',', $dialog_ids) : [$dialog_id ?: 0];
|
$dialogIds = $dialog_ids ? explode(',', $dialog_ids) : [$dialog_id ?: 0];
|
||||||
foreach($dialogIds as $dialog_id) {
|
foreach ($dialogIds as $dialog_id) {
|
||||||
//
|
//
|
||||||
WebSocketDialog::checkDialog($dialog_id);
|
WebSocketDialog::checkDialog($dialog_id);
|
||||||
//
|
//
|
||||||
@ -919,13 +919,13 @@ class DialogController extends AbstractController
|
|||||||
'ext' => $ext,
|
'ext' => $ext,
|
||||||
];
|
];
|
||||||
$result = WebSocketDialogMsg::sendMsg($action, $dialog_id, 'file', $fileData, $user->userid, false, false, $silence);
|
$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;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user