Skip to content

Commit

Permalink
Better short label autocomplete display for Group addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Oct 8, 2014
1 parent 811d69a commit 9c42f1a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions imp/lib/Ajax/Application/Handler/Dynamic.php
Original file line number Diff line number Diff line change
Expand Up @@ -1297,14 +1297,20 @@ public function autocompleteSearch()

foreach ($addr as $val) {
$tmp = array('v' => strval($val));

$l = $val->writeAddress(array('noquote' => true));
$s = $val->label;

if ($l !== $tmp['v']) {
$tmp['l'] = $l;
}

$s = $val->label;
if ($s !== $tmp['v']) {
if ($val instanceof Horde_Mail_Rfc822_Group) {
$tmp['s'] = sprintf(
_("%s [Group; %d addresses]"),
$s,
count($val)
);
} elseif ($s !== $tmp['v']) {
$tmp['s'] = $s;
}

Expand Down

0 comments on commit 9c42f1a

Please sign in to comment.