Software / code / prosody
Comparison
plugins/mod_storage_sql2.lua @ 6725:41725f3df3cc
mod_storage_sql2: Change order of arguments to :append to be the same as return values from :find iterator
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 19 May 2015 18:24:09 +0200 |
| parent | 6724:a8dbfa14e1a8 |
| child | 6726:e6e80ec50030 |
comparison
equal
deleted
inserted
replaced
| 6724:a8dbfa14e1a8 | 6725:41725f3df3cc |
|---|---|
| 214 return iterator(result); | 214 return iterator(result); |
| 215 end | 215 end |
| 216 | 216 |
| 217 local archive_store = {} | 217 local archive_store = {} |
| 218 archive_store.__index = archive_store | 218 archive_store.__index = archive_store |
| 219 function archive_store:append(username, key, when, with, value) | 219 function archive_store:append(username, key, value, when, with) |
| 220 if value == nil then -- COMPAT early versions | 220 if type(when) ~= "number" then |
| 221 when, with, value, key = key, when, with, value | 221 value, when, with = when, with, value; |
| 222 end | 222 end |
| 223 local user,store = username,self.store; | 223 local user,store = username,self.store; |
| 224 return engine:transaction(function() | 224 return engine:transaction(function() |
| 225 if key then | 225 if key then |
| 226 engine:delete("DELETE FROM `prosodyarchive` WHERE `host`=? AND `user`=? AND `store`=? AND `key`=?", host, user or "", store, key); | 226 engine:delete("DELETE FROM `prosodyarchive` WHERE `host`=? AND `user`=? AND `store`=? AND `key`=?", host, user or "", store, key); |