negotiate method

  1. @override
Future<Result<NegotiatorState, NegotiatorError>> negotiate(
  1. XMLNode nonza
)
override

Called with the currently received nonza nonza when the negotiator is active. If the negotiator is just elected to be the next one, then nonza is equal to the <stream:features /> nonza.

Returns the next state of the negotiator. If done or retryLater is selected, then negotiator won't be called again. If retryLater is returned, then the negotiator must switch some internal state to prevent getting matched immediately again. If ready is returned, then the negotiator indicates that it is not done with negotiation.

Implementation

@override
Future<Result<NegotiatorState, NegotiatorError>> negotiate(
  XMLNode nonza,
) async {
  // negotiate is only called when the negotiator matched, meaning the server
  // advertises CSI.
  _supported = true;
  return const Result(NegotiatorState.done);
}