/**
  * {@inheritdoc}
  */
 public function send(array $metrics, array $params = array())
 {
     arsort($metrics);
     $message = $this->getWinnerMessage($metrics);
     if (count($metrics)) {
         $message .= 'Number of commits from last 24h:<br/>';
         foreach ($metrics as $userName => $commits) {
             $message .= $userName . ' = ' . $commits . '<br/>';
         }
     }
     $message .= '<b>The Game is on Biatch!</b>';
     $this->client->message_room($params['room'], $params['from'], $message, true, HipChat::COLOR_PURPLE);
 }
Exemplo n.º 2
0
 /**
  * Send notification that a new room has been created.
  *
  * @param array $options
  * @param object|null $room
  * @return boolean
  */
 protected function notify($options, $room = null)
 {
     if (!isset($options['notification']) or !$options['notification']) {
         return false;
     }
     extract($options['notification']);
     if (!isset($room_id) or !$room_id) {
         return false;
     }
     if ($room) {
         $message = str_replace('[room_name]', $room->name, $message);
     }
     return (bool) $this->hipchat->message_room($room_id, $from, $message, $notify, $color, $message_format);
 }