util.pubsub: Small code tidying for :get_subscription()
authorMatthew Wild <mwild1@gmail.com>
Wed, 22 Dec 2010 03:46:07 +0000
changeset 3937 843ee23cc91a
parent 3936 61f12f8a8539
child 3938 a3ecaf46bd82
util.pubsub: Small code tidying for :get_subscription()
util/pubsub.lua
--- a/util/pubsub.lua	Wed Dec 22 03:44:51 2010 +0000
+++ b/util/pubsub.lua	Wed Dec 22 03:46:07 2010 +0000
@@ -154,9 +154,10 @@
 	end
 	--
 	local node_obj = self.nodes[node];
-	if node_obj then
-		return true, node_obj.subscribers[jid];
+	if not node_obj then
+		return false, "item-not-found";
 	end
+	return true, node_obj.subscribers[jid];
 end
 
 function service:create(node, actor)