diff --git a/appinfo/info.xml b/appinfo/info.xml
index 1d750883d..110a1d7a6 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -17,7 +17,7 @@
- 🚀 Get your project organized
- 0.6.2
+ 0.6.2-1
agpl
Julius Härtl
Deck
@@ -36,7 +36,7 @@
pgsql
sqlite
mysql
-
+
OCA\Deck\Cron\DeleteCron
@@ -54,6 +54,7 @@
OCA\Deck\Activity\Setting
+ OCA\Deck\Activity\SettingComment
OCA\Deck\Activity\DescriptionSetting
diff --git a/js/service/ActivityService.js b/js/service/ActivityService.js
index 5b929559a..a7a128484 100644
--- a/js/service/ActivityService.js
+++ b/js/service/ActivityService.js
@@ -94,7 +94,7 @@ class ActivityService {
static getUrl(type, id, since) {
if (type === DECK_ACTIVITY_TYPE_CARD) {
- return OC.linkToOCS('apps/activity/api/v2/activity', 2) + 'filter?format=json&object_type=deck_card&object_id=' + id + '&limit=' + this.RESULT_PER_PAGE + '&since=' + since;
+ return OC.linkToOCS('apps/activity/api/v2/activity', 2) + 'deck?format=json&object_type=deck_card&object_id=' + id + '&limit=' + this.RESULT_PER_PAGE + '&since=' + since;
}
if (type === DECK_ACTIVITY_TYPE_BOARD) {
return OC.linkToOCS('apps/activity/api/v2/activity', 2) + 'deck?format=json&limit=' + this.RESULT_PER_PAGE + '&since=' + since;
diff --git a/js/service/BoardService.js b/js/service/BoardService.js
index 2857b6d0f..0cf704b00 100644
--- a/js/service/BoardService.js
+++ b/js/service/BoardService.js
@@ -4,20 +4,20 @@
* @author Julius Härtl
*
* @license GNU AGPL version 3 or any later version
- *
+ *
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
- *
+ *
*/
import app from '../app/App.js';
/* global app OC angular */
diff --git a/lib/Activity/ActivityManager.php b/lib/Activity/ActivityManager.php
index 4679d32a4..dd2f82fad 100644
--- a/lib/Activity/ActivityManager.php
+++ b/lib/Activity/ActivityManager.php
@@ -47,6 +47,7 @@ use OCP\IUser;
class ActivityManager {
+ const DECK_NOAUTHOR_COMMENT_SYSTEM_ENFORCED = 'DECK_NOAUTHOR_COMMENT_SYSTEM_ENFORCED';
private $manager;
private $userId;
private $permissionService;
@@ -327,6 +328,7 @@ class ActivityManager {
// case self::SUBJECT_BOARD_UPDATE_COLOR
break;
case self::SUBJECT_CARD_COMMENT_CREATE:
+ $eventType = 'deck_comment';
$subjectParams = $this->findDetailsForCard($entity->getId());
if (array_key_exists('comment', $additionalParams)) {
/** @var IComment $entity */
@@ -335,7 +337,6 @@ class ActivityManager {
unset($additionalParams['comment']);
}
break;
-
case self::SUBJECT_STACK_CREATE:
case self::SUBJECT_STACK_UPDATE:
case self::SUBJECT_STACK_UPDATE_TITLE:
@@ -402,6 +403,12 @@ class ActivityManager {
$event->setMessage($message);
}
+ // FIXME: We currently require activities for comments even if they are disabled though settings
+ // Get rid of this once the frontend fetches comments/activity individually
+ if ($eventType === 'deck_comment') {
+ $event->setAuthor(self::DECK_NOAUTHOR_COMMENT_SYSTEM_ENFORCED);
+ }
+
return $event;
}
diff --git a/lib/Activity/DeckProvider.php b/lib/Activity/DeckProvider.php
index 87a7832a7..1efefdd27 100644
--- a/lib/Activity/DeckProvider.php
+++ b/lib/Activity/DeckProvider.php
@@ -90,7 +90,7 @@ class DeckProvider implements IProvider {
$author = $event->getAuthor();
// get author if
- if ($author === '' && array_key_exists('author', $subjectParams)) {
+ if (($author === '' || $author === ActivityManager::DECK_NOAUTHOR_COMMENT_SYSTEM_ENFORCED) && array_key_exists('author', $subjectParams)) {
$author = $subjectParams['author'];
unset($subjectParams['author']);
}
diff --git a/lib/Activity/Filter.php b/lib/Activity/Filter.php
index d4209b7cc..62b9a7c83 100644
--- a/lib/Activity/Filter.php
+++ b/lib/Activity/Filter.php
@@ -79,7 +79,7 @@ class Filter implements \OCP\Activity\IFilter {
* @since 11.0.0
*/
public function filterTypes(array $types) {
- return $types;
+ return array_merge($types, ['deck_comment']);
}
/**
diff --git a/lib/Activity/SettingComment.php b/lib/Activity/SettingComment.php
new file mode 100644
index 000000000..fd8ad178b
--- /dev/null
+++ b/lib/Activity/SettingComment.php
@@ -0,0 +1,53 @@
+
+ *
+ * @author Julius Härtl
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+namespace OCA\Deck\Activity;
+
+
+class SettingComment extends Setting {
+
+ /**
+ * @return string Lowercase a-z and underscore only identifier
+ * @since 11.0.0
+ */
+ public function getIdentifier() {
+ return 'deck_comment';
+ }
+
+ /**
+ * @return string A translated string
+ * @since 11.0.0
+ */
+ public function getName() {
+ return $this->l->t('A comment was created on a card');
+ }
+
+ /**
+ * @return bool True when the option can be changed for the stream
+ * @since 11.0.0
+ */
+ public function canChangeStream() {
+ return false;
+ }
+
+}