mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-17 19:23:26 +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();
|
$userids = $dialog->dialogUser->pluck('userid')->toArray();
|
||||||
$diffids = array_values(array_diff($mentions, $userids));
|
$diffids = array_values(array_diff($mentions, $userids));
|
||||||
if ($diffids && $dialog->type === 'group') {
|
if ($diffids) {
|
||||||
$dialog->joinGroup($diffids, $msg->userid);
|
// 仅(群聊)且(是群主或没有群主)才可以@成员以外的人
|
||||||
$dialog->pushMsg("groupJoin", null, $diffids);
|
if ($dialog->type === 'group' && in_array($dialog->owner_id, [0, $msg->userid])) {
|
||||||
$userids = array_values(array_unique(array_merge($mentions, $userids)));
|
$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) {
|
getMoreUser(key, existIds) {
|
||||||
return new Promise(resolve => {
|
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 && clearTimeout(this.__getMoreTimer)
|
||||||
this.__getMoreTimer = setTimeout(_ => {
|
this.__getMoreTimer = setTimeout(_ => {
|
||||||
this.$store.dispatch("call", {
|
this.$store.dispatch("call", {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user