X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdiaspora.php;h=545edcc4bf11a848726589823fc66906d030850a;hb=81c87885cf61247608a0fa8e738707510e737ace;hp=b1560b920186adf2fa57b07c5a37a2c366180c32;hpb=1c38540f20b3207a0fd09ef0802125e45e83bcf6;p=friendica.git diff --git a/include/diaspora.php b/include/diaspora.php index b1560b9201..545edcc4bf 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -13,7 +13,7 @@ use Friendica\Core\Config; require_once 'include/items.php'; require_once 'include/bb2diaspora.php'; -require_once 'include/Scrape.php'; +require_once 'include/probe.php'; require_once 'include/Contact.php'; require_once 'include/Photo.php'; require_once 'include/socgraph.php'; @@ -1395,7 +1395,7 @@ class Diaspora { $message_id = self::message_exists($importer["uid"], $guid); if ($message_id) { - return $message_id; + return true; } $parent_item = self::parent_item($importer["uid"], $parent_guid, $author, $contact); @@ -1454,6 +1454,10 @@ class Diaspora { $message_id = item_store($datarray); + if ($message_id <= 0) { + return false; + } + if ($message_id) { logger("Stored comment ".$datarray["guid"]." with message id ".$message_id, LOGGER_DEBUG); } @@ -1472,7 +1476,7 @@ class Diaspora { proc_run(PRIORITY_HIGH, "include/notifier.php", "comment-import", $message_id); } - return $message_id; + return true; } /** @@ -1623,7 +1627,7 @@ class Diaspora { } if (!$conversation) { logger("unable to create conversation."); - return; + return false; } foreach ($messages as $mesg) @@ -1701,7 +1705,7 @@ class Diaspora { $message_id = self::message_exists($importer["uid"], $guid); if ($message_id) - return $message_id; + return true; $parent_item = self::parent_item($importer["uid"], $parent_guid, $author, $contact); if (!$parent_item) @@ -1754,8 +1758,13 @@ class Diaspora { $message_id = item_store($datarray); - if ($message_id) + if ($message_id <= 0) { + return false; + } + + if ($message_id) { logger("Stored like ".$datarray["guid"]." with message id ".$message_id, LOGGER_DEBUG); + } // If we are the origin of the parent we store the original data and notify our followers if ($message_id AND $parent_item["origin"]) { @@ -1771,7 +1780,7 @@ class Diaspora { proc_run(PRIORITY_HIGH, "include/notifier.php", "comment-import", $message_id); } - return $message_id; + return true; } /** @@ -2348,7 +2357,7 @@ class Diaspora { $message_id = self::message_exists($importer["uid"], $guid); if ($message_id) { - return $message_id; + return true; } $original_item = self::original_item($root_guid, $root_author, $author); @@ -2399,9 +2408,10 @@ class Diaspora { if ($message_id) { logger("Stored reshare ".$datarray["guid"]." with message id ".$message_id, LOGGER_DEBUG); + return true; + } else { + return false; } - - return $message_id; } /** @@ -2532,7 +2542,7 @@ class Diaspora { $message_id = self::message_exists($importer["uid"], $guid); if ($message_id) { - return $message_id; + return true; } $address = array(); @@ -2616,9 +2626,10 @@ class Diaspora { if ($message_id) { logger("Stored item ".$datarray["guid"]." with message id ".$message_id, LOGGER_DEBUG); + return true; + } else { + return false; } - - return $message_id; } /* ************************************************************************************** *