X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fdiaspora.php;h=3145c52ea3fbb62242c2254aa1728aa547db5077;hb=32e8f3468d17f9f84b308aa903f7efa1fa22441f;hp=24d4d45da6d4dc85c064de51d5300ec59a85b885;hpb=4b858650ced0d7648a3545a9da2c67a09222ccc6;p=friendica.git diff --git a/include/diaspora.php b/include/diaspora.php index 24d4d45da6..3145c52ea3 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -22,6 +22,12 @@ function diaspora_dispatch_public($msg) { return; } + // Use a dummy importer to import the data for the public copy + $importer = array("uid" => 0, "page-flags" => PAGE_FREELOVE); + $result = diaspora_dispatch($importer,$msg); + logger("Dispatcher reported ".$result, LOGGER_DEBUG); + + // Now distribute it to the followers $r = q("SELECT `user`.* FROM `user` WHERE `user`.`uid` IN ( SELECT `contact`.`uid` FROM `contact` WHERE `contact`.`network` = '%s' AND `contact`.`addr` = '%s' ) AND `account_expired` = 0 AND `account_removed` = 0 ", @@ -34,15 +40,8 @@ function diaspora_dispatch_public($msg) { diaspora_dispatch($rr,$msg); } } - else { + else logger('diaspora_public: no subscribers for '.$msg["author"].' '.print_r($msg, true)); - - // Use a dummy importer - $importer = array("uid" => 0, "page-flags" => PAGE_FREELOVE); - $result = diaspora_dispatch($importer,$msg); - - logger("Dispatcher reported ".$result, LOGGER_DEBUG); - } } @@ -846,9 +845,8 @@ function diaspora_post($importer,$xml,$msg) { } $message_id = $diaspora_handle . ':' . $guid; - $r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `uri` = '%s' AND `guid` = '%s' LIMIT 1", + $r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `guid` = '%s' LIMIT 1", intval($importer['uid']), - dbesc($message_id), dbesc($guid) ); if(count($r)) { @@ -965,9 +963,8 @@ function diaspora_store_by_guid($guid, $server, $uid = 0) { $objecttype = $item["object-type"]; $message_id = $author.':'.$guid; - $r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `uri` = '%s' AND `guid` = '%s' LIMIT 1", + $r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `guid` = '%s' LIMIT 1", intval($uid), - dbesc($message_id), dbesc($guid) ); if(count($r)) @@ -1135,9 +1132,8 @@ function diaspora_reshare($importer,$xml,$msg) { } $message_id = $diaspora_handle . ':' . $guid; - $r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `uri` = '%s' AND `guid` = '%s' LIMIT 1", + $r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `guid` = '%s' LIMIT 1", intval($importer['uid']), - dbesc($message_id), dbesc($guid) ); if(count($r)) { @@ -1321,9 +1317,8 @@ function diaspora_asphoto($importer,$xml,$msg) { } $message_id = $diaspora_handle . ':' . $guid; - $r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `uri` = '%s' AND `guid` = '%s' LIMIT 1", + $r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `guid` = '%s' LIMIT 1", intval($importer['uid']), - dbesc($message_id), dbesc($guid) ); if(count($r)) {