]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
users can choose to just see nicknames in streams
authorEvan Prodromou <evan@status.net>
Sat, 24 Sep 2011 11:19:52 +0000 (07:19 -0400)
committerEvan Prodromou <evan@status.net>
Sat, 24 Sep 2011 11:19:52 +0000 (07:19 -0400)
lib/noticelistitem.php

index 0231f3a57fa7deeea7868bcd05cb20344576f7cd..a8506aa46e077bf271cef69023e7f437b0cc070d 100644 (file)
@@ -219,8 +219,14 @@ class NoticeListItem extends Widget
         $this->out->elementStart('a', $attrs);
         $this->showAvatar();
         $this->out->text(' ');
-        $this->out->element('span',array('class' => 'fn'),
-                            $this->profile->getBestName());
+        $user = common_current_user();
+        if (!empty($user) && $user->streamNicknames()) {
+            $this->out->element('span',array('class' => 'fn'),
+                                $this->profile->nickname);
+        } else {
+            $this->out->element('span',array('class' => 'fn'),
+                                $this->profile->getBestName());
+        }
         $this->out->elementEnd('a');
 
         $this->out->elementEnd('span');
@@ -262,11 +268,15 @@ class NoticeListItem extends Widget
 
         $groups = $this->getGroups();
 
+        $user = common_current_user();
+        
+        $streamNicknames = !empty($user) && $user->streamNicknames();
+
         foreach ($groups as $group) {
             $ga[] = array('href' => $group->homeUrl(),
                           'title' => $group->nickname,
                           'class' => 'addressee group',
-                          'text' => $group->getBestName());
+                          'text' => ($streamNicknames) ? $group->nickname : $group->getBestName());
         }
 
         return $ga;
@@ -283,11 +293,15 @@ class NoticeListItem extends Widget
 
         $replies = $this->getReplyProfiles();
 
+        $user = common_current_user();
+        
+        $streamNicknames = !empty($user) && $user->streamNicknames();
+
         foreach ($replies as $reply) {
             $pa[] = array('href' => $reply->profileurl,
                           'title' => $reply->nickname,
                           'class' => 'addressee account',
-                          'text' => $reply->getBestName());
+                          'text' => ($streamNicknames) ? $reply->nickname : $reply->getBestName());
         }
 
         return $pa;