d* little fixes

This commit is contained in:
friendica 2014-09-23 04:40:36 -07:00
parent ad86cc24c8
commit 2b466ccb8c

View File

@ -2132,15 +2132,9 @@ function diaspora_profile($importer,$xml,$msg) {
$image_url = "http://" . $handle_parts[1] . $image_url; $image_url = "http://" . $handle_parts[1] . $image_url;
} }
/* $r = q("SELECT DISTINCT ( `resource-id` ) FROM `photo` WHERE `uid` = %d AND `contact-id` = %d AND `album` = 'Contact Photos' ", require_once('include/photo/photo_driver.php');
intval($importer['channel_id']),
intval($contact['id'])
);
$oldphotos = ((count($r)) ? $r : null);*/
require_once('include/Photo.php'); $images = import_profile_photo($image_url,$contact['xchan_hash']);
$images = import_profile_photo($image_url,$importer['channel_id'],$contact['id']);
// Generic birthday. We don't know the timezone. The year is irrelevant. // Generic birthday. We don't know the timezone. The year is irrelevant.
@ -2157,7 +2151,7 @@ function diaspora_profile($importer,$xml,$msg) {
// TODO: update name on item['author-name'] if the name changed. See consume_feed() // TODO: update name on item['author-name'] if the name changed. See consume_feed()
// Not doing this currently because D* protocol is scheduled for revision soon. // Not doing this currently because D* protocol is scheduled for revision soon.
$r = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s', `photo` = '%s', `thumb` = '%s', `micro` = '%s', `avatar-date` = '%s' , `bd` = '%s' WHERE `id` = %d AND `uid` = %d", /* $r = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s', `photo` = '%s', `thumb` = '%s', `micro` = '%s', `avatar-date` = '%s' , `bd` = '%s' WHERE `id` = %d AND `uid` = %d",
dbesc($name), dbesc($name),
dbesc(datetime_convert()), dbesc(datetime_convert()),
dbesc($images[0]), dbesc($images[0]),
@ -2168,7 +2162,7 @@ function diaspora_profile($importer,$xml,$msg) {
intval($contact['id']), intval($contact['id']),
intval($importer['channel_id']) intval($importer['channel_id'])
); );
*/
/* if($r) { /* if($r) {
if($oldphotos) { if($oldphotos) {
foreach($oldphotos as $ph) { foreach($oldphotos as $ph) {