Changeset

3549:b059a3fb2a58

Update modules using mod_http_files to serve files for change in Prosody trunk See commits in Prosody: f1594893998f afc48785f738 a39f3681d685 c93fdec624c7
author Kim Alvefur <zash@zash.se>
date Fri, 05 Apr 2019 18:57:51 +0200
parents 3548:8a15a9b13881
children 3550:8079e9c6d419
files mod_admin_web/admin_web/mod_admin_web.lua mod_http_upload/mod_http_upload.lua mod_invite/mod_invite.lua mod_password_reset/mod_password_reset.lua
diffstat 4 files changed, 30 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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";
 	};
 
--- 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";
--- 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";
--- 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");