Quering over the related messages when the node/comment unpublished/published.