aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-07-18 18:10:03 -0700
committerfriendica <info@friendica.com>2013-07-18 18:10:03 -0700
commit6f1db253f3038acc92075cd3f17c86eaab4fe3a5 (patch)
tree4c863d1e5278840edfd700ec6a278c7f3c24085e
parentd9701d46066ce61102dc874639b8afd0a3ade735 (diff)
downloadvolse-hubzilla-6f1db253f3038acc92075cd3f17c86eaab4fe3a5.tar.gz
volse-hubzilla-6f1db253f3038acc92075cd3f17c86eaab4fe3a5.tar.bz2
volse-hubzilla-6f1db253f3038acc92075cd3f17c86eaab4fe3a5.zip
use (numeric) abook_id for friends/followers in Twitter API. Many existing clients won't be able to handle xchans. Save those for the Red specific API.
-rw-r--r--include/api.php14
-rw-r--r--version.inc2
2 files changed, 8 insertions, 8 deletions
diff --git a/include/api.php b/include/api.php
index c79ac4a9b..ac86178a6 100644
--- a/include/api.php
+++ b/include/api.php
@@ -1528,17 +1528,17 @@ require_once('include/photos.php');
// For Red, the closest thing we can do to figure out if you're friends is if both of you are sending each other your streams.
// This won't work if either of you send your stream to everybody on the network
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')
- $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_id FROM abook where abook_flags = 0 and abook_channel = %d $sql_extra",
intval(api_user())
);
$ret = array();
foreach($r as $cid){
- $ret[] = api_get_user($a, $cid['id']);
+ $ret[] = api_get_user($a, $cid['abook_id']);
}
@@ -1648,7 +1648,7 @@ require_once('include/photos.php');
if($qtype == 'followers')
$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 abook_xchan FROM abook where abook_flags = 0 and abook_channel = %d $sql_extra",
+ $r = q("SELECT abook_id FROM abook where abook_flags = 0 and abook_channel = %d $sql_extra",
intval(api_user())
);
@@ -1657,14 +1657,14 @@ require_once('include/photos.php');
header("Content-type: application/xml");
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\r\n" . '<ids>' . "\r\n";
foreach($r as $rr)
- echo '<id>' . $rr['abook_xchan'] . '</id>' . "\r\n";
+ echo '<id>' . $rr['abook_id'] . '</id>' . "\r\n";
echo '</ids>' . "\r\n";
killme();
}
elseif($type === 'json') {
$ret = array();
header("Content-type: application/json");
- foreach($r as $rr) $ret[] = $rr['abook_xchan'];
+ foreach($r as $rr) $ret[] = $rr['abook_id'];
echo json_encode($ret);
killme();
}
diff --git a/version.inc b/version.inc
index ac2cd8ef7..886470b51 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2013-07-17.377
+2013-07-18.378