history method

Future<RoomMessages> history(
  1. RoomHistoryFilter filter,
  2. Authentication authentication
)

Implementation

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

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