Software /
code /
prosody-modules
Comparison
mod_mam/mod_mam.lua @ 2512:bc7539ccbde1
mod_mam: Normalize whitespace
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 20 Feb 2017 00:48:31 +0100 |
parent | 2511:34a6ba5dfe4f |
child | 2513:66a61f48e376 |
comparison
equal
deleted
inserted
replaced
2511:34a6ba5dfe4f | 2512:bc7539ccbde1 |
---|---|
139 local qmax = m_min(qset and qset.max or default_max_items, max_max_items); | 139 local qmax = m_min(qset and qset.max or default_max_items, max_max_items); |
140 local reverse = qset and qset.before or false; | 140 local reverse = qset and qset.before or false; |
141 local before, after = qset and qset.before, qset and qset.after; | 141 local before, after = qset and qset.before, qset and qset.after; |
142 if type(before) ~= "string" then before = nil; end | 142 if type(before) ~= "string" then before = nil; end |
143 | 143 |
144 | |
145 -- Load all the data! | 144 -- Load all the data! |
146 local data, err = archive:find(origin.username, { | 145 local data, err = archive:find(origin.username, { |
147 start = qstart; ["end"] = qend; -- Time range | 146 start = qstart; ["end"] = qend; -- Time range |
148 with = qwith; | 147 with = qwith; |
149 limit = qmax + 1; | 148 limit = qmax + 1; |
265 -- We store chat messages or normal messages that have a body | 264 -- We store chat messages or normal messages that have a body |
266 if not(orig_type == "chat" or (orig_type == "normal" and stanza:get_child("body")) ) then | 265 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()); | 266 log("debug", "Not archiving stanza: %s (type)", stanza:top_tag()); |
268 return; | 267 return; |
269 end | 268 end |
269 | |
270 -- or if hints suggest we shouldn't | 270 -- or if hints suggest we shouldn't |
271 if not stanza:get_child("store", "urn:xmpp:hints") then -- No hint telling us we should store | 271 if not stanza:get_child("store", "urn:xmpp:hints") then -- No hint telling us we should store |
272 if 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-store", "urn:xmpp:hints") then -- Hint telling us we should NOT store | 273 or stanza:get_child("no-store", "urn:xmpp:hints") then -- Hint telling us we should NOT store |
274 log("debug", "Not archiving stanza: %s (hint)", stanza:top_tag()); | 274 log("debug", "Not archiving stanza: %s (hint)", stanza:top_tag()); |