2021-02-20 22:29:07 +00:00
|
|
|
function inIframe () {
|
|
|
|
try {
|
|
|
|
return window.self !== window.top
|
|
|
|
} catch (e) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-20 19:42:41 +00:00
|
|
|
window.initConverse = function initConverse ({
|
2021-02-20 22:12:12 +00:00
|
|
|
jid,
|
|
|
|
assetsPath,
|
2021-02-20 19:42:41 +00:00
|
|
|
room,
|
2021-02-20 22:12:12 +00:00
|
|
|
boshServiceUrl,
|
|
|
|
websocketServiceUrl
|
2021-02-20 19:42:41 +00:00
|
|
|
}) {
|
|
|
|
window.converse.initialize({
|
2021-02-20 22:12:12 +00:00
|
|
|
assets_path: assetsPath,
|
2021-02-20 19:42:41 +00:00
|
|
|
|
|
|
|
authentication: 'anonymous',
|
|
|
|
auto_login: true,
|
|
|
|
auto_join_rooms: [
|
|
|
|
room
|
|
|
|
],
|
2021-02-21 15:10:52 +00:00
|
|
|
discover_connection_methods: false, // this parameter seems buggy with converseJS 7.0.4
|
2021-02-20 22:12:12 +00:00
|
|
|
bosh_service_url: boshServiceUrl === '' ? undefined : boshServiceUrl,
|
|
|
|
websocket_url: websocketServiceUrl === '' ? undefined : websocketServiceUrl,
|
|
|
|
jid: jid,
|
2021-02-20 19:42:41 +00:00
|
|
|
notify_all_room_messages: [
|
|
|
|
room
|
|
|
|
],
|
|
|
|
singleton: true,
|
|
|
|
auto_focus: false,
|
2021-05-02 12:41:54 +00:00
|
|
|
hide_muc_participants: inIframe(),
|
2021-02-20 19:42:41 +00:00
|
|
|
keepalive: true,
|
|
|
|
play_sounds: false,
|
|
|
|
muc_mention_autocomplete_min_chars: 3,
|
|
|
|
muc_mention_autocomplete_filter: 'contains',
|
|
|
|
modtools_disable_assign: true,
|
|
|
|
muc_disable_slash_commands: [
|
|
|
|
'admin', 'ban', 'clear', 'deop', 'destroy', 'kick',
|
|
|
|
'member', 'modtools', 'mute', 'op', 'owner', 'register',
|
|
|
|
'revoke', 'subject', 'topic', 'voice'
|
|
|
|
],
|
|
|
|
muc_instant_rooms: true,
|
|
|
|
show_client_info: false,
|
|
|
|
allow_adhoc_commands: false,
|
|
|
|
allow_contact_requests: false,
|
|
|
|
show_controlbox_by_default: false,
|
|
|
|
view_mode: 'fullscreen'
|
|
|
|
})
|
|
|
|
}
|