Software /
code /
prosody
Comparison
plugins/mod_mam/mod_mam.lua @ 11819:f590e3c51eff
mod_mam: Merge main and RSM-specific log message here too
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 23 Sep 2021 17:55:49 +0200 |
parent | 11795:41af102c7190 |
child | 11875:210a785dfa8a |
comparison
equal
deleted
inserted
replaced
11818:c443abff04d8 | 11819:f590e3c51eff |
---|---|
141 return true; | 141 return true; |
142 end | 142 end |
143 qstart, qend = vstart, vend; | 143 qstart, qend = vstart, vend; |
144 end | 144 end |
145 | 145 |
146 module:log("debug", "Archive query by %s id=%s with=%s when=%s...%s", | |
147 origin.username, | |
148 qid or stanza.attr.id, | |
149 qwith or "*", | |
150 qstart and timestamp(qstart) or "", | |
151 qend and timestamp(qend) or ""); | |
152 | |
153 -- RSM stuff | 146 -- RSM stuff |
154 local qset = rsm.get(query); | 147 local qset = rsm.get(query); |
155 local qmax = m_min(qset and qset.max or default_max_items, max_max_items); | 148 local qmax = m_min(qset and qset.max or default_max_items, max_max_items); |
156 local reverse = qset and qset.before or false; | 149 local reverse = qset and qset.before or false; |
157 local before, after = qset and qset.before or qbefore, qset and qset.after or qafter; | 150 local before, after = qset and qset.before or qbefore, qset and qset.after or qafter; |
158 if type(before) ~= "string" then before = nil; end | 151 if type(before) ~= "string" then before = nil; end |
159 if qset then | 152 |
160 module:log("debug", "Archive query id=%s rsm=%q", qid or stanza.attr.id, qset); | 153 |
161 end | 154 module:log("debug", "Archive query by %s id=%s with=%s when=%s...%s rsm=%q", |
155 origin.username, | |
156 qid or stanza.attr.id, | |
157 qwith or "*", | |
158 qstart and timestamp(qstart) or "", | |
159 qend and timestamp(qend) or "", | |
160 qset); | |
161 | |
162 -- A reverse query needs to be flipped | 162 -- A reverse query needs to be flipped |
163 local flip = reverse; | 163 local flip = reverse; |
164 -- A flip-page query needs to be the opposite of that. | 164 -- A flip-page query needs to be the opposite of that. |
165 if query:get_child("flip-page") then flip = not flip end | 165 if query:get_child("flip-page") then flip = not flip end |
166 | 166 |