update friends/followers API so Friendica Android client won't choke
This commit is contained in:
parent
fc265a8e3a
commit
94e87c0a84
@ -1644,11 +1644,11 @@ require_once('include/photos.php');
|
|||||||
// This won't work if either of you send your stream to everybody on the network
|
// This won't work if either of you send your stream to everybody on the network
|
||||||
|
|
||||||
if($qtype == 'friends')
|
if($qtype == 'friends')
|
||||||
$sql_extra = sprintf(" AND ( their_perms & %d ) and ( my_perms & %d ) ", intval(PERMS_W_STREAM), intval(PERMS_W_STREAM));
|
$sql_extra = sprintf(" AND ( abook_their_perms & %d ) and ( abook_my_perms & %d ) ", intval(PERMS_W_STREAM), intval(PERMS_W_STREAM));
|
||||||
if($qtype == 'followers')
|
if($qtype == 'followers')
|
||||||
$sql_extra = sprintf(" AND ( my_perms & %d ) and not ( their_perms & %d ) ", intval(PERMS_W_STREAM), intval(PERMS_W_STREAM));
|
$sql_extra = sprintf(" AND ( abook_my_perms & %d ) and not ( abook_their_perms & %d ) ", intval(PERMS_W_STREAM), intval(PERMS_W_STREAM));
|
||||||
|
|
||||||
$r = q("SELECT id FROM abook where abook_flags = 0 and abook_channel = %d $sql_extra",
|
$r = q("SELECT abook_xchan FROM abook where abook_flags = 0 and abook_channel = %d $sql_extra",
|
||||||
intval(api_user())
|
intval(api_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1657,14 +1657,14 @@ require_once('include/photos.php');
|
|||||||
header("Content-type: application/xml");
|
header("Content-type: application/xml");
|
||||||
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\r\n" . '<ids>' . "\r\n";
|
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\r\n" . '<ids>' . "\r\n";
|
||||||
foreach($r as $rr)
|
foreach($r as $rr)
|
||||||
echo '<id>' . $rr['id'] . '</id>' . "\r\n";
|
echo '<id>' . $rr['abook_xchan'] . '</id>' . "\r\n";
|
||||||
echo '</ids>' . "\r\n";
|
echo '</ids>' . "\r\n";
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
elseif($type === 'json') {
|
elseif($type === 'json') {
|
||||||
$ret = array();
|
$ret = array();
|
||||||
header("Content-type: application/json");
|
header("Content-type: application/json");
|
||||||
foreach($r as $rr) $ret[] = $rr['id'];
|
foreach($r as $rr) $ret[] = $rr['abook_xchan'];
|
||||||
echo json_encode($ret);
|
echo json_encode($ret);
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,6 @@ CREATE TABLE IF NOT EXISTS `channel` (
|
|||||||
KEY `channel_account_id` (`channel_account_id`),
|
KEY `channel_account_id` (`channel_account_id`),
|
||||||
KEY `channel_primary` (`channel_primary`),
|
KEY `channel_primary` (`channel_primary`),
|
||||||
KEY `channel_name` (`channel_name`),
|
KEY `channel_name` (`channel_name`),
|
||||||
KEY `channel_address` (`channel_address`),
|
|
||||||
KEY `channel_timezone` (`channel_timezone`),
|
KEY `channel_timezone` (`channel_timezone`),
|
||||||
KEY `channel_location` (`channel_location`),
|
KEY `channel_location` (`channel_location`),
|
||||||
KEY `channel_theme` (`channel_theme`),
|
KEY `channel_theme` (`channel_theme`),
|
||||||
|
Reference in New Issue
Block a user