Some more places where the avatar picture is taken from the database

This commit is contained in:
Michael Vogel 2016-06-10 07:44:32 +02:00
parent 30056dd22d
commit 807fbe173b
2 changed files with 20 additions and 3 deletions

View File

@ -484,12 +484,18 @@ function message_content(&$a) {
$to_name_e = $message['name']; $to_name_e = $message['name'];
} }
$contact = get_contact_details_by_url($message['from-url']);
if (isset($contact["thumb"]))
$from_photo = $contact["thumb"];
else
$from_photo = $message['from-photo'];
$mails[] = array( $mails[] = array(
'id' => $message['id'], 'id' => $message['id'],
'from_name' => $from_name_e, 'from_name' => $from_name_e,
'from_url' => $from_url, 'from_url' => $from_url,
'sparkle' => $sparkle, 'sparkle' => $sparkle,
'from_photo' => proxy_url($message['from-photo'], false, PROXY_SIZE_THUMB), 'from_photo' => proxy_url($from_photo, false, PROXY_SIZE_THUMB),
'subject' => $subject_e, 'subject' => $subject_e,
'body' => $body_e, 'body' => $body_e,
'delete' => t('Delete message'), 'delete' => t('Delete message'),
@ -585,12 +591,18 @@ function render_messages($msg, $t) {
$to_name_e = $rr['name']; $to_name_e = $rr['name'];
} }
$contact = get_contact_details_by_url($rr['url']);
if (isset($contact["thumb"]))
$from_photo = $contact["thumb"];
else
$from_photo = (($rr['thumb']) ? $rr['thumb'] : $rr['from-photo']);
$rslt .= replace_macros($tpl, array( $rslt .= replace_macros($tpl, array(
'$id' => $rr['id'], '$id' => $rr['id'],
'$from_name' => $participants, '$from_name' => $participants,
'$from_url' => (($rr['network'] === NETWORK_DFRN) ? 'redir/' . $rr['contact-id'] : $rr['url']), '$from_url' => (($rr['network'] === NETWORK_DFRN) ? 'redir/' . $rr['contact-id'] : $rr['url']),
'$sparkle' => ' sparkle', '$sparkle' => ' sparkle',
'$from_photo' => (($rr['thumb']) ? $rr['thumb'] : $rr['from-photo']), '$from_photo' => proxy_url($from_photo, false, PROXY_SIZE_THUMB),
'$subject' => $subject_e, '$subject' => $subject_e,
'$delete' => t('Delete conversation'), '$delete' => t('Delete conversation'),
'$body' => $body_e, '$body' => $body_e,

View File

@ -189,6 +189,11 @@ function ping_init(&$a) {
* 'message' => notification message. "{0}" will be replaced by subject name * 'message' => notification message. "{0}" will be replaced by subject name
**/ **/
function xmlize($n){ function xmlize($n){
$contact = get_contact_details_by_url($n['url']);
if (isset($contact["thumb"]))
$n['photo'] = proxy_url($contact["thumb"], false, PROXY_SIZE_MICRO);
else
$n['photo'] = proxy_url($n['photo'], false, PROXY_SIZE_MICRO); $n['photo'] = proxy_url($n['photo'], false, PROXY_SIZE_MICRO);
$n['message'] = html_entity_decode($n['message'], ENT_COMPAT | ENT_HTML401, "UTF-8"); $n['message'] = html_entity_decode($n['message'], ENT_COMPAT | ENT_HTML401, "UTF-8");