Mercurial > prosody-modules
comparison mod_storage_xmlarchive/mod_storage_xmlarchive.lua @ 1760:e72f9eac51c8
mod_storage_(various): Order swapping in 54c8a0cb2996 was backwards
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 21 May 2015 12:09:47 +0200 |
| parents | 0aeab7234d5e |
| children | cf3ee2eca46d |
comparison
equal
deleted
inserted
replaced
| 1759:0aeab7234d5e | 1760:e72f9eac51c8 |
|---|---|
| 21 end); | 21 end); |
| 22 | 22 |
| 23 local archive = {}; | 23 local archive = {}; |
| 24 local archive_mt = { __index = archive }; | 24 local archive_mt = { __index = archive }; |
| 25 | 25 |
| 26 local s = require"util.serialization".new("debug").serialize; | |
| 26 function archive:append(username, _, data, when, with) | 27 function archive:append(username, _, data, when, with) |
| 27 if type(when) ~= "number" then | 28 if type(when) ~= "number" then |
| 28 data, when, with = when, with, data; | 29 when, with, data = data, when, with; |
| 29 end | 30 end |
| 30 if getmetatable(data) ~= st.stanza_mt then | 31 if getmetatable(data) ~= st.stanza_mt then |
| 31 module:log("error", "Attempt to store non-stanza object, traceback: %s", debug.traceback()); | 32 module:log("error", "Attempt to store non-stanza object, traceback: %s", debug.traceback()); |
| 32 return nil, "unsupported-datatype"; | 33 return nil, "unsupported-datatype"; |
| 33 end | 34 end |
