util.pubsub: Small code tidying for :get_subscription()

Wed, 22 Dec 2010 03:46:07 +0000

author
Matthew Wild <mwild1@gmail.com>
date
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 file | annotate | diff | comparison | revisions
--- 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)

mercurial