From 258029457fe9083b1962eddf5d07b22a41262f1d Mon Sep 17 00:00:00 2001 From: worlword Date: Thu, 5 Apr 2018 08:48:20 +0200 Subject: [PATCH] Removed dist-files from pull request --- dist/converse.js | 1491 +++++++++++++++++----------------------------- 1 file changed, 539 insertions(+), 952 deletions(-) diff --git a/dist/converse.js b/dist/converse.js index 1cefebc35..26213aa55 100644 --- a/dist/converse.js +++ b/dist/converse.js @@ -28230,73 +28230,6 @@ return es; }))); -//! moment.js locale configuration -//! locale : Basque [eu] -//! author : Eneko Illarramendi : https://github.com/eillarra - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define('moment/locale/eu',['../moment'], factory) : - factory(global.moment) -}(this, (function (moment) { 'use strict'; - - -var eu = moment.defineLocale('eu', { - months : 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'), - monthsShort : 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'), - monthsParseExact : true, - weekdays : 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split('_'), - weekdaysShort : 'ig._al._ar._az._og._ol._lr.'.split('_'), - weekdaysMin : 'ig_al_ar_az_og_ol_lr'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'YYYY-MM-DD', - LL : 'YYYY[ko] MMMM[ren] D[a]', - LLL : 'YYYY[ko] MMMM[ren] D[a] HH:mm', - LLLL : 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm', - l : 'YYYY-M-D', - ll : 'YYYY[ko] MMM D[a]', - lll : 'YYYY[ko] MMM D[a] HH:mm', - llll : 'ddd, YYYY[ko] MMM D[a] HH:mm' - }, - calendar : { - sameDay : '[gaur] LT[etan]', - nextDay : '[bihar] LT[etan]', - nextWeek : 'dddd LT[etan]', - lastDay : '[atzo] LT[etan]', - lastWeek : '[aurreko] dddd LT[etan]', - sameElse : 'L' - }, - relativeTime : { - future : '%s barru', - past : 'duela %s', - s : 'segundo batzuk', - m : 'minutu bat', - mm : '%d minutu', - h : 'ordu bat', - hh : '%d ordu', - d : 'egun bat', - dd : '%d egun', - M : 'hilabete bat', - MM : '%d hilabete', - y : 'urte bat', - yy : '%d urte' - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } -}); - -return eu; - -}))); - //! moment.js locale configuration //! locale : French [fr] //! author : John Fischer : https://github.com/jfroffice @@ -29811,6 +29744,8 @@ return zhTw; }))); + + // Converse.js (A browser based XMPP chat client) // http://conversejs.org // @@ -29822,8 +29757,8 @@ return zhTw; /*global define */ (function (root, factory) { - define('i18n',["es6-promise", "jed", "lodash.noconflict", "moment", 'moment/locale/af', 'moment/locale/ar', 'moment/locale/bg', 'moment/locale/ca', 'moment/locale/de', 'moment/locale/es', 'moment/locale/eu', 'moment/locale/fr', 'moment/locale/he', 'moment/locale/hu', 'moment/locale/id', 'moment/locale/it', 'moment/locale/ja', 'moment/locale/nb', 'moment/locale/nl', 'moment/locale/pl', 'moment/locale/pt-br', 'moment/locale/ru', 'moment/locale/tr', 'moment/locale/uk', 'moment/locale/zh-cn', 'moment/locale/zh-tw'], factory); -})(this, function (Promise, Jed, _, moment) { + define('i18n',["es6-promise", "jed", "lodash.noconflict", "moment", 'moment/locale/af', 'moment/locale/ar', 'moment/locale/bg', 'moment/locale/ca', 'moment/locale/de', 'moment/locale/es', 'moment/locale/fr', 'moment/locale/he', 'moment/locale/hu', 'moment/locale/id', 'moment/locale/it', 'moment/locale/ja', 'moment/locale/nb', 'moment/locale/nl', 'moment/locale/pl', 'moment/locale/pt-br', 'moment/locale/ru', 'moment/locale/tr', 'moment/locale/uk', 'moment/locale/zh-cn', 'moment/locale/zh-tw'], factory); +})(void 0, function (Promise, Jed, _, moment) { 'use strict'; function detectLocale(library_check) { @@ -36297,6 +36232,8 @@ require(["strophe-polyfill"]); })); /* jshint ignore:end */ ; + + function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } // Converse.js (A browser based XMPP chat client) @@ -36311,7 +36248,7 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat /*global define, escape, window */ (function (root, factory) { define('utils',["sizzle", "es6-promise", "lodash.noconflict", "strophe"], factory); -})(this, function (sizzle, Promise, _, Strophe) { +})(void 0, function (sizzle, Promise, _, Strophe) { "use strict"; var b64_sha1 = Strophe.SHA1.b64_sha1; @@ -36526,14 +36463,6 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat })); }; - u.renderMovieURLs = function (obj) { - return ""; - }; - - u.renderAudioURLs = function (obj) { - return ""; - }; - u.slideInAllElements = function (elements) { var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300; return Promise.all(_.map(elements, _.partial(u.slideIn, _, duration))); @@ -37048,19 +36977,9 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat el.dispatchEvent(evt); }; - u.geoUriToHttp = function (text, _converse) { - var regex = /geo:([\-0-9.]+),([\-0-9.]+)(?:,([\-0-9.]+))?(?:\?(.*))?/g; - return text.replace(regex, _converse.geouri_replacement); - }; - - u.httpToGeoUri = function (text, _converse) { - var replacement = 'geo:$1,$2'; - return text.replace(_converse.geouri_regex, replacement); - }; - return u; }); -//# sourceMappingURL=core.js.map; +//# sourceMappingURL=utils.js.map; (function (global, factory) { if (typeof define === "function" && define.amd) { define('pluggable',['exports', 'lodash'], factory); @@ -39728,6 +39647,8 @@ Backbone.sync = function(method, model, options) { return Backbone.BrowserStorage; })); + + // Converse.js (A browser based XMPP chat client) // http://conversejs.org // @@ -39738,7 +39659,7 @@ return Backbone.BrowserStorage; /*global Backbone, define, window, JSON */ (function (root, factory) { define('converse-core',["sizzle", "es6-promise", "lodash.noconflict", "lodash.fp", "polyfill", "i18n", "utils", "moment", "strophe", "pluggable", "backbone.noconflict", "backbone.nativeview", "backbone.browserStorage"], factory); -})(this, function (sizzle, Promise, _, f, polyfill, i18n, u, moment, Strophe, pluggable, Backbone) { +})(void 0, function (sizzle, Promise, _, f, polyfill, i18n, u, moment, Strophe, pluggable, Backbone) { /* Cannot use this due to Safari bug. * See https://github.com/jcbrand/converse.js/issues/196 */ @@ -39787,7 +39708,7 @@ return Backbone.BrowserStorage; _.extend(_converse, Backbone.Events); // Core plugins are whitelisted automatically - _converse.core_plugins = ['converse-bookmarks', 'converse-chatboxes', 'converse-chatview', 'converse-controlbox', 'converse-core', 'converse-disco', 'converse-dragresize', 'converse-dropdown', 'converse-fullscreen', 'converse-headline', 'converse-httpFileUpload', 'converse-mam', 'converse-minimize', 'converse-modal', 'converse-muc', 'converse-muc-embedded', 'converse-muc-views', 'converse-notification', 'converse-otr', 'converse-ping', 'converse-profile', 'converse-register', 'converse-roomslist', 'converse-rosterview', 'converse-singleton', 'converse-spoilers', 'converse-vcard']; // Make converse pluggable + _converse.core_plugins = ['converse-bookmarks', 'converse-chatboxes', 'converse-chatview', 'converse-controlbox', 'converse-core', 'converse-disco', 'converse-dragresize', 'converse-dropdown', 'converse-fullscreen', 'converse-headline', 'converse-mam', 'converse-minimize', 'converse-modal', 'converse-muc', 'converse-muc-embedded', 'converse-muc-views', 'converse-notification', 'converse-otr', 'converse-ping', 'converse-profile', 'converse-register', 'converse-roomslist', 'converse-rosterview', 'converse-singleton', 'converse-spoilers', 'converse-vcard']; // Make converse pluggable pluggable.enable(_converse, '_converse', 'pluggable'); // Module-level constants @@ -40012,14 +39933,12 @@ return Backbone.BrowserStorage; expose_rid_and_sid: false, filter_by_resource: false, forward_messages: false, - geouri_regex: /https:\/\/www.openstreetmap.org\/.*#map=[0-9]+\/([\-0-9.]+)\/([\-0-9.]+)\S*/g, - geouri_replacement: 'https://www.openstreetmap.org/?mlat=$1&mlon=$2#map=18/$1/$2', hide_offline_users: false, include_offline_state: false, jid: undefined, keepalive: true, locales_url: 'locale/{{{locale}}}/LC_MESSAGES/converse.json', - locales: ['af', 'ar', 'bg', 'ca', 'de', 'es', 'eu', 'en', 'fr', 'he', 'hu', 'id', 'it', 'ja', 'nb', 'nl', 'pl', 'pt_BR', 'ru', 'tr', 'uk', 'zh_CN', 'zh_TW'], + locales: ['af', 'ar', 'bg', 'ca', 'de', 'es', 'en', 'fr', 'he', 'hu', 'id', 'it', 'ja', 'nb', 'nl', 'pl', 'pt_BR', 'ru', 'tr', 'uk', 'zh_CN', 'zh_TW'], message_carbons: true, message_storage: 'session', nickname: undefined, @@ -40829,7 +40748,7 @@ return Backbone.BrowserStorage; } } }, - removeFromRoster: function removeFromRoster(callback, errback) { + removeFromRoster: function removeFromRoster(callback) { /* Instruct the XMPP server to remove this contact from our roster * Parameters: * (Function) callback @@ -40843,7 +40762,7 @@ return Backbone.BrowserStorage; subscription: "remove" }); - _converse.connection.sendIQ(iq, callback, errback); + _converse.connection.sendIQ(iq, callback, callback); return this; } @@ -46297,12 +46216,6 @@ function print() { __p += __j.call(arguments, '') } if (o.use_emoji) { ; __p += '\n
  • \n \n
  • \n'; } ; -__p += '\n'; - if (o.show_fileUpload_button) { ; -__p += '\n\n
  • \n \n
  • \n'; - } ; __p += '\n'; if (o.show_call_button) { ; __p += '\n
  • 2 && arguments[2] !== undefined ? arguments[2] : null; - /* This method gets called once the user has typed a message * and then pressed enter in a chat box. * @@ -48155,17 +47763,7 @@ return __p var attrs = this.getOutgoingMessageAttributes(text, spoiler_hint); var message = this.model.messages.create(attrs); - /* check, if a file was send. If true it will send the file with XEP-0066. */ - - var messageStanza; - - if (file !== null) { - messageStanza = this.createFileMessageStanza(message); - } else { - messageStanza = this.createMessageStanza(message); - } - - this.sendMessage(messageStanza); + this.sendMessage(message); }, getOutgoingMessageAttributes: function getOutgoingMessageAttributes(text, spoiler_hint) { /* Overridable method which returns the attributes to be @@ -48177,7 +47775,7 @@ return __p 'fullname': _.isEmpty(fullname) ? _converse.bare_jid : fullname, 'sender': 'me', 'time': moment().format(), - 'message': u.httpToGeoUri(emojione.shortnameToUnicode(text), _converse), + 'message': emojione.shortnameToUnicode(text), 'is_spoiler': is_spoiler }; @@ -50328,6 +49926,8 @@ exports.default = vnode; }); //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy8ucmVnaXN0cnkubnBtanMub3JnL2Jyb3dzZXItcGFjay82LjAuMi9ub2RlX21vZHVsZXMvYnJvd3Nlci1wYWNrL19wcmVsdWRlLmpzIiwiaHRtbGRvbWFwaS5qcyIsInRvdm5vZGUuanMiLCJ2bm9kZS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQ0FBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUNqRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtB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vZGVfMS5kZWZhdWx0KCcnLCB7fSwgW10sIHVuZGVmaW5lZCwgdW5kZWZpbmVkKTtcbiAgICB9XG59XG5leHBvcnRzLnRvVk5vZGUgPSB0b1ZOb2RlO1xuZXhwb3J0cy5kZWZhdWx0ID0gdG9WTm9kZTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXRvdm5vZGUuanMubWFwIiwiXCJ1c2Ugc3RyaWN0XCI7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHsgdmFsdWU6IHRydWUgfSk7XG5mdW5jdGlvbiB2bm9kZShzZWwsIGRhdGEsIGNoaWxkcmVuLCB0ZXh0LCBlbG0pIHtcbiAgICB2YXIga2V5ID0gZGF0YSA9PT0gdW5kZWZpbmVkID8gdW5kZWZpbmVkIDogZGF0YS5rZXk7XG4gICAgcmV0dXJuIHsgc2VsOiBzZWwsIGRhdGE6IGRhdGEsIGNoaWxkcmVuOiBjaGlsZHJlbixcbiAgICAgICAgdGV4dDogdGV4dCwgZWxtOiBlbG0sIGtleToga2V5IH07XG59XG5leHBvcnRzLnZub2RlID0gdm5vZGU7XG5leHBvcnRzLmRlZmF1bHQgPSB2bm9kZTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXZub2RlLmpzLm1hcCJdfQ== ; + + function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } /*! @@ -50342,7 +49942,7 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat // CommonJS-like environments module.exports = factory(require('snabbdom'), require('snabbdom-attributes'), require('snabbdom-class'), require('snabbdom-dataset'), require('snabbdom-props'), require('snabbdom-style'), require('tovnode'), require('underscore'), require('backbone')); } -})(this, function (snabbdom, snabbdom_attributes, snabbdom_class, snabbdom_dataset, snabbdom_props, snabbdom_style, tovnode, _, Backbone) { +})(void 0, function (snabbdom, snabbdom_attributes, snabbdom_class, snabbdom_dataset, snabbdom_props, snabbdom_style, tovnode, _, Backbone) { "use strict"; var domParser = new DOMParser(); @@ -50410,11 +50010,14 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat }); return Backbone.VDOMView; }); +//# sourceMappingURL=backbone.vdomview.js.map; + + (function (root, factory) { if (typeof define === 'function' && define.amd) { define('converse-modal',["converse-core", "bootstrap", "underscore", "backbone", "backbone.vdomview"], factory); } -})(this, function (converse, bootstrap, _, Backbone) { +})(void 0, function (converse, bootstrap, _, Backbone) { "use strict"; converse.plugins.add('converse-modal', { @@ -50451,6 +50054,8 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat }); }); //# sourceMappingURL=converse-modal.js.map; + + // Converse.js (A browser based XMPP chat client) // http://conversejs.org // @@ -50461,7 +50066,7 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat /*global define */ (function (root, factory) { define('converse-rosterview',["converse-core", "tpl!add_contact_modal", "tpl!group_header", "tpl!pending_contact", "tpl!requesting_contact", "tpl!roster", "tpl!roster_filter", "tpl!roster_item", "tpl!search_contact", "awesomplete", "converse-chatboxes", "converse-modal"], factory); -})(this, function (converse, tpl_add_contact_modal, tpl_group_header, tpl_pending_contact, tpl_requesting_contact, tpl_roster, tpl_roster_filter, tpl_roster_item, tpl_search_contact, Awesomplete) { +})(void 0, function (converse, tpl_add_contact_modal, tpl_group_header, tpl_pending_contact, tpl_requesting_contact, tpl_roster, tpl_roster_filter, tpl_roster_item, tpl_search_contact, Awesomplete) { "use strict"; var _converse$env = converse.env, @@ -50943,7 +50548,16 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat var result = confirm(__("Are you sure you want to remove this contact?")); if (result === true) { - this.model.removeFromRoster(function (iq) { + var iq = $iq({ + type: 'set' + }).c('query', { + xmlns: Strophe.NS.ROSTER + }).c('item', { + jid: this.model.get('jid'), + subscription: "remove" + }); + + _converse.connection.sendIQ(iq, function (iq) { _this.model.destroy(); _this.remove(); @@ -51709,6 +51323,8 @@ return __p }); })); + + // Converse.js (A browser based XMPP chat client) // http://conversejs.org // @@ -51719,7 +51335,7 @@ return __p /*global define */ (function (root, factory) { define('converse-vcard',["converse-core", "strophe.vcard"], factory); -})(this, function (converse) { +})(void 0, function (converse) { "use strict"; var _converse$env = converse.env, @@ -51931,6 +51547,8 @@ return __p }); }); //# sourceMappingURL=converse-vcard.js.map; + + // Converse.js (A browser based XMPP chat client) // http://conversejs.org // @@ -51941,7 +51559,7 @@ return __p /*global define */ (function (root, factory) { define('converse-profile',["converse-core", "bootstrap", "tpl!chat_status_modal", "tpl!profile_modal", "tpl!profile_view", "tpl!status_option", "converse-vcard", "converse-modal"], factory); -})(this, function (converse, bootstrap, tpl_chat_status_modal, tpl_profile_modal, tpl_profile_view, tpl_status_option) { +})(void 0, function (converse, bootstrap, tpl_chat_status_modal, tpl_profile_modal, tpl_profile_view, tpl_status_option) { "use strict"; var _converse$env = converse.env, @@ -52083,6 +51701,8 @@ return __p }); }); //# sourceMappingURL=converse-profile.js.map; + + // Converse.js (A browser based XMPP chat client) // http://conversejs.org // @@ -52093,7 +51713,7 @@ return __p /*global define */ (function (root, factory) { define('converse-controlbox',["converse-core", "lodash.fp", "tpl!converse_brand_heading", "tpl!controlbox", "tpl!controlbox_toggle", "tpl!login_panel", "converse-chatview", "converse-rosterview", "converse-profile"], factory); -})(this, function (converse, fp, tpl_brand_heading, tpl_controlbox, tpl_controlbox_toggle, tpl_login_panel) { +})(void 0, function (converse, fp, tpl_brand_heading, tpl_controlbox, tpl_controlbox_toggle, tpl_login_panel) { "use strict"; var CHATBOX_TYPE = 'chatbox'; @@ -52865,6 +52485,8 @@ __e(o.value) + return __p };}); + + // Converse.js (A browser based XMPP chat client) // http://conversejs.org // @@ -52877,7 +52499,7 @@ return __p /*global define, escape, Jed */ (function (root, factory) { define('form-utils',["sizzle", "lodash.noconflict", "utils", "tpl!field", "tpl!select_option", "tpl!form_select", "tpl!form_textarea", "tpl!form_checkbox", "tpl!form_username", "tpl!form_input", "tpl!form_captcha", "tpl!form_url"], factory); -})(this, function (sizzle, _, u, tpl_field, tpl_select_option, tpl_form_select, tpl_form_textarea, tpl_form_checkbox, tpl_form_username, tpl_form_input, tpl_form_captcha, tpl_form_url) { +})(void 0, function (sizzle, _, u, tpl_field, tpl_select_option, tpl_form_select, tpl_form_textarea, tpl_form_checkbox, tpl_form_username, tpl_form_input, tpl_form_captcha, tpl_form_url) { "use strict"; var XFORM_TYPE_MAP = { @@ -53006,7 +52628,7 @@ return __p return u; }); -//# sourceMappingURL=form.js.map; +//# sourceMappingURL=form-utils.js.map; /* Copyright 2010, François de Metz */ @@ -53271,6 +52893,8 @@ Strophe.addConnectionPlugin('disco', }); })); + + // Converse.js (A browser based XMPP chat client) // http://conversejs.org // @@ -53283,7 +52907,7 @@ Strophe.addConnectionPlugin('disco', /*global Backbone, define, window */ (function (root, factory) { define('converse-disco',["converse-core", "sizzle", "strophe.disco"], factory); -})(this, function (converse, sizzle) { +})(void 0, function (converse, sizzle) { var _converse$env = converse.env, Backbone = _converse$env.Backbone, Promise = _converse$env.Promise, @@ -53688,112 +53312,8 @@ Strophe.addConnectionPlugin('disco', }); //# sourceMappingURL=backbone.orderedlistview.js.map; -// Converse.js (A browser based XMPP chat client) -// http://conversejs.org -// -// This is the utilities module. -// -// Copyright (c) 2012-2017, Jan-Carel Brand -// Licensed under the Mozilla Public License (MPLv2) -// - -/*global define, escape, Jed */ -(function (root, factory) { - define('muc-utils',["converse-core", "utils"], factory); -})(this, function (converse, u) { - "use strict"; - - var _converse$env = converse.env, - Strophe = _converse$env.Strophe, - sizzle = _converse$env.sizzle, - _ = _converse$env._; - - u.computeAffiliationsDelta = function computeAffiliationsDelta(exclude_existing, remove_absentees, new_list, old_list) { - /* Given two lists of objects with 'jid', 'affiliation' and - * 'reason' properties, return a new list containing - * those objects that are new, changed or removed - * (depending on the 'remove_absentees' boolean). - * - * The affiliations for new and changed members stay the - * same, for removed members, the affiliation is set to 'none'. - * - * The 'reason' property is not taken into account when - * comparing whether affiliations have been changed. - * - * Parameters: - * (Boolean) exclude_existing: Indicates whether JIDs from - * the new list which are also in the old list - * (regardless of affiliation) should be excluded - * from the delta. One reason to do this - * would be when you want to add a JID only if it - * doesn't have *any* existing affiliation at all. - * (Boolean) remove_absentees: Indicates whether JIDs - * from the old list which are not in the new list - * should be considered removed and therefore be - * included in the delta with affiliation set - * to 'none'. - * (Array) new_list: Array containing the new affiliations - * (Array) old_list: Array containing the old affiliations - */ - var new_jids = _.map(new_list, 'jid'); - - var old_jids = _.map(old_list, 'jid'); // Get the new affiliations - var delta = _.map(_.difference(new_jids, old_jids), function (jid) { - return new_list[_.indexOf(new_jids, jid)]; - }); - - if (!exclude_existing) { - // Get the changed affiliations - delta = delta.concat(_.filter(new_list, function (item) { - var idx = _.indexOf(old_jids, item.jid); - - if (idx >= 0) { - return item.affiliation !== old_list[idx].affiliation; - } - - return false; - })); - } - - if (remove_absentees) { - // Get the removed affiliations - delta = delta.concat(_.map(_.difference(old_jids, new_jids), function (jid) { - return { - 'jid': jid, - 'affiliation': 'none' - }; - })); - } - - return delta; - }; - - u.parseMemberListIQ = function parseMemberListIQ(iq) { - /* Given an IQ stanza with a member list, create an array of member - * objects. - */ - return _.map(sizzle("query[xmlns=\"".concat(Strophe.NS.MUC_ADMIN, "\"] item"), iq), function (item) { - return { - 'jid': item.getAttribute('jid'), - 'affiliation': item.getAttribute('affiliation') - }; - }); - }; - - u.marshallAffiliationIQs = function marshallAffiliationIQs() { - /* Marshall a list of IQ stanzas into a map of JIDs and - * affiliations. - * - * Parameters: - * Any amount of XMLElement objects, representing the IQ - * stanzas. - */ - return _.flatMap(arguments[0], u.parseMemberListIQ); - }; -}); -//# sourceMappingURL=muc.js.map; // Converse.js (A browser based XMPP chat client) // http://conversejs.org // @@ -53807,8 +53327,8 @@ Strophe.addConnectionPlugin('disco', * specified in XEP-0045 Multi-user chat. */ (function (root, factory) { - define('converse-muc',["form-utils", "converse-core", "converse-chatview", "converse-disco", "backbone.overview", "backbone.orderedlistview", "backbone.vdomview", "muc-utils"], factory); -})(this, function (u, converse) { + define('converse-muc',["form-utils", "converse-core", "converse-chatview", "converse-disco", "backbone.overview", "backbone.orderedlistview", "backbone.vdomview"], factory); +})(void 0, function (u, converse) { "use strict"; var MUC_ROLE_WEIGHTS = { @@ -54056,328 +53576,6 @@ Strophe.addConnectionPlugin('disco', 'type': converse.CHATROOMS_TYPE }); }, - directInvite: function directInvite(recipient, reason) { - /* Send a direct invitation as per XEP-0249 - * - * Parameters: - * (String) recipient - JID of the person being invited - * (String) reason - Optional reason for the invitation - */ - if (this.get('membersonly')) { - // When inviting to a members-only room, 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. - var map = {}; - map[recipient] = 'member'; - - var deltaFunc = _.partial(u.computeAffiliationsDelta, true, false); - - this.updateMemberLists([{ - 'jid': recipient, - 'affiliation': 'member', - 'reason': reason - }], ['member', 'owner', 'admin'], deltaFunc); - } - - var attrs = { - 'xmlns': 'jabber:x:conference', - 'jid': this.get('jid') - }; - - if (reason !== null) { - attrs.reason = reason; - } - - if (this.get('password')) { - attrs.password = this.get('password'); - } - - var invitation = $msg({ - from: _converse.connection.jid, - to: recipient, - id: _converse.connection.getUniqueId() - }).c('x', attrs); - - _converse.connection.send(invitation); - - _converse.emit('roomInviteSent', { - 'room': this, - 'recipient': recipient, - 'reason': reason - }); - }, - sendConfiguration: function sendConfiguration(config, callback, errback) { - /* Send an IQ stanza with the room configuration. - * - * Parameters: - * (Array) config: The room configuration - * (Function) callback: Callback upon succesful IQ response - * The first parameter passed in is IQ containing the - * room 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. - * The second is the response IQ from the server. - */ - var iq = $iq({ - to: this.get('jid'), - type: "set" - }).c("query", { - xmlns: Strophe.NS.MUC_OWNER - }).c("x", { - xmlns: Strophe.NS.XFORM, - type: "submit" - }); - - _.each(config || [], function (node) { - iq.cnode(node).up(); - }); - - callback = _.isUndefined(callback) ? _.noop : _.partial(callback, iq.nodeTree); - errback = _.isUndefined(errback) ? _.noop : _.partial(errback, iq.nodeTree); - return _converse.connection.sendIQ(iq, callback, errback); - }, - parseRoomFeatures: function parseRoomFeatures(iq) { - /* Parses an IQ stanza containing the room's features. - * - * See http://xmpp.org/extensions/xep-0045.html#disco-roominfo - * - * - * - * - * - * - * - * - * - * - */ - var features = { - 'features_fetched': true, - 'name': iq.querySelector('identity').getAttribute('name') - }; - - _.each(iq.querySelectorAll('feature'), function (field) { - var fieldname = field.getAttribute('var'); - - if (!fieldname.startsWith('muc_')) { - if (fieldname === Strophe.NS.MAM) { - features.mam_enabled = true; - } - - return; - } - - features[fieldname.replace('muc_', '')] = true; - }); - - var desc_field = iq.querySelector('field[var="muc#roominfo_description"] value'); - - if (!_.isNull(desc_field)) { - features.description = desc_field.textContent; - } - - this.save(features); - }, - requestMemberList: function requestMemberList(affiliation) { - var _this = this; - - /* Send an IQ stanza to the server, asking it for the - * member-list of this room. - * - * See: http://xmpp.org/extensions/xep-0045.html#modifymember - * - * Parameters: - * (String) affiliation: The specific member list to - * fetch. 'admin', 'owner' or 'member'. - * - * Returns: - * A promise which resolves once the list has been - * retrieved. - */ - return new Promise(function (resolve, reject) { - affiliation = affiliation || 'member'; - var iq = $iq({ - to: _this.get('jid'), - type: "get" - }).c("query", { - xmlns: Strophe.NS.MUC_ADMIN - }).c("item", { - 'affiliation': affiliation - }); - - _converse.connection.sendIQ(iq, resolve, reject); - }); - }, - setAffiliation: function setAffiliation(affiliation, members) { - /* Send IQ stanzas to the server to set an affiliation for - * the provided JIDs. - * - * See: http://xmpp.org/extensions/xep-0045.html#modifymember - * - * XXX: Prosody doesn't accept multiple JIDs' affiliations - * being set in one IQ stanza, so as a workaround we send - * a separate stanza for each JID. - * Related ticket: https://prosody.im/issues/issue/795 - * - * Parameters: - * (String) affiliation: The affiliation - * (Object) members: A map of jids, affiliations and - * optionally reasons. Only those entries with the - * same affiliation as being currently set will be - * considered. - * - * Returns: - * A promise which resolves and fails depending on the - * XMPP server response. - */ - members = _.filter(members, function (member) { - return (// We only want those members who have the right - // affiliation (or none, which implies the provided one). - _.isUndefined(member.affiliation) || member.affiliation === affiliation - ); - }); - - var promises = _.map(members, _.bind(this.sendAffiliationIQ, this, affiliation)); - - return Promise.all(promises); - }, - saveAffiliationAndRole: function saveAffiliationAndRole(pres) { - /* Parse the presence stanza for the current user's - * affiliation. - * - * Parameters: - * (XMLElement) pres: A stanza. - */ - var item = sizzle("x[xmlns=\"".concat(Strophe.NS.MUC_USER, "\"] item"), pres).pop(); - var is_self = pres.querySelector("status[code='110']"); - - if (is_self && !_.isNil(item)) { - var affiliation = item.getAttribute('affiliation'); - var role = item.getAttribute('role'); - - if (affiliation) { - this.save({ - 'affiliation': affiliation - }); - } - - if (role) { - this.save({ - 'role': role - }); - } - } - }, - sendAffiliationIQ: function sendAffiliationIQ(affiliation, member) { - var _this2 = this; - - /* Send an IQ stanza specifying an affiliation change. - * - * Paremeters: - * (String) affiliation: affiliation (could also be stored - * on the member object). - * (Object) member: Map containing the member's jid and - * optionally a reason and affiliation. - */ - return new Promise(function (resolve, reject) { - var iq = $iq({ - to: _this2.get('jid'), - type: "set" - }).c("query", { - xmlns: Strophe.NS.MUC_ADMIN - }).c("item", { - 'affiliation': member.affiliation || affiliation, - 'jid': member.jid - }); - - if (!_.isUndefined(member.reason)) { - iq.c("reason", member.reason); - } - - _converse.connection.sendIQ(iq, resolve, reject); - }); - }, - setAffiliations: function setAffiliations(members) { - /* Send IQ stanzas to the server to modify the - * affiliations in this room. - * - * See: http://xmpp.org/extensions/xep-0045.html#modifymember - * - * Parameters: - * (Object) members: A map of jids, affiliations and optionally reasons - * (Function) onSuccess: callback for a succesful response - * (Function) onError: callback for an error response - */ - var affiliations = _.uniq(_.map(members, 'affiliation')); - - _.each(affiliations, _.partial(this.setAffiliation.bind(this), _, members)); - }, - getJidsWithAffiliations: function getJidsWithAffiliations(affiliations) { - var _this3 = this; - - /* Returns a map of JIDs that have the affiliations - * as provided. - */ - if (_.isString(affiliations)) { - affiliations = [affiliations]; - } - - return new Promise(function (resolve, reject) { - var promises = _.map(affiliations, _.partial(_this3.requestMemberList.bind(_this3))); - - Promise.all(promises).then(_.flow(u.marshallAffiliationIQs, resolve), _.flow(u.marshallAffiliationIQs, resolve)); - }); - }, - updateMemberLists: function updateMemberLists(members, affiliations, deltaFunc) { - var _this4 = this; - - /* Fetch the lists of users with the given affiliations. - * Then compute the delta between those users and - * the passed in members, and if it exists, send the delta - * to the XMPP server to update the member list. - * - * Parameters: - * (Object) members: Map of member jids and affiliations. - * (String|Array) affiliation: An array of affiliations or - * a string if only one affiliation. - * (Function) deltaFunc: The function to compute the delta - * between old and new member lists. - * - * Returns: - * A promise which is resolved once the list has been - * updated or once it's been established there's no need - * to update the list. - */ - this.getJidsWithAffiliations(affiliations).then(function (old_members) { - _this4.setAffiliations(deltaFunc(members, old_members)); - }); - }, - checkForReservedNick: function checkForReservedNick(callback, errback) { - /* Use service-discovery to ask the XMPP server whether - * this user has a reserved nickname for this room. - * If so, we'll use that, otherwise we render the nickname form. - * - * Parameters: - * (Function) callback: Callback upon succesful IQ response - * (Function) errback: Callback upon error IQ response - */ - _converse.connection.sendIQ($iq({ - 'to': this.get('jid'), - 'from': _converse.connection.jid, - 'type': "get" - }).c("query", { - 'xmlns': Strophe.NS.DISCO_INFO, - 'node': 'x-roomuser-item' - }), callback, errback); - - return this; - }, isUserMentioned: function isUserMentioned(message) { /* Returns a boolean to indicate whether the current user * was mentioned in a message. @@ -54401,17 +53599,17 @@ Strophe.addConnectionPlugin('disco', } if (u.isNewMessage(stanza) && this.newMessageWillBeHidden()) { - var settings = { + this.save({ 'num_unread_general': this.get('num_unread_general') + 1 - }; + }); if (this.isUserMentioned(body.textContent)) { - settings.num_unread = this.get('num_unread') + 1; + this.save({ + 'num_unread': this.get('num_unread') + 1 + }); _converse.incrementMsgCounter(); } - - this.save(settings); } }, clearUnreadMsgCounter: function clearUnreadMsgCounter() { @@ -54784,6 +53982,8 @@ __p += '">\n'; return __p };}); + + // Converse.js (A browser based XMPP chat client) // http://conversejs.org // @@ -54798,7 +53998,7 @@ return __p */ (function (root, factory) { define('converse-bookmarks',["converse-core", "converse-muc", "tpl!chatroom_bookmark_form", "tpl!chatroom_bookmark_toggle", "tpl!bookmark", "tpl!bookmarks_list"], factory); -})(this, function (converse, muc, tpl_chatroom_bookmark_form, tpl_chatroom_bookmark_toggle, tpl_bookmark, tpl_bookmarks_list) { +})(void 0, function (converse, muc, tpl_chatroom_bookmark_form, tpl_chatroom_bookmark_toggle, tpl_bookmark, tpl_bookmarks_list) { var _converse$env = converse.env, Backbone = _converse$env.Backbone, Promise = _converse$env.Promise, @@ -55169,7 +54369,7 @@ return __p 'jid': bookmark.getAttribute('jid'), 'name': bookmark.getAttribute('name'), 'autojoin': bookmark.getAttribute('autojoin') === 'true', - 'nick': _.get(bookmark.querySelector('nick'), 'textContent') + 'nick': bookmark.querySelector('nick').textContent }); }); }, @@ -55466,6 +54666,8 @@ __e(o.info_title) + return __p };}); + + // Converse.js (A browser based XMPP chat client) // http://conversejs.org // @@ -55480,7 +54682,7 @@ return __p */ (function (root, factory) { define('converse-roomslist',["utils", "converse-core", "converse-muc", "tpl!rooms_list", "tpl!rooms_list_item"], factory); -})(this, function (utils, converse, muc, tpl_rooms_list, tpl_rooms_list_item) { +})(void 0, function (utils, converse, muc, tpl_rooms_list, tpl_rooms_list_item) { var _converse$env = converse.env, Backbone = _converse$env.Backbone, Promise = _converse$env.Promise, @@ -55832,6 +55034,8 @@ Strophe.RSM.prototype = { }; })); + + // Converse.js (A browser based XMPP chat client) // http://conversejs.org // @@ -55843,7 +55047,7 @@ Strophe.RSM.prototype = { // XEP-0059 Result Set Management (function (root, factory) { define('converse-mam',["sizzle", "converse-core", "utils", "converse-disco", "strophe.rsm"], factory); -})(this, function (sizzle, converse, utils) { +})(void 0, function (sizzle, converse, utils) { "use strict"; var CHATROOMS_TYPE = 'chatroom'; @@ -56390,7 +55594,7 @@ return __p define('tpl!chatarea', ['lodash'], function(_) {return function(o) { var __t, __p = '', __e = _.escape, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } -__p += '
    \n
    \n
    \n \n \n
  • \n'; } ; -__p += '\n'; - if (o.show_fileUpload_button) { ; -__p += '\n\n
  • \n \n
  • \n'; - } ; __p += '\n'; if (o.show_call_button) { ; __p += '\n
  • = 0) { + return item.affiliation !== old_list[idx].affiliation; + } + + return false; + })); + } + + if (remove_absentees) { + // Get the removed affiliations + delta = delta.concat(_.map(_.difference(old_jids, new_jids), function (jid) { + return { + 'jid': jid, + 'affiliation': 'none' + }; + })); + } + + return delta; + }, + sendAffiliationIQ: function sendAffiliationIQ(chatroom_jid, affiliation, member) { + /* Send an IQ stanza specifying an affiliation change. + * + * Paremeters: + * (String) chatroom_jid: JID of the relevant room + * (String) affiliation: affiliation (could also be stored + * on the member object). + * (Object) member: Map containing the member's jid and + * optionally a reason and affiliation. + */ + return new Promise(function (resolve, reject) { + var iq = $iq({ + to: chatroom_jid, + type: "set" + }).c("query", { + xmlns: Strophe.NS.MUC_ADMIN + }).c("item", { + 'affiliation': member.affiliation || affiliation, + 'jid': member.jid + }); + + if (!_.isUndefined(member.reason)) { + iq.c("reason", member.reason); + } + + _converse.connection.sendIQ(iq, resolve, reject); + }); + }, + setAffiliation: function setAffiliation(affiliation, members) { + /* Send IQ stanzas to the server to set an affiliation for + * the provided JIDs. + * + * See: http://xmpp.org/extensions/xep-0045.html#modifymember + * + * XXX: Prosody doesn't accept multiple JIDs' affiliations + * being set in one IQ stanza, so as a workaround we send + * a separate stanza for each JID. + * Related ticket: https://prosody.im/issues/issue/795 + * + * Parameters: + * (String) affiliation: The affiliation + * (Object) members: A map of jids, affiliations and + * optionally reasons. Only those entries with the + * same affiliation as being currently set will be + * considered. + * + * Returns: + * A promise which resolves and fails depending on the + * XMPP server response. + */ + members = _.filter(members, function (member) { + return (// We only want those members who have the right + // affiliation (or none, which implies the provided + // one). + _.isUndefined(member.affiliation) || member.affiliation === affiliation + ); + }); + + var promises = _.map(members, _.partial(this.sendAffiliationIQ, this.model.get('jid'), affiliation)); + + return Promise.all(promises); + }, + setAffiliations: function setAffiliations(members) { + /* Send IQ stanzas to the server to modify the + * affiliations in this room. + * + * See: http://xmpp.org/extensions/xep-0045.html#modifymember + * + * Parameters: + * (Object) members: A map of jids, affiliations and optionally reasons + * (Function) onSuccess: callback for a succesful response + * (Function) onError: callback for an error response + */ + var affiliations = _.uniq(_.map(members, 'affiliation')); + + _.each(affiliations, _.partial(this.setAffiliation.bind(this), _, members)); + }, + marshallAffiliationIQs: function marshallAffiliationIQs() { + /* Marshall a list of IQ stanzas into a map of JIDs and + * affiliations. + * + * Parameters: + * Any amount of XMLElement objects, representing the IQ + * stanzas. + */ + return _.flatMap(arguments[0], this.parseMemberListIQ); + }, + getJidsWithAffiliations: function getJidsWithAffiliations(affiliations) { + var _this4 = this; + + /* Returns a map of JIDs that have the affiliations + * as provided. + */ + if (_.isString(affiliations)) { + affiliations = [affiliations]; + } + + return new Promise(function (resolve, reject) { + var promises = _.map(affiliations, _.partial(_this4.requestMemberList, _this4.model.get('jid'))); + + Promise.all(promises).then(_.flow(_this4.marshallAffiliationIQs.bind(_this4), resolve), _.flow(_this4.marshallAffiliationIQs.bind(_this4), resolve)); + }); + }, + updateMemberLists: function updateMemberLists(members, affiliations, deltaFunc) { + var _this5 = this; + + /* Fetch the lists of users with the given affiliations. + * Then compute the delta between those users and + * the passed in members, and if it exists, send the delta + * to the XMPP server to update the member list. + * + * Parameters: + * (Object) members: Map of member jids and affiliations. + * (String|Array) affiliation: An array of affiliations or + * a string if only one affiliation. + * (Function) deltaFunc: The function to compute the delta + * between old and new member lists. + * + * Returns: + * A promise which is resolved once the list has been + * updated or once it's been established there's no need + * to update the list. + */ + this.getJidsWithAffiliations(affiliations).then(function (old_members) { + _this5.setAffiliations(deltaFunc(members, old_members)); + }); + }, + directInvite: function directInvite(recipient, reason) { + /* Send a direct invitation as per XEP-0249 + * + * Parameters: + * (String) recipient - JID of the person being invited + * (String) reason - Optional reason for the invitation + */ + if (this.model.get('membersonly')) { + // When inviting to a members-only room, 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. + var map = {}; + map[recipient] = 'member'; + + var deltaFunc = _.partial(this.computeAffiliationsDelta, true, false); + + this.updateMemberLists([{ + 'jid': recipient, + 'affiliation': 'member', + 'reason': reason + }], ['member', 'owner', 'admin'], deltaFunc); + } + + var attrs = { + 'xmlns': 'jabber:x:conference', + 'jid': this.model.get('jid') + }; + + if (reason !== null) { + attrs.reason = reason; + } + + if (this.model.get('password')) { + attrs.password = this.model.get('password'); + } + + var invitation = $msg({ + from: _converse.connection.jid, + to: recipient, + id: _converse.connection.getUniqueId() + }).c('x', attrs); + + _converse.connection.send(invitation); + + _converse.emit('roomInviteSent', { + 'room': this, + 'recipient': recipient, + 'reason': reason + }); + }, handleChatStateMessage: function handleChatStateMessage(message) { /* Override the method on the ChatBoxView base class to * ignore notifications in groupchats. @@ -57496,7 +56973,7 @@ return __p * Parameters: * (String) text: The message text to be sent. */ - text = u.httpToGeoUri(emojione.shortnameToUnicode(text), _converse); + text = emojione.shortnameToUnicode(text); var msgid = _converse.connection.getUniqueId(); @@ -57519,20 +56996,6 @@ return __p msgid: msgid }); }, - sendChatRoomFile: function sendChatRoomFile(text) { - var msgid = _converse.connection.getUniqueId(); - - var stanza = $msg({ - 'from': _converse.connection.jid, - 'to': this.model.get('jid'), - 'type': 'groupchat', - 'id': msgid - }).c("body").t(text).up().c("x", { - 'xmlns': Strophe.NS.OUTOFBAND - }).c('url').t(text).up(); - - _converse.connection.send(stanza); - }, modifyRole: function modifyRole(room, nick, role, reason, onSuccess, onError) { var item = $build("item", { nick: nick, @@ -57581,19 +57044,13 @@ return __p onCommandError: function onCommandError() { this.showStatusNotification(__("Error: could not execute the command"), true); }, - onMessageSubmitted: function onMessageSubmitted(text, notNeeded) { - var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - + onMessageSubmitted: function onMessageSubmitted(text) { /* Gets called when the user presses enter to send off a * message in a chat room. * * Parameters: * (String) text - The message text. */ - if (file !== null) { - return this.sendChatRoomFile(text); - } - if (_converse.muc_disable_moderator_commands) { return this.sendChatRoomMessage(text); } @@ -57608,7 +57065,7 @@ return __p break; } - this.model.setAffiliation('admin', [{ + this.setAffiliation('admin', [{ 'jid': args[0], 'reason': args[1] }]).then(null, this.onCommandError.bind(this)); @@ -57619,7 +57076,7 @@ return __p break; } - this.model.setAffiliation('outcast', [{ + this.setAffiliation('outcast', [{ 'jid': args[0], 'reason': args[1] }]).then(null, this.onCommandError.bind(this)); @@ -57662,7 +57119,7 @@ return __p break; } - this.model.setAffiliation('member', [{ + this.setAffiliation('member', [{ 'jid': args[0], 'reason': args[1] }]).then(null, this.onCommandError.bind(this)); @@ -57682,7 +57139,7 @@ return __p break; } - this.model.setAffiliation('owner', [{ + this.setAffiliation('owner', [{ 'jid': args[0], 'reason': args[1] }]).then(null, this.onCommandError.bind(this)); @@ -57701,7 +57158,7 @@ return __p break; } - this.model.setAffiliation('none', [{ + this.setAffiliation('none', [{ 'jid': args[0], 'reason': args[1] }]).then(null, this.onCommandError.bind(this)); @@ -57817,8 +57274,7 @@ return __p nick = nick ? nick : this.model.get('nick'); if (!nick) { - this.checkForReservedNick(); - return this; + return this.checkForReservedNick(); } if (this.model.get('connection_status') === converse.ROOMSTATUS.ENTERED) { @@ -57888,7 +57344,7 @@ return __p _converse.ChatBoxView.prototype.close.apply(this, arguments); }, renderConfigurationForm: function renderConfigurationForm(stanza) { - var _this4 = this; + var _this6 = this; /* Renders a form given an IQ stanza containing the current * room configuration. @@ -57933,16 +57389,48 @@ return __p last_fieldset_el.querySelector('input[type=button]').addEventListener('click', function (ev) { ev.preventDefault(); - _this4.closeForm(); + _this6.closeForm(); }); form_el.addEventListener('submit', function (ev) { ev.preventDefault(); - _this4.saveConfiguration(ev.target).then(_this4.getRoomFeatures.bind(_this4)); + _this6.saveConfiguration(ev.target).then(_this6.getRoomFeatures.bind(_this6)); }, false); }, + sendConfiguration: function sendConfiguration(config, onSuccess, onError) { + /* Send an IQ stanza with the room configuration. + * + * Parameters: + * (Array) config: The room configuration + * (Function) onSuccess: Callback upon succesful IQ response + * The first parameter passed in is IQ containing the + * room configuration. + * The second is the response IQ from the server. + * (Function) onError: Callback upon error IQ response + * The first parameter passed in is IQ containing the + * room configuration. + * The second is the response IQ from the server. + */ + var iq = $iq({ + to: this.model.get('jid'), + type: "set" + }).c("query", { + xmlns: Strophe.NS.MUC_OWNER + }).c("x", { + xmlns: Strophe.NS.XFORM, + type: "submit" + }); + + _.each(config || [], function (node) { + iq.cnode(node).up(); + }); + + onSuccess = _.isUndefined(onSuccess) ? _.noop : _.partial(onSuccess, iq.nodeTree); + onError = _.isUndefined(onError) ? _.noop : _.partial(onError, iq.nodeTree); + return _converse.connection.sendIQ(iq, onSuccess, onError); + }, saveConfiguration: function saveConfiguration(form) { - var _this5 = this; + var _this7 = this; /* Submit the room configuration form by sending an IQ * stanza to the server. @@ -57957,13 +57445,13 @@ return __p var inputs = form ? sizzle(':input:not([type=button]):not([type=submit])', form) : [], configArray = _.map(inputs, u.webForm2xForm); - _this5.model.sendConfiguration(configArray, resolve, reject); + _this7.sendConfiguration(configArray, resolve, reject); - _this5.closeForm(); + _this7.closeForm(); }); }, autoConfigureChatRoom: function autoConfigureChatRoom() { - var _this6 = this; + var _this8 = this; /* Automatically configure room based on the * 'roomconfig' data on this view's model. @@ -57977,7 +57465,7 @@ return __p */ var that = this; return new Promise(function (resolve, reject) { - _this6.fetchRoomConfiguration().then(function (stanza) { + _this8.fetchRoomConfiguration().then(function (stanza) { var configArray = [], fields = stanza.querySelectorAll('field'), config = that.model.get('roomconfig'); @@ -58009,7 +57497,7 @@ return __p configArray.push(field); if (! --count) { - that.model.sendConfiguration(configArray, resolve, reject); + that.sendConfiguration(configArray, resolve, reject); } }); }); @@ -58023,7 +57511,7 @@ return __p this.renderAfterTransition(); }, fetchRoomConfiguration: function fetchRoomConfiguration(handler) { - var _this7 = this, + var _this9 = this, _arguments = arguments; /* Send an IQ stanza to fetch the room configuration data. @@ -58035,13 +57523,13 @@ return __p */ return new Promise(function (resolve, reject) { _converse.connection.sendIQ($iq({ - 'to': _this7.model.get('jid'), + 'to': _this9.model.get('jid'), 'type': "get" }).c("query", { xmlns: Strophe.NS.MUC_OWNER }), function (iq) { if (handler) { - handler.apply(_this7, _arguments); + handler.apply(_this9, _arguments); } resolve(iq); @@ -58049,14 +57537,57 @@ return __p ); }); }, + parseRoomFeatures: function parseRoomFeatures(iq) { + /* See http://xmpp.org/extensions/xep-0045.html#disco-roominfo + * + * + * + * + * + * + * + * + * + * + */ + var features = { + 'features_fetched': true, + 'name': iq.querySelector('identity').getAttribute('name') + }; + + _.each(iq.querySelectorAll('feature'), function (field) { + var fieldname = field.getAttribute('var'); + + if (!fieldname.startsWith('muc_')) { + if (fieldname === Strophe.NS.MAM) { + features.mam_enabled = true; + } + + return; + } + + features[fieldname.replace('muc_', '')] = true; + }); + + var desc_field = iq.querySelector('field[var="muc#roominfo_description"] value'); + + if (!_.isNull(desc_field)) { + features.description = desc_field.textContent; + } + + this.model.save(features); + }, getRoomFeatures: function getRoomFeatures() { - var _this8 = this; + var _this10 = this; /* Fetch the room disco info, parse it and then * save it on the Backbone.Model of this chat rooms. */ return new Promise(function (resolve, reject) { - _converse.connection.disco.info(_this8.model.get('jid'), null, _.flow(_this8.model.parseRoomFeatures.bind(_this8.model), resolve), function () { + _converse.connection.disco.info(_this10.model.get('jid'), null, _.flow(_this10.parseRoomFeatures.bind(_this10), resolve), function () { reject(new Error("Could not parse the room features")); }, 5000); }); @@ -58100,10 +57631,20 @@ return __p checkForReservedNick: function checkForReservedNick() { /* User service-discovery to ask the XMPP server whether * this user has a reserved nickname for this room. - * If so, we'll use that, otherwise we render the nickname form. + * If so, we'll use that, otherwise we render the nickname + * form. */ this.showSpinner(); - this.model.checkForReservedNick(this.onNickNameFound.bind(this), this.onNickNameNotFound.bind(this)); + + _converse.connection.sendIQ($iq({ + 'to': this.model.get('jid'), + 'from': _converse.connection.jid, + 'type': "get" + }).c("query", { + 'xmlns': Strophe.NS.DISCO_INFO, + 'node': 'x-roomuser-item' + }), this.onNickNameFound.bind(this), this.onNickNameNotFound.bind(this)); + return this; }, onNickNameFound: function onNickNameFound(iq) { @@ -58264,6 +57805,33 @@ return __p return; }, + saveAffiliationAndRole: function saveAffiliationAndRole(pres) { + /* Parse the presence stanza for the current user's + * affiliation. + * + * Parameters: + * (XMLElement) pres: A stanza. + */ + var item = sizzle("x[xmlns=\"".concat(Strophe.NS.MUC_USER, "\"] item"), pres).pop(); + var is_self = pres.querySelector("status[code='110']"); + + if (is_self && !_.isNil(item)) { + var affiliation = item.getAttribute('affiliation'); + var role = item.getAttribute('role'); + + if (affiliation) { + this.model.save({ + 'affiliation': affiliation + }); + } + + if (role) { + this.model.save({ + 'role': role + }); + } + } + }, parseXUserElement: function parseXUserElement(x, stanza, is_self) { /* Parse the passed-in * element and construct a map containing relevant @@ -58317,7 +57885,7 @@ return __p return notification; }, displayNotificationsforUser: function displayNotificationsforUser(notification) { - var _this9 = this; + var _this11 = this; /* Given the notification object generated by * parseXUserElement, display any relevant messages and @@ -58339,7 +57907,7 @@ return __p } _.each(notification.messages, function (message) { - _this9.content.insertAdjacentHTML('beforeend', tpl_info({ + _this11.content.insertAdjacentHTML('beforeend', tpl_info({ 'data': '', 'isodate': moment().format(), 'extra_classes': 'chat-event', @@ -58565,7 +58133,7 @@ return __p * Parameters: * (XMLElement) pres: The stanza */ - this.model.saveAffiliationAndRole(pres); + this.saveAffiliationAndRole(pres); var locked_room = pres.querySelector("status[code='201']"); if (locked_room) { @@ -59038,7 +58606,7 @@ return __p var reason = prompt(__('You are about to invite %1$s to the chat room "%2$s". ' + 'You may optionally include a message, explaining the reason for the invitation.', suggestion.text.label, this.model.get('id'))); if (reason !== null) { - this.chatroomview.model.directInvite(suggestion.text.value, reason); + this.chatroomview.directInvite(suggestion.text.value, reason); } var form = suggestion.target.form, @@ -59164,6 +58732,8 @@ return __p }); }); //# sourceMappingURL=converse-muc-views.js.map; + + // Converse.js (A browser based XMPP chat client) // http://conversejs.org // @@ -59172,7 +58742,7 @@ return __p // (function (root, factory) { define('converse-muc-embedded',["converse-core", "converse-muc"], factory); -})(this, function (converse) { +})(void 0, function (converse) { "use strict"; var _converse$env = converse.env, @@ -66523,6 +66093,8 @@ CryptoJS.mode.CTR = (function () { } })); + + // Converse.js (A browser based XMPP chat client) // http://conversejs.org // @@ -66537,7 +66109,7 @@ CryptoJS.mode.CTR = (function () { */ (function (root, factory) { define('converse-otr',["converse-chatview", "bootstrap", "tpl!toolbar_otr", 'otr'], factory); -})(this, function (converse, bootstrap, tpl_toolbar_otr, otr) { +})(void 0, function (converse, bootstrap, tpl_toolbar_otr, otr) { "use strict"; var _converse$env = converse.env, @@ -67133,6 +66705,8 @@ __p += '\n'; return __p };}); + + // Converse.js (A browser based XMPP chat client) // http://conversejs.org // @@ -67147,7 +66721,7 @@ return __p */ (function (root, factory) { define('converse-register',["form-utils", "converse-core", "tpl!form_username", "tpl!register_link", "tpl!register_panel", "tpl!registration_form", "tpl!registration_request", "tpl!form_input", "tpl!spinner", "converse-controlbox"], factory); -})(this, function (utils, converse, tpl_form_username, tpl_register_link, tpl_register_panel, tpl_registration_form, tpl_registration_request, tpl_form_input, tpl_spinner) { +})(void 0, function (utils, converse, tpl_form_username, tpl_register_link, tpl_register_panel, tpl_registration_form, tpl_registration_request, tpl_form_input, tpl_spinner) { "use strict"; // Strophe methods for building stanzas var _converse$env = converse.env, @@ -67935,6 +67509,8 @@ return __p }); })); + + // Converse.js (A browser based XMPP chat client) // http://conversejs.org // @@ -67949,7 +67525,7 @@ return __p */ (function (root, factory) { define('converse-ping',["converse-core", "strophe.ping"], factory); -})(this, function (converse) { +})(void 0, function (converse) { "use strict"; // Strophe methods for building stanzas var _converse$env = converse.env, @@ -68057,6 +67633,8 @@ return __p }); }); //# sourceMappingURL=converse-ping.js.map; + + // Converse.js (A browser based XMPP chat client) // http://conversejs.org // @@ -68067,7 +67645,7 @@ return __p /*global define */ (function (root, factory) { define('converse-notification',["converse-core"], factory); -})(this, function (converse) { +})(void 0, function (converse) { "use strict"; var _converse$env = converse.env, @@ -68414,6 +67992,8 @@ __p += '\n