diff --git a/packages/moxxmpp/lib/src/events.dart b/packages/moxxmpp/lib/src/events.dart index 1e922a7..9c0b8b3 100644 --- a/packages/moxxmpp/lib/src/events.dart +++ b/packages/moxxmpp/lib/src/events.dart @@ -71,9 +71,11 @@ class MessageEvent extends XmppEvent { this.from, this.to, this.id, + this.encrypted, this.extensions, { this.type, this.error, + this.encryptionError, }); /// The from attribute of the message. @@ -90,6 +92,12 @@ class MessageEvent extends XmppEvent { final StanzaError? error; + /// Flag indicating whether the message was encrypted. + final bool encrypted; + + /// The error in case an encryption error occurred. + final Object? encryptionError; + /// Data added by other handlers. final TypedMap extensions; diff --git a/packages/moxxmpp/lib/src/message.dart b/packages/moxxmpp/lib/src/message.dart index 5f48ca2..bae047e 100644 --- a/packages/moxxmpp/lib/src/message.dart +++ b/packages/moxxmpp/lib/src/message.dart @@ -81,9 +81,11 @@ class MessageManager extends XmppManagerBase { JID.fromString(state.stanza.attributes['from']! as String), JID.fromString(state.stanza.attributes['to']! as String), state.stanza.attributes['id']! as String, + state.encrypted, state.extensions, type: state.stanza.attributes['type'] as String?, error: StanzaError.fromStanza(state.stanza), + encryptionError: state.encryptionError, ), );