summaryrefslogtreecommitdiff
path: root/app/Model/Comment.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-12-29 09:30:36 +0100
committerFrederic Guillot <fred@kanboard.net>2015-12-29 09:30:36 +0100
commitded63d21a84811c9e082c0fea0110a1b498265d6 (patch)
tree2d95b985ef8402ae899ced0307af4e8e3d47e431 /app/Model/Comment.php
parent9ff0abd8d683ab5a285fcf70e27d1bcd1cbc47df (diff)
Send notifications on user mentions
Diffstat (limited to 'app/Model/Comment.php')
-rw-r--r--app/Model/Comment.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/Model/Comment.php b/app/Model/Comment.php
index f60a96e3..71e964dc 100644
--- a/app/Model/Comment.php
+++ b/app/Model/Comment.php
@@ -26,8 +26,9 @@ class Comment extends Base
*
* @var string
*/
- const EVENT_UPDATE = 'comment.update';
- const EVENT_CREATE = 'comment.create';
+ const EVENT_UPDATE = 'comment.update';
+ const EVENT_CREATE = 'comment.create';
+ const EVENT_USER_MENTION = 'comment.user.mention';
/**
* Get all comments for a given task
@@ -110,7 +111,9 @@ class Comment extends Base
$comment_id = $this->persist(self::TABLE, $values);
if ($comment_id) {
- $this->container['dispatcher']->dispatch(self::EVENT_CREATE, new CommentEvent(array('id' => $comment_id) + $values));
+ $event = new CommentEvent(array('id' => $comment_id) + $values);
+ $this->dispatcher->dispatch(self::EVENT_CREATE, $event);
+ $this->userMention->fireEvents($values['comment'], self::EVENT_USER_MENTION, $event);
}
return $comment_id;