diff options
author | Zach Copley <zach@status.net> | 2010-02-26 14:47:38 -0800 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-02-26 14:47:38 -0800 |
commit | d3fc8e22193a86fc71ba21462db89c30fa2abc4b (patch) | |
tree | f2a07e112c1a3f824ef94c19efdaa349e98803ff /lib | |
parent | dced92d6fde00d7a5609aba780fcfeac7c2b2fe0 (diff) |
Pull conversation URL from Conversation instead of assuming it's local
Diffstat (limited to 'lib')
-rw-r--r-- | lib/noticelist.php | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/lib/noticelist.php b/lib/noticelist.php index 7d1d2828f..88a925241 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -541,18 +541,39 @@ class NoticeListItem extends Widget { $hasConversation = false; if (!empty($this->notice->conversation)) { - $conversation = Notice::conversationStream($this->notice->conversation, 1, 1); + $conversation = Notice::conversationStream( + $this->notice->conversation, + 1, + 1 + ); if ($conversation->N > 0) { $hasConversation = true; } } if ($hasConversation) { - $this->out->text(' '); - $convurl = common_local_url('conversation', - array('id' => $this->notice->conversation)); - $this->out->element('a', array('href' => $convurl.'#notice-'.$this->notice->id, - 'class' => 'response'), - _('in context')); + $conv = Conversation::staticGet( + 'id', + $this->notice->conversation + ); + $convurl = $conv->uri; + if (!empty($convurl)) { + $this->out->text(' '); + $this->out->element( + 'a', + array( + 'href' => $convurl.'#notice-'.$this->notice->id, + 'class' => 'response'), + _('in context') + ); + } else { + $msg = sprintf( + "Couldn't find Conversation ID %d to make 'in context'" + . "link for Notice ID %d", + $this->notice->conversation, + $this->notice->id + ); + common_log(LOG_WARNING, $msg); + } } } |