]> git.mxchange.org Git - friendica.git/commitdiff
Renamed
authorMichael <heluecht@pirati.ca>
Sun, 30 Sep 2018 08:14:05 +0000 (08:14 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 30 Sep 2018 08:14:05 +0000 (08:14 +0000)
src/Model/APContact.php
src/Protocol/ActivityPub.php
src/Util/HTTPSignature.php
src/Util/LDSignature.php

index c8f8998ae60ec78e67f95873e6ecf57c66767ac6..efd6ed0e9dc60c4216382f7415743dca360331a6 100644 (file)
@@ -63,7 +63,7 @@ class APContact extends BaseObject
         * @param boolean $update true = always update, false = never update, null = update when not found
         * @return array profile array
         */
-       public static function getProfileByURL($url, $update = null)
+       public static function getByURL($url, $update = null)
        {
                if (empty($url)) {
                        return false;
index c04347f4e9bf2854b79af8f0f102f91c63ba1690..ab5da4666cde647cec9701ba4891e0bc803b5cc8 100644 (file)
@@ -312,9 +312,9 @@ class ActivityPub
                $activity = json_decode($conversation['source'], true);
 
                $actor = JsonLD::fetchElement($activity, 'actor', 'id');
-               $profile = APContact::getProfileByURL($actor);
+               $profile = APContact::getByURL($actor);
 
-               $item_profile = APContact::getProfileByURL($item['author-link']);
+               $item_profile = APContact::getByURL($item['author-link']);
                $exclude[] = $item['author-link'];
 
                if ($item['gravity'] == GRAVITY_PARENT) {
@@ -356,7 +356,7 @@ class ActivityPub
 
                $data = array_merge($data, self::fetchPermissionBlockFromConversation($item));
 
-               $actor_profile = APContact::getProfileByURL($item['author-link']);
+               $actor_profile = APContact::getByURL($item['author-link']);
 
                $terms = Term::tagArrayFromItemId($item['id'], TERM_MENTION);
 
@@ -369,7 +369,7 @@ class ActivityPub
                        }
 
                        foreach ($terms as $term) {
-                               $profile = APContact::getProfileByURL($term['url'], false);
+                               $profile = APContact::getByURL($term['url'], false);
                                if (!empty($profile) && empty($contacts[$profile['url']])) {
                                        $data['cc'][] = $profile['url'];
                                        $contacts[$profile['url']] = $profile['url'];
@@ -405,7 +405,7 @@ class ActivityPub
                                continue;
                        }
 
-                       $profile = APContact::getProfileByURL($parent['author-link'], false);
+                       $profile = APContact::getByURL($parent['author-link'], false);
                        if (!empty($profile) && empty($contacts[$profile['url']])) {
                                $data['cc'][] = $profile['url'];
                                $contacts[$profile['url']] = $profile['url'];
@@ -415,7 +415,7 @@ class ActivityPub
                                continue;
                        }
 
-                       $profile = APContact::getProfileByURL($parent['owner-link'], false);
+                       $profile = APContact::getByURL($parent['owner-link'], false);
                        if (!empty($profile) && empty($contacts[$profile['url']])) {
                                $data['cc'][] = $profile['url'];
                                $contacts[$profile['url']] = $profile['url'];
@@ -449,9 +449,9 @@ class ActivityPub
                $inboxes = [];
 
                if ($item['gravity'] == GRAVITY_ACTIVITY) {
-                       $item_profile = APContact::getProfileByURL($item['author-link']);
+                       $item_profile = APContact::getByURL($item['author-link']);
                } else {
-                       $item_profile = APContact::getProfileByURL($item['owner-link']);
+                       $item_profile = APContact::getByURL($item['owner-link']);
                }
 
                foreach (['to', 'cc', 'bto', 'bcc'] as $element) {
@@ -470,7 +470,7 @@ class ActivityPub
                                        }
                                        DBA::close($contacts);
                                } else {
-                                       $profile = APContact::getProfileByURL($receiver);
+                                       $profile = APContact::getByURL($receiver);
                                        if (!empty($profile)) {
                                                $target = defaults($profile, 'sharedinbox', $profile['inbox']);
                                                $inboxes[$target] = $target;
@@ -725,7 +725,7 @@ class ActivityPub
         */
        public static function transmitActivity($activity, $target, $uid)
        {
-               $profile = APContact::getProfileByURL($target);
+               $profile = APContact::getByURL($target);
 
                $owner = User::getOwnerDataById($uid);
 
@@ -751,7 +751,7 @@ class ActivityPub
         */
        public static function transmitContactAccept($target, $id, $uid)
        {
-               $profile = APContact::getProfileByURL($target);
+               $profile = APContact::getByURL($target);
 
                $owner = User::getOwnerDataById($uid);
                $data = ['@context' => 'https://www.w3.org/ns/activitystreams',
@@ -778,7 +778,7 @@ class ActivityPub
         */
        public static function transmitContactReject($target, $id, $uid)
        {
-               $profile = APContact::getProfileByURL($target);
+               $profile = APContact::getByURL($target);
 
                $owner = User::getOwnerDataById($uid);
                $data = ['@context' => 'https://www.w3.org/ns/activitystreams',
@@ -804,7 +804,7 @@ class ActivityPub
         */
        public static function transmitContactUndo($target, $uid)
        {
-               $profile = APContact::getProfileByURL($target);
+               $profile = APContact::getByURL($target);
 
                $id = System::baseUrl() . '/activity/' . System::createGUID();
 
@@ -847,7 +847,7 @@ class ActivityPub
         */
        public static function probeProfile($url)
        {
-               $apcontact = APContact::getProfileByURL($url, true);
+               $apcontact = APContact::getByURL($url, true);
                if (empty($apcontact)) {
                        return false;
                }
@@ -1141,7 +1141,7 @@ class ActivityPub
                }
 
                if (!empty($actor)) {
-                       $profile = APContact::getProfileByURL($actor);
+                       $profile = APContact::getByURL($actor);
                        $followers = defaults($profile, 'followers', '');
 
                        logger('Actor: ' . $actor . ' - Followers: ' . $followers, LOGGER_DEBUG);
@@ -1706,7 +1706,7 @@ class ActivityPub
                }
 
                logger('Updating profile for ' . $activity['object']['id'], LOGGER_DEBUG);
-               APContact::getProfileByURL($activity['object']['id'], true);
+               APContact::getByURL($activity['object']['id'], true);
        }
 
        /**
index c02124874f8e9dce4c6acffba3dc9ac343d4e238..234d896078a6b1710df1885348ad25fdece2e610 100644 (file)
@@ -424,12 +424,12 @@ class HTTPSignature
        {
                $url = (strpos($id, '#') ? substr($id, 0, strpos($id, '#')) : $id);
 
-               $profile = APContact::getProfileByURL($url);
+               $profile = APContact::getByURL($url);
                if (!empty($profile)) {
                        logger('Taking key from id ' . $id, LOGGER_DEBUG);
                        return ['url' => $url, 'pubkey' => $profile['pubkey']];
                } elseif ($url != $actor) {
-                       $profile = APContact::getProfileByURL($actor);
+                       $profile = APContact::getByURL($actor);
                        if (!empty($profile)) {
                                logger('Taking key from actor ' . $actor, LOGGER_DEBUG);
                                return ['url' => $actor, 'pubkey' => $profile['pubkey']];
index ebbffeb1e8b1f0bb34dd88d674f3752cf344bfc0..7776ec96c26f320b8c4cb8f4b217c3b0cf11e088 100644 (file)
@@ -30,7 +30,7 @@ class LDSignature
                        return false;
                }
 
-               $profile = APContact::getProfileByURL($actor);
+               $profile = APContact::getByURL($actor);
                if (empty($profile['pubkey'])) {
                        return false;
                }