Changeset

2911:43adc18ff9f3

mod_auto_answer_disco_info: Don’t answer if the target session isn’t online
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 07 Mar 2018 20:15:20 +0100
parents 2910:415455faccae
children 2912:6e5bd5d8a5e2
files mod_auto_answer_disco_info/mod_auto_answer_disco_info.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_auto_answer_disco_info/mod_auto_answer_disco_info.lua	Wed Mar 07 20:13:48 2018 +0100
+++ b/mod_auto_answer_disco_info/mod_auto_answer_disco_info.lua	Wed Mar 07 20:15:20 2018 +0100
@@ -15,6 +15,10 @@
 	local node = query.attr.node;
 
 	local target_session = prosody.full_sessions[to];
+	if target_session == nil then
+		return;
+	end
+
 	local disco_info = target_session.caps_cache;
 	if disco_info ~= nil and (node == nil or node == disco_info.attr.node) then
 		local iq = st.reply(stanza);