]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Introduce neat function getFeedSub() on Ostatus_profile
authorMikael Nordfeldth <mmn@hethane.se>
Mon, 1 May 2017 19:17:22 +0000 (21:17 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Mon, 1 May 2017 19:17:22 +0000 (21:17 +0200)
plugins/OStatus/classes/Ostatus_profile.php

index 80e5974e21c5dd32a237497a078f345a811f18ec..8b701faf4c1b1a9f13adfac3790d110abf82dfad 100644 (file)
@@ -80,6 +80,11 @@ class Ostatus_profile extends Managed_DataObject
         return $this->uri;
     }
 
+    public function getFeedSub()
+    {
+        return FeedSub::getByUri($this->feeduri);
+    }
+
     static function fromProfile(Profile $profile)
     {
         $oprofile = Ostatus_profile::getKV('profile_id', $profile->getID());
@@ -1858,7 +1863,7 @@ class Ostatus_profile extends Managed_DataObject
 
         if (array_key_exists('feedurl', $hints) && common_valid_http_url($hints['feedurl'])) {
             try {
-                $feedsub = FeedSub::getByUri($this->feeduri);
+                $feedsub = $this->getFeedSub();
                 common_debug('URIFIX Changing FeedSub id==['._ve($feedsub->id).'] feeduri '._ve($feedsub->uri).' to '._ve($hints['feedurl']));
                 $feedorig = clone($feedsub);
                 $feedsub->uri = $hints['feedurl'];