Merge branch 'subscribers_as_addressees' into 'nightly'

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
This commit is contained in:
mmn 2015-06-06 21:14:50 +00:00
commit f7769c17b5

View File

@ -102,7 +102,16 @@ class ToSelector extends Widget
$choices[$value] = $groups->getBestName(); $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) { if ($this->to instanceof Profile) {
$value = 'profile:'.$this->to->id; $value = 'profile:'.$this->to->id;