def _handle_stream_features(self, features): """Process the received stream features. :param features: The features stanza. """ for order, name in self._stream_feature_order: if name in features['features']: handler, restart = self._stream_feature_handlers[name] if handler(features) and restart: # Don't continue if the feature requires # restarting the XML stream. return True
def _handle_stream_features(self, features): """ Process the received stream features. Arguments: features -- The features stanza. """ # Record all of the features. self.features = [] for sub in features.xml: self.features.append(sub.tag) # Process the features. for sub in features.xml: for feature in self.registered_features: mask, handler, halt = feature if mask.match(sub): if handler(sub) and halt: # Don't continue if the feature was # marked as a breaker. return True