]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'subscribers_as_addressees' into 'nightly'
authormmn <mmn@hethane.se>
Sat, 6 Jun 2015 21:14:50 +0000 (21:14 +0000)
committermmn <mmn@hethane.se>
Sat, 6 Jun 2015 21:14:50 +0000 (21:14 +0000)
Add subscribers as addressees to toselector

Populate the dropdown recipient menu first with groups, then with followed users. There is no alphabetical sorting (perhaps to be added later?). See this discussion https://gnusocial.no/conversation/190705#notice-190705. Thanks to @chimo.

Hope it is good now.

See merge request !14

lib/toselector.php

index 6d424dc259ccc8433c2e5996cd392bc16fe51dbe..566b6a0f29accba2aecee3f0ecc757c192316dd2 100644 (file)
@@ -102,7 +102,16 @@ class ToSelector extends Widget
             $choices[$value] = $groups->getBestName();
         }
 
-        // XXX: add users...?
+        // Add subscribed users to dropdown menu
+        $users = $this->user->getSubscribed();
+        while ($users->fetch()) {
+            $value = 'profile:'.$users->id;
+            if ($this->user->streamNicknames()) {
+                $choices[$value] = $users->getNickname();
+            } else {
+                $choices[$value] = $users->getBestName();
+            }
+        }
 
         if ($this->to instanceof Profile) {
             $value = 'profile:'.$this->to->id;