Merge with 0.10
authorMatthew Wild <mwild1@gmail.com>
Mon, 06 Jul 2015 17:07:05 +0100
changeset 6755 3cc2bc9c1bff
parent 6753 2a2eb30b1ed4 (current diff)
parent 6754 18f18bceb662 (diff)
child 6756 33426c56f5d5
Merge with 0.10
plugins/sql.lib.lua
--- a/plugins/mod_storage_sql2.lua	Mon Jun 29 13:50:31 2015 +0100
+++ b/plugins/mod_storage_sql2.lua	Mon Jul 06 17:07:05 2015 +0100
@@ -379,10 +379,10 @@
 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
 
--- a/plugins/muc/mod_muc.lua	Mon Jun 29 13:50:31 2015 +0100
+++ b/plugins/muc/mod_muc.lua	Mon Jul 06 17:07:05 2015 +0100
@@ -60,7 +60,7 @@
 	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
 
--- a/plugins/sql.lib.lua	Mon Jun 29 13:50:31 2015 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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;
--- a/prosodyctl	Mon Jun 29 13:50:31 2015 +0100
+++ b/prosodyctl	Mon Jul 06 17:07:05 2015 +0100
@@ -841,7 +841,8 @@
 		});
 		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)
--- a/util/sql.lua	Mon Jun 29 13:50:31 2015 +0100
+++ b/util/sql.lua	Mon Jul 06 17:07:05 2015 +0100
@@ -111,8 +111,12 @@
 	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