mod_message: Return early on messages of type error (silences empty if branch warning) [luacheck]
authorKim Alvefur <zash@zash.se>
Mon, 06 Mar 2017 15:27:37 +0100
changeset 7959 beaeafedc2d7
parent 7958 bba71bfe2154
child 7960 083c062c2fb7
child 7962 3941d609ff85
mod_message: Return early on messages of type error (silences empty if branch warning) [luacheck]
plugins/mod_message.lua
--- a/plugins/mod_message.lua	Mon Mar 06 15:24:44 2017 +0100
+++ b/plugins/mod_message.lua	Mon Mar 06 15:27:37 2017 +0100
@@ -20,7 +20,7 @@
 
 	local t = stanza.attr.type;
 	if t == "error" then
-		-- discard
+		return true; -- discard
 	elseif t == "groupchat" then
 		origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
 	elseif t == "headline" then