Comparison

mod_mam/mod_mam.lua @ 1957:ca33cca2e028

mod_mam: Clarify condition presendence
author Kim Alvefur <zash@zash.se>
date Wed, 09 Dec 2015 14:00:11 +0100
parent 1790:4c2146f5bf39
child 2000:b5adfe72709b
comparison
equal deleted inserted replaced
1956:1a5be0ecc876 1957:ca33cca2e028
222 local orig_from = stanza.attr.from; 222 local orig_from = stanza.attr.from;
223 local orig_to = stanza.attr.to or orig_from; 223 local orig_to = stanza.attr.to or orig_from;
224 -- Stanza without 'to' are treated as if it was to their own bare jid 224 -- Stanza without 'to' are treated as if it was to their own bare jid
225 225
226 -- We store chat messages or normal messages that have a body 226 -- We store chat messages or normal messages that have a body
227 if not(orig_type == "chat" or orig_type == "normal" and stanza:get_child("body") ) then 227 if not(orig_type == "chat" or (orig_type == "normal" and stanza:get_child("body")) ) then
228 module:log("debug", "Not archiving stanza: %s (type)", stanza:top_tag()); 228 module:log("debug", "Not archiving stanza: %s (type)", stanza:top_tag());
229 return; 229 return;
230 end 230 end
231 -- or if hints suggest we shouldn't 231 -- or if hints suggest we shouldn't
232 if stanza:get_child("no-permanent-storage", "urn:xmpp:hints") -- The XEP needs to decide on "store" or "storage" 232 if stanza:get_child("no-permanent-storage", "urn:xmpp:hints") -- The XEP needs to decide on "store" or "storage"