]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Notice.php
fix call of common_find_mentions() in Notice::saveReplies()
[quix0rs-gnu-social.git] / classes / Notice.php
index ac4640534c48b15264ef8cc3fcd1206be144b4ac..3702dbcfa8e59010b1ee07aba9983eb8b1f1e3a8 100644 (file)
@@ -282,12 +282,6 @@ class Notice extends Memcached_DataObject
 
         $notice->content = $final;
 
-        if (!empty($rendered)) {
-            $notice->rendered = $rendered;
-        } else {
-            $notice->rendered = common_render_content($final, $notice);
-        }
-
         $notice->source = $source;
         $notice->uri = $uri;
         $notice->url = $url;
@@ -315,6 +309,12 @@ class Notice extends Memcached_DataObject
             $notice->location_ns = $location_ns;
         }
 
+        if (!empty($rendered)) {
+            $notice->rendered = $rendered;
+        } else {
+            $notice->rendered = common_render_content($final, $notice);
+        }
+
         if (Event::handle('StartNoticeSave', array(&$notice))) {
 
             // XXX: some of these functions write to the DB
@@ -944,6 +944,8 @@ class Notice extends Memcached_DataObject
                 $reply->profile_id = $user->id;
 
                 $id = $reply->insert();
+
+                self::blow('reply:stream:%d', $user->id);
             }
         }
 
@@ -971,7 +973,10 @@ class Notice extends Memcached_DataObject
 
         $sender = Profile::staticGet($this->profile_id);
 
-        $mentions = common_find_mentions($this->profile_id, $this->content);
+        // @todo ideally this parser information would only
+        // be calculated once.
+
+        $mentions = common_find_mentions($this->content, $this);
 
         $replied = array();