API: Set the application name to "api" (if not defined), "remote_self" has an application name as well.

This commit is contained in:
Michael Vogel 2014-09-27 23:37:05 +02:00
parent bd0b93e630
commit 21c09c0732
2 changed files with 10 additions and 0 deletions

View file

@ -726,6 +726,9 @@
$_REQUEST['api_source'] = true; $_REQUEST['api_source'] = true;
if (!isset($_REQUEST["source"]) OR ($_REQUEST["source"] == ""))
$_REQUEST["source"] = "api";
// call out normal post function // call out normal post function
require_once('mod/item.php'); require_once('mod/item.php');
@ -1300,6 +1303,9 @@
$_REQUEST['type'] = 'wall'; $_REQUEST['type'] = 'wall';
$_REQUEST['api_source'] = true; $_REQUEST['api_source'] = true;
if (!isset($_REQUEST["source"]) OR ($_REQUEST["source"] == ""))
$_REQUEST["source"] = "api";
require_once('mod/item.php'); require_once('mod/item.php');
item_post($a); item_post($a);
} }

View file

@ -1938,6 +1938,7 @@ function edited_timestamp_is_newer($existing, $update) {
function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) { function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) {
require_once('library/simplepie/simplepie.inc'); require_once('library/simplepie/simplepie.inc');
require_once('include/contact_selectors.php');
if(! strlen($xml)) { if(! strlen($xml)) {
logger('consume_feed: empty input'); 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; $notify = true;
if($contact['network'] === NETWORK_FEED) { if($contact['network'] === NETWORK_FEED) {
$datarray['private'] = 0; $datarray['private'] = 0;