]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/noticelist.php
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
[quix0rs-gnu-social.git] / lib / noticelist.php
index 85c169716a2753dcbaffe2e914969e3c32019cac..c05b990245f01acdce345b4866d94212367b9c46 100644 (file)
@@ -294,6 +294,7 @@ class NoticeListItem extends Widget
         }
         $this->out->elementStart('a', $attrs);
         $this->showAvatar();
+        $this->out->text(' ');
         $this->showNickname();
         $this->out->elementEnd('a');
         $this->out->elementEnd('span');
@@ -432,8 +433,10 @@ class NoticeListItem extends Widget
 
         $url  = $location->getUrl();
 
+        $this->out->text(' ');
         $this->out->elementStart('span', array('class' => 'location'));
         $this->out->text(_('at'));
+        $this->out->text(' ');
         if (empty($url)) {
             $this->out->element('span', array('class' => 'geo',
                                               'title' => $latlon),
@@ -473,9 +476,11 @@ class NoticeListItem extends Widget
     function showNoticeSource()
     {
         if ($this->notice->source) {
+            $this->out->text(' ');
             $this->out->elementStart('span', 'source');
             $this->out->text(_('from'));
             $source_name = _($this->notice->source);
+            $this->out->text(' ');
             switch ($this->notice->source) {
              case 'web':
              case 'xmpp':
@@ -486,12 +491,28 @@ class NoticeListItem extends Widget
                 $this->out->element('span', 'device', $source_name);
                 break;
              default:
+
+                $name = null;
+                $url  = null;
+
                 $ns = Notice_source::staticGet($this->notice->source);
+
                 if ($ns) {
+                    $name = $ns->name;
+                    $url  = $ns->url;
+                } else {
+                    $app = Oauth_application::staticGet('name', $this->notice->source);
+                    if ($app) {
+                        $name = $app->name;
+                        $url  = $app->source_url;
+                    }
+                }
+
+                if (!empty($name) && !empty($url)) {
                     $this->out->elementStart('span', 'device');
-                    $this->out->element('a', array('href' => $ns->url,
+                    $this->out->element('a', array('href' => $url,
                                                    'rel' => 'external'),
-                                        $ns->name);
+                                        $name);
                     $this->out->elementEnd('span');
                 } else {
                     $this->out->element('span', 'device', $source_name);
@@ -524,6 +545,7 @@ class NoticeListItem extends Widget
             }
         }
         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,
@@ -575,12 +597,14 @@ class NoticeListItem extends Widget
     function showReplyLink()
     {
         if (common_logged_in()) {
+            $this->out->text(' ');
             $reply_url = common_local_url('newnotice',
                                           array('replyto' => $this->profile->nickname, 'inreplyto' => $this->notice->id));
             $this->out->elementStart('a', array('href' => $reply_url,
                                                 'class' => 'notice_reply',
                                                 'title' => _('Reply to this notice')));
             $this->out->text(_('Reply'));
+            $this->out->text(' ');
             $this->out->element('span', 'notice_id', $this->notice->id);
             $this->out->elementEnd('a');
         }
@@ -600,7 +624,7 @@ class NoticeListItem extends Widget
 
         if (!empty($user) &&
             ($todel->profile_id == $user->id || $user->hasRight(Right::DELETEOTHERSNOTICE))) {
-
+            $this->out->text(' ');
             $deleteurl = common_local_url('deletenotice',
                                           array('notice' => $todel->id));
             $this->out->element('a', array('href' => $deleteurl,
@@ -619,6 +643,7 @@ class NoticeListItem extends Widget
     {
         $user = common_current_user();
         if ($user && $user->id != $this->notice->profile_id) {
+            $this->out->text(' ');
             $profile = $user->getProfile();
             if ($profile->hasRepeated($this->notice->id)) {
                 $this->out->element('span', array('class' => 'repeated',