messages method

Future<RoomMessages> messages(
  1. Room room,
  2. Authentication authentication
)

Implementation

Future<RoomMessages> messages(
    Room room, Authentication authentication) async {
  http.Response response = await _httpService.getWithFilter(
    '/api/v1/im.messages',
    RoomFilter(room),
    authentication,
  );

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