         ], cb
 
     getNodeListeners: (node, cb) ->
-        @db.query "SELECT DISTINCT listener FROM subscriptions WHERE node = $1 AND listener IS NOT NULL"
+        @db.query """SELECT DISTINCT listener
+                     FROM subscriptions
+                     WHERE node=$1
+                     AND subscription='subscribed'
+                     AND listener IS NOT NULL"""
         , [node]
         , (err, res) ->
             cb err, res?.rows?.map((row) -> row.listener)

                     AND EXISTS (SELECT affiliation
                                 FROM affiliations
                                 WHERE node=$1
                                 AND (affiliation='owner' OR affiliation='moderator')"""
        , [node]
        , (err, res) ->
            cb err, res?.rows?.map((row) -> row.listener)

        cb err, res?.rows?.map (row) -> row.node


LOST_TRANSACTION_TIMEOUT = 60 * 1000

##
# Wraps the postgres-js transaction with our model operations.
