Skip to content

Commit

Permalink
merge activity settings for calendars, events and todos
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Aug 6, 2020
1 parent a4d511d commit a712686
Show file tree
Hide file tree
Showing 14 changed files with 7 additions and 309 deletions.
3 changes: 0 additions & 3 deletions apps/dav/appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,10 @@
<activity>
<settings>
<setting>OCA\DAV\CalDAV\Activity\Setting\Calendar</setting>
<setting>OCA\DAV\CalDAV\Activity\Setting\Event</setting>
<setting>OCA\DAV\CalDAV\Activity\Setting\Todo</setting>
</settings>

<filters>
<filter>OCA\DAV\CalDAV\Activity\Filter\Calendar</filter>
<filter>OCA\DAV\CalDAV\Activity\Filter\Todo</filter>
</filters>

<providers>
Expand Down
3 changes: 0 additions & 3 deletions apps/dav/composer/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@
'OCA\\DAV\\BackgroundJob\\UploadCleanup' => $baseDir . '/../lib/BackgroundJob/UploadCleanup.php',
'OCA\\DAV\\CalDAV\\Activity\\Backend' => $baseDir . '/../lib/CalDAV/Activity/Backend.php',
'OCA\\DAV\\CalDAV\\Activity\\Filter\\Calendar' => $baseDir . '/../lib/CalDAV/Activity/Filter/Calendar.php',
'OCA\\DAV\\CalDAV\\Activity\\Filter\\Todo' => $baseDir . '/../lib/CalDAV/Activity/Filter/Todo.php',
'OCA\\DAV\\CalDAV\\Activity\\Provider\\Base' => $baseDir . '/../lib/CalDAV/Activity/Provider/Base.php',
'OCA\\DAV\\CalDAV\\Activity\\Provider\\Calendar' => $baseDir . '/../lib/CalDAV/Activity/Provider/Calendar.php',
'OCA\\DAV\\CalDAV\\Activity\\Provider\\Event' => $baseDir . '/../lib/CalDAV/Activity/Provider/Event.php',
'OCA\\DAV\\CalDAV\\Activity\\Provider\\Todo' => $baseDir . '/../lib/CalDAV/Activity/Provider/Todo.php',
'OCA\\DAV\\CalDAV\\Activity\\Setting\\Calendar' => $baseDir . '/../lib/CalDAV/Activity/Setting/Calendar.php',
'OCA\\DAV\\CalDAV\\Activity\\Setting\\Event' => $baseDir . '/../lib/CalDAV/Activity/Setting/Event.php',
'OCA\\DAV\\CalDAV\\Activity\\Setting\\Todo' => $baseDir . '/../lib/CalDAV/Activity/Setting/Todo.php',
'OCA\\DAV\\CalDAV\\BirthdayCalendar\\EnablePlugin' => $baseDir . '/../lib/CalDAV/BirthdayCalendar/EnablePlugin.php',
'OCA\\DAV\\CalDAV\\BirthdayService' => $baseDir . '/../lib/CalDAV/BirthdayService.php',
'OCA\\DAV\\CalDAV\\CachedSubscription' => $baseDir . '/../lib/CalDAV/CachedSubscription.php',
Expand Down
3 changes: 0 additions & 3 deletions apps/dav/composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,11 @@ class ComposerStaticInitDAV
'OCA\\DAV\\BackgroundJob\\UploadCleanup' => __DIR__ . '/..' . '/../lib/BackgroundJob/UploadCleanup.php',
'OCA\\DAV\\CalDAV\\Activity\\Backend' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Backend.php',
'OCA\\DAV\\CalDAV\\Activity\\Filter\\Calendar' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Filter/Calendar.php',
'OCA\\DAV\\CalDAV\\Activity\\Filter\\Todo' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Filter/Todo.php',
'OCA\\DAV\\CalDAV\\Activity\\Provider\\Base' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Base.php',
'OCA\\DAV\\CalDAV\\Activity\\Provider\\Calendar' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Calendar.php',
'OCA\\DAV\\CalDAV\\Activity\\Provider\\Event' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Event.php',
'OCA\\DAV\\CalDAV\\Activity\\Provider\\Todo' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Todo.php',
'OCA\\DAV\\CalDAV\\Activity\\Setting\\Calendar' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/Calendar.php',
'OCA\\DAV\\CalDAV\\Activity\\Setting\\Event' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/Event.php',
'OCA\\DAV\\CalDAV\\Activity\\Setting\\Todo' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/Todo.php',
'OCA\\DAV\\CalDAV\\BirthdayCalendar\\EnablePlugin' => __DIR__ . '/..' . '/../lib/CalDAV/BirthdayCalendar/EnablePlugin.php',
'OCA\\DAV\\CalDAV\\BirthdayService' => __DIR__ . '/..' . '/../lib/CalDAV/BirthdayService.php',
'OCA\\DAV\\CalDAV\\CachedSubscription' => __DIR__ . '/..' . '/../lib/CalDAV/CachedSubscription.php',
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/Activity/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ public function onTouchCalendarObject($action, array $calendarData, array $share
$event = $this->activityManager->generateEvent();
$event->setApp('dav')
->setObject('calendar', (int) $calendarData['id'])
->setType($object['type'] === 'event' ? 'calendar_event' : 'calendar_todo')
->setType('calendar')
->setAuthor($currentUser);

$users = $this->getUsersForShares($shares);
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/Activity/Filter/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function getIcon() {
* @since 11.0.0
*/
public function filterTypes(array $types) {
return array_intersect(['calendar', 'calendar_event'], $types);
return array_intersect(['calendar', 'calendar_event', 'calendar_todo'], $types);
}

/**
Expand Down
93 changes: 0 additions & 93 deletions apps/dav/lib/CalDAV/Activity/Filter/Todo.php

This file was deleted.

2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/Activity/Provider/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ protected function generateObjectParameter(array $eventData) {
* @since 11.0.0
*/
public function parse($language, IEvent $event, IEvent $previousEvent = null) {
if ($event->getApp() !== 'dav' || $event->getType() !== 'calendar_event') {
if ($event->getApp() !== 'dav' || ($event->getType() !== 'calendar' && $event->getType() !== 'calendar_event')) {
throw new \InvalidArgumentException();
}

Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/Activity/Provider/Todo.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Todo extends Event {
* @since 11.0.0
*/
public function parse($language, IEvent $event, IEvent $previousEvent = null) {
if ($event->getApp() !== 'dav' || $event->getType() !== 'calendar_todo') {
if ($event->getApp() !== 'dav' || ($event->getType() !== 'calendar' && $event->getType() !== 'calendar_todo')) {
throw new \InvalidArgumentException();
}

Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/Activity/Setting/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function getIdentifier() {
* @since 11.0.0
*/
public function getName() {
return $this->l->t('A <strong>calendar</strong> was modified');
return $this->l->t('A <strong>calendar</strong>, <strong>event</strong> or <strong>todo</strong> was modified');
}

/**
Expand Down
98 changes: 0 additions & 98 deletions apps/dav/lib/CalDAV/Activity/Setting/Event.php

This file was deleted.

98 changes: 0 additions & 98 deletions apps/dav/lib/CalDAV/Activity/Setting/Todo.php

This file was deleted.

2 changes: 0 additions & 2 deletions apps/dav/tests/unit/CalDAV/Activity/Filter/GenericTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
namespace OCA\DAV\Tests\unit\CalDAV\Activity\Filter;

use OCA\DAV\CalDAV\Activity\Filter\Calendar;
use OCA\DAV\CalDAV\Activity\Filter\Todo;
use OCP\Activity\IFilter;
use Test\TestCase;

Expand All @@ -36,7 +35,6 @@ class GenericTest extends TestCase {
public function dataFilters() {
return [
[Calendar::class],
[Todo::class],
];
}

Expand Down
Loading

0 comments on commit a712686

Please sign in to comment.