]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/showstream.php
Twitter-compatible API - properly encode and decode UTF-8 HTML entities
[quix0rs-gnu-social.git] / actions / showstream.php
index d0f72280b38233d09388976671909478f0111d42..16bffa4ea7edeb1711ae92a8a7893e4a26492a4b 100644 (file)
@@ -58,7 +58,7 @@ class ShowstreamAction extends StreamAction {
 
                $this->show_profile($profile);
 
-               $this->show_notices($profile);
+               $this->show_notices($user);
 
                common_show_footer();
        }
@@ -75,11 +75,27 @@ class ShowstreamAction extends StreamAction {
        }
 
        function show_header($user) {
+               # Feeds
+               common_element('link', array('rel' => 'alternate',
+                                                                        'href' => common_local_url('api', 
+                                                                                                                               array('apiaction' => 'statuses',
+                                                                                                                                         'method' => 'user_timeline.rss',
+                                                                                                                                         'argument' => $user->nickname)),
+                                                                        'type' => 'application/rss+xml',
+                                                                        'title' => sprintf(_('Notice feed for %s'), $user->nickname)));
+               common_element('link', array('rel' => 'alternate feed',
+                                                                        'href' => common_local_url('api', 
+                                                                                                                               array('apiaction' => 'statuses',
+                                                                                                                                         'method' => 'user_timeline.atom',
+                                                                                                                                         'argument' => $user->nickname)),
+                                                                        'type' => 'application/atom+xml',
+                                                                        'title' => sprintf(_('Notice feed for %s'), $user->nickname)));
                common_element('link', array('rel' => 'alternate',
                                                                         'href' => common_local_url('userrss', array('nickname' =>
                                                                                                                                                           $user->nickname)),
-                                                                        'type' => 'application/rss+xml',
+                                                                        'type' => 'application/rdf+xml',
                                                                         'title' => sprintf(_('Notice feed for %s'), $user->nickname)));
+               # FOAF
                common_element('link', array('rel' => 'meta',
                                                                         'href' => common_local_url('foaf', array('nickname' =>
                                                                                                                                                          $user->nickname)),
@@ -335,7 +351,7 @@ class ShowstreamAction extends StreamAction {
                common_element_end('div');
        }
 
-       function show_notices($profile) {
+       function show_notices($user) {
 
                $page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
 
@@ -359,7 +375,7 @@ class ShowstreamAction extends StreamAction {
                }
                
                common_pagination($page>1, $cnt>NOTICES_PER_PAGE, $page,
-                                                 'showstream', array('nickname' => $profile->nickname));
+                                                 'showstream', array('nickname' => $user->nickname));
        }
 
        function show_last_notice($profile) {