mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-03 16:02:08 +00:00
perf: 仅(群聊)且(是群主或没有群主)才可以@成员以外的人
This commit is contained in:
parent
567a77b0be
commit
5ec56b4a9e
@ -61,10 +61,13 @@ class WebSocketDialogMsgTask extends AbstractTask
|
||||
// 将会话以外的成员加入会话内
|
||||
$userids = $dialog->dialogUser->pluck('userid')->toArray();
|
||||
$diffids = array_values(array_diff($mentions, $userids));
|
||||
if ($diffids && $dialog->type === 'group') {
|
||||
$dialog->joinGroup($diffids, $msg->userid);
|
||||
$dialog->pushMsg("groupJoin", null, $diffids);
|
||||
$userids = array_values(array_unique(array_merge($mentions, $userids)));
|
||||
if ($diffids) {
|
||||
// 仅(群聊)且(是群主或没有群主)才可以@成员以外的人
|
||||
if ($dialog->type === 'group' && in_array($dialog->owner_id, [0, $msg->userid])) {
|
||||
$dialog->joinGroup($diffids, $msg->userid);
|
||||
$dialog->pushMsg("groupJoin", null, $diffids);
|
||||
$userids = array_values(array_unique(array_merge($mentions, $userids)));
|
||||
}
|
||||
}
|
||||
|
||||
// 推送目标①:会话成员/群成员
|
||||
|
||||
@ -1095,7 +1095,10 @@ export default {
|
||||
|
||||
getMoreUser(key, existIds) {
|
||||
return new Promise(resolve => {
|
||||
if (this.taskId > 0 || this.dialogData.type === 'group') {
|
||||
const {owner_id, type} = this.dialogData
|
||||
const permission = type === 'group' && [0, this.userId].includes(owner_id)
|
||||
if (this.taskId > 0 || permission) {
|
||||
console.log(this.dialogData);
|
||||
this.__getMoreTimer && clearTimeout(this.__getMoreTimer)
|
||||
this.__getMoreTimer = setTimeout(_ => {
|
||||
this.$store.dispatch("call", {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user