Unified contact data handling
This commit is contained in:
parent
20ab3f13a6
commit
71d3274841
11 changed files with 113 additions and 101 deletions
|
|
@ -389,6 +389,7 @@ if(!function_exists('conversation')) {
|
|||
function conversation(&$a, $items, $mode, $update, $preview = false) {
|
||||
|
||||
require_once('include/bbcode.php');
|
||||
require_once('include/Contact.php');
|
||||
require_once('mod/proxy.php');
|
||||
|
||||
$ssl_state = ((local_user()) ? true : false);
|
||||
|
|
@ -610,11 +611,19 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
|
|||
else
|
||||
$profile_link = zrl($profile_link);
|
||||
|
||||
$normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
|
||||
if(($normalised != 'mailbox') && (x($a->contacts[$normalised])))
|
||||
$profile_avatar = $a->contacts[$normalised]['thumb'];
|
||||
// Don't rely on the author-avatar. It is better to use the data from the contact table
|
||||
$author_contact = get_contact_details_by_url($item['author-link'], $profile_owner);
|
||||
if ($author_contact["thumb"])
|
||||
$profile_avatar = $author_contact["thumb"];
|
||||
else
|
||||
$profile_avatar = $a->remove_baseurl(((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']));
|
||||
$profile_avatar = $item['author-avatar'];
|
||||
|
||||
// This was the old method. We leave it here at the moment
|
||||
//$normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
|
||||
//if(($normalised != 'mailbox') && (x($a->contacts[$normalised])))
|
||||
// $profile_avatar = $a->contacts[$normalised]['thumb'];
|
||||
//else
|
||||
// $profile_avatar = $a->remove_baseurl(((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']));
|
||||
|
||||
$locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
|
||||
call_hooks('render_location',$locate);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue