Changeset

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
parents 9676:837ba29aaeff
children 9678:6178b491fe28
files plugins/mod_presence.lua
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
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