diff options
author | Brion Vibber <brion@pobox.com> | 2010-02-17 10:14:08 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-02-17 10:14:08 -0800 |
commit | 5a6cbb248f8cdcb171ea5540e6a6c2eb10506a82 (patch) | |
tree | c72830bef3388b1ceb19cc6ef688177122961435 /classes/Notice.php | |
parent | 46e9aa13aa87955b441bc63b7cf2f58622b131b0 (diff) | |
parent | 3cb6b1670bd7e3860fdca217e4075f51378fe5e0 (diff) |
Merge branch 'testing' into 0.9.x
Diffstat (limited to 'classes/Notice.php')
-rw-r--r-- | classes/Notice.php | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/classes/Notice.php b/classes/Notice.php index 73b22d58a..b0edb6de6 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -309,7 +309,8 @@ class Notice extends Memcached_DataObject // the beginning of a new conversation. if (empty($notice->conversation)) { - $notice->conversation = $notice->id; + $conv = Conversation::create(); + $notice->conversation = $conv->id; $changed = true; } @@ -331,14 +332,15 @@ class Notice extends Memcached_DataObject return $notice; } - function blowOnInsert() + function blowOnInsert($conversation = false) { self::blow('profile:notice_ids:%d', $this->profile_id); self::blow('public'); - if ($this->conversation != $this->id) { - self::blow('notice:conversation_ids:%d', $this->conversation); - } + // XXX: Before we were blowing the casche only if the notice id + // was not the root of the conversation. What to do now? + + self::blow('notice:conversation_ids:%d', $this->conversation); if (!empty($this->repeat_of)) { self::blow('notice:repeats:%d', $this->repeat_of); @@ -1015,28 +1017,29 @@ class Notice extends Memcached_DataObject } } - if (!empty($this->conversation) - && $this->conversation != $this->id) { - $xs->element( - 'link', array( - 'rel' => 'ostatus:conversation', - 'href' => common_local_url( - 'conversation', - array('id' => $this->conversation) - ) + if (!empty($this->conversation)) { + + $conv = Conversation::staticGet('id', $this->conversation); + + if (!empty($conv)) { + $xs->element( + 'link', array( + 'rel' => 'ostatus:conversation', + 'href' => $conv->uri ) ); + } } $reply_ids = $this->getReplies(); foreach ($reply_ids as $id) { $profile = Profile::staticGet('id', $id); - if (!empty($profile)) { + if (!empty($profile)) { $xs->element( 'link', array( 'rel' => 'ostatus:attention', - 'href' => $profile->getAcctUri() + 'href' => $profile->getUri() ) ); } |