feat: 添加投票功能 - 100%

This commit is contained in:
weifashi
2023-12-08 18:05:40 +08:00
parent e9fd223808
commit 9a942c483d
15 changed files with 574 additions and 120 deletions

View File

@@ -522,6 +522,7 @@ class WebSocketDialogMsg extends AbstractModel
switch ($data['type']) {
case 'text':
case 'word-chain':
case 'vote':
return $this->previewTextMsg($data['msg']['text'], $preserveHtml);
case 'record':
return "[语音]";
@@ -860,10 +861,10 @@ class WebSocketDialogMsg extends AbstractModel
if (empty($dialogMsg)) {
throw new ApiException('消息不存在');
}
if ($dialogMsg->type !== 'text') {
if ($dialogMsg->type !== 'text' && $dialogMsg->type !== 'vote') {
throw new ApiException('此消息不支持此操作');
}
if ($dialogMsg->userid != $sender) {
if ($dialogMsg->userid != $sender && $dialogMsg->type !== 'vote') {
throw new ApiException('仅支持修改自己的消息');
}
//