aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-08-26 13:17:37 +0200
committerKim Alvefur <zash@zash.se>2015-08-26 13:17:37 +0200
commitf0447816d8e4e81771b73d0d025a61221e290e3f (patch)
tree9dc703a47bdb80713dc5c5926a4215a12b0337fe
parente58beaa308ceb3ce53acdac6c299c7f3a7d019c8 (diff)
parent0049dd0d5f58affe39b8acb0ae460bbd42ec4a8f (diff)
downloadprosody-f0447816d8e4e81771b73d0d025a61221e290e3f.tar.gz
prosody-f0447816d8e4e81771b73d0d025a61221e290e3f.zip
Merge 0.10->trunk
-rw-r--r--plugins/mod_admin_adhoc.lua2
-rwxr-xr-xtools/ejabberd2prosody.lua17
2 files changed, 18 insertions, 1 deletions
diff --git a/plugins/mod_admin_adhoc.lua b/plugins/mod_admin_adhoc.lua
index c21a2060..fdbdf462 100644
--- a/plugins/mod_admin_adhoc.lua
+++ b/plugins/mod_admin_adhoc.lua
@@ -30,6 +30,7 @@ local modulemanager = require "core.modulemanager";
local core_post_stanza = prosody.core_post_stanza;
local adhoc_simple = require "util.adhoc".new_simple_form;
local adhoc_initial = require "util.adhoc".new_initial_data_form;
+local set = require"util.set";
module:depends("adhoc");
local adhoc_new = module:require "adhoc".new;
@@ -613,6 +614,7 @@ end, function(fields, err)
end);
local function send_to_online(message, server)
+ local sessions;
if server then
sessions = { [server] = hosts[server] };
else
diff --git a/tools/ejabberd2prosody.lua b/tools/ejabberd2prosody.lua
index 590145cd..46a48f57 100755
--- a/tools/ejabberd2prosody.lua
+++ b/tools/ejabberd2prosody.lua
@@ -72,7 +72,22 @@ function vcard(node, host, stanza)
print("["..(err or "success").."] vCard: "..node.."@"..host);
end
function password(node, host, password)
- local ret, err = dm.store(node, host, "accounts", {password = password});
+ local data = {};
+ if type(password) == "string" then
+ data.password = password;
+ elseif type(password) == "table" and password[1] == "scram" then
+ local unb64 = require"mime".unb64;
+ local function hex(s)
+ return s:gsub(".", function (c)
+ return ("%02x"):format(c:byte());
+ end);
+ end
+ data.stored_key = hex(unb64(password[2]));
+ data.server_key = hex(unb64(password[3]));
+ data.salt = unb64(password[4]);
+ data.iteration_count = password[5];
+ end
+ local ret, err = dm.store(node, host, "accounts", data);
print("["..(err or "success").."] accounts: "..node.."@"..host);
end
function roster(node, host, jid, item)