aboutsummaryrefslogtreecommitdiffstats
path: root/include/api.php
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-06-15 19:15:47 -0400
committerAndrew Manning <tamanning@zoho.com>2016-06-15 19:15:47 -0400
commitf2dda646ecf1d11bf88c085d1174d3c147f799b1 (patch)
treec86f59fcca3a84413d77c325be433c4c5ea862e2 /include/api.php
parent98484f0def82493ff9d45405dadefd141a1b32ba (diff)
parent47fc0c79588d55a207dc39ae8062ec55382e2564 (diff)
downloadvolse-hubzilla-f2dda646ecf1d11bf88c085d1174d3c147f799b1.tar.gz
volse-hubzilla-f2dda646ecf1d11bf88c085d1174d3c147f799b1.tar.bz2
volse-hubzilla-f2dda646ecf1d11bf88c085d1174d3c147f799b1.zip
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'include/api.php')
-rw-r--r--include/api.php17
1 files changed, 4 insertions, 13 deletions
diff --git a/include/api.php b/include/api.php
index be525f7e9..df6aba957 100644
--- a/include/api.php
+++ b/include/api.php
@@ -839,7 +839,7 @@ require_once('include/api_auth.php');
$_REQUEST['parent_mid'] = $parent;
if($_REQUEST['namespace'] && $parent) {
- $x = q("select iid from item_id where service = '%s' and sid = '%s' limit 1",
+ $x = q("select iid from iconfig where cat = 'system' and k = '%s' and v = '%s' limit 1",
dbesc($_REQUEST['namespace']),
dbesc($parent)
);
@@ -967,20 +967,10 @@ require_once('include/api_auth.php');
$ret = array();
$tmp = array();
- $str = '';
foreach($i as $ii) {
$tmp[] = encode_item($ii,true);
- if($str)
- $str .= ',';
- $str .= $ii['id'];
}
$ret['item'] = $tmp;
- if($str) {
- $r = q("select item_id.*, item.mid from item_id left join item on item_id.iid = item.id where item.id in ( $str ) ");
-
- if($r)
- $ret['item_id'] = $r;
- }
json_return_and_die($ret);
}
@@ -1462,7 +1452,8 @@ require_once('include/api_auth.php');
}
else {
if($_REQUEST['namespace'] && $_REQUEST['remote_id']) {
- $r = q("select * from item_id where service = '%s' and sid = '%s' and uid = %d limit 1",
+ $r = q("select * from iconfig left join item on iconfig.iid = item.id
+ where cat = 'system' and k = '%s' and v = '%s' and item.uid = %d limit 1",
dbesc($_REQUEST['namespace']),
dbesc($_REQUEST['remote_id']),
intval($user_info['uid'])
@@ -1472,7 +1463,7 @@ require_once('include/api_auth.php');
$id = $r[0]['iid'];
}
if($_REQUEST['namespace'] && $_REQUEST['comment_id']) {
- $r = q("select * from item_id left join item on item.id = item_id.iid where service = '%s' and sid = '%s' and uid = %d and item.id != item.parent limit 1",
+ $r = q("select * from iconfig left join item on item.id = iconfig.iid where cat = 'system' and k = '%s' and v = '%s' and uid = %d and item.id != item.parent limit 1",
dbesc($_REQUEST['namespace']),
dbesc($_REQUEST['comment_id']),
intval($user_info['uid'])