From 21c09c07325cf2b3d6985f9a6f878bfb048269e1 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 27 Sep 2014 23:37:05 +0200 Subject: [PATCH 1/2] API: Set the application name to "api" (if not defined), "remote_self" has an application name as well. --- include/api.php | 6 ++++++ include/items.php | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/include/api.php b/include/api.php index 69dc51ba..f4e744f0 100644 --- a/include/api.php +++ b/include/api.php @@ -726,6 +726,9 @@ $_REQUEST['api_source'] = true; + if (!isset($_REQUEST["source"]) OR ($_REQUEST["source"] == "")) + $_REQUEST["source"] = "api"; + // call out normal post function require_once('mod/item.php'); @@ -1300,6 +1303,9 @@ $_REQUEST['type'] = 'wall'; $_REQUEST['api_source'] = true; + if (!isset($_REQUEST["source"]) OR ($_REQUEST["source"] == "")) + $_REQUEST["source"] = "api"; + require_once('mod/item.php'); item_post($a); } diff --git a/include/items.php b/include/items.php index e0e0c842..8cbcc3e6 100644 --- a/include/items.php +++ b/include/items.php @@ -1938,6 +1938,7 @@ function edited_timestamp_is_newer($existing, $update) { function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) { require_once('library/simplepie/simplepie.inc'); + require_once('include/contact_selectors.php'); if(! strlen($xml)) { logger('consume_feed: empty input'); @@ -2593,6 +2594,9 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) } } + if (!isset($datarray["app"]) OR ($datarray["app"] == "")) + $datarray["app"] = network_to_name($contact['network']); + $notify = true; if($contact['network'] === NETWORK_FEED) { $datarray['private'] = 0; From 2b26181509e281ad2196cc1ac7e29b38b40e4113 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 28 Sep 2014 00:42:27 +0200 Subject: [PATCH 2/2] Issue 1158: muting of threads now works with the API as well. --- include/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/api.php b/include/api.php index f4e744f0..1ccd3edb 100644 --- a/include/api.php +++ b/include/api.php @@ -1393,7 +1393,7 @@ AND `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0 AND `contact`.`id` = `item`.`contact-id` AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 - AND `item`.`parent` IN (SELECT `iid` from thread where uid = %d AND `mention`) + AND `item`.`parent` IN (SELECT `iid` from thread where uid = %d AND `mention` AND !`ignored`) $sql_extra AND `item`.`id`>%d ORDER BY `item`.`id` DESC LIMIT %d ,%d ",