feat(xep): Expose new/replaced ratchets in the MessageEvent
This commit is contained in:
parent
d35b955259
commit
b5efc2dfae
@ -1,3 +1,4 @@
|
||||
import 'package:moxxmpp/src/managers/data.dart';
|
||||
import 'package:omemo_dart/omemo_dart.dart';
|
||||
|
||||
/// A simple wrapper class for defining elements that should not be encrypted.
|
||||
@ -18,3 +19,11 @@ class OmemoEncryptionError {
|
||||
/// See omemo_dart's EncryptionResult for info on this field.
|
||||
final Map<String, List<EncryptToJidError>> deviceEncryptionErrors;
|
||||
}
|
||||
|
||||
class OmemoData extends StanzaHandlerExtension {
|
||||
OmemoData(this.newRatchets, this.replacedRatchets);
|
||||
|
||||
final Map<String, List<int>> newRatchets;
|
||||
|
||||
final Map<String, List<int>> replacedRatchets;
|
||||
}
|
||||
|
@ -516,6 +516,12 @@ class OmemoManager extends XmppManagerBase {
|
||||
children: children,
|
||||
tag: stanza.tag,
|
||||
attributes: Map<String, String>.from(stanza.attributes),
|
||||
)
|
||||
..extensions.set<OmemoData>(
|
||||
OmemoData(
|
||||
result.newRatchets,
|
||||
result.replacedRatchets,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ dependencies:
|
||||
version: ^0.2.0
|
||||
omemo_dart:
|
||||
hosted: https://git.polynom.me/api/packages/PapaTutuWawa/pub
|
||||
version: ^0.5.0
|
||||
version: ^0.5.1
|
||||
random_string: ^2.3.1
|
||||
saslprep: ^1.0.2
|
||||
synchronized: ^3.0.0+2
|
||||
@ -30,3 +30,10 @@ dev_dependencies:
|
||||
build_runner: ^2.1.11
|
||||
test: ^1.16.0
|
||||
very_good_analysis: ^3.0.1
|
||||
|
||||
# TODO: Remove once we release 0.5.1
|
||||
dependency_overrides:
|
||||
omemo_dart:
|
||||
git:
|
||||
url: https://github.com/PapaTutuWawa/omemo_dart.git
|
||||
rev: 49c7e114e6cf80dcde55fbbd218bba3182045862
|
||||
|
Loading…
Reference in New Issue
Block a user