Changeset

1527:06ecc5b3ca46

mod_smacks: Send failure correctly on s2s
author Kim Alvefur <zash@zash.se>
date Mon, 20 Oct 2014 11:55:08 +0200
parents 1526:120817435151
children 1528:5ccb3ee2cf72
files mod_smacks/mod_smacks.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_smacks/mod_smacks.lua	Mon Oct 20 11:51:07 2014 +0200
+++ b/mod_smacks/mod_smacks.lua	Mon Oct 20 11:55:08 2014 +0200
@@ -138,7 +138,7 @@
 	local ok, err, err_text = can_do_smacks(session);
 	if not ok then
 		session.log("warn", "Failed to enable smacks: %s", err_text); -- TODO: XEP doesn't say we can send error text, should it?
-		session.send(st.stanza("failed", { xmlns = xmlns_sm }):tag(err, { xmlns = xmlns_errors}));
+		(session.sends2s or session.send)(st.stanza("failed", { xmlns = xmlns_sm }):tag(err, { xmlns = xmlns_errors}));
 		return true;
 	end