history method

Future<List<Message>?> history({
  1. required String target,
  2. String? reference,
  3. int limit = FetchLimit.DEFAULT,
})

Implementation

Future<List<Message>?> history({
  required String target,
  String? reference,
  int limit = FetchLimit.DEFAULT,
}) async {
  if (reference == null) {
    final threadHash = await PUSH_CHAT.conversationHash(
      conversationId: target,
      accountAddress: _account,
    );
    reference = threadHash;
  }

  if (reference == null) {
    return [];
  }

  return PUSH_CHAT.history(
    threadhash: reference,
    limit: limit,
    accountAddress: _account,
    pgpPrivateKey: _decryptedPgpPvtKey,
    toDecrypt: _hasSigner,
  );
}