]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/noticelist.php
correct link for repeat attribution in noticelist
[quix0rs-gnu-social.git] / lib / noticelist.php
index 7319a62ea76f7961b07f428256f8a222c7f90d6e..85e1befccfabf3b9f46e7028e24120acdf6d9c19 100644 (file)
@@ -167,8 +167,13 @@ class NoticeListItem extends Widget
     {
         parent::__construct($out);
         if (!empty($notice->repeat_of)) {
-            $this->notice = Notice::staticGet('id', $notice->repeat_of);
-            $this->repeat = $notice;
+            $original = Notice::staticGet('id', $notice->repeat_of);
+            if (empty($original)) { // could have been deleted
+                $this->notice = $notice;
+            } else {
+                $this->notice = $original;
+                $this->repeat = $notice;
+            }
         } else {
             $this->notice  = $notice;
         }
@@ -537,12 +542,14 @@ class NoticeListItem extends Widget
                 $attrs['title'] = $repeater->fullname . ' (' . $repeater->nickname . ')';
             }
 
-            $this->out->elementStart('span', 'repeat');
+            $this->out->elementStart('span', 'repeat vcard');
 
-            $this->out->elementStart('a', $attrs);
+            $this->out->raw(_('Repeated by'));
 
             $avatar = $repeater->getAvatar(AVATAR_MINI_SIZE);
 
+            $this->out->elementStart('a', $attrs);
+
             $this->out->element('img', array('src' => ($avatar) ?
                                              $avatar->displayUrl() :
                                              Avatar::defaultImage(AVATAR_MINI_SIZE),
@@ -554,12 +561,9 @@ class NoticeListItem extends Widget
                                              $repeater->fullname :
                                              $repeater->nickname));
 
+            $this->out->element('span', 'nickname', $repeater->nickname);
             $this->out->elementEnd('a');
 
-            $text_link = XMLStringer::estring('a', $attrs, $repeater->nickname);
-
-            $this->out->raw(sprintf(_('Repeated by %s'), $text_link));
-
             $this->out->elementEnd('span');
         }
     }