fix query to get threads info which have any protected messages