Commit 617efa86 authored by JC Brand's avatar JC Brand

Use `jabberRoom` attribute to determine if JID is room or not

updates #15
parent 02ce9bbe
......@@ -52,12 +52,20 @@ vim: tabstop=2 shiftwidth=2:
initConverse () {
const component = document.querySelector('ldp-chat');
let auto_join_rooms = [];
let auto_join_private_chats = [];
if (this.resource.jabberRoom) {
auto_join_rooms.push(this.resource.jabberID);
} else {
auto_join_private_chats.push(this.resource.jabberID);
}
converse.initialize({
'debug': (component.dataset.debug === "true"),
'root': this.shadowRoot,
'authentication': component.dataset.authentication,
'auto_login': (component.dataset.autoLogin === "true"),
'auto_join_rooms': [this.resource.jabberID],
'auto_join_rooms': auto_join_rooms,
'auto_join_private_chats': auto_join_private_chats,
'bosh_service_url': component.dataset.boshServiceUrl,
'jid': component.dataset.jid,
'locales_url': component.dataset.localesUrl,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment