Send notifications on user mentions

This commit is contained in:
Frederic Guillot
2015-12-29 09:30:36 +01:00
parent 9ff0abd8d6
commit ded63d21a8
19 changed files with 323 additions and 74 deletions

View File

@@ -86,8 +86,13 @@ class TaskCreation extends Base
*/
private function fireEvents($task_id, array $values)
{
$values['task_id'] = $task_id;
$this->container['dispatcher']->dispatch(Task::EVENT_CREATE_UPDATE, new TaskEvent($values));
$this->container['dispatcher']->dispatch(Task::EVENT_CREATE, new TaskEvent($values));
$event = new TaskEvent(array('task_id' => $task_id) + $values);
$this->dispatcher->dispatch(Task::EVENT_CREATE_UPDATE, $event);
$this->dispatcher->dispatch(Task::EVENT_CREATE, $event);
if (! empty($values['description'])) {
$this->userMention->fireEvents($values['description'], Task::EVENT_USER_MENTION, $event);
}
}
}