]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
show where a notice came from
authorEvan Prodromou <evan@prodromou.name>
Wed, 30 Jul 2008 03:26:51 +0000 (23:26 -0400)
committerEvan Prodromou <evan@prodromou.name>
Wed, 30 Jul 2008 03:26:51 +0000 (23:26 -0400)
darcs-hash:20080730032651-84dde-0685ec5f899129bc75745ca8d1d083f56f3f1ff5.gz

actions/showstream.php
lib/stream.php

index fba68d129d646e9bbf3f2fc2556fad236393903c..0f4d79d270c82a5577c8ed4a580596e9ca619b2e 100644 (file)
@@ -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(' (');
index 91829d83578eba3d3843a97c4551dd9a5ad62e88..44b7b9738d1b230d5b5266b7907e31d567a1c106 100644 (file)
@@ -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;
+       }
 }