Software /
code /
prosody
Comparison
plugins/mod_storage_internal.lua @ 8089:4ba8cb75d925
mod_storage_internal: Support the 'key' archive query field
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 15 Apr 2017 02:27:07 +0200 |
parent | 8023:5a9d491cc714 |
child | 8142:13e075549cb3 |
comparison
equal
deleted
inserted
replaced
8087:eb38f3b919be | 8089:4ba8cb75d925 |
---|---|
65 if not items then return items, err; end | 65 if not items then return items, err; end |
66 local count = #items; | 66 local count = #items; |
67 local i = 0; | 67 local i = 0; |
68 if query then | 68 if query then |
69 items = array(items); | 69 items = array(items); |
70 if query.key then | |
71 items:filter(function (item) | |
72 return item.key == query.key; | |
73 end); | |
74 end | |
70 if query.with then | 75 if query.with then |
71 items:filter(function (item) | 76 items:filter(function (item) |
72 return item.with == query.with; | 77 return item.with == query.with; |
73 end); | 78 end); |
74 end | 79 end |