Commit 3011461f authored by andreabenini's avatar andreabenini

Update converse.js

parent d715b3d3
...@@ -304,6 +304,7 @@ ...@@ -304,6 +304,7 @@
auto_login: false, // Currently only used in connection with anonymous login auto_login: false, // Currently only used in connection with anonymous login
auto_reconnect: false, auto_reconnect: false,
auto_subscribe: false, auto_subscribe: false,
auto_join_on_invite: false, // Auto-join chatroom on invite
bosh_service_url: undefined, // The BOSH connection manager URL. bosh_service_url: undefined, // The BOSH connection manager URL.
cache_otr_key: false, cache_otr_key: false,
csi_waiting_time: 0, // Support for XEP-0352. Seconds before client is considered idle and CSI is sent out. csi_waiting_time: 0, // Support for XEP-0352. Seconds before client is considered idle and CSI is sent out.
...@@ -3633,15 +3634,19 @@ ...@@ -3633,15 +3634,19 @@
contact = converse.roster.get(from), contact = converse.roster.get(from),
result; result;
if (!reason) { if (converse.auto_join_on_invite) {
result = confirm( result = true;
__(___("%1$s has invited you to join a chat room: %2$s"), contact.get('fullname'), room_jid)
);
} else { } else {
result = confirm( contact = contact? contact.get('fullname'): Strophe.getNodeFromJid(from); // Invite request might come from someone not your roster list
__(___('%1$s has invited you to join a chat room: %2$s, and left the following reason: "%3$s"'), if (!reason) {
contact.get('fullname'), room_jid, reason) result = confirm(
); __(___("%1$s has invited you to join a chat room: %2$s"), contact, room_jid)
);
} else {
result = confirm(
__(___('%1$s has invited you to join a chat room: %2$s, and left the following reason: "%3$s"'), contact, room_jid, reason)
);
}
} }
if (result === true) { if (result === true) {
var chatroom = converse.chatboxviews.showChat({ var chatroom = converse.chatboxviews.showChat({
......
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