diff options
author | Kim Alvefur <zash@zash.se> | 2018-12-02 17:22:26 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-12-02 17:22:26 +0100 |
commit | aa3cfe1ea0241eeb60d09ad11bd2727d28887a7d (patch) | |
tree | 7b2e2ee4da898d5232152d3b811f97f3e4c5f73a /plugins | |
parent | e984432ca4a85a2e9abef99b667731d8541ed662 (diff) | |
download | prosody-aa3cfe1ea0241eeb60d09ad11bd2727d28887a7d.tar.gz prosody-aa3cfe1ea0241eeb60d09ad11bd2727d28887a7d.zip |
mod_presence: Handle older boolean subscription request data (thanks Martin)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_presence.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua index 1ea837e8..5aed5854 100644 --- a/plugins/mod_presence.lua +++ b/plugins/mod_presence.lua @@ -81,9 +81,13 @@ function handle_normal_presence(origin, stanza) end end for jid, pending_request in pairs(roster[false].pending) do -- resend incoming subscription requests - local subscribe = st.deserialize(pending_request); - subscribe.attr.type, subscribe.attr.from = "subscribe", jid; - origin.send(subscribe); + if type(pending_request) == "table" then + local subscribe = st.deserialize(pending_request); + subscribe.attr.type, subscribe.attr.from = "subscribe", jid; + origin.send(subscribe); + else + origin.send(st.presence({type="subscribe", from=jid})); + end end local request = st.presence({type="subscribe", from=origin.username.."@"..origin.host}); for jid, item in pairs(roster) do -- resend outgoing subscription requests |