Commit 21241c5c authored by JC Brand's avatar JC Brand

Fixes #967. Rooms list not shown when server doesn't support bookmarks

parent 349d097e
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
- #800 Could not register successfully in ejabberd 17.01 - #800 Could not register successfully in ejabberd 17.01
- #949 Don't flash the roster contacts filter (i.e. hide by default) - #949 Don't flash the roster contacts filter (i.e. hide by default)
- #953 MUC "Features" displayed when exiting configuration - #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. - Don't require `auto_login` to be `true` when using the API to log in.
- Moment locale wasn't being set to the value passed via the `i18n` option. - Moment locale wasn't being set to the value passed via the `i18n` option.
- In the chat heading, two avatars sometimes get rendered. - In the chat heading, two avatars sometimes get rendered.
......
...@@ -385,7 +385,7 @@ ...@@ -385,7 +385,7 @@
_converse.log('Error while fetching bookmarks', Strophe.LogLevel.WARN); _converse.log('Error while fetching bookmarks', Strophe.LogLevel.WARN);
_converse.log(iq.outerHTML, Strophe.LogLevel.DEBUG); _converse.log(iq.outerHTML, Strophe.LogLevel.DEBUG);
if (!_.isNil(deferred)) { if (!_.isNil(deferred)) {
return deferred.reject(); return deferred.reject(new Error("Could not fetch bookmarks"));
} }
} }
}); });
...@@ -517,10 +517,13 @@ ...@@ -517,10 +517,13 @@
return; return;
} }
_converse.bookmarks = new _converse.Bookmarks(); _converse.bookmarks = new _converse.Bookmarks();
_converse.bookmarks.fetchBookmarks().then(function () { _converse.bookmarks.fetchBookmarks().then(() => {
_converse.bookmarksview = new _converse.BookmarksView( _converse.bookmarksview = new _converse.BookmarksView(
{'model': _converse.bookmarks} {'model': _converse.bookmarks}
); );
})
.catch(_.partial(_converse.log, _, Strophe.LogLevel.ERROR))
.then(() => {
_converse.emit('bookmarksInitialized'); _converse.emit('bookmarksInitialized');
}); });
}; };
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
* *
* NB: These plugins need to have already been loaded via require.js. * NB: These plugins need to have already been loaded via require.js.
*/ */
optional_dependencies: ["converse-bookmarks"], optional_dependencies: ["converse-controlbox", "converse-muc", "converse-bookmarks"],
initialize () { initialize () {
/* The initialize function gets called as soon as the plugin is /* The initialize function gets called as soon as the plugin is
......
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