mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-06 05:05:35 +00:00
feat:发送文本消息接口 - 添加群发字段
This commit is contained in:
parent
6870a29ec9
commit
7147db0ef2
@ -718,6 +718,7 @@ class DialogController extends AbstractController
|
||||
}
|
||||
//
|
||||
$dialog_id = intval(Request::input('dialog_id'));
|
||||
$dialog_ids = trim(Request::input('dialog_ids'));
|
||||
$update_id = intval(Request::input('update_id'));
|
||||
$update_mark = !($user->bot && in_array(strtolower(trim(Request::input('update_mark'))), ['no', 'false', '0']));
|
||||
$reply_id = intval(Request::input('reply_id'));
|
||||
@ -725,6 +726,10 @@ class DialogController extends AbstractController
|
||||
$text_type = strtolower(trim(Request::input('text_type')));
|
||||
$silence = in_array(strtolower(trim(Request::input('silence'))), ['yes', 'true', '1']);
|
||||
$markdown = in_array($text_type, ['md', 'markdown']);
|
||||
//
|
||||
$result = [];
|
||||
$dialogIds = $dialog_ids ? explode(',', $dialog_ids) : [$dialog_id];
|
||||
foreach($dialogIds as $dialog_id) {
|
||||
//
|
||||
WebSocketDialog::checkDialog($dialog_id);
|
||||
//
|
||||
@ -770,14 +775,16 @@ class DialogController extends AbstractController
|
||||
'height' => -1,
|
||||
'ext' => $ext,
|
||||
];
|
||||
return 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);
|
||||
}
|
||||
//
|
||||
$msgData = ['text' => $text];
|
||||
if ($markdown) {
|
||||
$msgData['type'] = 'md';
|
||||
}
|
||||
return WebSocketDialogMsg::sendMsg($action, $dialog_id, 'text', $msgData, $user->userid, false, false, $silence);
|
||||
$result = WebSocketDialogMsg::sendMsg($action, $dialog_id, 'text', $msgData, $user->userid, false, false, $silence);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user