diff --git a/src/Adapters/RoomResourceGoogleCalendar.php b/src/Adapters/RoomResourceGoogleCalendar.php index 80299c3..ae335b9 100644 --- a/src/Adapters/RoomResourceGoogleCalendar.php +++ b/src/Adapters/RoomResourceGoogleCalendar.php @@ -12,6 +12,7 @@ class RoomResourceGoogleCalendar implements RoomResourceAdapterInterface { const DEFAULT_TIME_ZONE = 'Europe/Zagreb'; + const ACCEPTED = 'accepted'; private $config = []; @@ -362,11 +363,18 @@ public function reserveRoom($room, $length = self::DEFAULT_MEET_LENGTH, $summary 'timeZone' => $this->getTimeZone(), ], 'attendees' => [ - ['email' => $this->getUserPrimaryCalendarId()], + [ + 'email' => $room->getId(), + 'resource' => true, + ], + [ + 'email' => $this->getUserPrimaryCalendarId(), + 'responseStatus' => self::ACCEPTED + ], ] ]); - $event = $this->getService()->events->insert($room->getId(), $event); + $event = $this->getService()->events->insert($this->getUserPrimaryCalendarId(), $event); return $event; } }