Changeset

3937:843ee23cc91a

util.pubsub: Small code tidying for :get_subscription()
author Matthew Wild <mwild1@gmail.com>
date Wed, 22 Dec 2010 03:46:07 +0000
parents 3936:61f12f8a8539
children 3938:a3ecaf46bd82
files util/pubsub.lua
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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)