Commit 29386dd2 authored by Weblate's avatar Weblate

Merge remote-tracking branch 'origin/master'

parents 81795436 16b8946d
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
be available. See the [locales_url](https://conversejs.org/docs/html/configurations.html#locales-url) be available. See the [locales_url](https://conversejs.org/docs/html/configurations.html#locales-url)
configuration setting for more info. configuration setting for more info.
- The translation machinery has now been moved to a separate module in `src/i18n.js`. - The translation machinery has now been moved to a separate module in `src/i18n.js`.
- jQuery has been completely removed as a dependency (still used in tests though).
## 3.2.1 (2017-08-29) ## 3.2.1 (2017-08-29)
......
...@@ -4142,15 +4142,9 @@ ...@@ -4142,15 +4142,9 @@
"dev": true "dev": true
}, },
"jquery": { "jquery": {
"version": "2.2.3", "version": "3.2.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-2.2.3.tgz", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.2.1.tgz",
"integrity": "sha1-ReB+QZAzTeNsnhpktDsfE3PZF1g=", "integrity": "sha1-XE2d5lKvbNCncBVKYxu6ErAVx4c=",
"dev": true
},
"jquery.browser": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/jquery.browser/-/jquery.browser-0.1.0.tgz",
"integrity": "sha1-nHKmCV/SgUtER26o9xZne3Kmors=",
"dev": true "dev": true
}, },
"js-tokens": { "js-tokens": {
...@@ -8137,6 +8131,12 @@ ...@@ -8137,6 +8131,12 @@
"type-detect": "4.0.3" "type-detect": "4.0.3"
} }
}, },
"sizzle": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/sizzle/-/sizzle-2.3.3.tgz",
"integrity": "sha1-TrB4w3IxpWtS5Bk/cB5++JN+YGs=",
"dev": true
},
"slash": { "slash": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz",
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
"install": "^0.8.5", "install": "^0.8.5",
"jasmine-core": "2.6.4", "jasmine-core": "2.6.4",
"jed": "0.5.4", "jed": "0.5.4",
"jquery": "2.2.3", "jquery": "3.2.1",
"jshint": "^2.9.4", "jshint": "^2.9.4",
"lodash": "4.17.4", "lodash": "4.17.4",
"lodash-template-loader": "^2.0.0", "lodash-template-loader": "^2.0.0",
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
"requirejs": "2.3.3", "requirejs": "2.3.3",
"run-headless-chromium": "^0.1.1", "run-headless-chromium": "^0.1.1",
"sinon": "^2.1.0", "sinon": "^2.1.0",
"sizzle": "^2.3.3",
"snabbdom": "jcbrand/snabbdom", "snabbdom": "jcbrand/snabbdom",
"snyk": "^1.21.2", "snyk": "^1.21.2",
"strophe.js": "1.2.14", "strophe.js": "1.2.14",
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
var Strophe = converse.env.Strophe; var Strophe = converse.env.Strophe;
var Promise = converse.env.Promise; var Promise = converse.env.Promise;
var moment = converse.env.moment; var moment = converse.env.moment;
var sizzle = converse.env.sizzle;
var u = converse.env.utils; var u = converse.env.utils;
return describe("ChatRooms", function () { return describe("ChatRooms", function () {
...@@ -150,6 +151,7 @@ ...@@ -150,6 +151,7 @@
expect(room.is_chatroom).toBeTruthy(); expect(room.is_chatroom).toBeTruthy();
chatroomview = _converse.chatboxviews.get(jid); chatroomview = _converse.chatboxviews.get(jid);
expect(u.isVisible(chatroomview.el)).toBeTruthy(); expect(u.isVisible(chatroomview.el)).toBeTruthy();
chatroomview.close();
// Test with mixed case in JID // Test with mixed case in JID
jid = 'Leisure@localhost'; jid = 'Leisure@localhost';
...@@ -172,10 +174,11 @@ ...@@ -172,10 +174,11 @@
chatroomview.close(); chatroomview.close();
_converse.muc_instant_rooms = false; _converse.muc_instant_rooms = false;
var sent_IQ, IQ_id; var sent_IQ, IQ_id, sent_IQ_els = [];
var sendIQ = _converse.connection.sendIQ; var sendIQ = _converse.connection.sendIQ;
spyOn(_converse.connection, 'sendIQ').and.callFake(function (iq, callback, errback) { spyOn(_converse.connection, 'sendIQ').and.callFake(function (iq, callback, errback) {
sent_IQ = iq; sent_IQ = iq;
sent_IQ_els.push(iq.nodeTree);
IQ_id = sendIQ.bind(this)(iq, callback, errback); IQ_id = sendIQ.bind(this)(iq, callback, errback);
}); });
// Test with configuration // Test with configuration
...@@ -191,6 +194,7 @@ ...@@ -191,6 +194,7 @@
'whois': 'anyone' 'whois': 'anyone'
} }
}); });
chatroomview = _converse.chatboxviews.get('room@conference.example.org');
// We pretend this is a new room, so no disco info is returned. // We pretend this is a new room, so no disco info is returned.
var features_stanza = $iq({ var features_stanza = $iq({
...@@ -228,7 +232,7 @@ ...@@ -228,7 +232,7 @@
"<iq to='room@conference.example.org' type='get' xmlns='jabber:client' id='"+IQ_id+ "<iq to='room@conference.example.org' type='get' xmlns='jabber:client' id='"+IQ_id+
"'><query xmlns='http://jabber.org/protocol/muc#owner'/></iq>" "'><query xmlns='http://jabber.org/protocol/muc#owner'/></iq>"
); );
_converse.connection._dataRecv(test_utils.createRequest($( var node = Strophe.xmlHtmlNode(
'<iq xmlns="jabber:client"'+ '<iq xmlns="jabber:client"'+
' type="result"'+ ' type="result"'+
' to="dummy@localhost/pda"'+ ' to="dummy@localhost/pda"'+
...@@ -257,22 +261,27 @@ ...@@ -257,22 +261,27 @@
' <value>20</value></field>'+ ' <value>20</value></field>'+
' </x>'+ ' </x>'+
' </query>'+ ' </query>'+
' </iq>')[0])); ' </iq>');
spyOn(chatroomview, 'sendConfiguration').and.callThrough();
_converse.connection._dataRecv(test_utils.createRequest(node.firstElementChild));
return test_utils.waitUntil(function () { return test_utils.waitUntil(function () {
return sent_IQ.toLocaleString() !== return chatroomview.sendConfiguration.calls.count() === 1;
"<iq to='room@conference.example.org' type='get' xmlns='jabber:client' id='"+IQ_id+
"'><query xmlns='http://jabber.org/protocol/muc#owner'/></iq>";
}, 300).then(function () { }, 300).then(function () {
var $sent_stanza = $(sent_IQ.toLocaleString()); var sent_stanza = sent_IQ_els.pop();
expect($sent_stanza.find('field[var="muc#roomconfig_roomname"] value').text()).toBe('Room'); while (sent_stanza.getAttribute('type') !== 'set') {
expect($sent_stanza.find('field[var="muc#roomconfig_roomdesc"] value').text()).toBe('Welcome to this room'); sent_stanza = sent_IQ_els.pop();
expect($sent_stanza.find('field[var="muc#roomconfig_persistentroom"] value').text()).toBe('1'); }
expect($sent_stanza.find('field[var="muc#roomconfig_publicroom"] value ').text()).toBe('1'); expect(sizzle('field[var="muc#roomconfig_roomname"] value', sent_stanza).pop().textContent).toBe('Room');
expect($sent_stanza.find('field[var="muc#roomconfig_changesubject"] value').text()).toBe('0'); expect(sizzle('field[var="muc#roomconfig_roomdesc"] value', sent_stanza).pop().textContent).toBe('Welcome to this room');
expect($sent_stanza.find('field[var="muc#roomconfig_whois"] value ').text()).toBe('anyone'); expect(sizzle('field[var="muc#roomconfig_persistentroom"] value', sent_stanza).pop().textContent).toBe('1');
expect($sent_stanza.find('field[var="muc#roomconfig_membersonly"] value').text()).toBe('1'); expect(sizzle('field[var="muc#roomconfig_publicroom"] value ', sent_stanza).pop().textContent).toBe('1');
expect($sent_stanza.find('field[var="muc#roomconfig_historylength"] value').text()).toBe('20'); expect(sizzle('field[var="muc#roomconfig_changesubject"] value', sent_stanza).pop().textContent).toBe('0');
expect(sizzle('field[var="muc#roomconfig_whois"] value ', sent_stanza).pop().textContent).toBe('anyone');
expect(sizzle('field[var="muc#roomconfig_membersonly"] value', sent_stanza).pop().textContent).toBe('1');
expect(sizzle('field[var="muc#roomconfig_historylength"] value', sent_stanza).pop().textContent).toBe('20');
done(); done();
}); });
}); });
...@@ -376,15 +385,15 @@ ...@@ -376,15 +385,15 @@
.c('status').attrs({code:'201'}).nodeTree; .c('status').attrs({code:'201'}).nodeTree;
_converse.connection._dataRecv(test_utils.createRequest(presence)); _converse.connection._dataRecv(test_utils.createRequest(presence));
var info_text = $(view.el).find('.chat-content .chat-info').text(); var info_text = view.el.querySelector('.chat-content .chat-info').textContent;
expect(info_text).toBe('A new room has been created'); expect(info_text).toBe('A new room has been created');
// An instant room is created by saving the default configuratoin. // An instant room is created by saving the default configuratoin.
// //
/* <iq to="myroom@conference.chat.example.org" type="set" xmlns="jabber:client" id="5025e055-036c-4bc5-a227-706e7e352053:sendIQ"> /* <iq to="myroom@conference.chat.example.org" type="set" xmlns="jabber:client" id="5025e055-036c-4bc5-a227-706e7e352053:sendIQ">
* <query xmlns="http://jabber.org/protocol/muc#owner"><x xmlns="jabber:x:data" type="submit"/></query> * <query xmlns="http://jabber.org/protocol/muc#owner"><x xmlns="jabber:x:data" type="submit"/></query>
* </iq> * </iq>
*/ */
expect(sent_IQ.toLocaleString()).toBe( expect(sent_IQ.toLocaleString()).toBe(
"<iq to='lounge@localhost' type='set' xmlns='jabber:client' id='"+IQ_id+"'>"+ "<iq to='lounge@localhost' type='set' xmlns='jabber:client' id='"+IQ_id+"'>"+
"<query xmlns='http://jabber.org/protocol/muc#owner'><x xmlns='jabber:x:data' type='submit'/>"+ "<query xmlns='http://jabber.org/protocol/muc#owner'><x xmlns='jabber:x:data' type='submit'/>"+
......
...@@ -38,7 +38,7 @@ require.config({ ...@@ -38,7 +38,7 @@ require.config({
"lodash.noconflict": "src/lodash.noconflict", "lodash.noconflict": "src/lodash.noconflict",
"pluggable": "node_modules/pluggable.js/dist/pluggable", "pluggable": "node_modules/pluggable.js/dist/pluggable",
"polyfill": "src/polyfill", "polyfill": "src/polyfill",
"sizzle": "node_modules/jquery/sizzle/dist/sizzle", "sizzle": "node_modules/sizzle/dist/sizzle",
"strophe": "node_modules/strophe.js/strophe", "strophe": "node_modules/strophe.js/strophe",
"strophe.disco": "node_modules/strophejs-plugin-disco/strophe.disco", "strophe.disco": "node_modules/strophejs-plugin-disco/strophe.disco",
"strophe.ping": "node_modules/strophejs-plugin-ping/strophe.ping", "strophe.ping": "node_modules/strophejs-plugin-ping/strophe.ping",
......
...@@ -710,8 +710,11 @@ ...@@ -710,8 +710,11 @@
// Forward the message, so that other connected resources are also aware of it. // Forward the message, so that other connected resources are also aware of it.
_converse.connection.send( _converse.connection.send(
$msg({ to: _converse.bare_jid, type: 'chat', id: message.get('msgid') }) $msg({ to: _converse.bare_jid, type: 'chat', id: message.get('msgid') })
.c('forwarded', {xmlns:'urn:xmpp:forward:0'}) .c('forwarded', {'xmlns': Strophe.NS.FORWARD})
.c('delay', {xmns:'urn:xmpp:delay',stamp:(new Date()).getTime()}).up() .c('delay', {
'xmns': Strophe.NS.DELAY,
'stamp': moment.format()
}).up()
.cnode(messageStanza.tree()) .cnode(messageStanza.tree())
); );
} }
......
...@@ -36,13 +36,14 @@ ...@@ -36,13 +36,14 @@
Strophe.addNamespace('CHATSTATES', 'http://jabber.org/protocol/chatstates'); Strophe.addNamespace('CHATSTATES', 'http://jabber.org/protocol/chatstates');
Strophe.addNamespace('CSI', 'urn:xmpp:csi:0'); Strophe.addNamespace('CSI', 'urn:xmpp:csi:0');
Strophe.addNamespace('DELAY', 'urn:xmpp:delay'); Strophe.addNamespace('DELAY', 'urn:xmpp:delay');
Strophe.addNamespace('FORWARD', 'urn:xmpp:forward:0');
Strophe.addNamespace('HINTS', 'urn:xmpp:hints'); Strophe.addNamespace('HINTS', 'urn:xmpp:hints');
Strophe.addNamespace('MAM', 'urn:xmpp:mam:2'); Strophe.addNamespace('MAM', 'urn:xmpp:mam:2');
Strophe.addNamespace('SID', 'urn:xmpp:sid:0');
Strophe.addNamespace('NICK', 'http://jabber.org/protocol/nick'); Strophe.addNamespace('NICK', 'http://jabber.org/protocol/nick');
Strophe.addNamespace('PUBSUB', 'http://jabber.org/protocol/pubsub'); Strophe.addNamespace('PUBSUB', 'http://jabber.org/protocol/pubsub');
Strophe.addNamespace('ROSTERX', 'http://jabber.org/protocol/rosterx'); Strophe.addNamespace('ROSTERX', 'http://jabber.org/protocol/rosterx');
Strophe.addNamespace('RSM', 'http://jabber.org/protocol/rsm'); Strophe.addNamespace('RSM', 'http://jabber.org/protocol/rsm');
Strophe.addNamespace('SID', 'urn:xmpp:sid:0');
Strophe.addNamespace('XFORM', 'jabber:x:data'); Strophe.addNamespace('XFORM', 'jabber:x:data');
// Use Mustache style syntax for variable interpolation // Use Mustache style syntax for variable interpolation
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment