Search code examples
xmppejabberdconverse.js

Is there a way to not show invite popups in conversejs when converse is initialized as singleton in embeded mode?


I am using conversejs as client for providing a multiuser chat embeded in an html page. User might be added to a lot of groups. When a user is chating in a group and gets invite to join another group a popup is shown to accept the invite, i do not want the user to see that invitation and rather user should stay in the same group that he has opened.

Given bellow is the initialization sample :

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);})

Solution

  • You can set allow_muc_invitations to false.