From 8956f32a9c6fff30b6f604dba0a1ea0330712be1 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 5 Oct 2017 12:48:36 +0200 Subject: util.encodings: Use the 'idx' argument correctly [-Wunused-parameter] --- util-src/encodings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util-src/encodings.c b/util-src/encodings.c index 465819d5..d85c7cf6 100644 --- a/util-src/encodings.c +++ b/util-src/encodings.c @@ -216,7 +216,7 @@ static const char *utf8_decode(const char *o, int *val) { */ const char *check_utf8(lua_State *L, int idx, size_t *l) { size_t pos, len; - const char *s = luaL_checklstring(L, 1, &len); + const char *s = luaL_checklstring(L, idx, &len); pos = 0; while(pos <= len) { -- cgit v1.2.3 From 50611461f2fd9ca769502ac6bcc1e0baaef0e789 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 5 Oct 2017 17:22:42 +0200 Subject: mod_storage_sql: Remove return values from purge method --- plugins/mod_storage_sql.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua index d4a5f871..edbfd5e4 100644 --- a/plugins/mod_storage_sql.lua +++ b/plugins/mod_storage_sql.lua @@ -415,8 +415,7 @@ end function driver:purge(username) return engine:transaction(function() - local stmt,err = engine:delete("DELETE FROM \"prosody\" WHERE \"host\"=? AND \"user\"=?", host, username); - return true, err; + engine:delete("DELETE FROM \"prosody\" WHERE \"host\"=? AND \"user\"=?", host, username); end); end -- cgit v1.2.3 From ce996cdb1cdc4c5331332df525b9d181c8fc0c4e Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 5 Oct 2017 17:44:47 +0200 Subject: mod_storage_sql: Also clear the prosodyarchive table when an user is deleted (fixes #1009) --- plugins/mod_storage_sql.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua index edbfd5e4..c729c66a 100644 --- a/plugins/mod_storage_sql.lua +++ b/plugins/mod_storage_sql.lua @@ -416,6 +416,7 @@ end function driver:purge(username) return engine:transaction(function() engine:delete("DELETE FROM \"prosody\" WHERE \"host\"=? AND \"user\"=?", host, username); + engine:delete("DELETE FROM \"prosodyarchive\" WHERE \"host\"=? AND \"user\"=?", host, username); end); end -- cgit v1.2.3