diff --git a/PHPCI/Plugin/XMPP.php b/PHPCI/Plugin/XMPP.php index 2fb3ae63..9bef3402 100644 --- a/PHPCI/Plugin/XMPP.php +++ b/PHPCI/Plugin/XMPP.php @@ -151,6 +151,13 @@ class XMPP implements \PHPCI\Plugin return false; } + /* + * Without recipients we can't send notification + */ + if (count($this->recipients) == 0) { + return false; + } + /* * Try to build conf file */ @@ -181,13 +188,16 @@ class XMPP implements \PHPCI\Plugin /* * Send XMPP notification for all recipients */ - $success = false; + $success = array() foreach($this->recipients as $recipient) { - $success = $this->phpci->executeCommand('echo %s | ' . $sendxmpp . - ' %s %s', $message, $tls, $recipients); + if($cmd = $this->phpci->executeCommand('echo %s | ' . $sendxmpp . + ' %s %s', $message, $tls, $recipients)) { + $success[] = $cmd; + } + print $this->phpci->getLastOutput(); } - return $success; + return (count($success) === count($this->recipients)); } }