Skip to content

Commit

Permalink
Use display label if provided.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed May 19, 2014
1 parent 8d1d001 commit 37ab010
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Expand Up @@ -132,6 +132,7 @@ protected function _process($domain, $tag, $types, $email)
continue;
}

$label = strval($xml->emailProvider->displayName);
foreach ($xml->emailProvider->{$tag} as $val) {
if (in_array($val['type'], $types)) {
switch ($val['type']) {
Expand All @@ -150,6 +151,7 @@ protected function _process($domain, $tag, $types, $email)

$ob->host = strval($val->hostname);
$ob->port = intval(strval($val->port));
$ob->label = $label;
$ob->tls = (strcasecmp($val->socketType, 'SSL') === 0);

if (!is_null($email) &&
Expand Down
Expand Up @@ -36,6 +36,13 @@ abstract class Horde_Mail_Autoconfig_Server
*/
public $port = null;

/**
* The server label.
*
* @var integer
*/
public $label = null;

/**
* Is TLS needed to directly connect to the server/port?
*
Expand Down
4 changes: 3 additions & 1 deletion imp/lib/Ajax/Application/Handler/RemotePrefs.php
Expand Up @@ -61,7 +61,9 @@ public function autoconfigAccount()

$res->mconfig = (object)$mconfig;
$res->mconfig->imap = $imap;
$res->mconfig->label = $email->bare_address;
if (empty($res->mconfig->label)) {
$res->mconfig->label = $email->bare_address;
}
$res->success = true;

$notification->push(
Expand Down

0 comments on commit 37ab010

Please sign in to comment.