Comparison

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
comparison
equal deleted inserted replaced
9676:837ba29aaeff 9677:d0cc1c4e1a1c
79 core_post_stanza(res, res.presence, true); 79 core_post_stanza(res, res.presence, true);
80 res.presence.attr.to = nil; 80 res.presence.attr.to = nil;
81 end 81 end
82 end 82 end
83 for jid, pending_request in pairs(roster[false].pending) do -- resend incoming subscription requests 83 for jid, pending_request in pairs(roster[false].pending) do -- resend incoming subscription requests
84 local subscribe = st.deserialize(pending_request); 84 if type(pending_request) == "table" then
85 subscribe.attr.type, subscribe.attr.from = "subscribe", jid; 85 local subscribe = st.deserialize(pending_request);
86 origin.send(subscribe); 86 subscribe.attr.type, subscribe.attr.from = "subscribe", jid;
87 origin.send(subscribe);
88 else
89 origin.send(st.presence({type="subscribe", from=jid}));
90 end
87 end 91 end
88 local request = st.presence({type="subscribe", from=origin.username.."@"..origin.host}); 92 local request = st.presence({type="subscribe", from=origin.username.."@"..origin.host});
89 for jid, item in pairs(roster) do -- resend outgoing subscription requests 93 for jid, item in pairs(roster) do -- resend outgoing subscription requests
90 if item.ask then 94 if item.ask then
91 request.attr.to = jid; 95 request.attr.to = jid;