xmpp - 当 converse 在嵌入模式下初始化为单例时,有没有办法在 conversejs 中不显示邀请弹出窗口?
问题描述
我使用 conversejs 作为客户端来提供嵌入在 html 页面中的多用户聊天。用户可能会被添加到很多组中。当用户在一个群组中聊天并获得加入另一个群组的邀请时,会显示一个弹出窗口以接受邀请,我不希望用户看到该邀请,而是用户应该留在他打开的同一个群组中。
下面给出初始化示例:
converse.initialize({
authentication: 'login',
credentials_url: 'https://myserver.primet.com/chatapi/apiserver/api/chat/autologin/auth?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6ImFQY3R3X29kdlJPb0VOZzNWb09sSWgydGlFcyJ9.eyJhdWQiOiI2YTE1NzNkMS03ZDZjLTRkZGItYjVlYS1hZGQyZWM1MDkzZjEiLCJpc3MiOiJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vZmNlNTAxOTUtMjMxNS00N2FmLWE2ODQtZmY5M',
auto_login: 'true',
bosh_service_url: 'https://myserver.primet.com/chatserver/http-bind/',
jid: ‘james@qachatserver.primet.com',
keepalive: true,
trusted: false,
auto_reconnect: true,
muc_nickname_from_jid: true,
auto_join_rooms: ['deal_909090390898989090909@conference.qachatserver.primet.com'],
auto_focus: false,
locked_muc_nickname: true,
show_desktop_notifications: false,
send_chat_state_notifications: false,
blacklisted_plugins: [
'converse-notification'
],
singleton: true,
muc_show_join_leave: false,
visible_toolbar_buttons: {
call: false,
spoiler: false,
emoji: false,
toggle_occupants: true
},
notify_all_room_messages: false,
notification_delay: 3000,
allow_message_corrections: 'false',
view_mode: 'embedded'
}).then(() => { setTimeout(function(){ var toggleButton = document.getElementsByClassName('toggle-occupants fa fa-angle-double-right')[0]; if (toggleButton) { toggleButton.click(); toggleButton.style.display="none"}},500);})
解决方案
您可以将allow_muc_invitations设置为false
.
推荐阅读
- regex - Postgresql 中的 REGEXP_LIKE
- python-3.x - 为什么我的 PyGame 图像存储在程序本地而不加载?
- android - 为什么我可以在数据更改之前在 onResume() 中调用 notifyItemChanged()?
- javascript - 如何获取输入字段中的最后一个字符/数字?
- python - 如何在该程序中正确实施 try-except ?
- awk - 为什么 awk 中的 asort 会弄乱我数组中的一条记录?
- angular - 如何让 Creative Tim Angular Material Pro 在 JVectorMap 上渲染区域?
- python - 如果条件满足,分配标识符
- android - Mockito - RuntimeException:存根!模拟 RecyclerView.Adapter 时
- voltdb - 搜索 VoltDB ODBC 驱动程序