aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_private.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2008-11-16 04:39:48 +0500
committerWaqas Hussain <waqas20@gmail.com>2008-11-16 04:39:48 +0500
commit643710a6880b4d55bf7ed712779d0d14a1b4c140 (patch)
treec823eb6ea89adbd0011d887dccd66212fad10b4b /plugins/mod_private.lua
parent0fbd257633c4135bf5ad7550747c06ce69f7ea3a (diff)
downloadprosody-643710a6880b4d55bf7ed712779d0d14a1b4c140.tar.gz
prosody-643710a6880b4d55bf7ed712779d0d14a1b4c140.zip
Fixed mod_private to use session.send for sending stanzas
Diffstat (limited to 'plugins/mod_private.lua')
-rw-r--r--plugins/mod_private.lua15
1 files changed, 7 insertions, 8 deletions
diff --git a/plugins/mod_private.lua b/plugins/mod_private.lua
index 91ea83e1..f463f543 100644
--- a/plugins/mod_private.lua
+++ b/plugins/mod_private.lua
@@ -1,6 +1,5 @@
local st = require "util.stanza"
-local send = require "core.sessionmanager".send_to_session
local jid_split = require "util.jid".split;
local datamanager = require "util.datamanager"
@@ -19,9 +18,9 @@ add_iq_handler("c2s", "jabber:iq:private",
local data = datamanager.load(node, host, "private");
if stanza.attr.type == "get" then
if data and data[key] then
- send(session, st.reply(stanza):tag("query", {xmlns = "jabber:iq:private"}):add_child(st.deserialize(data[key])));
+ session.send(st.reply(stanza):tag("query", {xmlns = "jabber:iq:private"}):add_child(st.deserialize(data[key])));
else
- send(session, st.reply(stanza):add_child(stanza.tags[1]));
+ session.send(st.reply(stanza):add_child(stanza.tags[1]));
end
else -- set
if not data then data = {}; end;
@@ -32,16 +31,16 @@ add_iq_handler("c2s", "jabber:iq:private",
end
-- TODO delete datastore if empty
if datamanager.store(node, host, "private", data) then
- send(session, st.reply(stanza));
+ session.send(st.reply(stanza));
else
- send(session, st.error_reply(stanza, "wait", "internal-server-error"));
+ session.send(st.error_reply(stanza, "wait", "internal-server-error"));
end
end
else
- send(session, st.error_reply(stanza, "modify", "bad-format"));
+ session.send(st.error_reply(stanza, "modify", "bad-format"));
end
else
- send(session, st.error_reply(stanza, "cancel", "forbidden"));
+ session.send(st.error_reply(stanza, "cancel", "forbidden"));
end
end
- end); \ No newline at end of file
+ end);