Implement comment deletion and loading indicator

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2018-10-05 10:12:15 +02:00
parent e547a5d2b9
commit f5520d3087
6 changed files with 33 additions and 21 deletions

View File

@@ -29,6 +29,7 @@ use OCA\Deck\Db\Acl;
use OCP\Activity\IEvent;
use OCP\Activity\IProvider;
use OCP\Comments\IComment;
use OCP\Comments\NotFoundException;
use OCP\IURLGenerator;
use OCP\IUserManager;
@@ -235,8 +236,11 @@ class DeckProvider implements IProvider {
private function parseParamForComment($subjectParams, $params, IEvent $event) {
if (array_key_exists('comment', $subjectParams)) {
/** @var IComment $comment */
$comment = \OC::$server->getCommentsManager()->get((int) $subjectParams['comment']);
$event->setParsedMessage($comment->getMessage());
try {
$comment = \OC::$server->getCommentsManager()->get((int)$subjectParams['comment']);
$event->setParsedMessage($comment->getMessage());
} catch (NotFoundException $e) {
}
}
$params['comment'] = $subjectParams['comment'];
return $params;