diff --git a/CHANGES.md b/CHANGES.md index 62aedfbde..b1acb039a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ ### Bugfixes - #800 Could not register successfully in ejabberd 17.01 - #949 Don't flash the roster contacts filter (i.e. hide by default) +- #951 Duplicate messages received in an MUC chat room. - #953 MUC "Features" displayed when exiting configuration - #967 Rooms list doesn't show when the server doesn't support bookmarks - Don't require `auto_login` to be `true` when using the API to log in. diff --git a/package-lock.json b/package-lock.json index 823accb24..9fe2b3b5e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -921,7 +921,7 @@ "dev": true }, "backbone.overview": { - "version": "git+https://github.com/jcbrand/Backbone.Overview.git#16239768880044f402edbdb1843220c44204cf15", + "version": "git+https://github.com/jcbrand/Backbone.Overview.git#1c67a73be1f43cbb39fcd6b1b5d3cfc0ffdf2b5c", "dev": true, "requires": { "backbone": "1.3.3" diff --git a/spec/chatroom.js b/spec/chatroom.js index 4d6ce6d55..6b6970457 100644 --- a/spec/chatroom.js +++ b/spec/chatroom.js @@ -75,9 +75,8 @@ test_utils.createContacts(_converse, 'current'); test_utils.waitUntil(function () { - return $(_converse.rosterview.el).find('.roster-group .group-toggle').length; - }, 300) - .then(function () { + return $(_converse.rosterview.el).find('.roster-group .group-toggle').length; + }, 300).then(function () { test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy').then(function () { var jid = 'lounge@localhost'; var room = _converse.api.rooms.get(jid); @@ -289,6 +288,7 @@ }); describe("An instant chat room", function () { + it("will be created when muc_instant_rooms is set to true", mock.initConverseWithPromises( null, ['rosterGroupsFetched'], {}, @@ -297,9 +297,17 @@ var sent_IQ, IQ_id; var sendIQ = _converse.connection.sendIQ; spyOn(_converse.connection, 'sendIQ').and.callFake(function (iq, callback, errback) { - sent_IQ = iq; - IQ_id = sendIQ.bind(this)(iq, callback, errback); + if (iq.nodeTree.getAttribute('to') === 'lounge@localhost') { + sent_IQ = iq; + IQ_id = sendIQ.bind(this)(iq, callback, errback); + } else { + sendIQ.bind(this)(iq, callback, errback); + } }); + test_utils.openChatRoom(_converse, 'lounge', 'localhost', 'dummy'); + + // We pretend this is a new room, so no disco info is returned. + // /* * * @@ -309,10 +317,8 @@ * * */ - test_utils.openChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - // We pretend this is a new room, so no disco info is returned. var features_stanza = $iq({ - from: 'lounge@localhost', + 'from': 'lounge@localhost', 'id': IQ_id, 'to': 'dummy@localhost/desktop', 'type': 'error' @@ -337,7 +343,7 @@ "type='get' xmlns='jabber:client' id='"+IQ_id+"'>"+ "" }, 300).then(function () { - /* * + /* * * * @@ -1238,8 +1244,12 @@ var sent_IQ, IQ_id; var sendIQ = _converse.connection.sendIQ; spyOn(_converse.connection, 'sendIQ').and.callFake(function (iq, callback, errback) { - sent_IQ = iq; - IQ_id = sendIQ.bind(this)(iq, callback, errback); + if (iq.nodeTree.getAttribute('to') === 'lounge@localhost') { + sent_IQ = iq; + IQ_id = sendIQ.bind(this)(iq, callback, errback); + } else { + sendIQ.bind(this)(iq, callback, errback); + } }); test_utils.openChatRoom(_converse, 'lounge', 'localhost', 'dummy');