listChannelMessages method
#Listing message history
Message listing takes a parameter which indicates if messages are received from oldest to newest (forward) or newest to oldest.
Implementation
@override
Future<model.ChannelMessageList> listChannelMessages({
required model.Session session,
required String channelId,
int limit = 20,
bool? forward,
String? cursor,
}) async {
assert(limit > 0 && limit <= 100);
final res = await _client.listChannelMessages(
api.ListChannelMessagesRequest(
channelId: channelId,
limit: api.Int32Value(value: limit),
forward: api.BoolValue(value: forward),
cursor: cursor,
),
options: _getSessionCallOptions(session),
);
return model.ChannelMessageList.fromDto(res);
}