summaryrefslogtreecommitdiff
path: root/lib/stream.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-07-29 23:26:51 -0400
committerEvan Prodromou <evan@prodromou.name>2008-07-29 23:26:51 -0400
commit2090e0aa78daea617c605239a9cb1aaddfcf3228 (patch)
treee8d819a9d71c8d6485e5a773c33d004595e4d9b8 /lib/stream.php
parente998cc3960fd4a0cd6df9b21500f0272d5c5eb66 (diff)
show where a notice came from
darcs-hash:20080730032651-84dde-0685ec5f899129bc75745ca8d1d083f56f3f1ff5.gz
Diffstat (limited to 'lib/stream.php')
-rw-r--r--lib/stream.php24
1 files changed, 24 insertions, 0 deletions
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;
+ }
}