diff --git a/Makefile b/Makefile index b7dc0271f..e625d373b 100644 --- a/Makefile +++ b/Makefile @@ -166,9 +166,9 @@ dist/converse-no-dependencies.min.js: src locale node_modules *.js dist/converse-no-dependencies.js: src locale node_modules *.js $(RJS) -o src/build-no-dependencies.js optimize=none out=dist/converse-no-dependencies.js dist/converse-mobile.min.js: src locale node_modules *.js - $(RJS) -o src/build.js include=converse-mobile out=dist/converse-mobile.min.js + $(RJS) -o src/build.js paths.converse=src/converse-mobile include=converse out=dist/converse-mobile.min.js dist/converse-mobile.js: src locale node_modules *.js - $(RJS) -o src/build.js optimize=none include=converse-mobile out=dist/converse-mobile.js + $(RJS) -o src/build.js paths.converse=src/converse-mobile include=converse out=dist/converse-mobile.js optimize=none .PHONY: jsmin jsmin: $(BUILDS) diff --git a/docs/CHANGES.md b/docs/CHANGES.md index 30fc5a760..6ac132429 100755 --- a/docs/CHANGES.md +++ b/docs/CHANGES.md @@ -33,7 +33,7 @@ - Use lodash instead of underscore.js [jcbrand] - Case insensitive matching of moderation commands. [jcbrand] - Add `/subject` as alias to `/topic` [jcbrand] -- `allow_chat_pending_contacts` now defaults to `true` [jcbrand] +- `message_carbons`, `play_sounds` and `allow_chat_pending_contacts` now default to `true` [jcbrand] - Improved roster filter UX. [jcbrand] - Render the login form again upon authfail. [jcbrand] - New promises API: [waitUntil](https://conversejs.org/docs/html/developer_api.html#waituntil) diff --git a/spec/converse.js b/spec/converse.js index 8bfa267f7..5f793f2bf 100644 --- a/spec/converse.js +++ b/spec/converse.js @@ -324,11 +324,11 @@ describe("The \"settings\" API", function() { it("has methods 'get' and 'set' to set configuration settings", mock.initConverse(function (_converse) { expect(_.keys(_converse.api.settings)).toEqual(["get", "set"]); - expect(_converse.api.settings.get("play_sounds")).toBe(false); - _converse.api.settings.set("play_sounds", true); expect(_converse.api.settings.get("play_sounds")).toBe(true); - _converse.api.settings.set({"play_sounds": false}); + _converse.api.settings.set("play_sounds", false); expect(_converse.api.settings.get("play_sounds")).toBe(false); + _converse.api.settings.set({"play_sounds": true}); + expect(_converse.api.settings.get("play_sounds")).toBe(true); // Only whitelisted settings allowed. expect(typeof _converse.api.settings.get("non_existing")).toBe("undefined"); _converse.api.settings.set("non_existing", true); diff --git a/src/config.js b/src/config.js index 3cf0be3ca..9d82cec3a 100644 --- a/src/config.js +++ b/src/config.js @@ -19,7 +19,6 @@ require.config({ "backbone": "node_modules/backbone/backbone", "backbone.browserStorage": "node_modules/backbone.browserStorage/backbone.browserStorage", "backbone.overview": "node_modules/backbone.overview/backbone.overview", - "converse": "src/converse", "eventemitter": "node_modules/otr/build/dep/eventemitter", "jquery": "node_modules/jquery/dist/jquery", "jquery-private": "src/jquery-private", @@ -42,7 +41,7 @@ require.config({ "utils": "src/utils", // Converse - "converse-mobile": "src/converse-mobile", + "converse": "src/converse", "converse-core": "src/converse-core", "converse-bookmarks": "src/converse-bookmarks", diff --git a/src/converse-core.js b/src/converse-core.js index 7c09b3e67..9da11a50f 100755 --- a/src/converse-core.js +++ b/src/converse-core.js @@ -242,7 +242,7 @@ jid: undefined, keepalive: true, locked_domain: undefined, - message_carbons: false, + message_carbons: true, message_storage: 'session', password: undefined, prebind_url: null, diff --git a/src/converse-notification.js b/src/converse-notification.js index ea42ef1c5..9af661222 100644 --- a/src/converse-notification.js +++ b/src/converse-notification.js @@ -34,7 +34,7 @@ show_chatstate_notifications: false, chatstate_notification_blacklist: [], // ^ a list of JIDs to ignore concerning chat state notifications - play_sounds: false, + play_sounds: true, sounds_path: '/sounds/', notification_icon: '/logo/conversejs128.png' }); @@ -104,7 +104,7 @@ // feature, but no browser currently supports it. // https://developer.mozilla.org/en-US/docs/Web/API/notification/sound var audio; - if (_converse.play_sounds && !_.isUndefined(Audio)) { + if (_converse.play_sounds && !_.isUndefined(window.Audio)) { audio = new Audio(_converse.sounds_path+"msg_received.ogg"); if (audio.canPlayType('/audio/ogg')) { audio.play();