onSasl2FeaturesReceived method

  1. @override
Future<List<XMLNode>> onSasl2FeaturesReceived(
  1. XMLNode sasl2Features
)
override

Called by the SASL2 negotiator when we received the SASL2 stream features sasl2Features. The return value is a list of XML elements that should be added to the SASL2 nonza. This method is only called when the element contains an item with xmlns equal to negotiatingXmlns.

Implementation

@override
Future<List<XMLNode>> onSasl2FeaturesReceived(XMLNode sasl2Features) async {
  final inline = sasl2Features.firstTag('inline')!;
  final resume = inline.firstTag('resume', xmlns: smXmlns);

  if (resume == null) {
    return [];
  }

  final sm = attributes.getManagerById<StreamManagementManager>(smManager)!;
  final srid = sm.state.streamResumptionId;
  final h = sm.state.s2c;
  if (srid == null) {
    _log.finest('No srid');
    return [];
  }

  return [
    StreamManagementResumeNonza(
      srid,
      h,
    ),
  ];
}