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 <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Aug 6, 2020
1 parent a4d511d commit 5fed97f
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 297 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
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.

0 comments on commit 5fed97f

Please sign in to comment.