registerFeatureNegotiators method

Future<void> registerFeatureNegotiators(
  1. List<XmppFeatureNegotiatorBase> negotiators
)

Register a list of negotiator with the connection.

Implementation

Future<void> registerFeatureNegotiators(
  List<XmppFeatureNegotiatorBase> negotiators,
) async {
  for (final negotiator in negotiators) {
    _log.finest('Registering ${negotiator.id}');
    negotiator.register(
      NegotiatorAttributes(
        sendRawXML,
        () => this,
        () => connectionSettings,
        _sendEvent,
        _negotiationsHandler.getNegotiatorById,
        getManagerById,
        _getJidWithResource,
        () => _socket,
        () => _isAuthenticated,
        _setAuthenticated,
        setResource,
        _negotiationsHandler.removeNegotiatingFeature,
      ),
    );
    _negotiationsHandler.registerNegotiator(negotiator);
  }

  _log.finest('Negotiators registered');
  await _negotiationsHandler.runPostRegisterCallback();
}