summaryrefslogtreecommitdiff
path: root/modules/comment/models
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-08-27 16:11:47 -0700
committerBharat Mediratta <bharat@menalto.com>2009-08-27 16:11:47 -0700
commit74363ced870d4114e7570729636875e0258917b3 (patch)
tree61bc27831a362994fc96ea90172d50e25d5c76cb /modules/comment/models
parent98e9a96ba4d2419e02717369be8c0d886bc35ef7 (diff)
parent4828db003f3ee505eb9e6d056cdb142da34b78ff (diff)
Merge branch 'master' of git@github.com:gallery/gallery3 into HEAD
Conflicts: modules/slideshow/helpers/slideshow_event.php
Diffstat (limited to 'modules/comment/models')
-rw-r--r--modules/comment/models/comment.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/modules/comment/models/comment.php b/modules/comment/models/comment.php
index 22c465df..83d0888a 100644
--- a/modules/comment/models/comment.php
+++ b/modules/comment/models/comment.php
@@ -31,7 +31,7 @@ class Comment_Model extends ORM {
if ($author->guest) {
return $this->guest_name;
} else {
- return $author->full_name;
+ return $author->display_name();
}
}
@@ -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();
+ $visible_change = $this->original()->state == "published" || $this->state == "published";
+ parent::save();
+
+ if (isset($created)) {
+ module::event("comment_created", $this);
+ } else {
+ module::event("comment_updated", $this->original(), $this);
+ }
+
+ // We only notify on the related items if we're making a visible change.
+ if ($visible_change) {
+ module::event("item_related_update", $this->item());
+ }
+
+ return $this;
}
}