sort out some anomalies

This commit is contained in:
friendica 2014-08-25 21:42:46 -07:00
parent 84ff380302
commit eb8f194419
4 changed files with 20 additions and 8 deletions

View File

@ -215,7 +215,7 @@ function diaspora_process_outbound($arr) {
else { else {
// public message // public message
$contact = array('hubloc_callback' => $arr['hub']['hubloc_callback']); $contact = $arr['hub'];
if($target_item['verb'] === ACTIVITY_DISLIKE) { if($target_item['verb'] === ACTIVITY_DISLIKE) {
// unsupported // unsupported
@ -2709,9 +2709,9 @@ function diaspora_transmit($owner,$contact,$slap,$public_batch,$queue_run=false)
if($public_batch) if($public_batch)
$dest_url = $contact['hubloc_callback'] . '/public'; $dest_url = $contact['hubloc_callback'] . '/public';
else else
$dest_url = $contact['hubloc_callback'] . '/users/' . $contact['guid']; $dest_url = $contact['hubloc_callback'] . '/users/' . $contact['hubloc_guid'];
logger('diaspora_transmit: URL: ' . $dest_url, LOGGER_DEBUG);
if(intval(get_config('system','diaspora_test'))) if(intval(get_config('system','diaspora_test')))
return 200; return 200;

View File

@ -929,7 +929,7 @@ function discover_by_webbie($webbie) {
dbesc($webbie) dbesc($webbie)
); );
if(! $r) { if(! $r) {
$r = q("insert into hubloc ( hubloc_guid, hubloc_hash, hubloc_addr, hubloc_network, hubloc_url, hubloc_host, hubloc_callback, hubloc_updated ) values ('%s','%s','%s','%s','%s','%s','%s','%s')", $r = q("insert into hubloc ( hubloc_guid, hubloc_hash, hubloc_addr, hubloc_network, hubloc_url, hubloc_host, hubloc_callback, hubloc_updated, hubloc_flags ) values ('%s','%s','%s','%s','%s','%s','%s','%s', %d)",
dbesc($guid), dbesc($guid),
dbesc($addr), dbesc($addr),
dbesc($addr), dbesc($addr),
@ -937,7 +937,8 @@ function discover_by_webbie($webbie) {
dbesc(trim($diaspora_base,'/')), dbesc(trim($diaspora_base,'/')),
dbesc($hostname), dbesc($hostname),
dbesc($notify), dbesc($notify),
dbesc(datetime_convert()) dbesc(datetime_convert()),
intval(HUBLOC_FLAGS_PRIMARY)
); );
} }
$photos = import_profile_photo($vcard['photo'],$addr); $photos = import_profile_photo($vcard['photo'],$addr);

View File

@ -445,11 +445,11 @@ function notifier_run($argv, $argc){
// aren't the owner or author. // aren't the owner or author.
$r = q("select hubloc_sitekey, hubloc_network, hubloc_flags, hubloc_callback, hubloc_host from hubloc $r = q("select hubloc_guid, hubloc_sitekey, hubloc_network, hubloc_flags, hubloc_callback, hubloc_host from hubloc
where hubloc_hash in (" . implode(',',$recipients) . ") group by hubloc_sitekey order by hubloc_connected desc limit 1"); where hubloc_hash in (" . implode(',',$recipients) . ") group by hubloc_sitekey order by hubloc_connected desc limit 1");
} }
else { else {
$r = q("select hubloc_sitekey, hubloc_network, hubloc_flags, hubloc_callback, hubloc_host from hubloc $r = q("select hubloc_guid, hubloc_sitekey, hubloc_network, hubloc_flags, hubloc_callback, hubloc_host from hubloc
where hubloc_hash in (" . implode(',',$recipients) . ") $sql_extra group by hubloc_sitekey"); where hubloc_hash in (" . implode(',',$recipients) . ") $sql_extra group by hubloc_sitekey");
} }

View File

@ -198,11 +198,17 @@ function zot_finger($webbie,$channel,$autofallback = true) {
if($r) { if($r) {
$url = $r[0]['hubloc_url']; $url = $r[0]['hubloc_url'];
if($r[0]['hubloc_network'] && $r[0]['hubloc_network'] !== 'zot') {
logger('zot_finger: alternate network: ' . $webbie);
return array('success' => false);
}
} }
else { else {
$url = 'https://' . $host; $url = 'https://' . $host;
} }
$rhs = '/.well-known/zot-info'; $rhs = '/.well-known/zot-info';
$https = ((strpos($url,'https://') === 0) ? true : false); $https = ((strpos($url,'https://') === 0) ? true : false);
@ -271,6 +277,11 @@ function zot_finger($webbie,$channel,$autofallback = true) {
function zot_refresh($them,$channel = null, $force = false) { function zot_refresh($them,$channel = null, $force = false) {
if(array_key_exists('xchan_network',$them) && ($them['xchan_network'] !== 'zot')) {
logger('zot_refresh: not got zot. ' . $them['xchan_name']);
return true;
}
logger('zot_refresh: them: ' . print_r($them,true), LOGGER_DATA); logger('zot_refresh: them: ' . print_r($them,true), LOGGER_DATA);
if($channel) if($channel)
logger('zot_refresh: channel: ' . print_r($channel,true), LOGGER_DATA); logger('zot_refresh: channel: ' . print_r($channel,true), LOGGER_DATA);