getMessagesByTimestamp method
Retrieves previous or next messages based on the timestamp in a specific channel.
The timestamp
to be the reference point for messages to retrieve, in Unix milliseconds format.
Implementation
Future<List<RootMessage>> getMessagesByTimestamp(
int timestamp,
MessageListParams params,
) async {
sbLog.i(StackTrace.current, 'timestamp: $timestamp');
if (timestamp <= 0) {
throw InvalidParameterException();
}
if (channelType == ChannelType.group) {
params.showSubChannelMessagesOnly = false;
}
final res = await chat.apiClient
.send<ChannelMessagesGetResponse>(ChannelMessagesGetRequest(
chat,
channelType: channelType,
channelUrl: channelUrl,
params: params.toJson(),
timestamp: timestamp,
));
return res.messages;
}