Fix: continue presence signal if policy is mandatory

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
This commit is contained in:
David Goulet 2014-04-09 22:11:15 -04:00
parent 30bfe6ed3e
commit 57d12c3483
1 changed files with 9 additions and 1 deletions

View File

@ -87,8 +87,16 @@ end
-- becomes unavailable so next time the user connects, the message will
-- be displayes again.
local function handle_presence(event)
local jid = strip_full_jid(event.stanza.attr.from);
local jid;
-- Continue signal, mandatory policy does not require us to
-- remove the "messaged" entry.
if mandatory then
return nil;
end
if event.stanza.attr.type == "unavailable" then
jid = strip_full_jid(event.stanza.attr.from);
messaged[jid] = nil;
end
end