]> git.mxchange.org Git - friendica.git/commitdiff
Renamed the contact relationship functions
authorMichael <heluecht@pirati.ca>
Sun, 28 Jan 2018 17:26:39 +0000 (17:26 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 28 Jan 2018 17:26:39 +0000 (17:26 +0000)
src/Model/Contact.php
src/Protocol/DFRN.php
src/Protocol/Diaspora.php
src/Protocol/OStatus.php

index 1f8a2434ba4088a3ffa10af67c0f4e869011b5e9..3b12dbf73966dbd4b0e76bc61834cd563c9ff5e6 100644 (file)
@@ -1355,7 +1355,7 @@ class Contact extends BaseObject
                return $contact;
        }
 
-       public static function newFollower($importer, $contact, $datarray, $item, $sharing = false) {
+       public static function addRelationship($importer, $contact, $datarray, $item, $sharing = false) {
                $url = notags(trim($datarray['author-link']));
                $name = notags(trim($datarray['author-name']));
                $photo = notags(trim($datarray['author-avatar']));
@@ -1446,7 +1446,7 @@ class Contact extends BaseObject
                }
        }
 
-       public static function loseFollower($importer, $contact, array $datarray = [], $item = "") {
+       public static function removeFollower($importer, $contact, array $datarray = [], $item = "") {
 
                if (($contact['rel'] == CONTACT_IS_FRIEND) || ($contact['rel'] == CONTACT_IS_SHARING)) {
                        dba::update('contact', ['rel' => CONTACT_IS_SHARING], ['id' => $contact['id']]);
@@ -1455,7 +1455,7 @@ class Contact extends BaseObject
                }
        }
 
-       public static function loseSharer($importer, $contact, array $datarray = [], $item = "") {
+       public static function removeSharer($importer, $contact, array $datarray = [], $item = "") {
 
                if (($contact['rel'] == CONTACT_IS_FRIEND) || ($contact['rel'] == CONTACT_IS_FOLLOWER)) {
                        dba::update('contact', ['rel' => CONTACT_IS_FOLLOWER], ['id' => $contact['id']]);
index 92cd29b29698d2c634b7d65ec9157890daaf2dff..22a7ecb611ff16578405a86cd800db9dc0f35346 100644 (file)
@@ -2255,22 +2255,22 @@ class DFRN
                        // This function once was responsible for DFRN and OStatus.
                        if (activity_match($item["verb"], ACTIVITY_FOLLOW)) {
                                logger("New follower");
-                               Contact::newFollower($importer, $contact, $item, $nickname);
+                               Contact::addRelationship($importer, $contact, $item, $nickname);
                                return false;
                        }
                        if (activity_match($item["verb"], ACTIVITY_UNFOLLOW)) {
                                logger("Lost follower");
-                               Contact::loseFollower($importer, $contact, $item);
+                               Contact::removeFollower($importer, $contact, $item);
                                return false;
                        }
                        if (activity_match($item["verb"], ACTIVITY_REQ_FRIEND)) {
                                logger("New friend request");
-                               Contact::newFollower($importer, $contact, $item, $nickname, true);
+                               Contact::addRelationship($importer, $contact, $item, $nickname, true);
                                return false;
                        }
                        if (activity_match($item["verb"], ACTIVITY_UNFRIEND)) {
                                logger("Lost sharer");
-                               Contact::loseSharer($importer, $contact, $item);
+                               Contact::removeSharer($importer, $contact, $item);
                                return false;
                        }
                } else {
index 068c1bae7324538f1c5deb2b653ba7060aff76b4..c05db2eb1f2a671f2a16d25b283a7c5de810022c 100644 (file)
@@ -2502,7 +2502,7 @@ class Diaspora
                                return true;
                        } else {
                                logger("Author ".$author." doesn't want to follow us anymore.", LOGGER_DEBUG);
-                               Contact::loseFollower($importer, $contact);
+                               Contact::removeFollower($importer, $contact);
                                return true;
                        }
                }
index 3edd84cbb037926518e3233ca79b535b87ae16b2..3c0f3627be8ca8a805049dee176ee356e411ac9a 100644 (file)
@@ -456,12 +456,12 @@ class OStatus
                        }
 
                        if ($item["verb"] == ACTIVITY_FOLLOW) {
-                               Contact::newFollower($importer, $contact, $item, $nickname);
+                               Contact::addRelationship($importer, $contact, $item, $nickname);
                                continue;
                        }
 
                        if ($item["verb"] == NAMESPACE_OSTATUS."/unfollow") {
-                               Contact::loseFollower($importer, $contact, $item, $dummy);
+                               Contact::removeFollower($importer, $contact, $item, $dummy);
                                continue;
                        }