aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2015-07-06 17:07:05 +0100
committerMatthew Wild <mwild1@gmail.com>2015-07-06 17:07:05 +0100
commit855cb99f3c81b03fdeb27896d59ed9b66900ae02 (patch)
tree116641904bf26766fe52624f4ef7af24d77ae2ee
parente6b0ecf2435c94405c08f5ffd7d595f0b75cc8a4 (diff)
parent5292b8232a0cb961cc2d301556a179505ba98dee (diff)
downloadprosody-855cb99f3c81b03fdeb27896d59ed9b66900ae02.tar.gz
prosody-855cb99f3c81b03fdeb27896d59ed9b66900ae02.zip
Merge with 0.10
-rw-r--r--plugins/mod_storage_sql2.lua2
-rw-r--r--plugins/muc/mod_muc.lua2
-rw-r--r--plugins/sql.lib.lua9
-rwxr-xr-xprosodyctl3
-rw-r--r--util/sql.lua4
5 files changed, 8 insertions, 12 deletions
diff --git a/plugins/mod_storage_sql2.lua b/plugins/mod_storage_sql2.lua
index 7c797447..10a16743 100644
--- a/plugins/mod_storage_sql2.lua
+++ b/plugins/mod_storage_sql2.lua
@@ -379,10 +379,10 @@ local function upgrade_table(params, apply_changes)
end
local function normalize_params(params)
- assert(params.driver and params.database, "Configuration error: Both the SQL driver and the database need to be specified");
if params.driver == "SQLite3" then
params.database = resolve_relative_path(prosody.paths.data or ".", params.database or "prosody.sqlite");
end
+ assert(params.driver and params.database, "Configuration error: Both the SQL driver and the database need to be specified");
return params;
end
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index c514bafd..69351504 100644
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -60,7 +60,7 @@ function muclib.room_mt:get_affiliation(jid)
return _get_affiliation(self, jid);
end
function muclib.room_mt:set_affiliation(actor, jid, affiliation, callback, reason)
- if is_admin(jid) then return nil, "modify", "not-acceptable"; end
+ if affiliation ~= "owner" and is_admin(jid) then return nil, "modify", "not-acceptable"; end
return _set_affiliation(self, actor, jid, affiliation, callback, reason);
end
diff --git a/plugins/sql.lib.lua b/plugins/sql.lib.lua
deleted file mode 100644
index 005ee45d..00000000
--- a/plugins/sql.lib.lua
+++ /dev/null
@@ -1,9 +0,0 @@
-local cache = module:shared("/*/sql.lib/util.sql");
-
-if not cache._M then
- prosody.unlock_globals();
- cache._M = require "util.sql";
- prosody.lock_globals();
-end
-
-return cache._M;
diff --git a/prosodyctl b/prosodyctl
index 6c4b148a..a67f3dbd 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -841,7 +841,8 @@ function commands.check(arg)
});
local known_global_options = set.new({
"pidfile", "log", "plugin_paths", "prosody_user", "prosody_group", "daemonize",
- "umask", "prosodyctl_timeout", "use_ipv6", "use_libevent", "network_settings"
+ "umask", "prosodyctl_timeout", "use_ipv6", "use_libevent", "network_settings",
+ "network_backend", "http_default_host",
});
local config = config.getconfig();
-- Check that we have any global options (caused by putting a host at the top)
diff --git a/util/sql.lua b/util/sql.lua
index 5aa12f94..92032f43 100644
--- a/util/sql.lua
+++ b/util/sql.lua
@@ -111,8 +111,12 @@ function engine:connect()
self.conn = dbh;
self.prepared = {};
self:set_encoding();
+ self:onconnect();
return true;
end
+function engine:onconnect()
+ -- Override from create_engine()
+end
function engine:execute(sql, ...)
local success, err = self:connect();
if not success then return success, err; end