sendEmptyMessageImpl method

Future<void> sendEmptyMessageImpl(
  1. EncryptionResult result,
  2. String toJid
)

For usage with omemo_dart's OmemoManager.

Implementation

Future<void> sendEmptyMessageImpl(
  omemo.EncryptionResult result,
  String toJid,
) async {
  await getAttributes().sendStanza(
    StanzaDetails(
      Stanza.message(
        to: toJid,
        type: 'chat',
        children: [
          _buildEncryptedElement(
            result,
            toJid,
            await _getDeviceId(),
          ),

          // Add a storage hint in case this is a message
          // Taken from the example at
          // https://xmpp.org/extensions/xep-0384.html#message-structure-description.
          MessageProcessingHint.store.toXML(),
        ],
      ),
      awaitable: false,
      encrypted: true,
    ),
  );
}