plugins/mod_mam/mod_mam.lua
changeset 11763 9925be5d3b8b
parent 11762 c35b81575d5d
child 11764 d66738eeb875
equal deleted inserted replaced
11762:c35b81575d5d 11763:9925be5d3b8b
   478 -- have been archived. This would generally only happen if mod_offline is
   478 -- have been archived. This would generally only happen if mod_offline is
   479 -- disabled.  Otherwise the message would generate a delivery failure report,
   479 -- disabled.  Otherwise the message would generate a delivery failure report,
   480 -- which would not be accurate because it has been archived.
   480 -- which would not be accurate because it has been archived.
   481 module:hook("message/offline/handle", function(event)
   481 module:hook("message/offline/handle", function(event)
   482 	local stanza = event.stanza;
   482 	local stanza = event.stanza;
   483 	if stanza:get_child("stanza-id", xmlns_st_id) then
   483 	local user = event.username .. "@" .. host;
   484 		return true;
   484 	for st_id in stanza:childtags("stanza-id", xmlns_st_id) do
       
   485 		if st_id.attr.by == user then
       
   486 			return true;
       
   487 		end
   485 	end
   488 	end
   486 end, -2);
   489 end, -2);
   487 
   490 
   488 if cleanup_after ~= "never" then
   491 if cleanup_after ~= "never" then
   489 	local cleanup_storage = module:open_store("archive_cleanup");
   492 	local cleanup_storage = module:open_store("archive_cleanup");