Merge branch 'master' into converse-omemo

This commit is contained in:
JC Brand 2018-07-22 12:15:16 +02:00
commit ce447e4035
54 changed files with 16545 additions and 15217 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -88,7 +88,7 @@
checkForReservedNick () {
/* Check if the user has a bookmark with a saved nickanme
* for this room, and if so use it.
* for this groupchat, and if so use it.
* Otherwise delegate to the super method.
*/
const { _converse } = this.__super__;
@ -116,7 +116,7 @@
},
setBookmarkState () {
/* Set whether the room is bookmarked or not.
/* Set whether the groupchat is bookmarked or not.
*/
const { _converse } = this.__super__;
if (!_.isUndefined(_converse.bookmarks)) {
@ -257,9 +257,9 @@
openBookmarkedRoom (bookmark) {
if (bookmark.get('autojoin')) {
const room = _converse.api.rooms.create(bookmark.get('jid'), bookmark.get('nick'));
if (!room.get('hidden')) {
room.trigger('show');
const groupchat = _converse.api.rooms.create(bookmark.get('jid'), bookmark.get('nick'));
if (!groupchat.get('hidden')) {
groupchat.trigger('show');
}
}
return bookmark;
@ -344,16 +344,16 @@
},
markRoomAsBookmarked (bookmark) {
const room = _converse.chatboxes.get(bookmark.get('jid'));
if (!_.isUndefined(room)) {
room.save('bookmarked', true);
const groupchat = _converse.chatboxes.get(bookmark.get('jid'));
if (!_.isUndefined(groupchat)) {
groupchat.save('bookmarked', true);
}
},
markRoomAsUnbookmarked (bookmark) {
const room = _converse.chatboxes.get(bookmark.get('jid'));
if (!_.isUndefined(room)) {
room.save('bookmarked', false);
const groupchat = _converse.chatboxes.get(bookmark.get('jid'));
if (!_.isUndefined(groupchat)) {
groupchat.save('bookmarked', false);
}
},

View File

@ -176,25 +176,25 @@
/* http://xmpp.org/extensions/xep-0045.html
* ----------------------------------------
* 100 message Entering a room Inform user that any occupant is allowed to see the user's full JID
* 101 message (out of band) Affiliation change Inform user that his or her affiliation changed while not in the room
* 102 message Configuration change Inform occupants that room now shows unavailable members
* 103 message Configuration change Inform occupants that room now does not show unavailable members
* 104 message Configuration change Inform occupants that a non-privacy-related room configuration change has occurred
* 110 presence Any room presence Inform user that presence refers to one of its own room occupants
* 170 message or initial presence Configuration change Inform occupants that room logging is now enabled
* 171 message Configuration change Inform occupants that room logging is now disabled
* 172 message Configuration change Inform occupants that the room is now non-anonymous
* 173 message Configuration change Inform occupants that the room is now semi-anonymous
* 174 message Configuration change Inform occupants that the room is now fully-anonymous
* 201 presence Entering a room Inform user that a new room has been created
* 210 presence Entering a room Inform user that the service has assigned or modified the occupant's roomnick
* 301 presence Removal from room Inform user that he or she has been banned from the room
* 303 presence Exiting a room Inform all occupants of new room nickname
* 307 presence Removal from room Inform user that he or she has been kicked from the room
* 321 presence Removal from room Inform user that he or she is being removed from the room because of an affiliation change
* 322 presence Removal from room Inform user that he or she is being removed from the room because the room has been changed to members-only and the user is not a member
* 332 presence Removal from room Inform user that he or she is being removed from the room because of a system shutdown
* 100 message Entering a groupchat Inform user that any occupant is allowed to see the user's full JID
* 101 message (out of band) Affiliation change Inform user that his or her affiliation changed while not in the groupchat
* 102 message Configuration change Inform occupants that groupchat now shows unavailable members
* 103 message Configuration change Inform occupants that groupchat now does not show unavailable members
* 104 message Configuration change Inform occupants that a non-privacy-related groupchat configuration change has occurred
* 110 presence Any groupchat presence Inform user that presence refers to one of its own groupchat occupants
* 170 message or initial presence Configuration change Inform occupants that groupchat logging is now enabled
* 171 message Configuration change Inform occupants that groupchat logging is now disabled
* 172 message Configuration change Inform occupants that the groupchat is now non-anonymous
* 173 message Configuration change Inform occupants that the groupchat is now semi-anonymous
* 174 message Configuration change Inform occupants that the groupchat is now fully-anonymous
* 201 presence Entering a groupchat Inform user that a new groupchat has been created
* 210 presence Entering a groupchat Inform user that the service has assigned or modified the occupant's roomnick
* 301 presence Removal from groupchat Inform user that he or she has been banned from the groupchat
* 303 presence Exiting a groupchat Inform all occupants of new groupchat nickname
* 307 presence Removal from groupchat Inform user that he or she has been kicked from the groupchat
* 321 presence Removal from groupchat Inform user that he or she is being removed from the groupchat because of an affiliation change
* 322 presence Removal from groupchat Inform user that he or she is being removed from the groupchat because the groupchat has been changed to members-only and the user is not a member
* 332 presence Removal from groupchat Inform user that he or she is being removed from the groupchat because of a system shutdown
*/
_converse.muc = {
info_messages: {
@ -244,12 +244,12 @@
function insertRoomInfo (el, stanza) {
/* Insert room info (based on returned #disco IQ stanza)
/* Insert groupchat info (based on returned #disco IQ stanza)
*
* Parameters:
* (HTMLElement) el: The HTML DOM element that should
* contain the info.
* (XMLElement) stanza: The IQ stanza containing the room
* (XMLElement) stanza: The IQ stanza containing the groupchat
* info.
*/
// All MUC features found here: http://xmpp.org/registrar/disco-features.html
@ -291,7 +291,7 @@
}
function toggleRoomInfo (ev) {
/* Show/hide extra information about a room in a listing. */
/* Show/hide extra information about a groupchat in a listing. */
const parent_el = u.ancestor(ev.target, '.room-item'),
div_el = parent_el.querySelector('div.room-info');
if (div_el) {
@ -325,7 +325,7 @@
return tpl_list_chatrooms_modal(_.extend(this.model.toJSON(), {
'heading_list_chatrooms': __('Query for Groupchats'),
'label_server_address': __('Server address'),
'label_query': __('Show rooms'),
'label_query': __('Show groupchats'),
'server_placeholder': __('conference.example.org')
}));
},
@ -355,15 +355,15 @@
}
},
roomStanzaItemToHTMLElement (room) {
roomStanzaItemToHTMLElement (groupchat) {
const name = Strophe.unescapeNode(
room.getAttribute('name') ||
room.getAttribute('jid')
groupchat.getAttribute('name') ||
groupchat.getAttribute('jid')
);
const div = document.createElement('div');
div.innerHTML = tpl_room_item({
'name': Strophe.xmlunescape(name),
'jid': room.getAttribute('jid'),
'jid': groupchat.getAttribute('jid'),
'open_title': __('Click to open this groupchat'),
'info_title': __('Show more information on this groupchat')
});
@ -379,7 +379,7 @@
informNoRoomsFound () {
const chatrooms_el = this.el.querySelector('.available-chatrooms');
chatrooms_el.innerHTML = tpl_rooms_results({
'feedback_text': __('No rooms found')
'feedback_text': __('No groupchats found')
});
const input_el = this.el.querySelector('input[name="server"]');
input_el.classList.remove('hidden')
@ -388,7 +388,7 @@
onRoomsFound (iq) {
/* Handle the IQ stanza returned from the server, containing
* all its public rooms.
* all its public groupchats.
*/
const available_chatrooms = this.el.querySelector('.available-chatrooms');
this.rooms = iq.querySelectorAll('query item');
@ -396,7 +396,7 @@
// For translators: %1$s is a variable and will be
// replaced with the XMPP server name
available_chatrooms.innerHTML = tpl_rooms_results({
'feedback_text': __('Rooms found:')
'feedback_text': __('groupchats found:')
});
const fragment = document.createDocumentFragment();
const children = _.reject(_.map(this.rooms, this.roomStanzaItemToHTMLElement), _.isNil)
@ -410,7 +410,7 @@
},
updateRoomsList () {
/* Send an IQ stanza to the server asking for all rooms
/* Send an IQ stanza to the server asking for all groupchats
*/
_converse.connection.sendIQ(
$iq({
@ -507,7 +507,7 @@
_converse.ChatRoomView = _converse.ChatBoxView.extend({
/* Backbone.NativeView which renders a chat room, based upon the view
/* Backbone.NativeView which renders a groupchat, based upon the view
* for normal one-on-one chat boxes.
*/
length: 300,
@ -596,12 +596,12 @@
},
renderHeading () {
/* Render the heading UI of the chat room. */
/* Render the heading UI of the groupchat. */
this.el.querySelector('.chat-head-chatroom').innerHTML = this.generateHeadingHTML();
},
renderChatArea () {
/* Render the UI container in which chat room messages will appear.
/* Render the UI container in which groupchat messages will appear.
*/
if (_.isNull(this.el.querySelector('.chat-area'))) {
const container_el = this.el.querySelector('.chatroom-body');
@ -719,7 +719,7 @@
},
close (ev) {
/* Close this chat box, which implies leaving the room as
/* Close this chat box, which implies leaving the groupchat as
* well.
*/
this.hide();
@ -799,15 +799,15 @@
}
},
modifyRole(room, nick, role, reason, onSuccess, onError) {
modifyRole(groupchat, nick, role, reason, onSuccess, onError) {
const item = $build("item", {nick, role});
const iq = $iq({to: room, type: "set"}).c("query", {xmlns: Strophe.NS.MUC_ADMIN}).cnode(item.node);
const iq = $iq({to: groupchat, type: "set"}).c("query", {xmlns: Strophe.NS.MUC_ADMIN}).cnode(item.node);
if (reason !== null) { iq.c("reason", reason); }
return _converse.connection.sendIQ(iq, onSuccess, onError);
},
validateRoleChangeCommand (command, args) {
/* Check that a command to change a chat room user's role or
/* Check that a command to change a groupchat user's role or
* affiliation has anough arguments.
*/
// TODO check if first argument is valid
@ -967,7 +967,7 @@
registerHandlers () {
/* Register presence and message handlers for this chat
* room
* groupchat
*/
// XXX: Ideally this can be refactored out so that we don't
// need to do stanza processing inside the views in this
@ -1007,12 +1007,12 @@
},
join (nick, password) {
/* Join the chat room.
/* Join the groupchat.
*
* Parameters:
* (String) nick: The user's nickname
* (String) password: Optional password, if required by
* the room.
* the groupchat.
*/
if (!nick && !this.model.get('nick')) {
this.checkForReservedNick();
@ -1024,13 +1024,13 @@
renderConfigurationForm (stanza) {
/* Renders a form given an IQ stanza containing the current
* room configuration.
* groupchat configuration.
*
* Returns a promise which resolves once the user has
* either submitted the form, or canceled it.
*
* Parameters:
* (XMLElement) stanza: The IQ stanza containing the room
* (XMLElement) stanza: The IQ stanza containing the groupchat
* config.
*/
const container_el = this.el.querySelector('.chatroom-body');
@ -1090,7 +1090,7 @@
},
getAndRenderConfigurationForm (ev) {
/* Start the process of configuring a chat room, either by
/* Start the process of configuring a groupchat, either by
* rendering a configuration form, or by auto-configuring
* based on the "roomconfig" data stored on the
* Backbone.Model.
@ -1112,7 +1112,7 @@
submitNickname (ev) {
/* Get the nickname value from the form and then join the
* chat room with it.
* groupchat with it.
*/
ev.preventDefault();
const nick_el = ev.target.nick;
@ -1130,7 +1130,7 @@
checkForReservedNick () {
/* User service-discovery to ask the XMPP server whether
* this user has a reserved nickname for this room.
* this user has a reserved nickname for this groupchat.
* If so, we'll use that, otherwise we render the nickname form.
*/
this.showSpinner();
@ -1144,7 +1144,7 @@
/* We've received an IQ response from the server which
* might contain the user's reserved nickname.
* If no nickname is found we either render a form for
* them to specify one, or we try to join the room with the
* them to specify one, or we try to join the groupchat with the
* node of the user's JID.
*
* Parameters:
@ -1491,7 +1491,7 @@
},
showErrorMessageFromPresence (presence) {
// We didn't enter the room, so we must remove it from the MUC add-on
// We didn't enter the groupchat, so we must remove it from the MUC add-on
const error = presence.querySelector('error');
if (error.getAttribute('type') === 'auth') {
if (!_.isNull(error.querySelector('not-authorized'))) {
@ -1507,7 +1507,7 @@
}
} else if (error.getAttribute('type') === 'cancel') {
if (!_.isNull(error.querySelector('not-allowed'))) {
this.showDisconnectMessages(__('You are not allowed to create new rooms.'));
this.showDisconnectMessages(__('You are not allowed to create new groupchats.'));
} else if (!_.isNull(error.querySelector('not-acceptable'))) {
this.showDisconnectMessages(__("Your nickname doesn't conform to this groupchat's policies."));
} else if (!_.isNull(error.querySelector('conflict'))) {
@ -1528,7 +1528,7 @@
},
renderAfterTransition () {
/* Rerender the room after some kind of transition. For
/* Rerender the groupchat after some kind of transition. For
* example after the spinner has been removed or after a
* form has been submitted and removed.
*/
@ -1606,8 +1606,8 @@
render () {
this.el.innerHTML = tpl_room_panel({
'heading_chatrooms': __('Groupchats'),
'title_new_room': __('Add a new room'),
'title_list_rooms': __('Query for rooms')
'title_new_room': __('Add a new groupchat'),
'title_list_rooms': __('Query for groupchats')
});
return this;
},
@ -1783,7 +1783,7 @@
promptForInvite (suggestion) {
const reason = prompt(
__('You are about to invite %1$s to the chat room "%2$s". '+
__('You are about to invite %1$s to the groupchat "%2$s". '+
'You may optionally include a message, explaining the reason for the invitation.',
suggestion.text.label, this.model.get('id'))
);
@ -1854,7 +1854,7 @@
function setMUCDomainFromDisco (controlboxview) {
/* Check whether service discovery for the user's domain
* returned MUC information and use that to automatically
* set the MUC domain for the "Rooms" panel of the controlbox.
* set the MUC domain in the "Add groupchat" modal.
*/
function featureAdded (feature) {
if (feature.get('var') === Strophe.NS.MUC &&
@ -1899,7 +1899,7 @@
function reconnectToChatRooms () {
/* Upon a reconnection event from converse, join again
* all the open chat rooms.
* all the open groupchats.
*/
_converse.chatboxviews.each(function (view) {
if (view.model.get('type') === converse.CHATROOMS_TYPE) {

View File

@ -77,9 +77,9 @@
// New functions which don't exist yet can also be added.
tearDown () {
const rooms = this.chatboxes.where({'type': converse.CHATROOMS_TYPE});
_.each(rooms, function (room) {
u.safeSave(room, {'connection_status': converse.ROOMSTATUS.DISCONNECTED});
const groupchats = this.chatboxes.where({'type': converse.CHATROOMS_TYPE});
_.each(groupchats, function (groupchat) {
u.safeSave(groupchat, {'connection_status': converse.ROOMSTATUS.DISCONNECTED});
});
this.__super__.tearDown.call(this, arguments);
},
@ -139,7 +139,7 @@
_converse.openChatRoom = function (jid, settings, bring_to_foreground) {
/* Opens a chat room, making sure that certain attributes
/* Opens a groupchat, making sure that certain attributes
* are correct, for example that the "type" is set to
* "chatroom".
*/
@ -195,7 +195,7 @@
registerHandlers () {
/* Register presence and message handlers for this chat
* room
* groupchat
*/
const room_jid = this.get('jid');
this.removeHandlers();
@ -218,7 +218,7 @@
removeHandlers () {
/* Remove the presence and message handlers that were
* registered for this chat room.
* registered for this groupchat.
*/
if (this.message_handler) {
_converse.connection.deleteHandler(this.message_handler);
@ -251,19 +251,19 @@
},
join (nick, password) {
/* Join the chat room.
/* Join the groupchat.
*
* Parameters:
* (String) nick: The user's nickname
* (String) password: Optional password, if required by
* the room.
* the groupchat.
*/
nick = nick ? nick : this.get('nick');
if (!nick) {
throw new TypeError('join: You need to provide a valid nickname');
}
if (this.get('connection_status') === converse.ROOMSTATUS.ENTERED) {
// We have restored a chat room from session storage,
// We have restored a groupchat from session storage,
// so we don't send out a presence stanza again.
return this;
}
@ -281,7 +281,7 @@
},
leave (exit_msg) {
/* Leave the chat room.
/* Leave the groupchat.
*
* Parameters:
* (String) exit_msg: Optional message to indicate your
@ -323,7 +323,7 @@
},
getRoomFeatures () {
/* Fetch the room disco info, parse it and then save it.
/* Fetch the groupchat disco info, parse it and then save it.
*/
return new Promise((resolve, reject) => {
_converse.api.disco.info(this.get('jid'), null)
@ -331,7 +331,7 @@
this.parseRoomFeatures(stanza);
resolve()
}).catch((err) => {
_converse.log("Could not parse the room features", Strophe.LogLevel.WARN);
_converse.log("Could not parse the groupchat features", Strophe.LogLevel.WARN);
_converse.log(err, Strophe.LogLevel.WARN);
reject(err);
});
@ -340,20 +340,20 @@
getRoomJIDAndNick (nick) {
/* Utility method to construct the JID for the current user
* as occupant of the room.
* as occupant of the groupchat.
*
* This is the room JID, with the user's nick added at the
* This is the groupchat JID, with the user's nick added at the
* end.
*
* For example: room@conference.example.org/nickname
* For example: groupchat@conference.example.org/nickname
*/
if (nick) {
this.save({'nick': nick});
} else {
nick = this.get('nick');
}
const room = this.get('jid');
const jid = Strophe.getBareJidFromJid(room);
const groupchat = this.get('jid');
const jid = Strophe.getBareJidFromJid(groupchat);
return jid + (nick !== null ? `/${nick}` : "");
},
@ -386,7 +386,7 @@
* (String) reason - Optional reason for the invitation
*/
if (this.get('membersonly')) {
// When inviting to a members-only room, we first add
// When inviting to a members-only groupchat, we first add
// the person to the member list by giving them an
// affiliation of 'member' (if they're not affiliated
// already), otherwise they won't be able to join.
@ -419,7 +419,7 @@
},
parseRoomFeatures (iq) {
/* Parses an IQ stanza containing the room's features.
/* Parses an IQ stanza containing the groupchat's features.
*
* See http://xmpp.org/extensions/xep-0045.html#disco-roominfo
*
@ -459,7 +459,7 @@
requestMemberList (affiliation) {
/* Send an IQ stanza to the server, asking it for the
* member-list of this room.
* member-list of this groupchat.
*
* See: http://xmpp.org/extensions/xep-0045.html#modifymember
*
@ -513,7 +513,7 @@
},
saveConfiguration (form) {
/* Submit the room configuration form by sending an IQ
/* Submit the groupchat configuration form by sending an IQ
* stanza to the server.
*
* Returns a promise which resolves once the XMPP server
@ -532,7 +532,7 @@
},
autoConfigureChatRoom () {
/* Automatically configure room based on this model's
/* Automatically configure groupchat based on this model's
* 'roomconfig' data.
*
* Returns a promise which resolves once a response IQ has
@ -573,7 +573,7 @@
},
fetchRoomConfiguration () {
/* Send an IQ stanza to fetch the room configuration data.
/* Send an IQ stanza to fetch the groupchat configuration data.
* Returns a promise which resolves once the response IQ
* has been received.
*/
@ -590,17 +590,17 @@
},
sendConfiguration (config, callback, errback) {
/* Send an IQ stanza with the room configuration.
/* Send an IQ stanza with the groupchat configuration.
*
* Parameters:
* (Array) config: The room configuration
* (Array) config: The groupchat configuration
* (Function) callback: Callback upon succesful IQ response
* The first parameter passed in is IQ containing the
* room configuration.
* groupchat configuration.
* The second is the response IQ from the server.
* (Function) errback: Callback upon error IQ response
* The first parameter passed in is IQ containing the
* room configuration.
* groupchat configuration.
* The second is the response IQ from the server.
*/
const iq = $iq({to: this.get('jid'), type: "set"})
@ -658,7 +658,7 @@
setAffiliations (members) {
/* Send IQ stanzas to the server to modify the
* affiliations in this room.
* affiliations in this groupchat.
*
* See: http://xmpp.org/extensions/xep-0045.html#modifymember
*
@ -716,7 +716,7 @@
checkForReservedNick (callback, errback) {
/* Use service-discovery to ask the XMPP server whether
* this user has a reserved nickname for this room.
* this user has a reserved nickname for this groupchat.
* If so, we'll use that, otherwise we render the nickname form.
*
* Parameters:
@ -837,7 +837,7 @@
},
onMessage (stanza) {
/* Handler for all MUC messages sent to this chat room.
/* Handler for all MUC messages sent to this groupchat.
*
* Parameters:
* (XMLElement) stanza: The message stanza.
@ -897,14 +897,14 @@
/* Handles a received presence relating to the current
* user.
*
* For locked rooms (which are by definition "new"), the
* room will either be auto-configured or created instantly
* (with default config) or a configuration room will be
* For locked groupchats (which are by definition "new"), the
* groupchat will either be auto-configured or created instantly
* (with default config) or a configuration groupchat will be
* rendered.
*
* If the room is not locked, then the room will be
* If the groupchat is not locked, then the groupchat will be
* auto-configured only if applicable and if the current
* user is the room's owner.
* user is the groupchat's owner.
*
* Parameters:
* (XMLElement) pres: The stanza
@ -920,11 +920,11 @@
this.saveConfiguration().then(this.getRoomFeatures.bind(this));
} else {
this.trigger('configurationNeeded');
return; // We haven't yet entered the room, so bail here.
return; // We haven't yet entered the groupchat, so bail here.
}
} else if (!this.get('features_fetched')) {
// The features for this room weren't fetched.
// That must mean it's a new room without locking
// The features for this groupchat weren't fetched.
// That must mean it's a new groupchat without locking
// (in which case Prosody doesn't send a 201 status),
// otherwise the features would have been fetched in
// the "initialize" method already.
@ -1087,7 +1087,7 @@
_converse.onDirectMUCInvitation = function (message) {
/* A direct MUC invitation to join a room has been received
/* A direct MUC invitation to join a groupchat has been received
* See XEP-0249: Direct MUC invitations.
*
* Parameters:
@ -1109,11 +1109,11 @@
contact = contact? contact.get('fullname'): Strophe.getNodeFromJid(from);
if (!reason) {
result = confirm(
__("%1$s has invited you to join a chat room: %2$s", contact, room_jid)
__("%1$s has invited you to join a groupchat: %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"',
__('%1$s has invited you to join a groupchat: %2$s, and left the following reason: "%3$s"',
contact, room_jid, reason)
);
}
@ -1153,22 +1153,22 @@
};
function autoJoinRooms () {
/* Automatically join chat rooms, based on the
/* Automatically join groupchats, based on the
* "auto_join_rooms" configuration setting, which is an array
* of strings (room JIDs) or objects (with room JID and other
* of strings (groupchat JIDs) or objects (with groupchat JID and other
* settings).
*/
_.each(_converse.auto_join_rooms, function (room) {
if (_converse.chatboxes.where({'jid': room}).length) {
_.each(_converse.auto_join_rooms, function (groupchat) {
if (_converse.chatboxes.where({'jid': groupchat}).length) {
return;
}
if (_.isString(room)) {
_converse.api.rooms.open(room);
} else if (_.isObject(room)) {
_converse.api.rooms.open(room.jid, room.nick);
if (_.isString(groupchat)) {
_converse.api.rooms.open(groupchat);
} else if (_.isObject(groupchat)) {
_converse.api.rooms.open(groupchat.jid, groupchat.nick);
} else {
_converse.log(
'Invalid room criteria specified for "auto_join_rooms"',
'Invalid groupchat criteria specified for "auto_join_rooms"',
Strophe.LogLevel.ERROR);
}
});
@ -1176,7 +1176,7 @@
}
function disconnectChatRooms () {
/* When disconnecting, mark all chat rooms as
/* When disconnecting, mark all groupchats as
* disconnected, so that they will be properly entered again
* when fetched from session storage.
*/
@ -1214,7 +1214,7 @@
/************************ BEGIN API ************************/
// We extend the default converse.js API to add methods specific to MUC chat rooms.
// We extend the default converse.js API to add methods specific to MUC groupchats.
_.extend(_converse.api, {
'rooms': {
'close' (jids) {

View File

@ -8,7 +8,7 @@
<div class="modal-body">
<div class="room-info">
<p class="room-info"><strong>{{{o.__('Name')}}}</strong>: {{{o.name}}}</p>
<p class="room-info"><strong>{{{o.__('Room address (JID)')}}}</strong>: {{{o.jid}}}</p>
<p class="room-info"><strong>{{{o.__('Groupchat address (JID)')}}}</strong>: {{{o.jid}}}</p>
<p class="room-info"><strong>{{{o.__('Description')}}}</strong>: {{{o.description}}}</p>
{[ if (o.subject) { ]}
<p class="room-info"><strong>{{{o.__('Topic')}}}</strong>: {{o.topic}}</p> <!-- Sanitized in converse-muc-views. We want to render links. -->
@ -19,40 +19,40 @@
<div class="chatroom-features">
<ul class="features-list">
{[ if (o.passwordprotected) { ]}
<li class="feature" ><span class="fa fa-lock"></span>{{{ o.__('Password protected') }}} - <em>{{{ o.__('This room requires a password before entry') }}}</em></li>
<li class="feature" ><span class="fa fa-lock"></span>{{{ o.__('Password protected') }}} - <em>{{{ o.__('This groupchat requires a password before entry') }}}</em></li>
{[ } ]}
{[ if (o.unsecured) { ]}
<li class="feature" ><span class="fa fa-unlock"></span>{{{ o.__('No password required') }}} - <em>{{{ o.__('This room does not require a password upon entry') }}}</em></li>
<li class="feature" ><span class="fa fa-unlock"></span>{{{ o.__('No password required') }}} - <em>{{{ o.__('This groupchat does not require a password upon entry') }}}</em></li>
{[ } ]}
{[ if (o.hidden) { ]}
<li class="feature" ><span class="fa fa-eye-slash"></span>{{{ o.__('Hidden') }}} - <em>{{{ o.__('This room is not publicly searchable') }}}</em></li>
<li class="feature" ><span class="fa fa-eye-slash"></span>{{{ o.__('Hidden') }}} - <em>{{{ o.__('This groupchat is not publicly searchable') }}}</em></li>
{[ } ]}
{[ if (o.public_room) { ]}
<li class="feature" ><span class="fa fa-eye"></span>{{{ o.__('Public') }}} - <em>{{{ o.__('This room is publicly searchable') }}}</em></li>
<li class="feature" ><span class="fa fa-eye"></span>{{{ o.__('Public') }}} - <em>{{{ o.__('This groupchat is publicly searchable') }}}</em></li>
{[ } ]}
{[ if (o.membersonly) { ]}
<li class="feature" ><span class="fa fa-address-book"></span>{{{ o.__('Members only') }}} - <em>{{{ o.__('this room is restricted to members only') }}}</em></li>
<li class="feature" ><span class="fa fa-address-book"></span>{{{ o.__('Members only') }}} - <em>{{{ o.__('This groupchat is restricted to members only') }}}</em></li>
{[ } ]}
{[ if (o.open) { ]}
<li class="feature" ><span class="fa fa-globe"></span>{{{ o.__('Open') }}} - <em>{{{ o.__('Anyone can join this room') }}}</em></li>
<li class="feature" ><span class="fa fa-globe"></span>{{{ o.__('Open') }}} - <em>{{{ o.__('Anyone can join this groupchat') }}}</em></li>
{[ } ]}
{[ if (o.persistent) { ]}
<li class="feature" ><span class="fa fa-save"></span>{{{ o.__('Persistent') }}} - <em>{{{ o.__('This room persists even if it\'s unoccupied') }}}</em></li>
<li class="feature" ><span class="fa fa-save"></span>{{{ o.__('Persistent') }}} - <em>{{{ o.__('This groupchat persists even if it\'s unoccupied') }}}</em></li>
{[ } ]}
{[ if (o.temporary) { ]}
<li class="feature" ><span class="fa fa-snowflake-o"></span>{{{ o.__('Temporary') }}} - <em>{{{ o.__('This room will disappear once the last person leaves') }}}</em></li>
<li class="feature" ><span class="fa fa-snowflake-o"></span>{{{ o.__('Temporary') }}} - <em>{{{ o.__('This groupchat will disappear once the last person leaves') }}}</em></li>
{[ } ]}
{[ if (o.nonanonymous) { ]}
<li class="feature" ><span class="fa fa-id-card"></span>{{{ o.__('Not anonymous') }}} - <em>{{{ o.__('All other room occupants can see your XMPP username') }}}</em></li>
<li class="feature" ><span class="fa fa-id-card"></span>{{{ o.__('Not anonymous') }}} - <em>{{{ o.__('All other groupchat participants can see your XMPP username') }}}</em></li>
{[ } ]}
{[ if (o.semianonymous) { ]}
<li class="feature" ><span class="fa fa-user-secret"></span>{{{ o.__('Semi-anonymous') }}} - <em>{{{ o.__('Only moderators can see your XMPP username') }}}</em></li>
{[ } ]}
{[ if (o.moderated) { ]}
<li class="feature" ><span class="fa fa-gavel"></span>{{{ o.__('Moderated') }}} - <em>{{{ o.__('This room is being moderated') }}}</em></li>
<li class="feature" ><span class="fa fa-gavel"></span>{{{ o.__('Moderated') }}} - <em>{{{ o.__('This groupchat is being moderated') }}}</em></li>
{[ } ]}
{[ if (o.unmoderated) { ]}
<li class="feature" ><span class="fa fa-info-circle"></span>{{{ o.__('Not moderated') }}} - <em>{{{ o.__('This room is not being moderated') }}}</em></li>
<li class="feature" ><span class="fa fa-info-circle"></span>{{{ o.__('Not moderated') }}} - <em>{{{ o.__('This groupchat is not being moderated') }}}</em></li>
{[ } ]}
{[ if (o.mam_enabled) { ]}
<li class="feature" ><span class="fa fa-database"></span>{{{ o.__('Message archiving') }}} - <em>{{{ o.__('Messages are archived on the server') }}}</em></li>