add google buzz

This commit is contained in:
Friendika 2010-11-21 15:25:10 -08:00
parent f7760a9f5b
commit f1630780e9
3 changed files with 28 additions and 7 deletions

View file

@ -40,7 +40,7 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
$sql_extra = ''; $sql_extra = '';
if($privmail || $celeb) { if($privmail || $celeb) {
$sql_extra = sprintf(" AND `rel` = %d ", intval(REL_BUD)); $sql_extra .= sprintf(" AND `rel` = %d ", intval(REL_BUD));
} }
if($privmail) if($privmail)
@ -49,7 +49,7 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
$o .= "<select name=\"{$selname}[]\" id=\"$selclass\" class=\"$selclass\" multiple=\"multiple\" size=\"$size\" >\r\n"; $o .= "<select name=\"{$selname}[]\" id=\"$selclass\" class=\"$selclass\" multiple=\"multiple\" size=\"$size\" >\r\n";
$r = q("SELECT `id`, `name`, `url`, `network` FROM `contact` $r = q("SELECT `id`, `name`, `url`, `network` FROM `contact`
WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `notify` != ''
$sql_extra $sql_extra
ORDER BY `name` ASC ", ORDER BY `name` ASC ",
intval(local_user()) intval(local_user())

View file

@ -257,7 +257,7 @@
$deliver_status = dfrn_deliver($owner,$contact,$atom); $deliver_status = dfrn_deliver($owner,$contact,$atom);
break; break;
default: default:
if($followup) { if($followup && $contact['notify']) {
slapper($owner,$contact['notify'],$slap); slapper($owner,$contact['notify'],$slap);
} }
else { else {
@ -268,10 +268,12 @@
if(count($slaps) && $notify_hub) { if(count($slaps) && $notify_hub) {
logger('notifier: slapdelivery: ' . $contact['name']); logger('notifier: slapdelivery: ' . $contact['name']);
foreach($slaps as $slappy) { foreach($slaps as $slappy) {
if($contact['notify']) {
slapper($owner,$contact['notify'],$slappy); slapper($owner,$contact['notify'],$slappy);
} }
} }
} }
}
break; break;
} }
@ -289,10 +291,12 @@
foreach($url_recipients as $url) { foreach($url_recipients as $url) {
logger('notifier: urldelivery: ' . $url); logger('notifier: urldelivery: ' . $url);
foreach($slaps as $slappy) { foreach($slaps as $slappy) {
if($url) {
slapper($owner,$url,$slappy); slapper($owner,$url,$slappy);
} }
} }
} }
}
if((strlen($hub)) && ($notify_hub)) { if((strlen($hub)) && ($notify_hub)) {
$hubs = explode(',', $hub); $hubs = explode(',', $hub);

View file

@ -50,6 +50,14 @@ function follow_post(&$a) {
if($hcard) { if($hcard) {
$vcard = scrape_vcard($hcard); $vcard = scrape_vcard($hcard);
// Google doesn't use absolute url in profile photos
if((x($vcard,'photo')) && substr($vcard['photo'],0,1) == '/') {
$h = parse_url($hcard);
if($h)
$vcard['photo'] = $h['scheme'] . '://' . $h['host'] . $vcard['photo'];
}
} }
if(! $profile) if(! $profile)
@ -61,11 +69,17 @@ function follow_post(&$a) {
if(x($vcard,'nick')) if(x($vcard,'nick'))
$vcard['fn'] = $vcard['nick']; $vcard['fn'] = $vcard['nick'];
if(! ((x($vcard['fn'])) && ($poll) && ($notify) && ($profile))) { logger('follow: poll=' . $poll . ' notify=' . $notify . ' profile=' . $profile . ' vcard=' . print_r($vcard,true));
if(! ((x($vcard['fn'])) && ($poll) && ($profile))) {
notice( t('The profile address specified does not provide adequate information.') . EOL); notice( t('The profile address specified does not provide adequate information.') . EOL);
goaway($_SESSION['return_url']); goaway($_SESSION['return_url']);
} }
if(! $notify) {
notice( t('Limited profile. This person will be unable to receive direct/personal notifications from you.') . EOL);
}
if(! x($vcard,'photo')) if(! x($vcard,'photo'))
$vcard['photo'] = $a->get_baseurl() . '/images/default-profile.jpg' ; $vcard['photo'] = $a->get_baseurl() . '/images/default-profile.jpg' ;
@ -77,6 +91,7 @@ function follow_post(&$a) {
intval(local_user()), intval(local_user()),
dbesc($poll) dbesc($poll)
); );
if(count($r)) { if(count($r)) {
// update contact // update contact
if($r[0]['rel'] == REL_VIP) { if($r[0]['rel'] == REL_VIP) {
@ -104,10 +119,12 @@ function follow_post(&$a) {
intval(REL_FAN) intval(REL_FAN)
); );
} }
$r = q("SELECT * FROM `contact` WHERE `url` = '%s' AND `uid` = %d LIMIT 1", $r = q("SELECT * FROM `contact` WHERE `url` = '%s' AND `uid` = %d LIMIT 1",
dbesc($profile), dbesc($profile),
intval(local_user()) intval(local_user())
); );
if(! count($r)) { if(! count($r)) {
notice( t('Unable to retrieve contact information.') . EOL); notice( t('Unable to retrieve contact information.') . EOL);
goaway($_SESSION['return_url']); goaway($_SESSION['return_url']);