Comparison

mod_mam/mod_mam.lua @ 2511:34a6ba5dfe4f

mod_mam: Bring hints processing in line with 0.10 version
author Kim Alvefur <zash@zash.se>
date Mon, 20 Feb 2017 00:09:13 +0100
parent 2510:d81882aa0e1e
child 2512:bc7539ccbde1
comparison
equal deleted inserted replaced
2510:d81882aa0e1e 2511:34a6ba5dfe4f
266 if not(orig_type == "chat" or (orig_type == "normal" and stanza:get_child("body")) ) then 266 if not(orig_type == "chat" or (orig_type == "normal" and stanza:get_child("body")) ) then
267 log("debug", "Not archiving stanza: %s (type)", stanza:top_tag()); 267 log("debug", "Not archiving stanza: %s (type)", stanza:top_tag());
268 return; 268 return;
269 end 269 end
270 -- or if hints suggest we shouldn't 270 -- or if hints suggest we shouldn't
271 if stanza:get_child("no-permanent-storage", "urn:xmpp:hints") -- The XEP needs to decide on "store" or "storage" 271 if not stanza:get_child("store", "urn:xmpp:hints") then -- No hint telling us we should store
272 or stanza:get_child("no-permanent-store", "urn:xmpp:hints") 272 if stanza:get_child("no-permanent-store", "urn:xmpp:hints")
273 or stanza:get_child("no-storage", "urn:xmpp:hints") 273 or stanza:get_child("no-store", "urn:xmpp:hints") then -- Hint telling us we should NOT store
274 or stanza:get_child("no-store", "urn:xmpp:hints") then 274 log("debug", "Not archiving stanza: %s (hint)", stanza:top_tag());
275 log("debug", "Not archiving stanza: %s (hint)", stanza:top_tag()); 275 return;
276 return; 276 end
277 end 277 end
278 278
279 -- Whos storage do we put it in? 279 -- Whos storage do we put it in?
280 local store_user = c2s and origin.username or jid_split(orig_to); 280 local store_user = c2s and origin.username or jid_split(orig_to);
281 -- And who are they chatting with? 281 -- And who are they chatting with?