Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mpociot committed Jan 9, 2018
1 parent 2c505ae commit 55a0a96
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/HipChatDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,12 @@ public function buildServicePayload($message, $matchingMessage, $additionalParam
$parameters['message'] = $message;
}

$recipient = $matchingMessage->getRecipient() === '' ? $matchingMessage->getSender() : $matchingMessage->getRecipient();

$this->apiURL = Collection::make($this->config->get('urls', []))->filter(function ($url) use (
$matchingMessage
$recipient
) {
return strstr($url, 'room/'.$matchingMessage->getRecipient().'/notification');
return strstr($url, 'room/'.$recipient.'/notification');
})->first();

return $parameters;
Expand Down

0 comments on commit 55a0a96

Please sign in to comment.