summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-10-13 13:20:53 +0200
committerJoas Schilling <coding@schilljs.com>2016-11-03 12:07:59 +0100
commitd3e8463de28197de2d4d61c35906b020ec85b432 (patch)
tree461f74a5824208858b9a7f6c2e2cf7c9ad4466c3 /apps/dav/lib
parent43b46bcc6aa491ffcaa8ee6d8214285136d250cc (diff)
downloadnextcloud-server-d3e8463de28197de2d4d61c35906b020ec85b432.tar.gz
nextcloud-server-d3e8463de28197de2d4d61c35906b020ec85b432.zip
Use a different type for events and todos
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r--apps/dav/lib/CalDAV/Activity/Backend.php2
-rw-r--r--apps/dav/lib/CalDAV/Activity/Extension.php21
2 files changed, 20 insertions, 3 deletions
diff --git a/apps/dav/lib/CalDAV/Activity/Backend.php b/apps/dav/lib/CalDAV/Activity/Backend.php
index 6e4da340c9a..1c1637cd562 100644
--- a/apps/dav/lib/CalDAV/Activity/Backend.php
+++ b/apps/dav/lib/CalDAV/Activity/Backend.php
@@ -427,7 +427,7 @@ class Backend {
$event = $this->activityManager->generateEvent();
$event->setApp('dav')
->setObject(Extension::CALENDAR, $calendarId)
- ->setType(Extension::CALENDAR)
+ ->setType($object['type'] === 'event' ? Extension::CALENDAR_EVENT : Extension::CALENDAR_TODO)
->setAuthor($currentUser);
$users = $this->getUsersForCalendar($calendarId);
diff --git a/apps/dav/lib/CalDAV/Activity/Extension.php b/apps/dav/lib/CalDAV/Activity/Extension.php
index d3b0871363e..29222b90ce8 100644
--- a/apps/dav/lib/CalDAV/Activity/Extension.php
+++ b/apps/dav/lib/CalDAV/Activity/Extension.php
@@ -31,6 +31,8 @@ class Extension implements IExtension {
* Filter with all sharing related activities
*/
const CALENDAR = 'calendar';
+ const CALENDAR_EVENT = 'calendar_event';
+ const CALENDAR_TODO = 'calendar_todo';
const SUBJECT_ADD = 'calendar_add';
const SUBJECT_UPDATE = 'calendar_update';
@@ -75,6 +77,8 @@ class Extension implements IExtension {
return array(
self::CALENDAR => (string) $l->t('A <strong>calendar</strong> was modified'),
+ self::CALENDAR_EVENT => (string) $l->t('A calendar <strong>event</strong> was modified'),
+ self::CALENDAR_TODO => (string) $l->t('A calendar <strong>todo</strong> was modified'),
);
}
@@ -89,6 +93,8 @@ class Extension implements IExtension {
$defaultTypes = [];
if ($method === self::METHOD_STREAM) {
$defaultTypes[] = self::CALENDAR;
+ $defaultTypes[] = self::CALENDAR_EVENT;
+ $defaultTypes[] = self::CALENDAR_TODO;
}
return $defaultTypes;
@@ -104,7 +110,10 @@ class Extension implements IExtension {
public function getTypeIcon($type) {
switch ($type) {
case self::CALENDAR:
+ case self::CALENDAR_EVENT:
return 'icon-calendar-dark';
+ case self::CALENDAR_TODO:
+ return 'icon-checkmark';
}
return false;
@@ -314,6 +323,12 @@ class Extension implements IExtension {
'name' => (string) $l->t('Calendar'),
'url' => $this->URLGenerator->linkToRoute('activity.Activities.showList', ['filter' => self::CALENDAR]),
],
+ self::CALENDAR_TODO => [
+ 'id' => self::CALENDAR_TODO,
+ 'icon' => 'icon-checkmark',
+ 'name' => (string) $l->t('Todos'),
+ 'url' => $this->URLGenerator->linkToRoute('activity.Activities.showList', ['filter' => self::CALENDAR_TODO]),
+ ],
],
'top' => [],
];
@@ -326,7 +341,7 @@ class Extension implements IExtension {
* @return boolean
*/
public function isFilterValid($filterValue) {
- return $filterValue === self::CALENDAR;
+ return in_array($filterValue, [self::CALENDAR, self::CALENDAR_TODO]);
}
/**
@@ -340,7 +355,9 @@ class Extension implements IExtension {
public function filterNotificationTypes($types, $filter) {
switch ($filter) {
case self::CALENDAR:
- return array_intersect([self::CALENDAR], $types);
+ return array_intersect([self::CALENDAR, self::CALENDAR_EVENT], $types);
+ case self::CALENDAR_TODO:
+ return array_intersect([self::CALENDAR_TODO], $types);
}
return false;
}