Changeset

3936:a3693e0d26b8

mod_smacks_offline: this module is obsoleted by latest mod_smacks update
author tmolitor <thilo@eightysoft.de>
date Sun, 08 Mar 2020 19:50:43 +0100
parents 3935:c49fea05772e
children 3937:e7dc25e54d02
files mod_smacks_offline/mod_smacks_offline.lua
diffstat 1 files changed, 3 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/mod_smacks_offline/mod_smacks_offline.lua	Sun Mar 08 19:49:47 2020 +0100
+++ b/mod_smacks_offline/mod_smacks_offline.lua	Sun Mar 08 19:50:43 2020 +0100
@@ -1,35 +1,4 @@
-local t_insert = table.insert;
-
-local mod_smacks = module:depends"smacks"
-
-local function store_unacked_stanzas(session)
-	local queue = session.outgoing_stanza_queue;
-	local replacement_queue = {};
-	session.outgoing_stanza_queue = replacement_queue;
+-- this module is deprecated, log an error and load the superseding module instead
+module:depends"smacks"
 
-	for _, stanza in ipairs(queue) do
-		if stanza.name == "message" and stanza.attr.xmlns == nil and
-				( stanza.attr.type == "chat" or ( stanza.attr.type or "normal" ) == "normal" ) then
-			module:fire_event("message/offline/handle", { origin = session, stanza = stanza } )
-		else
-			t_insert(replacement_queue, stanza);
-		end
-	end
-end
-
-local handle_unacked_stanzas = mod_smacks.handle_unacked_stanzas;
-
-local host_sessions = prosody.hosts[module.host].sessions;
-mod_smacks.handle_unacked_stanzas = function (session)
-	if session.username then
-		local sessions = host_sessions[session.username].sessions;
-		if next(sessions) == session.resource and next(sessions, session.resource) == nil then
-			store_unacked_stanzas(session)
-		end
-	end
-	return handle_unacked_stanzas(session);
-end
-
-function module.unload()
-	mod_smacks.handle_unacked_stanzas = handle_unacked_stanzas;
-end
+module:log("error", "mod_smacks_offline is deprecated! Just use mod_smacks!");
\ No newline at end of file