]> git.mxchange.org Git - friendica.git/commitdiff
API: Set the application name to "api" (if not defined), "remote_self" has an applica...
authorMichael Vogel <icarus@dabo.de>
Sat, 27 Sep 2014 21:37:05 +0000 (23:37 +0200)
committerMichael Vogel <icarus@dabo.de>
Sat, 27 Sep 2014 21:37:05 +0000 (23:37 +0200)
include/api.php
include/items.php

index 69dc51bac99ac4770db06136b6e67467397a29ac..f4e744f0450c6ec011b978f0cf1142b62d753f7f 100644 (file)
 
                $_REQUEST['api_source'] = true;
 
+               if (!isset($_REQUEST["source"]) OR ($_REQUEST["source"] == ""))
+                       $_REQUEST["source"] = "api";
+
                // call out normal post function
 
                require_once('mod/item.php');
                        $_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);
                }
index e0e0c842b7055736149684dea857b3ebc20df342..8cbcc3e6e93f35427277dcee246a73248fe944ba 100644 (file)
@@ -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;