diff options
author | Joas Schilling <coding@schilljs.com> | 2016-11-11 13:44:57 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-11-16 09:25:46 +0100 |
commit | 6047493b6dba2a402f256d2286008c3baaa3d5f9 (patch) | |
tree | 4d5d0e696f6c8b84c38add56a5c79f0a674037b7 | |
parent | b5f1296d1ff978e29eb41400ece13096ab636263 (diff) | |
download | nextcloud-server-6047493b6dba2a402f256d2286008c3baaa3d5f9.tar.gz nextcloud-server-6047493b6dba2a402f256d2286008c3baaa3d5f9.zip |
Fix integration tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | apps/dav/lib/CalDAV/Activity/Backend.php | 6 | ||||
-rw-r--r-- | lib/private/Activity/Event.php | 5 | ||||
-rw-r--r-- | lib/private/Activity/Manager.php | 12 |
3 files changed, 9 insertions, 14 deletions
diff --git a/apps/dav/lib/CalDAV/Activity/Backend.php b/apps/dav/lib/CalDAV/Activity/Backend.php index 6cf09f6de46..6a557fef7bd 100644 --- a/apps/dav/lib/CalDAV/Activity/Backend.php +++ b/apps/dav/lib/CalDAV/Activity/Backend.php @@ -112,7 +112,7 @@ class Backend { $event = $this->activityManager->generateEvent(); $event->setApp('dav') - ->setObject(Extension::CALENDAR, $calendarData['id']) + ->setObject(Extension::CALENDAR, (int) $calendarData['id']) ->setType(Extension::CALENDAR) ->setAuthor($currentUser); @@ -162,7 +162,7 @@ class Backend { $event = $this->activityManager->generateEvent(); $event->setApp('dav') - ->setObject(Extension::CALENDAR, $calendarData['id']) + ->setObject(Extension::CALENDAR, (int) $calendarData['id']) ->setType(Extension::CALENDAR) ->setAuthor($currentUser); @@ -387,7 +387,7 @@ class Backend { $event = $this->activityManager->generateEvent(); $event->setApp('dav') - ->setObject(Extension::CALENDAR, $calendarData['id']) + ->setObject(Extension::CALENDAR, (int) $calendarData['id']) ->setType($object['type'] === 'event' ? Extension::CALENDAR_EVENT : Extension::CALENDAR_TODO) ->setAuthor($currentUser); diff --git a/lib/private/Activity/Event.php b/lib/private/Activity/Event.php index c53335a316f..16c65c20853 100644 --- a/lib/private/Activity/Event.php +++ b/lib/private/Activity/Event.php @@ -539,10 +539,13 @@ class Event implements IEvent { $this->getAffectedUser() !== '' && $this->getTimestamp() !== 0 + /** + * Disabled for BC with old activities && $this->getObjectType() !== '' && - $this->getObjectId() !== '' + $this->getObjectId() !== 0 + */ ; } } diff --git a/lib/private/Activity/Manager.php b/lib/private/Activity/Manager.php index 35668a267ee..9c1629d79c2 100644 --- a/lib/private/Activity/Manager.php +++ b/lib/private/Activity/Manager.php @@ -173,14 +173,6 @@ class Manager implements IManager { * @throws \BadMethodCallException if required values have not been set */ public function publish(IEvent $event) { - $this->publishToConsumers($event, false); - } - - /** - * @param IEvent $event - * @param bool $legacyActivity - */ - protected function publishToConsumers(IEvent $event, $legacyActivity) { if ($event->getAuthor() === '') { if ($this->session->getUser() instanceof IUser) { $event->setAuthor($this->session->getUser()->getUID()); @@ -191,7 +183,7 @@ class Manager implements IManager { $event->setTimestamp(time()); } - if (!$legacyActivity && !$event->isValid()) { + if (!$event->isValid()) { throw new \BadMethodCallException('The given event is invalid'); } @@ -222,7 +214,7 @@ class Manager implements IManager { ->setObject('', 0, $file) ->setLink($link); - $this->publishToConsumers($event, true); + $this->publish($event); } /** |