aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2008-12-26 21:48:08 +0500
committerWaqas Hussain <waqas20@gmail.com>2008-12-26 21:48:08 +0500
commit6061bd797ccde732339153fa5296d3ae2686fa87 (patch)
tree994f801cc6ee7b5f4e733030d5396e9efdf0342d
parent7d0a2037b30eea26ac86eff30494246ad6d6edff (diff)
downloadprosody-6061bd797ccde732339153fa5296d3ae2686fa87.tar.gz
prosody-6061bd797ccde732339153fa5296d3ae2686fa87.zip
Delete the offline message store only when offline messages are present
-rw-r--r--core/presencemanager.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/core/presencemanager.lua b/core/presencemanager.lua
index 4d847563..0f0808aa 100644
--- a/core/presencemanager.lua
+++ b/core/presencemanager.lua
@@ -95,11 +95,14 @@ function handle_normal_presence(origin, stanza, core_route_stanza)
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