diff options
-rw-r--r-- | actions/showstream.php | 4 | ||||
-rw-r--r-- | lib/stream.php | 24 |
2 files changed, 28 insertions, 0 deletions
diff --git a/actions/showstream.php b/actions/showstream.php index fba68d129..0f4d79d27 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -400,6 +400,10 @@ class ShowstreamAction extends StreamAction { 'href' => $noticeurl, 'title' => common_exact_date($notice->created)), common_date_string($notice->created)); + if ($notice->source) { + common_text(_(' from ')); + $this->source_link($notice->source); + } if ($notice->reply_to) { $replyurl = common_local_url('shownotice', array('notice' => $notice->reply_to)); common_text(' ('); diff --git a/lib/stream.php b/lib/stream.php index 91829d835..44b7b9738 100644 --- a/lib/stream.php +++ b/lib/stream.php @@ -106,6 +106,10 @@ class StreamAction extends Action { 'href' => $noticeurl, 'title' => common_exact_date($notice->created)), common_date_string($notice->created)); + if ($notice->source) { + common_text(_(' from ')); + $this->source_link($notice->source); + } if ($notice->reply_to) { $replyurl = common_local_url('shownotice', array('notice' => $notice->reply_to)); common_text(' ('); @@ -131,4 +135,24 @@ class StreamAction extends Action { } common_element_end('li'); } + + function source_link($source) { + $source_name = _($source); + switch ($source) { + case 'web': + case 'xmpp': + case 'mail': + case 'omb': + case 'api': + common_element('span', 'noticesource', $source_name); + break; + default: + $ns = new Notice_source($source); + if ($ns) { + common_element('a', array('href' => $ns->url), + $ns->name); + } + } + return; + } } |