decrypt method

Future<EventUpdate> decrypt(
  1. Room room, {
  2. bool store = false,
})

Implementation

Future<EventUpdate> decrypt(Room room, {bool store = false}) async {
  final encryption = room.client.encryption;
  if (content['type'] != EventTypes.Encrypted ||
      !room.client.encryptionEnabled ||
      encryption == null) {
    return this;
  }
  try {
    final decrpytedEvent = await encryption.decryptRoomEvent(
        room.id, Event.fromJson(content, room),
        store: store, updateType: type);
    return EventUpdate(
        roomID: roomID, type: type, content: decrpytedEvent.toJson());
  } catch (e, s) {
    Logs().e('[LibOlm] Could not decrypt megolm event', e, s);
    return this;
  }
}