# ShouldEncryptStanzaCallback typedef

ShouldEncryptStanzaCallback = Future <bool> Function(JID toJid, Stanza stanza)

A callback for figuring out whether a stanza should be encrypted or not. Note that returning true here does not necessarily mean that a stanza gets encrypted because handlers can indicate that a stanza should not be encrypted, e.g. PubSub.

## Implementation

    typedef ShouldEncryptStanzaCallback = Future<bool> Function(
      JID toJid,
      Stanza stanza,
    );