Merge pull request #526 from andreabenini/auto_join_on_invite-patch-1

Auto join on invite patch 1 (auto_join_on_invite new parameter)
This commit is contained in:
JC Brand 2015-12-04 11:30:19 +01:00
commit 600c83a493
3 changed files with 26 additions and 8 deletions

View File

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

View File

@ -1,5 +1,10 @@
# Changelog
## 0.10.1 (2015-12-02)
- #524 Added auto_join_on_invite parameter for automatically joining chatrooms. [ben]
- FIX: A chatroom invite might come from someone not in your roster list. [ben]
## 0.10.0 (2015-11-05)
**Note:**
@ -16,6 +21,7 @@
- Add the ability to also drag-resize chat boxes horizontally. [jcbrand]
- Updated Sass files and created a new style. [jcbrand]
## 0.9.6 (2015-10-12)
- Bugfix. Spinner doesn't disappear when scrolling up (when server doesn't support XEP-0313). [jcbrand]

View File

@ -244,6 +244,13 @@ auto_subscribe
If true, the user will automatically subscribe back to any contact requests.
auto_join_on_invite
--------------
* Default: ``false``
If true, the user will automatically join a chatroom on invite without any confirm.
.. _`bosh-service-url`:
bosh_service_url