changeset 4610:342664061c9b

mod_http_upload: Fix issuing slots to components or other non-c2s sessions The 'full_jid' property only exists on local c2s sessions. This was not adjusted for in 0a56dc6c61af, so it did not work. Thanks Fren__ for highlighting the issue.
author Kim Alvefur <zash@zash.se>
date Thu, 01 Jul 2021 16:17:35 +0200
parents fcfe691d6322
children 7a9e1c81c63e
files mod_http_upload/mod_http_upload.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_http_upload/mod_http_upload.lua	Wed Jun 30 15:53:49 2021 +0200
+++ b/mod_http_upload/mod_http_upload.lua	Thu Jul 01 16:17:35 2021 +0200
@@ -195,7 +195,7 @@
 			:tag("file-too-large", {xmlns=xmlns})
 				:tag("max-file-size"):text(("%d"):format(file_size_limit));
 	elseif not check_quota(username, host, filesize) then
-		module:log("debug", "Upload of %dB by %s would exceed quota", filesize, origin.full_jid);
+		module:log("debug", "Upload of %dB by %s would exceed quota", filesize, user_bare);
 		return nil, st.error_reply(stanza, "wait", "resource-constraint", "Quota reached");
 	end
 
@@ -215,7 +215,7 @@
 	end
 
 	local slot = random_dir.."/"..filename;
-	pending_slots[slot] = origin.full_jid;
+	pending_slots[slot] = user_bare;
 
 	module:add_timer(900, function()
 		pending_slots[slot] = nil;