Imrpoved avatar handling when storing them/partly use of "micro"
This commit is contained in:
parent
f8a20a15d3
commit
0b1188b7fe
8 changed files with 43 additions and 24 deletions
|
@ -138,6 +138,8 @@ function dfrn_request_post(&$a) {
|
|||
|
||||
$dfrn_request = $parms['dfrn-request'];
|
||||
|
||||
$photo = $parms["photo"];
|
||||
|
||||
/********* Escape the entire array ********/
|
||||
|
||||
dbesc_array($parms);
|
||||
|
@ -185,6 +187,9 @@ function dfrn_request_post(&$a) {
|
|||
if(intval($def_gid))
|
||||
group_add_member(local_user(), '', $r[0]['id'], $def_gid);
|
||||
|
||||
if (isset($photo))
|
||||
update_contact_avatar($photo, local_user(), $r[0]["id"], true);
|
||||
|
||||
$forwardurl = $a->get_baseurl()."/contacts/".$r[0]['id'];
|
||||
} else
|
||||
$forwardurl = $a->get_baseurl()."/contacts";
|
||||
|
@ -530,7 +535,7 @@ function dfrn_request_post(&$a) {
|
|||
|
||||
$parms['url'] = $url;
|
||||
$parms['issued-id'] = $issued_id;
|
||||
|
||||
$photo = $parms["photo"];
|
||||
|
||||
dbesc_array($parms);
|
||||
$r = q("INSERT INTO `contact` ( `uid`, `created`, `url`, `nurl`, `addr`, `name`, `nick`, `issued-id`, `photo`, `site-pubkey`,
|
||||
|
@ -539,7 +544,7 @@ function dfrn_request_post(&$a) {
|
|||
intval($uid),
|
||||
dbesc(datetime_convert()),
|
||||
$parms['url'],
|
||||
dbesc(normalise_link($parms['url'])),
|
||||
dbesc(normalise_link($url)),
|
||||
$parms['addr'],
|
||||
$parms['fn'],
|
||||
$parms['nick'],
|
||||
|
@ -562,8 +567,10 @@ function dfrn_request_post(&$a) {
|
|||
$parms['url'],
|
||||
$parms['issued-id']
|
||||
);
|
||||
if(count($r))
|
||||
if(count($r)) {
|
||||
$contact_record = $r[0];
|
||||
update_contact_avatar($photo, $uid, $contact_record["id"], true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -138,6 +138,8 @@ function notifications_content(&$a) {
|
|||
$a->set_pager_itemspage(20);
|
||||
}
|
||||
|
||||
/// @todo Fetch contact details by "get_contact_details_by_url" instead of queries to contact, fcontact and gcontact
|
||||
|
||||
$r = q("SELECT `intro`.`id` AS `intro_id`, `intro`.*, `contact`.*, `fcontact`.`name` AS `fname`,`fcontact`.`url` AS `furl`,`fcontact`.`photo` AS `fphoto`,`fcontact`.`request` AS `frequest`,
|
||||
`gcontact`.`location` AS `glocation`, `gcontact`.`about` AS `gabout`,
|
||||
`gcontact`.`keywords` AS `gkeywords`, `gcontact`.`gender` AS `ggender`,
|
||||
|
|
|
@ -191,8 +191,8 @@ function ping_init(&$a) {
|
|||
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);
|
||||
if (isset($contact["micro"]))
|
||||
$n['photo'] = proxy_url($contact["micro"], false, PROXY_SIZE_MICRO);
|
||||
else
|
||||
$n['photo'] = proxy_url($n['photo'], false, PROXY_SIZE_MICRO);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue