more heavy lifting on API - though need to re-visit events and give them all message_ids from the origination site.
This commit is contained in:
@@ -1718,7 +1718,11 @@ function ids_to_querystr($arr,$idx = 'id') {
|
||||
return(implode(',', $t));
|
||||
}
|
||||
|
||||
function xchan_query(&$items) {
|
||||
// Fetches xchan and hubloc data for an array of items with only an
|
||||
// author_xchan and owner_xchan. If $abook is true also include the abook info.
|
||||
// This is needed in the API to save extra per item lookups there.
|
||||
|
||||
function xchan_query(&$items,$abook = false) {
|
||||
$arr = array();
|
||||
if($items && count($items)) {
|
||||
foreach($items as $item) {
|
||||
@@ -1729,8 +1733,14 @@ function xchan_query(&$items) {
|
||||
}
|
||||
}
|
||||
if(count($arr)) {
|
||||
$chans = q("select xchan.*,hubloc.* from xchan left join hubloc on hubloc_hash = xchan_hash
|
||||
where xchan_hash in (" . implode(',', $arr) . ") and ( hubloc_flags & " . intval(HUBLOC_FLAGS_PRIMARY) . " )");
|
||||
if($abook) {
|
||||
$chans = q("select * from xchan left join hubloc on hubloc_hash = xchan_hash left join abook on abook_xchan = xchan_hash
|
||||
where xchan_hash in (" . implode(',', $arr) . ") and ( hubloc_flags & " . intval(HUBLOC_FLAGS_PRIMARY) . " )");
|
||||
}
|
||||
else {
|
||||
$chans = q("select xchan.*,hubloc.* from xchan left join hubloc on hubloc_hash = xchan_hash
|
||||
where xchan_hash in (" . implode(',', $arr) . ") and ( hubloc_flags & " . intval(HUBLOC_FLAGS_PRIMARY) . " )");
|
||||
}
|
||||
}
|
||||
if($items && count($items) && $chans && count($chans)) {
|
||||
for($x = 0; $x < count($items); $x ++) {
|
||||
|
||||
Reference in New Issue
Block a user