summaryrefslogtreecommitdiff
path: root/modules/comment/models
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment/models')
-rw-r--r--modules/comment/models/comment.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/modules/comment/models/comment.php b/modules/comment/models/comment.php
index 22c465df..551fb245 100644
--- a/modules/comment/models/comment.php
+++ b/modules/comment/models/comment.php
@@ -61,8 +61,23 @@ class Comment_Model extends ORM {
$this->updated = time();
if (!$this->loaded && empty($this->created)) {
$this->created = $this->updated;
+ $created = true;
}
}
- return parent::save();
+ parent::save();
+
+ if (isset($created)) {
+ module::event("comment_created", $this);
+ } else {
+ module::event("comment_updated", $this);
+ }
+
+ // We only notify on the related items if we're making a visible change, which means moving in
+ // or out of a published state
+ if ($this->original("state") == "published" || $this->state == "published") {
+ module::event("item_related_update", $this->item());
+ }
+
+ return $this;
}
}