Mercurial > prosody-modules
comparison mod_conversejs/mod_conversejs.lua @ 6191:767b8594fb9d
mod_conversejs: Remove compatibility with 0.11
| author | Link Mauve <linkmauve@linkmauve.fr> |
|---|---|
| date | Wed, 09 Apr 2025 19:04:39 +0200 |
| parents | fe8222112cf4 |
| children | 303fcfe3a7e8 |
comparison
equal
deleted
inserted
replaced
| 6190:963c16e417d6 | 6191:767b8594fb9d |
|---|---|
| 26 if version ~= "" then version = "/" .. version end | 26 if version ~= "" then version = "/" .. version end |
| 27 | 27 |
| 28 local serve_dist = nil; | 28 local serve_dist = nil; |
| 29 local resources = module:get_option_path("conversejs_resources"); | 29 local resources = module:get_option_path("conversejs_resources"); |
| 30 if resources then | 30 if resources then |
| 31 local serve; | 31 local http_files = require "net.http.files"; |
| 32 if prosody.process_type == "prosody" then | |
| 33 -- Prosody >= trunk / 0.12 | |
| 34 local http_files = require "net.http.files"; | |
| 35 serve = http_files.serve; | |
| 36 else | |
| 37 -- Prosody <= 0.11 | |
| 38 serve = module:depends "http_files".serve; | |
| 39 end | |
| 40 local mime_map = module:shared("/*/http_files/mime").types or {css = "text/css"; js = "application/javascript"}; | 32 local mime_map = module:shared("/*/http_files/mime").types or {css = "text/css"; js = "application/javascript"}; |
| 41 serve_dist = serve({path = resources; mime_map = mime_map}); | 33 serve_dist = http_files.serve({path = resources; mime_map = mime_map}); |
| 42 | 34 |
| 43 cdn_url = module:http_url(); | 35 cdn_url = module:http_url(); |
| 44 end | 36 end |
| 45 | 37 |
| 46 local js_url = module:get_option_string("conversejs_script", cdn_url..version.."/dist/converse.min.js"); | 38 local js_url = module:get_option_string("conversejs_script", cdn_url..version.."/dist/converse.min.js"); |
