Software /
code /
prosody
Diff
plugins/mod_presence.lua @ 9677:d0cc1c4e1a1c
mod_presence: Handle older boolean subscription request data (thanks Martin)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 02 Dec 2018 17:22:26 +0100 |
parent | 9676:837ba29aaeff |
child | 9790:4a419089ad00 |
line wrap: on
line diff
--- a/plugins/mod_presence.lua Sun Dec 02 17:20:44 2018 +0100 +++ b/plugins/mod_presence.lua Sun Dec 02 17:22:26 2018 +0100 @@ -81,9 +81,13 @@ 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