# HG changeset patch # User Kim Alvefur # Date 1554483471 -7200 # Node ID b059a3fb2a58a3494d8f5c23d4f37f9abbbcccaa # Parent 8a15a9b13881677f81b89efbeec7abdb21073373 Update modules using mod_http_files to serve files for change in Prosody trunk See commits in Prosody: f1594893998f afc48785f738 a39f3681d685 c93fdec624c7 diff -r 8a15a9b13881 -r b059a3fb2a58 mod_admin_web/admin_web/mod_admin_web.lua --- a/mod_admin_web/admin_web/mod_admin_web.lua Wed Apr 03 11:57:37 2019 +0200 +++ b/mod_admin_web/admin_web/mod_admin_web.lua Fri Apr 05 18:57:51 2019 +0200 @@ -122,7 +122,15 @@ module:depends("bosh"); module:depends("admin_adhoc"); module:depends("http"); - local serve_file = module:depends("http_files").serve { + + local serve; + if not pcall(function () + local http_files = require "net.http.files"; + serve = http_files.serve; + end) then + serve = module:depends"http_files".serve; + end + local serve_file = serve { path = module:get_directory() .. "/www_files"; }; diff -r 8a15a9b13881 -r b059a3fb2a58 mod_http_upload/mod_http_upload.lua --- a/mod_http_upload/mod_http_upload.lua Wed Apr 03 11:57:37 2019 +0200 +++ b/mod_http_upload/mod_http_upload.lua Fri Apr 05 18:57:51 2019 +0200 @@ -44,7 +44,13 @@ module:depends("http"); module:depends("disco"); -local http_files = module:depends("http_files"); +local http_files; + +if not pcall(function () + http_files = require "net.http.files"; +end) then + http_files = module:depends"http_files"; +end -- namespaces local namespace = "urn:xmpp:http:upload:0"; diff -r 8a15a9b13881 -r b059a3fb2a58 mod_invite/mod_invite.lua --- a/mod_invite/mod_invite.lua Wed Apr 03 11:57:37 2019 +0200 +++ b/mod_invite/mod_invite.lua Fri Apr 05 18:57:51 2019 +0200 @@ -12,7 +12,13 @@ local invite_storage = module:open_store(); local inviter_storage = module:open_store("inviter"); -local serve = module:depends"http_files".serve; +local serve; +if not pcall(function () + local http_files = require "net.http.files"; + serve = http_files.serve; +end) then + serve = module:depends"http_files".serve; +end module:depends"adhoc"; module:depends"http"; diff -r 8a15a9b13881 -r b059a3fb2a58 mod_password_reset/mod_password_reset.lua --- a/mod_password_reset/mod_password_reset.lua Wed Apr 03 11:57:37 2019 +0200 +++ b/mod_password_reset/mod_password_reset.lua Fri Apr 05 18:57:51 2019 +0200 @@ -14,7 +14,13 @@ local max_token_age = module:get_option_number("password_reset_validity", 86400); -local serve = module:depends"http_files".serve; +local serve; +if not pcall(function () + local http_files = require "net.http.files"; + serve = http_files.serve; +end) then + serve = module:depends"http_files".serve; +end module:depends("adhoc"); module:depends("http");