无法将用户添加到 Quickblox JS 中的现有聊天
Unable to add users to existing chat in Quickblox JS
我已经为 JS 的 QuickBlox 聊天示例添加了一个功能,允许向现有聊天添加新用户
函数 addUsers(){
var curDlgId = currentDialog._id ;
var curDlgName = currentDialog.name;
$('.users_form.active').each(function(index) {
users_ids[index] = $(this).attr('id');
});
QB.chat.dialog.update(curDlgId,{ push_all : {users_ids}}, onAddUsersCompleted);
}
函数 onAddUsersCompleted(error,b,c){
}
但我在 onAddUsersCompleted 回调中收到错误消息:
错误=对象{代码:403,状态:"error",消息:"Forbidden",详细信息:“{"errors":["You don't have appropriate permissions to perform this operation"]}”}
怎么了?
Ostap,请尝试更改
QB.chat.dialog.update(curDlgId,{ push_all : {users_ids}}, onAddUsersCompleted);
到
QB.chat.dialog.update(curDlgId,{ push_all : users_ids}, onAddUsersCompleted);
我已经为 JS 的 QuickBlox 聊天示例添加了一个功能,允许向现有聊天添加新用户
函数 addUsers(){
var curDlgId = currentDialog._id ;
var curDlgName = currentDialog.name;
$('.users_form.active').each(function(index) {
users_ids[index] = $(this).attr('id');
});
QB.chat.dialog.update(curDlgId,{ push_all : {users_ids}}, onAddUsersCompleted);
}
函数 onAddUsersCompleted(error,b,c){
}
但我在 onAddUsersCompleted 回调中收到错误消息:
错误=对象{代码:403,状态:"error",消息:"Forbidden",详细信息:“{"errors":["You don't have appropriate permissions to perform this operation"]}”}
怎么了?
Ostap,请尝试更改 QB.chat.dialog.update(curDlgId,{ push_all : {users_ids}}, onAddUsersCompleted);
到 QB.chat.dialog.update(curDlgId,{ push_all : users_ids}, onAddUsersCompleted);