latest function

Future<Message?> latest({
  1. required String threadhash,
  2. String? accountAddress,
  3. String? pgpPrivateKey,
  4. bool toDecrypt = false,
})

Get the latest chat message

Implementation

Future<Message?> latest({
  required String threadhash,
  String? accountAddress,
  String? pgpPrivateKey,
  bool toDecrypt = false,
}) async {
  return (await history(
    threadhash: threadhash,
    accountAddress: accountAddress,
    pgpPrivateKey: pgpPrivateKey,
    limit: 1,
    toDecrypt: toDecrypt,
  ))
      ?.first;
}