disableCarbons method

Future<bool> disableCarbons()

Send a request to the server, asking it to disable Message Carbons.

Returns true if carbons were disabled. False, if not.

Implementation

Future<bool> disableCarbons() async {
  final result = (await getAttributes().sendStanza(
    StanzaDetails(
      Stanza.iq(
        type: 'set',
        children: [
          XMLNode.xmlns(
            tag: 'disable',
            xmlns: carbonsXmlns,
          ),
        ],
      ),
    ),
  ))!;

  if (result.attributes['type'] != 'result') {
    logger.warning('Failed to disable message carbons');

    return false;
  }

  logger.fine('Successfully disabled message carbons');

  _isEnabled = false;
  return true;
}