history method

Future<ChannelMessages> history(
  1. ChannelHistoryFilter filter,
  2. Authentication authentication
)

Implementation

Future<ChannelMessages> history(
    ChannelHistoryFilter filter, Authentication authentication) async {
  http.Response response = await _httpService.getWithFilter(
    '/api/v1/channels.history',
    filter,
    authentication,
  );

  if (response.statusCode == 200) {
    if (response.body.isNotEmpty == true) {
      return ChannelMessages.fromMap(jsonDecode(response.body));
    } else {
      return ChannelMessages();
    }
  }
  throw RocketChatException(response.body);
}