From 9ddb6635cc2abd3fc92c450590ecbd0aba535b7a Mon Sep 17 00:00:00 2001 From: Ivan Kurnosov Date: Sun, 18 Sep 2011 18:34:59 +1100 Subject: [PATCH] Added 'rooms/history' endpoint support --- HipChat.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/HipChat.php b/HipChat.php index cf109a5..ac93d3a 100644 --- a/HipChat.php +++ b/HipChat.php @@ -103,6 +103,18 @@ public function message_room($room_id, $from, $message, $notify = false, $color return ($response->status == 'sent'); } + /** + * Get chat history for a room + * + * @see https://www.hipchat.com/docs/api/method/rooms/history + */ + public function get_rooms_history($room_id, $date = 'recent') { + $response = $this->make_request('rooms/history', array( + 'room_id' => $room_id, + 'date' => $date + )); + return $response->messages; + } ///////////////////////////////////////////////////////////////////////////// // User functions