Fix failing tests
This commit is contained in:
parent
890d87c980
commit
63888dd454
@ -78,7 +78,7 @@
|
|||||||
hide_muc_server: true, // Federation is disabled, so no use in
|
hide_muc_server: true, // Federation is disabled, so no use in
|
||||||
// showing the MUC server.
|
// showing the MUC server.
|
||||||
play_sounds: true,
|
play_sounds: true,
|
||||||
show_controlbox_by_default: true,
|
show_controlbox_by_default: false,
|
||||||
strict_plugin_dependencies: false,
|
strict_plugin_dependencies: false,
|
||||||
debug: true
|
debug: true
|
||||||
});
|
});
|
||||||
|
@ -756,12 +756,6 @@
|
|||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("when sent by the current user", function () {
|
|
||||||
it("will always cause the chat area to be scrolled down", mock.initConverse(function (_converse) {
|
|
||||||
// TODO
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
|
|
||||||
it("is ignored if it's a malformed headline message", mock.initConverse(function (_converse) {
|
it("is ignored if it's a malformed headline message", mock.initConverse(function (_converse) {
|
||||||
test_utils.createContacts(_converse, 'current');
|
test_utils.createContacts(_converse, 'current');
|
||||||
test_utils.openControlBox();
|
test_utils.openControlBox();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Converse.js (A browser based XMPP chat client)
|
// Converse.js (A browser based XMPP chat client)
|
||||||
// http://conversejs.org
|
// http://conversejs.org
|
||||||
//
|
//
|
||||||
// Copyright (c) 2012-2016, Jan-Carel Brand <jc@opkode.com>
|
// Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com>
|
||||||
// Licensed under the Mozilla Public License (MPLv2)
|
// Licensed under the Mozilla Public License (MPLv2)
|
||||||
//
|
//
|
||||||
/*global define */
|
/*global define */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Converse.js (A browser based XMPP chat client)
|
// Converse.js (A browser based XMPP chat client)
|
||||||
// http://conversejs.org
|
// http://conversejs.org
|
||||||
//
|
//
|
||||||
// Copyright (c) 2012-2016, Jan-Carel Brand <jc@opkode.com>
|
// Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com>
|
||||||
// Licensed under the Mozilla Public License (MPLv2)
|
// Licensed under the Mozilla Public License (MPLv2)
|
||||||
//
|
//
|
||||||
/*global Backbone, define */
|
/*global Backbone, define */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Converse.js (A browser based XMPP chat client)
|
// Converse.js (A browser based XMPP chat client)
|
||||||
// http://conversejs.org
|
// http://conversejs.org
|
||||||
//
|
//
|
||||||
// Copyright (c) 2012-2016, Jan-Carel Brand <jc@opkode.com>
|
// Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com>
|
||||||
// Licensed under the Mozilla Public License (MPLv2)
|
// Licensed under the Mozilla Public License (MPLv2)
|
||||||
//
|
//
|
||||||
/*global Backbone, define */
|
/*global Backbone, define */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Converse.js (A browser based XMPP chat client)
|
// Converse.js (A browser based XMPP chat client)
|
||||||
// http://conversejs.org
|
// http://conversejs.org
|
||||||
//
|
//
|
||||||
// Copyright (c) 2012-2016, Jan-Carel Brand <jc@opkode.com>
|
// Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com>
|
||||||
// Licensed under the Mozilla Public License (MPLv2)
|
// Licensed under the Mozilla Public License (MPLv2)
|
||||||
//
|
//
|
||||||
/*global define, Backbone */
|
/*global define, Backbone */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Converse.js (A browser based XMPP chat client)
|
// Converse.js (A browser based XMPP chat client)
|
||||||
// http://conversejs.org
|
// http://conversejs.org
|
||||||
//
|
//
|
||||||
// Copyright (c) 2012-2016, Jan-Carel Brand <jc@opkode.com>
|
// Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com>
|
||||||
// Licensed under the Mozilla Public License (MPLv2)
|
// Licensed under the Mozilla Public License (MPLv2)
|
||||||
//
|
//
|
||||||
/*global Backbone, define, window, document */
|
/*global Backbone, define, window, document */
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
/* Handler method for all incoming messages of type "headline".
|
/* Handler method for all incoming messages of type "headline".
|
||||||
*/
|
*/
|
||||||
var from_jid = message.getAttribute('from');
|
var from_jid = message.getAttribute('from');
|
||||||
|
var _converse = this.__super__._converse;
|
||||||
if (utils.isHeadlineMessage(message)) {
|
if (utils.isHeadlineMessage(message)) {
|
||||||
_converse.chatboxes.create({
|
_converse.chatboxes.create({
|
||||||
'id': from_jid,
|
'id': from_jid,
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
// Converse.js (A browser based XMPP chat client)
|
||||||
|
// http://conversejs.org
|
||||||
|
//
|
||||||
|
// Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com>
|
||||||
|
// Licensed under the Mozilla Public License (MPLv2)
|
||||||
|
//
|
||||||
|
/*global Backbone */
|
||||||
(function (root, factory) {
|
(function (root, factory) {
|
||||||
define("converse-muc-embedded", [
|
define("converse-muc-embedded", [
|
||||||
"converse-api",
|
"converse-api",
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
*/
|
*/
|
||||||
(function (root, factory) {
|
(function (root, factory) {
|
||||||
define("converse-muc", [
|
define("converse-muc", [
|
||||||
"converse-core",
|
|
||||||
"converse-api",
|
"converse-api",
|
||||||
"tpl!chatarea",
|
"tpl!chatarea",
|
||||||
"tpl!chatroom",
|
"tpl!chatroom",
|
||||||
@ -48,20 +47,6 @@
|
|||||||
tpl_room_panel
|
tpl_room_panel
|
||||||
) {
|
) {
|
||||||
"use strict";
|
"use strict";
|
||||||
_converse.templates.chatarea = tpl_chatarea;
|
|
||||||
_converse.templates.chatroom = tpl_chatroom;
|
|
||||||
_converse.templates.chatroom_form = tpl_chatroom_form;
|
|
||||||
_converse.templates.chatroom_nickname_form = tpl_chatroom_nickname_form;
|
|
||||||
_converse.templates.chatroom_password_form = tpl_chatroom_password_form;
|
|
||||||
_converse.templates.chatroom_sidebar = tpl_chatroom_sidebar;
|
|
||||||
_converse.templates.chatroom_head = tpl_chatroom_head;
|
|
||||||
_converse.templates.chatrooms_tab = tpl_chatrooms_tab;
|
|
||||||
_converse.templates.info = tpl_info;
|
|
||||||
_converse.templates.occupant = tpl_occupant;
|
|
||||||
_converse.templates.room_description = tpl_room_description;
|
|
||||||
_converse.templates.room_item = tpl_room_item;
|
|
||||||
_converse.templates.room_panel = tpl_room_panel;
|
|
||||||
|
|
||||||
var ROOMS_PANEL_ID = 'chatrooms';
|
var ROOMS_PANEL_ID = 'chatrooms';
|
||||||
|
|
||||||
// Strophe methods for building stanzas
|
// Strophe methods for building stanzas
|
||||||
@ -77,10 +62,6 @@
|
|||||||
_ = converse.env._,
|
_ = converse.env._,
|
||||||
moment = converse.env.moment;
|
moment = converse.env.moment;
|
||||||
|
|
||||||
// For translations
|
|
||||||
var __ = utils.__.bind(_converse);
|
|
||||||
var ___ = utils.___;
|
|
||||||
|
|
||||||
// Add Strophe Namespaces
|
// Add Strophe Namespaces
|
||||||
Strophe.addNamespace('MUC_ADMIN', Strophe.NS.MUC + "#admin");
|
Strophe.addNamespace('MUC_ADMIN', Strophe.NS.MUC + "#admin");
|
||||||
Strophe.addNamespace('MUC_OWNER', Strophe.NS.MUC + "#owner");
|
Strophe.addNamespace('MUC_OWNER', Strophe.NS.MUC + "#owner");
|
||||||
@ -111,6 +92,7 @@
|
|||||||
* returned via the API.
|
* returned via the API.
|
||||||
*/
|
*/
|
||||||
if (!chatbox) { return; }
|
if (!chatbox) { return; }
|
||||||
|
var _converse = this.__super__._converse;
|
||||||
var view = _converse.chatboxviews.get(chatbox.get('id'));
|
var view = _converse.chatboxviews.get(chatbox.get('id'));
|
||||||
var box = this.__super__.wrappedChatBox.apply(this, arguments);
|
var box = this.__super__.wrappedChatBox.apply(this, arguments);
|
||||||
box.is_chatroom = view.is_chatroom;
|
box.is_chatroom = view.is_chatroom;
|
||||||
@ -119,6 +101,7 @@
|
|||||||
|
|
||||||
Features: {
|
Features: {
|
||||||
addClientFeatures: function () {
|
addClientFeatures: function () {
|
||||||
|
var _converse = this.__super__._converse;
|
||||||
this.__super__.addClientFeatures.apply(this, arguments);
|
this.__super__.addClientFeatures.apply(this, arguments);
|
||||||
if (_converse.allow_muc_invitations) {
|
if (_converse.allow_muc_invitations) {
|
||||||
_converse.connection.disco.addFeature('jabber:x:conference'); // Invites
|
_converse.connection.disco.addFeature('jabber:x:conference'); // Invites
|
||||||
@ -191,6 +174,7 @@
|
|||||||
|
|
||||||
ChatBoxViews: {
|
ChatBoxViews: {
|
||||||
onChatBoxAdded: function (item) {
|
onChatBoxAdded: function (item) {
|
||||||
|
var _converse = this.__super__._converse;
|
||||||
var view = this.get(item.get('id'));
|
var view = this.get(item.get('id'));
|
||||||
if (!view && item.get('type') === 'chatroom') {
|
if (!view && item.get('type') === 'chatroom') {
|
||||||
view = new _converse.ChatRoomView({'model': item});
|
view = new _converse.ChatRoomView({'model': item});
|
||||||
@ -206,6 +190,24 @@
|
|||||||
/* The initialize function gets called as soon as the plugin is
|
/* The initialize function gets called as soon as the plugin is
|
||||||
* loaded by converse.js's plugin machinery.
|
* loaded by converse.js's plugin machinery.
|
||||||
*/
|
*/
|
||||||
|
var _converse = this._converse,
|
||||||
|
__ = _converse.__,
|
||||||
|
___ = _converse.___;
|
||||||
|
|
||||||
|
_converse.templates.chatarea = tpl_chatarea;
|
||||||
|
_converse.templates.chatroom = tpl_chatroom;
|
||||||
|
_converse.templates.chatroom_form = tpl_chatroom_form;
|
||||||
|
_converse.templates.chatroom_nickname_form = tpl_chatroom_nickname_form;
|
||||||
|
_converse.templates.chatroom_password_form = tpl_chatroom_password_form;
|
||||||
|
_converse.templates.chatroom_sidebar = tpl_chatroom_sidebar;
|
||||||
|
_converse.templates.chatroom_head = tpl_chatroom_head;
|
||||||
|
_converse.templates.chatrooms_tab = tpl_chatrooms_tab;
|
||||||
|
_converse.templates.info = tpl_info;
|
||||||
|
_converse.templates.occupant = tpl_occupant;
|
||||||
|
_converse.templates.room_description = tpl_room_description;
|
||||||
|
_converse.templates.room_item = tpl_room_item;
|
||||||
|
_converse.templates.room_panel = tpl_room_panel;
|
||||||
|
|
||||||
// XXX: Inside plugins, all calls to the translation machinery
|
// XXX: Inside plugins, all calls to the translation machinery
|
||||||
// (e.g. utils.__) should only be done in the initialize function.
|
// (e.g. utils.__) should only be done in the initialize function.
|
||||||
// If called before, we won't know what language the user wants,
|
// If called before, we won't know what language the user wants,
|
||||||
@ -2376,9 +2378,9 @@
|
|||||||
*/
|
*/
|
||||||
_.each(_converse.auto_join_rooms, function (room) {
|
_.each(_converse.auto_join_rooms, function (room) {
|
||||||
if (_.isString(room)) {
|
if (_.isString(room)) {
|
||||||
converse.api.rooms.open(room);
|
_converse.api.rooms.open(room);
|
||||||
} else if (_.isObject(room)) {
|
} else if (_.isObject(room)) {
|
||||||
converse.api.rooms.open(room.jid, room.nick);
|
_converse.api.rooms.open(room.jid, room.nick);
|
||||||
} else {
|
} else {
|
||||||
_converse.log('Invalid room criteria specified for "auto_join_rooms"', 'error');
|
_converse.log('Invalid room criteria specified for "auto_join_rooms"', 'error');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user