From e71f4972952e61ae06d0e4970c47cee93e8cb8a1 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 30 Sep 2018 08:14:05 +0000 Subject: [PATCH] Renamed --- src/Model/APContact.php | 2 +- src/Protocol/ActivityPub.php | 32 ++++++++++++++++---------------- src/Util/HTTPSignature.php | 4 ++-- src/Util/LDSignature.php | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Model/APContact.php b/src/Model/APContact.php index c8f8998ae..efd6ed0e9 100644 --- a/src/Model/APContact.php +++ b/src/Model/APContact.php @@ -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; diff --git a/src/Protocol/ActivityPub.php b/src/Protocol/ActivityPub.php index c04347f4e..ab5da4666 100644 --- a/src/Protocol/ActivityPub.php +++ b/src/Protocol/ActivityPub.php @@ -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); } /** diff --git a/src/Util/HTTPSignature.php b/src/Util/HTTPSignature.php index c02124874..234d89607 100644 --- a/src/Util/HTTPSignature.php +++ b/src/Util/HTTPSignature.php @@ -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']]; diff --git a/src/Util/LDSignature.php b/src/Util/LDSignature.php index ebbffeb1e..7776ec96c 100644 --- a/src/Util/LDSignature.php +++ b/src/Util/LDSignature.php @@ -30,7 +30,7 @@ class LDSignature return false; } - $profile = APContact::getProfileByURL($actor); + $profile = APContact::getByURL($actor); if (empty($profile['pubkey'])) { return false; }