--- a/mod_conversejs/mod_conversejs.lua Thu Oct 25 22:41:13 2018 +0200
+++ b/mod_conversejs/mod_conversejs.lua Fri Oct 26 20:07:16 2018 +0200
@@ -4,7 +4,10 @@
local json_encode = require"util.json".encode;
module:depends"http";
-module:depends"bosh";
+
+local has_bosh = pcall(function ()
+ module:depends"bosh";
+end);
local has_ws = pcall(function ()
module:depends("websocket");
@@ -58,7 +61,7 @@
local function get_converse_options()
local allow_registration = module:get_option_boolean("allow_registration", false);
local converse_options = {
- bosh_service_url = module:http_url("bosh","/http-bind");
+ bosh_service_url = has_bosh and module:http_url("bosh","/http-bind") or nil;
websocket_url = has_ws and module:http_url("websocket","xmpp-websocket"):gsub("^http", "ws") or nil;
authentication = module:get_option_string("authentication") == "anonymous" and "anonymous" or "login";
jid = module.host;