]> git.mxchange.org Git - friendica.git/commitdiff
Posts from Diaspora are always accepted for the global contact
authorMichael Vogel <icarus@dabo.de>
Sun, 9 Aug 2015 12:28:59 +0000 (14:28 +0200)
committerMichael Vogel <icarus@dabo.de>
Sun, 9 Aug 2015 12:28:59 +0000 (14:28 +0200)
include/diaspora.php

index 534e2541cb3f373763c966fbebb9241776ac0c02..fd9dd8fb759f59549b3bfeae866acab2f36ef913 100755 (executable)
@@ -34,8 +34,13 @@ function diaspora_dispatch_public($msg) {
                        diaspora_dispatch($rr,$msg);
                }
        }
-       else
-               logger('diaspora_public: no subscribers');
+       else {
+               logger('diaspora_public: no subscribers '.print_r($msg, true));
+
+               // Use a dummy importer
+               $importer = array("uid" => 0, "page-flags" => PAGE_FREELOVE);
+               diaspora_dispatch($importer,$msg);
+       }
 }
 
 
@@ -782,6 +787,11 @@ function diaspora_post_allow($importer,$contact) {
        if($contact['rel'] == CONTACT_IS_FOLLOWER)
                if($importer['page-flags'] == PAGE_COMMUNITY)
                        return true;
+
+       // Messages for the global users are always accepted
+       if ($importer['uid'] == 0)
+               return true;
+
        return false;
 }
 
@@ -1605,7 +1615,7 @@ function diaspora_conversation($importer,$xml,$msg) {
        $created_at = datetime_convert('UTC','UTC',notags(unxmlify($xml->created_at)));
 
        $parent_uri = $diaspora_handle . ':' . $guid;
+
        $messages = $xml->message;
 
        if(! count($messages)) {
@@ -1619,7 +1629,7 @@ function diaspora_conversation($importer,$xml,$msg) {
                return;
        }
 
-       if(($contact['rel'] == CONTACT_IS_FOLLOWER) || ($contact['blocked']) || ($contact['readonly'])) { 
+       if(($contact['rel'] == CONTACT_IS_FOLLOWER) || ($contact['blocked']) || ($contact['readonly'])) {
                logger('diaspora_conversation: Ignoring this author.');
                return 202;
        }
@@ -1776,14 +1786,14 @@ function diaspora_message($importer,$xml,$msg) {
        $msg_conversation_guid = notags(unxmlify($xml->conversation_guid));
 
        $parent_uri = $diaspora_handle . ':' . $msg_parent_guid;
+
        $contact = diaspora_get_contact_by_handle($importer['uid'],$msg_diaspora_handle);
        if(! $contact) {
                logger('diaspora_message: cannot find contact: ' . $msg_diaspora_handle);
                return;
        }
 
-       if(($contact['rel'] == CONTACT_IS_FOLLOWER) || ($contact['blocked']) || ($contact['readonly'])) { 
+       if(($contact['rel'] == CONTACT_IS_FOLLOWER) || ($contact['blocked']) || ($contact['readonly'])) {
                logger('diaspora_message: Ignoring this author.');
                return 202;
        }