]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/Diaspora.php
Moved global PAGE_* to Profile class (#5500)
[friendica.git] / src / Protocol / Diaspora.php
index 372f8a6f7f223cb964a435443ef938f337f9247d..9cd6e7bc54bf05703dfae4179a8a5137f0ab17b0 100644 (file)
@@ -144,7 +144,7 @@ class Diaspora
 
                // Fetch the relay contact
                $condition = ['uid' => 0, 'nurl' => normalise_link($server_url),
-                       'contact-type' => ACCOUNT_TYPE_RELAY];
+                       'contact-type' => Contact::ACCOUNT_TYPE_RELAY];
                $contact = DBA::selectFirst('contact', $fields, $condition);
 
                if (DBA::isResult($contact)) {
@@ -183,7 +183,7 @@ class Diaspora
                $fields = array_merge($fields, $network_fields);
 
                $condition = ['uid' => 0, 'nurl' => normalise_link($server_url),
-                       'contact-type' => ACCOUNT_TYPE_RELAY];
+                       'contact-type' => Contact::ACCOUNT_TYPE_RELAY];
 
                if (DBA::exists('contact', $condition)) {
                        unset($fields['created']);
@@ -604,7 +604,7 @@ class Diaspora
                        return false;
                }
 
-               $importer = ["uid" => 0, "page-flags" => PAGE_FREELOVE];
+               $importer = ["uid" => 0, "page-flags" => Contact::PAGE_FREELOVE];
                $success = self::dispatch($importer, $msg, $fields);
 
                return $success;
@@ -1079,7 +1079,7 @@ class Diaspora
                 */
                // It is deactivated by now, due to side effects. See issue https://github.com/friendica/friendica/pull/4033
                // It is not removed by now. Possibly the code is needed?
-               //if (!$is_comment && $contact["rel"] == Contact::FOLLOWER && in_array($importer["page-flags"], array(PAGE_FREELOVE))) {
+               //if (!$is_comment && $contact["rel"] == Contact::FOLLOWER && in_array($importer["page-flags"], array(Contact::PAGE_FREELOVE))) {
                //      dba::update(
                //              'contact',
                //              array('rel' => Contact::FRIEND, 'writable' => true),
@@ -1099,7 +1099,7 @@ class Diaspora
                        // Yes, then it is fine.
                        return true;
                        // Is it a post to a community?
-               } elseif (($contact["rel"] == Contact::FOLLOWER) && in_array($importer["page-flags"], [PAGE_COMMUNITY, PAGE_PRVGROUP])) {
+               } elseif (($contact["rel"] == Contact::FOLLOWER) && in_array($importer["page-flags"], [Contact::PAGE_COMMUNITY, Contact::PAGE_PRVGROUP])) {
                        // That's good
                        return true;
                        // Is the message a global user or a comment?
@@ -2374,7 +2374,7 @@ class Diaspora
                        }
                }
 
-               if (!$following && $sharing && in_array($importer["page-flags"], [PAGE_SOAPBOX, PAGE_NORMAL])) {
+               if (!$following && $sharing && in_array($importer["page-flags"], [Contact::PAGE_SOAPBOX, Contact::PAGE_NORMAL])) {
                        logger("Author ".$author." wants to share with us - but doesn't want to listen. Request is ignored.", LOGGER_DEBUG);
                        return false;
                } elseif (!$following && !$sharing) {
@@ -2432,7 +2432,7 @@ class Diaspora
 
                Contact::updateAvatar($ret["photo"], $importer['uid'], $contact_record["id"], true);
 
-               if (in_array($importer["page-flags"], [PAGE_NORMAL, PAGE_PRVGROUP])) {
+               if (in_array($importer["page-flags"], [Contact::PAGE_NORMAL, Contact::PAGE_PRVGROUP])) {
                        logger("Sending intra message for author ".$author.".", LOGGER_DEBUG);
 
                        $hash = random_string().(string)time();   // Generate a confirm_key
@@ -2459,9 +2459,9 @@ class Diaspora
                        // but if our page-type is PAGE_COMMUNITY or PAGE_SOAPBOX
                        // we are going to change the relationship and make them a follower.
 
-                       if (($importer["page-flags"] == PAGE_FREELOVE) && $sharing && $following) {
+                       if (($importer["page-flags"] == Contact::PAGE_FREELOVE) && $sharing && $following) {
                                $new_relation = Contact::FRIEND;
-                       } elseif (($importer["page-flags"] == PAGE_FREELOVE) && $sharing) {
+                       } elseif (($importer["page-flags"] == Contact::PAGE_FREELOVE) && $sharing) {
                                $new_relation = Contact::SHARING;
                        } else {
                                $new_relation = Contact::FOLLOWER;
@@ -3105,7 +3105,7 @@ class Diaspora
                logger("transmit: ".$logid."-".$guid." to ".$dest_url." returns: ".$return_code);
 
                if (!$return_code || (($return_code == 503) && (stristr($a->get_curl_headers(), "retry-after")))) {
-                       if (!$no_queue && ($contact['contact-type'] != ACCOUNT_TYPE_RELAY)) {
+                       if (!$no_queue && ($contact['contact-type'] != Contact::ACCOUNT_TYPE_RELAY)) {
                                logger("queue message");
                                // queue message for redelivery
                                Queue::add($contact["id"], NETWORK_DIASPORA, $envelope, $public_batch, $guid);