another issue with diaspora postings to sys channel - sys has no connections, hence no abook records.
This commit is contained in:
parent
b1eebaaedb
commit
153719a20a
@ -272,8 +272,6 @@ function diaspora_process_outbound($arr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function diaspora_handle_from_contact($contact_hash) {
|
function diaspora_handle_from_contact($contact_hash) {
|
||||||
|
|
||||||
logger("diaspora_handle_from_contact: contact id is " . $contact_hash, LOGGER_DEBUG);
|
logger("diaspora_handle_from_contact: contact id is " . $contact_hash, LOGGER_DEBUG);
|
||||||
@ -291,11 +289,21 @@ function diaspora_get_contact_by_handle($uid,$handle) {
|
|||||||
|
|
||||||
if(diaspora_is_blacklisted($handle))
|
if(diaspora_is_blacklisted($handle))
|
||||||
return false;
|
return false;
|
||||||
|
require_once('include/identity.php');
|
||||||
|
|
||||||
|
$sys = get_sys_channel();
|
||||||
|
if(($sys) && ($sys['channel_id'] == $uid)) {
|
||||||
|
$r = q("SELECT * FROM xchan where xchan_addr = '%s' limit 1",
|
||||||
|
dbesc($handle)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$r = q("SELECT * FROM abook left join xchan on xchan_hash = abook_xchan where xchan_addr = '%s' and abook_channel = %d limit 1",
|
||||||
|
dbesc($handle),
|
||||||
|
intval($uid)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$r = q("SELECT * FROM abook left join xchan on xchan_hash = abook_xchan where xchan_addr = '%s' and abook_channel = %d limit 1",
|
|
||||||
dbesc($handle),
|
|
||||||
intval($uid)
|
|
||||||
);
|
|
||||||
return (($r) ? $r[0] : false);
|
return (($r) ? $r[0] : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user