Mercurial > prosody-modules
comparison mod_storage_muc_log/mod_storage_muc_log.lua @ 2820:f3a09a559201
mod_storage_muc_log: Trim trailing whitespace [luacheck]
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 15 Nov 2017 16:21:18 +0100 |
| parents | 093b70378fa5 |
| children | e8f0acfdccca |
comparison
equal
deleted
inserted
replaced
| 2819:9ffb059c9ba5 | 2820:f3a09a559201 |
|---|---|
| 101 local seek_once = query and query.after; | 101 local seek_once = query and query.after; |
| 102 | 102 |
| 103 local today, time, data, err, item; | 103 local today, time, data, err, item; |
| 104 local inner_start, inner_stop, inner_step; | 104 local inner_start, inner_stop, inner_step; |
| 105 local outer_start, outer_stop, outer_step = 1, #dates, 1; | 105 local outer_start, outer_stop, outer_step = 1, #dates, 1; |
| 106 if query and query.reverse then | 106 if query and query.reverse then |
| 107 outer_start, outer_stop, outer_step = outer_stop, outer_start, -outer_step; | 107 outer_start, outer_stop, outer_step = outer_stop, outer_start, -outer_step; |
| 108 seek_once = query.before; | 108 seek_once = query.before; |
| 109 if seek_once then | 109 if seek_once then |
| 110 end_date = seek_once:match"^(%d+)_%d"; | 110 end_date = seek_once:match"^(%d+)_%d"; |
| 111 end | 111 end |
| 117 today = dates[i]; | 117 today = dates[i]; |
| 118 if today >= start_date and today <= end_date then | 118 if today >= start_date and today <= end_date then |
| 119 data, err = data_load(node, host, datastore .. "/" .. today); | 119 data, err = data_load(node, host, datastore .. "/" .. today); |
| 120 if data then | 120 if data then |
| 121 inner_start, inner_stop, inner_step = 1, #data, 1; | 121 inner_start, inner_stop, inner_step = 1, #data, 1; |
| 122 if query and query.reverse then | 122 if query and query.reverse then |
| 123 inner_start, inner_stop, inner_step = inner_stop, inner_start, -inner_step; | 123 inner_start, inner_stop, inner_step = inner_stop, inner_start, -inner_step; |
| 124 end | 124 end |
| 125 if seek_once then | 125 if seek_once then |
| 126 inner_start = tonumber(seek_once:match("_(%d+)$")); | 126 inner_start = tonumber(seek_once:match("_(%d+)$")); |
| 127 inner_start = inner_start + (query and query.reverse and -1 or 1); | 127 inner_start = inner_start + (query and query.reverse and -1 or 1); |
