diff options
| author | Romain LE DISEZ <romain.git@ledisez.net> | 2009-07-18 17:51:23 +0200 | 
|---|---|---|
| committer | Romain LE DISEZ <romain.git@ledisez.net> | 2009-07-18 17:51:23 +0200 | 
| commit | c78744d4f8a0cfad7ca5aa3d2867fb66d4c6b8c4 (patch) | |
| tree | e2b4d5d066590a966d949409cb48104456edaf7e /modules/comment/models | |
| parent | 7f5030ac208c30a7dc576a57cd9e665022ccbde5 (diff) | |
| parent | df22832a5b7e7c1962940becab1c90aaec3392f9 (diff) | |
Merge commit 'upstream/master'
Diffstat (limited to 'modules/comment/models')
| -rw-r--r-- | modules/comment/models/comment.php | 17 | 
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;    }  } | 
