Mercurial > prosody-modules
comparison mod_jsxc/mod_jsxc.lua @ 6196:b74ec363de08
mod_jsxc: Remove compatibility with 0.11
| author | Link Mauve <linkmauve@linkmauve.fr> |
|---|---|
| date | Wed, 09 Apr 2025 19:05:21 +0200 |
| parents | 75b6e5df65f9 |
| children |
comparison
equal
deleted
inserted
replaced
| 6195:dfdf0bf1e84f | 6196:b74ec363de08 |
|---|---|
| 17 if version ~= "" then version = "/" .. version end | 17 if version ~= "" then version = "/" .. version end |
| 18 | 18 |
| 19 local serve_dist = nil; | 19 local serve_dist = nil; |
| 20 local resources = module:get_option_path("jsxc_resources"); | 20 local resources = module:get_option_path("jsxc_resources"); |
| 21 if resources then | 21 if resources then |
| 22 local serve; | 22 local http_files = require "net.http.files"; |
| 23 if prosody.process_type == "prosody" then | |
| 24 -- Prosody >= trunk / 0.12 | |
| 25 local http_files = require "net.http.files"; | |
| 26 serve = http_files.serve; | |
| 27 else | |
| 28 -- Prosody <= 0.11 | |
| 29 serve = module:depends "http_files".serve; | |
| 30 end | |
| 31 local mime_map = module:shared("/*/http_files/mime").types or { css = "text/css", js = "application/javascript" }; | 23 local mime_map = module:shared("/*/http_files/mime").types or { css = "text/css", js = "application/javascript" }; |
| 32 serve_dist = serve({ path = resources, mime_map = mime_map }); | 24 serve_dist = http_files.serve({ path = resources, mime_map = mime_map }); |
| 33 | 25 |
| 34 cdn_url = module:http_url(); | 26 cdn_url = module:http_url(); |
| 35 end | 27 end |
| 36 | 28 |
| 37 local js_url = module:get_option_string("jsxc_script", cdn_url..version.."/dist/jsxc.bundle.js"); | 29 local js_url = module:get_option_string("jsxc_script", cdn_url..version.."/dist/jsxc.bundle.js"); |
