util.pubsub: Small code tidying for :get_subscription()
authorMatthew Wild <mwild1@gmail.com>
Wed, 22 Dec 2010 03:46:07 +0000 (03:46 +0000)
committerMatthew Wild <mwild1@gmail.com>
Wed, 22 Dec 2010 03:46:07 +0000 (03:46 +0000)
util/pubsub.lua

index bba0ed3a7fdacb2313c55b5a64503d63acbf50ab..f7c6597f178159bb73c216a580a0bd02baa073c3 100644 (file)
@@ -154,9 +154,10 @@ function service:get_subscription(node, actor, jid)
        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)