Mail: Prefer client-side lavatar over server-side in mail list

This commit is contained in:
nathan 2023-01-27 15:10:25 -07:00
parent f503743956
commit d94c10b09f
3 changed files with 25 additions and 14 deletions

View File

@ -2132,18 +2132,26 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
if ($_folderType)
{
$fromcontact = self::getContactFromAddress($data['fromaddress']);
if (!empty($fromcontact))
if(!empty($fromcontact) && $fromcontact[0]['photo'])
{
$data['fromavatar'] = self::getContactFromAddress($data['fromaddress'])[0]['photo'];
$data['fromavatar'] = $fromcontact[0]['photo'];
}
}
$data['address'] = ($_folderType ? $data["toaddress"] : $data["fromaddress"]);
$data['lavatar'] = ['fname' => $data['address']];
$contact = self::getContactFromAddress($data['address']);
if(!empty($contact))
{
$data['lavatar'] = ['fname' => $contact[0]['n_given'], 'lname' => $contact[0]['n_family']];
if($contact[0]['photo'])
{
$data['avatar'] = $contact[0]['photo'];
if (!$_folderType) $data['fromavatar'] = $data['avatar'];
}
if(!$_folderType)
{
$data['fromavatar'] = $data['avatar'];
}
}
if (in_array("bodypreview", $cols)&&$header['bodypreview'])
@ -2372,7 +2380,7 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
return $GLOBALS['egw']->contacts->search(
array('contact_email' => $email[0], 'contact_email_home' => $email[0]),
array('contact_id', 'email', 'email_home', 'n_fn'),
array('contact_id', 'email', 'email_home', 'n_fn', 'n_given', 'n_family'),
'', '', '', false, 'OR', false
);
}

View File

@ -31,12 +31,14 @@
<nextmatch-header statustext="security" label="Security" id="security"/>
</row>
<row class="$row_cont[class]">
<et2-lavatar image="$row_cont[avatar]" fname="$row_cont[address]" size="2.75em" shape="rounded"></et2-lavatar>
<et2-lavatar image="$row_cont[avatar]" fname="$row_cont[lavatar][fname]"
lname="$row_cont[lavatar][lname]" size="2.75em" shape="rounded"></et2-lavatar>
<et2-description span="1" class="status_img"></et2-description>
<html id="${row}[attachments]"/>
<et2-vbox>
<et2-description id="${row}[subject]" noLang="1"></et2-description>
<et2-description id="${row}[bodypreview]" class="et2_label bodypreview" noLang="1"></et2-description>
<et2-description id="${row}[bodypreview]" class="et2_label bodypreview"
noLang="1"></et2-description>
</et2-vbox>
<et2-hbox>
<et2-date-time align="center" id="${row}[date]" readonly="true"></et2-date-time>

View File

@ -20,7 +20,8 @@
</row>
<row class="$row_cont[class]">
<et2-hbox class="$row_cont[class] mobile_cat_col">
<et2-lavatar image="$row_cont[avatar]" fname="$row_cont[address]" size="2.75em" shape="rounded"></et2-lavatar>
<et2-lavatar image="$row_cont[avatar]" fname="$row_cont[lavatar][fname]"
lname="$row_cont[lavatar][lname]" size="2.75em" shape="rounded"></et2-lavatar>
<et2-vbox>
<et2-url-email id="${row}[address]" class="$row_cont[class]" readonly="true"></et2-url-email>
<et2-hbox>