feat: Make RatchetMapKey internal
This commit is contained in:
parent
dd96e840d4
commit
9a9c9f064b
18
lib/src/omemo/ratchet_map_key.dart
Normal file
18
lib/src/omemo/ratchet_map_key.dart
Normal file
@ -0,0 +1,18 @@
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
@internal
|
||||
@immutable
|
||||
class RatchetMapKey {
|
||||
|
||||
const RatchetMapKey(this.jid, this.deviceId);
|
||||
final String jid;
|
||||
final int deviceId;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is RatchetMapKey && jid == other.jid && deviceId == other.deviceId;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => jid.hashCode ^ deviceId.hashCode;
|
||||
}
|
@ -13,6 +13,7 @@ import 'package:omemo_dart/src/keys.dart';
|
||||
import 'package:omemo_dart/src/omemo/bundle.dart';
|
||||
import 'package:omemo_dart/src/omemo/device.dart';
|
||||
import 'package:omemo_dart/src/omemo/fingerprint.dart';
|
||||
import 'package:omemo_dart/src/omemo/ratchet_map_key.dart';
|
||||
import 'package:omemo_dart/src/protobuf/omemo_authenticated_message.dart';
|
||||
import 'package:omemo_dart/src/protobuf/omemo_key_exchange.dart';
|
||||
import 'package:omemo_dart/src/protobuf/omemo_message.dart';
|
||||
@ -43,22 +44,6 @@ class EncryptedKey {
|
||||
final bool kex;
|
||||
}
|
||||
|
||||
@immutable
|
||||
class RatchetMapKey {
|
||||
|
||||
const RatchetMapKey(this.jid, this.deviceId);
|
||||
final String jid;
|
||||
final int deviceId;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is RatchetMapKey && jid == other.jid && deviceId == other.deviceId;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => jid.hashCode ^ deviceId.hashCode;
|
||||
}
|
||||
|
||||
class OmemoSessionManager {
|
||||
|
||||
OmemoSessionManager(this._device, this._deviceMap, this._ratchetMap)
|
||||
|
Loading…
Reference in New Issue
Block a user