mod_pubsub: Eliminate dead code
authorKim Alvefur <zash@zash.se>
Thu, 25 Jul 2019 12:26:07 +0200
changeset 10094 cdcf26331b9f
parent 10093 90e459f48cbd
child 10095 bd547587f48c
mod_pubsub: Eliminate dead code `data` is a stanza and always truthy
plugins/mod_pubsub/pubsub.lib.lua
--- a/plugins/mod_pubsub/pubsub.lib.lua	Fri Jul 26 21:21:48 2019 +0200
+++ b/plugins/mod_pubsub/pubsub.lib.lua	Thu Jul 25 12:26:07 2019 +0200
@@ -328,14 +328,9 @@
 	for _, id in ipairs(results) do
 		data:add_child(results[id]);
 	end
-	local reply;
-	if data then
-		reply = st.reply(stanza)
-			:tag("pubsub", { xmlns = xmlns_pubsub })
-				:add_child(data);
-	else
-		reply = pubsub_error_reply(stanza, "item-not-found");
-	end
+	local reply = st.reply(stanza)
+		:tag("pubsub", { xmlns = xmlns_pubsub })
+			:add_child(data);
 	origin.send(reply);
 	return true;
 end