X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=plugins%2Fmod_private.lua;h=abf1ec039a5d076c361d39784a2ce16dc453f757;hb=a00e3548bda906fa79f0de0ebd4a92d2577a8671;hp=0b1a16049162b0dd343417c1f2a3bf1c2f611f36;hpb=740d4f647339acbc871004de3970c46aeeeab759;p=prosody.git diff --git a/plugins/mod_private.lua b/plugins/mod_private.lua index 0b1a1604..abf1ec03 100644 --- a/plugins/mod_private.lua +++ b/plugins/mod_private.lua @@ -1,6 +1,6 @@ --- Prosody IM v0.4 --- Copyright (C) 2008-2009 Matthew Wild --- Copyright (C) 2008-2009 Waqas Hussain +-- Prosody IM +-- Copyright (C) 2008-2010 Matthew Wild +-- Copyright (C) 2008-2010 Waqas Hussain -- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. @@ -26,7 +26,11 @@ module:add_iq_handler("c2s", "jabber:iq:private", if #query.tags == 1 then local tag = query.tags[1]; local key = tag.name..":"..tag.attr.xmlns; - local data = datamanager.load(node, host, "private"); + local data, err = datamanager.load(node, host, "private"); + if err then + session.send(st.error_reply(stanza, "wait", "internal-server-error")); + return true; + end if stanza.attr.type == "get" then if data and data[key] then session.send(st.reply(stanza):tag("query", {xmlns = "jabber:iq:private"}):add_child(st.deserialize(data[key])));