Fri, 26 Dec 2008 21:48:08 +0500
Delete the offline message store only when offline messages are present
core/presencemanager.lua | file | annotate | diff | comparison | revisions |
--- a/core/presencemanager.lua Fri Dec 26 21:46:05 2008 +0500 +++ b/core/presencemanager.lua Fri Dec 26 21:48:08 2008 +0500 @@ -95,11 +95,14 @@ request.attr.to = jid; core_route_stanza(origin, request); end + end + local offline = offlinemanager.load(node, host); + if offline then + for _, msg in ipairs(offline) do + origin.send(msg); -- FIXME do we need to modify to/from in any way? + end + offlinemanager.deleteAll(node, host); end - for _, msg in ipairs(offlinemanager.load(node, host) or {}) do - origin.send(msg); -- FIXME do we need to modify to/from in any way? - end - offlinemanager.deleteAll(node, host); end origin.priority = 0; if stanza.attr.type == "unavailable" then