]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/noticelist.php
move UAP plugin to core
[quix0rs-gnu-social.git] / lib / noticelist.php
index 2165222eec4e5b398eca14b2f3f09f42ce0b770e..78abf34a76d512bb6fd289fbd6f4a5ce4fabf153 100644 (file)
@@ -191,6 +191,14 @@ class NoticeListItem extends Widget
 
     function show()
     {
+        if (empty($this->notice)) {
+            common_log(LOG_WARNING, "Trying to show missing notice; skipping.");
+            return;
+        } else if (empty($this->profile)) {
+            common_log(LOG_WARNING, "Trying to show missing profile (" . $this->notice->profile_id . "); skipping.");
+            return;
+        }
+
         $this->showStart();
         if (Event::handle('StartShowNoticeItem', array($this))) {
             $this->showNotice();
@@ -371,7 +379,7 @@ class NoticeListItem extends Widget
 
     function showNoticeLink()
     {
-        if($this->notice->is_local){
+        if($this->notice->is_local == Notice::LOCAL_PUBLIC || $this->notice->is_local == Notice::LOCAL_NONPUBLIC){
             $noticeurl = common_local_url('shownotice',
                                       array('notice' => $this->notice->id));
         }else{
@@ -551,17 +559,6 @@ class NoticeListItem extends Widget
 
             $this->out->elementStart('a', $attrs);
 
-            $this->out->element('img', array('src' => ($avatar) ?
-                                             $avatar->displayUrl() :
-                                             Avatar::defaultImage(AVATAR_MINI_SIZE),
-                                             'class' => 'avatar photo',
-                                             'width' => AVATAR_MINI_SIZE,
-                                             'height' => AVATAR_MINI_SIZE,
-                                             'alt' =>
-                                             ($repeater->fullname) ?
-                                             $repeater->fullname :
-                                             $repeater->nickname));
-
             $this->out->element('span', 'nickname', $repeater->nickname);
             $this->out->elementEnd('a');