]> git.mxchange.org Git - friendica.git/blobdiff - include/ostatus.php
Merge branch 'develop' into rewrites/coding-convention-split2
[friendica.git] / include / ostatus.php
index 6061ef9e11847ba3117d2f9205695f4ba5715aec..7090e765feb154a6416048aaf8e494f0aa4d689b 100644 (file)
@@ -132,9 +132,6 @@ class ostatus {
                                        dbesc($contact["name"]), dbesc($contact["nick"]), dbesc($contact["alias"]),
                                        dbesc($contact["about"]), dbesc($contact["location"]),
                                        dbesc(datetime_convert()), intval($contact["id"]));
-
-                               poco_check($contact["url"], $contact["name"], $contact["network"], $author["author-avatar"], $contact["about"], $contact["location"],
-                                                       "", "", "", datetime_convert(), 2, $contact["id"], $contact["uid"]);
                        }
 
                        if (isset($author["author-avatar"]) AND ($author["author-avatar"] != $r[0]['avatar'])) {
@@ -163,7 +160,9 @@ class ostatus {
                        $contact["generation"] = 2;
                        $contact["hide"] = false; // OStatus contacts are never hidden
                        $contact["photo"] = $author["author-avatar"];
-                       update_gcontact($contact);
+                       $gcid = update_gcontact($contact);
+
+                       link_gcontact($gcid, $contact["uid"], $contact["id"]);
                }
 
                return($author);
@@ -808,6 +807,9 @@ class ostatus {
 
                /// @todo This function is totally ugly and has to be rewritten totally
 
+               // Import all threads or only threads that were started by our followers?
+               $all_threads = !get_config('system','ostatus_full_threads');
+
                $item_stored = -1;
 
                $conversation_url = self::fetch_conversation($self, $conversation_url);
@@ -816,8 +818,8 @@ class ostatus {
                // Don't do a completion on liked content
                if (((intval(get_config('system','ostatus_poll_interval')) == -2) AND (count($item) > 0)) OR
                        ($item["verb"] == ACTIVITY_LIKE) OR ($conversation_url == "")) {
-                       $item_stored = item_store($item, true);
-                       return($item_stored);
+                       $item_stored = item_store($item, $all_threads);
+                       return $item_stored;
                }
 
                // Get the parent
@@ -897,7 +899,7 @@ class ostatus {
 
                if (!sizeof($items)) {
                        if (count($item) > 0) {
-                               $item_stored = item_store($item, true);
+                               $item_stored = item_store($item, $all_threads);
 
                                if ($item_stored) {
                                        logger("Conversation ".$conversation_url." couldn't be fetched. Item uri ".$item["uri"]." stored: ".$item_stored, LOGGER_DEBUG);
@@ -1195,7 +1197,7 @@ class ostatus {
                                }
                        }
 
-                       $item_stored = item_store($item, true);
+                       $item_stored = item_store($item, $all_threads);
                        if ($item_stored) {
                                logger("Uri ".$item["uri"]." wasn't found in conversation ".$conversation_url, LOGGER_DEBUG);
                                self::store_conversation($item_stored, $conversation_url);