]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add an indicator saying to whom a notice is addressed
authorEvan Prodromou <evan@status.net>
Sat, 9 Apr 2011 19:41:48 +0000 (15:41 -0400)
committerEvan Prodromou <evan@status.net>
Sat, 9 Apr 2011 19:41:48 +0000 (15:41 -0400)
lib/noticelistitem.php

index 9c509664060523c1964f379dcdc8720c0f0cfa3b..74c51f4a2ee9ac7b78e2725adf50315b93b3d51f 100644 (file)
@@ -119,6 +119,7 @@ class NoticeListItem extends Widget
     {
         $this->out->elementStart('div', 'entry-title');
         $this->showAuthor();
+        $this->showAddressees();
         $this->showContent();
         $this->out->elementEnd('div');
     }
@@ -218,6 +219,24 @@ class NoticeListItem extends Widget
         $this->out->elementEnd('span');
     }
 
+    function showAddressees()
+    {
+        $groups = $this->notice->getGroups();
+        if (!empty($groups) && count($groups) > 0) {
+            $this->out->text('▶ ');
+            $first = true;
+            foreach ($groups as $group) {
+                if (!$first) {
+                    $this->out->text(', ');
+                } else {
+                    $first = false;
+                }
+                $this->out->element('a', array('href' => $group->homeUrl()),
+                                    $group->nickname);
+            }
+        }
+    }
+
     /**
      * show the avatar of the notice's author
      *