]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/OStatus.php
Merge pull request #9436 from nupplaphil/task/test_notices
[friendica.git] / src / Protocol / OStatus.php
index 74a055265db795502f20e01bea8e40f6bd4622e5..4b67d8ecb292a5790431ab15adef27b437ec1493 100644 (file)
@@ -219,7 +219,7 @@ class OStatus
                        }
 
                        // Ensure that we are having this contact (with uid=0)
-                       $cid = Contact::getIdForURL($aliaslink, 0, false);
+                       $cid = Contact::getIdForURL($aliaslink);
 
                        if ($cid) {
                                $fields = ['url', 'nurl', 'name', 'nick', 'alias', 'about', 'location'];
@@ -544,15 +544,8 @@ class OStatus
                                                } elseif ($item['contact-id'] < 0) {
                                                        Logger::log("Item with uri ".$item["uri"]." is from a blocked contact.", Logger::DEBUG);
                                                } else {
-                                                       // We are having duplicated entries. Hopefully this solves it.
-                                                       if (DI::lock()->acquire('ostatus_process_item_insert')) {
-                                                               $ret = Item::insert($item);
-                                                               DI::lock()->release('ostatus_process_item_insert');
-                                                               Logger::log("Item with uri ".$item["uri"]." for user ".$importer["uid"].' stored. Return value: '.$ret);
-                                                       } else {
-                                                               $ret = Item::insert($item);
-                                                               Logger::log("We couldn't lock - but tried to store the item anyway. Return value is ".$ret);
-                                                       }
+                                                       $ret = Item::insert($item);
+                                                       Logger::log("Item with uri ".$item["uri"]." for user ".$importer["uid"].' stored. Return value: '.$ret);
                                                }
                                        }
                                }
@@ -745,7 +738,7 @@ class OStatus
 
                self::$conv_list[$conversation] = true;
 
-               $curlResult = DI::httpRequest()->get($conversation, false, ['accept_content' => 'application/atom+xml, text/html']);
+               $curlResult = DI::httpRequest()->get($conversation, ['accept_content' => 'application/atom+xml, text/html']);
 
                if (!$curlResult->isSuccess()) {
                        return;
@@ -938,7 +931,7 @@ class OStatus
                }
 
                $stored = false;
-               $curlResult = DI::httpRequest()->get($related, false, ['accept_content' => 'application/atom+xml, text/html']);
+               $curlResult = DI::httpRequest()->get($related, ['accept_content' => 'application/atom+xml, text/html']);
 
                if (!$curlResult->isSuccess()) {
                        return;
@@ -2129,7 +2122,7 @@ class OStatus
                }
 
                $check_date = DateTimeFormat::utc($last_update);
-               $authorid = Contact::getIdForURL($owner["url"], 0, false);
+               $authorid = Contact::getIdForURL($owner["url"]);
 
                $condition = ["`uid` = ? AND `received` > ? AND NOT `deleted`
                        AND `private` != ? AND `visible` AND `wall` AND `parent-network` IN (?, ?)",
@@ -2218,14 +2211,13 @@ class OStatus
         * Checks if the given contact url does support OStatus
         *
         * @param string  $url    profile url
-        * @param boolean $update Update the profile
         * @return boolean
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         * @throws \ImagickException
         */
-       public static function isSupportedByContactUrl($url, $update = false)
+       public static function isSupportedByContactUrl($url)
        {
-               $probe = Probe::uri($url, Protocol::OSTATUS, 0, !$update);
+               $probe = Probe::uri($url, Protocol::OSTATUS);
                return $probe['network'] == Protocol::OSTATUS;
        }
 }