1
0
mirror of https://github.com/moparisthebest/kaiwa synced 2024-11-05 17:15:04 -05:00

Fix: Load MUCs

This commit is contained in:
Sébastien Hut 2015-02-27 19:25:13 +01:00 committed by Sébastien Hut
parent cd49158025
commit 424be688f9

View File

@ -68,9 +68,10 @@ module.exports = BaseCollection.extend({
if (err) return;
rooms = res.discoItems.items;
if (rooms === undefined)
rooms = [];
var roomNum = 0;
if (rooms) {
rooms.forEach (function (room) {
client.getDiscoInfo(room.jid, '', function (err, res) {
@ -94,7 +95,6 @@ module.exports = BaseCollection.extend({
if (cb && roomNum == rooms.length) cb();
});
});
}
}).then(function() {
if (cb && !rooms.length) cb();
});