Skip to content

Commit

Permalink
Only try to get f/b information if we have the attendee email address.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Mar 4, 2016
1 parent fe7e6b7 commit 44c5512
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions kronolith/lib/Ajax/Application/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -914,10 +914,14 @@ public function getFreeBusy()
{
$result = new stdClass;
if ($this->vars->email) {
try {
$result->fb = Kronolith_FreeBusy::get($this->vars->email, true);
} catch (Exception $e) {
$GLOBALS['notification']->push($e->getMessage(), 'horde.warning');
$rfc822 = new Horde_Mail_Rfc822();
$res = $rfc822->parseAddressList($this->vars->email);
if ($res[0] && $res[0]->host) {
try {
$result->fb = Kronolith_FreeBusy::get($this->vars->email, true);
} catch (Exception $e) {
$GLOBALS['notification']->push($e->getMessage(), 'horde.warning');
}
}
} elseif ($this->vars->resource) {
try {
Expand Down

0 comments on commit 44c5512

Please sign in to comment.