aboutsummaryrefslogtreecommitdiffstats
path: root/core/rostermanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-12-01 22:13:24 +0000
committerMatthew Wild <mwild1@gmail.com>2018-12-01 22:13:24 +0000
commit38b328ad1be357a028a818eaad7c6c3541ac6759 (patch)
tree46f72ed2c7dd32d234f23a949bcb0197798681ec /core/rostermanager.lua
parentc219636c741e61d57ef8315480e6a596e6e4ff7a (diff)
downloadprosody-38b328ad1be357a028a818eaad7c6c3541ac6759.tar.gz
prosody-38b328ad1be357a028a818eaad7c6c3541ac6759.zip
rostermanager, mod_presence: Store stanza for incoming subscription requests (fixes #689) (thanks Zash, Ge0rG)
Diffstat (limited to 'core/rostermanager.lua')
-rw-r--r--core/rostermanager.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/rostermanager.lua b/core/rostermanager.lua
index 61b08002..2d616e4b 100644
--- a/core/rostermanager.lua
+++ b/core/rostermanager.lua
@@ -263,15 +263,15 @@ end
function is_contact_pending_in(username, host, jid)
local roster = load_roster(username, host);
- return roster[false].pending[jid];
+ return roster[false].pending[jid] ~= nil;
end
-local function set_contact_pending_in(username, host, jid)
+local function set_contact_pending_in(username, host, jid, stanza)
local roster = load_roster(username, host);
local item = roster[jid];
if item and (item.subscription == "from" or item.subscription == "both") then
return; -- false
end
- roster[false].pending[jid] = true;
+ roster[false].pending[jid] = st.is_stanza(stanza) and st.preserialize(stanza) or true;
return save_roster(username, host, roster, jid);
end
function is_contact_pending_out(username, host, jid)