getUserDeviceKeysByCurve25519Key method

DeviceKeys? getUserDeviceKeysByCurve25519Key(
  1. String senderKey
)

Gets user device keys by its curve25519 key. Returns null if it isn't found

Implementation

DeviceKeys? getUserDeviceKeysByCurve25519Key(String senderKey) {
  for (final user in userDeviceKeys.values) {
    final device = user.deviceKeys.values
        .firstWhereOrNull((e) => e.curve25519Key == senderKey);
    if (device != null) {
      return device;
    }
  }
  return null;
}