Bugfix. Arrays in configuration settings were ignored.

This commit is contained in:
JC Brand 2016-11-22 08:55:52 +00:00
parent 5a72466c45
commit c670893058
3 changed files with 8 additions and 1 deletions

View File

@ -4,6 +4,7 @@
- #721 keepalive not working with anonymous authentication [jcbrand]
- Enable new rooms to be configured automatically, with a default config, via `rooms.open`.
For details, refer to the [relevant documentation](https://conversejs.org/docs/html/developer_api.html#the-rooms-grouping) [jcbrand]
- Bugfix: Arrays in configuration settings were ignored. [jcbrand]
## 2.0.1 (2016-11-07)
- #203 New configuration setting [muc_domain](https://conversejs.org/docs/html/configuration.html#muc_domain) [jcbrand]

View File

@ -12,6 +12,7 @@
show_toolbar: true,
chatview_avatar_width: 32,
chatview_avatar_height: 32,
auto_join_rooms: [],
visible_toolbar_buttons: {
'emoticons': true,
'call': false,
@ -26,6 +27,9 @@
show_toolbar: false,
chatview_avatar_width: 32,
chatview_avatar_height: 48,
auto_join_rooms: [
'anonymous@conference.nomnom.im',
],
visible_toolbar_buttons: {
'emoticons': false,
'call': false,
@ -44,6 +48,8 @@
expect(context.visible_toolbar_buttons.call).toBeFalsy();
expect(context.visible_toolbar_buttons.toggle_occupants).toBeFalsy();
expect(context.visible_toolbar_buttons.invalid).toBeFalsy();
expect(context.auto_join_rooms.length).toBe(1);
expect(context.auto_join_rooms[0]).toBe('anonymous@conference.nomnom.im');
user_settings = {
visible_toolbar_buttons: {

View File

@ -253,7 +253,7 @@
if (_.isUndefined(user_settings[k])) {
continue;
}
if (_.isObject(settings[k])) {
if (_.isObject(settings[k]) && !_.isArray(settings[k])) {
applyUserSettings(context[k], settings[k], user_settings[k]);
} else {
context[k] = user_settings[k];