getInboundGroupSessionsToUpload method

  1. @override
Future<List<StoredInboundGroupSession>> getInboundGroupSessionsToUpload()
override

Implementation

@override
Future<List<StoredInboundGroupSession>>
    getInboundGroupSessionsToUpload() async {
  final sessions = (await Future.wait(_inboundGroupSessionsBox.keys.map(
          (sessionId) async =>
              await _inboundGroupSessionsBox.get(sessionId))))
      .where((rawSession) => rawSession['uploaded'] == false)
      .take(500)
      .map(
        (json) => StoredInboundGroupSession.fromJson(
          convertToJson(json),
        ),
      )
      .toList();
  return sessions;
}