]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Converted all ActivityObject::fromProfile to $profile->asActivityObject
authorMikael Nordfeldth <mmn@hethane.se>
Wed, 2 Jul 2014 16:50:28 +0000 (18:50 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Thu, 3 Jul 2014 08:51:36 +0000 (10:51 +0200)
12 files changed:
classes/Group_member.php
classes/Message.php
classes/Notice.php
classes/Subscription.php
classes/User.php
lib/activityobject.php
lib/atomusernoticefeed.php
plugins/Activity/ActivityPlugin.php
plugins/Favorite/classes/Fave.php
plugins/OStatus/OStatusPlugin.php
plugins/OStatus/classes/Ostatus_profile.php
plugins/OfflineBackup/lib/offlinebackupqueuehandler.php

index 803f78883592881844142231e36b0e8067edb727..14f417758da21890fecf21a944cdc77891c3beb8 100644 (file)
@@ -168,7 +168,7 @@ class Group_member extends Managed_DataObject
 
         $act->id = $this->getURI();
 
-        $act->actor     = ActivityObject::fromProfile($member);
+        $act->actor     = $member->asActivityObject();
         $act->verb      = ActivityVerb::JOIN;
         $act->objects[] = ActivityObject::fromGroup($group);
 
index 211284ecec86ab7dcde197d7523416a893c58ff3..bc25b1b0b3acfd15e0727e3e6ebe6594e4b12777 100644 (file)
@@ -183,7 +183,7 @@ class Message extends Managed_DataObject
                 throw new Exception(sprintf("Sender profile not found: %d", $this->from_profile));
             }
             
-            $act->actor            = ActivityObject::fromProfile($profile);
+            $act->actor            = $profile->asActivityObject();
             $act->actor->extra[]   = $profile->profileInfo(null);
 
             $act->verb = ActivityVerb::POST;
index e71500145d2e000410f6542ad64f34c4164c4873..ebf874bffb5d829f28b62fc2c55ebba421731975 100644 (file)
@@ -1782,7 +1782,7 @@ class Notice extends Managed_DataObject
 
             $profile = $this->getProfile();
 
-            $act->actor            = ActivityObject::fromProfile($profile);
+            $act->actor            = $profile->asActivityObject();
             $act->actor->extra[]   = $profile->profileInfo($cur);
 
             $act->verb = $this->verb;
index edee9950d81835ed5a45881c3f5909a7fd0bb07b..4d7eb524dcf8d89da61e4ba15d9a2bac39d7b7cc 100644 (file)
@@ -267,8 +267,8 @@ class Subscription extends Managed_DataObject
                                $subscriber->getBestName(),
                                $subscribed->getBestName());
 
-        $act->actor     = ActivityObject::fromProfile($subscriber);
-        $act->objects[] = ActivityObject::fromProfile($subscribed);
+        $act->actor     = $subscriber->asActivityObject();
+        $act->objects[] = $subscribed->asActivityObject();
 
         $url = common_local_url('AtomPubShowSubscription',
                                 array('subscriber' => $subscriber->id,
index c3ceb2646b166ca57a912c1d44aec2c31073a35a..1c54affda7461730b6553bfd41fd21cfffe9ab10 100644 (file)
@@ -990,7 +990,7 @@ class User extends Managed_DataObject
 
         $act = new Activity();
 
-        $act->actor = ActivityObject::fromProfile($profile);
+        $act->actor = $profile->asActivityObject();
         $act->verb = ActivityVerb::JOIN;
 
         $act->objects[] = $service;
index bd525a68d0d725a0c90ad20b9939fec3b47d4891..b3940be824b9a0ab5c34d91f99c85b9241c02f31 100644 (file)
@@ -457,11 +457,6 @@ class ActivityObject
         return $object;
     }
 
-    static function fromProfile(Profile $profile)
-    {
-        return $profile->asActivityObject();
-    }
-
     static function fromGroup(User_group $group)
     {
         $object = new ActivityObject();
index b899ecff4aa4c15da5173ddf9f40f81b49cc9c72..567045ee869ba50026de6cbb62787d40e1a26b7b 100644 (file)
@@ -62,7 +62,7 @@ class AtomUserNoticeFeed extends AtomNoticeFeed
 
             $profile = $user->getProfile();
 
-            $ao = ActivityObject::fromProfile($profile);
+            $ao = $profile->asActivityObject();
 
             array_push($ao->extra, $profile->profileInfo($cur));
 
index 1b36e11fd4c8419f1ccc12738846a4c3da0c2e42..ce6f114bfb1b42918e3e3afd8960d14b4ae69568 100644 (file)
@@ -390,7 +390,7 @@ class ActivityPlugin extends Plugin
             if (!empty($sub)) {
                 $profile = Profile::getKV('id', $sub->subscribed);
                 if (!empty($profile)) {
-                    $activity->objects = array(ActivityObject::fromProfile($profile));
+                    $activity->objects = array($profile->asActivityObject());
                 }
             }
             break;
index 3ec5fadd7b8c0cad65f802343e93d8795e2b2c06..ceaa37022b799f2e6c31720772dc3fc573ddde19 100644 (file)
@@ -157,7 +157,7 @@ class Fave extends Managed_DataObject
                                $profile->getBestName(),
                                $notice->getUrl());
 
-        $act->actor     = ActivityObject::fromProfile($profile);
+        $act->actor     = $profile->asActivityObject();
         $act->objects[] = ActivityObject::fromNotice($notice);
 
         $url = common_local_url('AtomPubShowFavorite',
index cebf5597d31c0c4f1154d2fe0081180ed62f1f86..7b19e386e6a04b3290c12e47aadcbd1eac800c2b 100644 (file)
@@ -691,8 +691,8 @@ class OStatusPlugin extends Plugin
                                $profile->getBestName(),
                                $other->getBestName());
 
-        $act->actor   = ActivityObject::fromProfile($profile);
-        $act->object  = ActivityObject::fromProfile($other);
+        $act->actor   = $profile->asActivityObject();
+        $act->object  = $other->asActivityObject();
 
         $oprofile->notifyActivity($act, $profile);
 
@@ -728,7 +728,7 @@ class OStatusPlugin extends Plugin
                                 $group->id,
                                 common_date_iso8601(time()));
 
-        $act->actor = ActivityObject::fromProfile($profile);
+        $act->actor = $profile->asActivityObject();
         $act->verb = ActivityVerb::JOIN;
         $act->object = $oprofile->asActivityObject();
 
@@ -782,7 +782,7 @@ class OStatusPlugin extends Plugin
                                 $group->id,
                                 common_date_iso8601(time()));
 
-        $act->actor = ActivityObject::fromProfile($member);
+        $act->actor = $member->asActivityObject();
         $act->verb = ActivityVerb::LEAVE;
         $act->object = $oprofile->asActivityObject();
 
@@ -828,7 +828,7 @@ class OStatusPlugin extends Plugin
                                 $peopletag->id,
                                 common_date_iso8601(time()));
 
-        $act->actor = ActivityObject::fromProfile($sub);
+        $act->actor = $sub->asActivityObject();
         $act->verb = ActivityVerb::FOLLOW;
         $act->object = $oprofile->asActivityObject();
 
@@ -880,7 +880,7 @@ class OStatusPlugin extends Plugin
                                 $peopletag->id,
                                 common_date_iso8601(time()));
 
-        $act->actor = ActivityObject::fromProfile($member);
+        $act->actor = $member->asActivityObject();
         $act->verb = ActivityVerb::UNFOLLOW;
         $act->object = $oprofile->asActivityObject();
 
@@ -973,8 +973,8 @@ class OStatusPlugin extends Plugin
                                 $tagged->getBestName(),
                                 $plist->getBestName());
 
-        $act->actor  = ActivityObject::fromProfile($tagger);
-        $act->objects = array(ActivityObject::fromProfile($tagged));
+        $act->actor  = $tagger->asActivityObject();
+        $act->objects = array($tagged->asActivityObject());
         $act->target = ActivityObject::fromPeopletag($plist);
 
         $oprofile->notifyDeferred($act, $tagger);
@@ -1024,8 +1024,8 @@ class OStatusPlugin extends Plugin
                                 $tagged->getBestName(),
                                 $plist->getBestName());
 
-        $act->actor  = ActivityObject::fromProfile($tagger);
-        $act->objects = array(ActivityObject::fromProfile($tagged));
+        $act->actor  = $tagger->asActivityObject();
+        $act->objects = array($tagged->asActivityObject());
         $act->target = ActivityObject::fromPeopletag($plist);
 
         $oprofile->notifyDeferred($act, $tagger);
@@ -1073,7 +1073,7 @@ class OStatusPlugin extends Plugin
                                $profile->getBestName(),
                                $notice->getUrl());
 
-        $act->actor   = ActivityObject::fromProfile($profile);
+        $act->actor   = $profile->asActivityObject();
         $act->object  = ActivityObject::fromNotice($notice);
 
         $oprofile->notifyActivity($act, $profile);
@@ -1191,7 +1191,7 @@ class OStatusPlugin extends Plugin
         $act->content = sprintf(_m('%s has updated their profile page.'),
                                $profile->getBestName());
 
-        $act->actor   = ActivityObject::fromProfile($profile);
+        $act->actor   = $profile->asActivityObject();
         $act->object  = $act->actor;
 
         while ($oprofile->fetch()) {
index 0629d73a7524e95f26faa8c8eb5c5bf5ff626c4c..e6db40c5a8e777704202f0c61f39f39f83b3c2c2 100644 (file)
@@ -132,7 +132,7 @@ class Ostatus_profile extends Managed_DataObject
         } else if ($this->isPeopletag()) {
             return ActivityObject::fromPeopletag($this->localPeopletag());
         } else {
-            return ActivityObject::fromProfile($this->localProfile());
+            return $this->localProfile()->asActivityObject();
         }
     }
 
@@ -156,7 +156,7 @@ class Ostatus_profile extends Managed_DataObject
             $noun = ActivityObject::fromPeopletag($this->localPeopletag());
             return $noun->asString('activity:' . $element);
         } else {
-            $noun = ActivityObject::fromProfile($this->localProfile());
+            $noun = $this->localProfile()->asActivityObject();
             return $noun->asString('activity:' . $element);
         }
     }
index ba95912b3bb822bda0e83adf9f383e1c3c2810d3..9f96193d95758ed85c67db31bfd4a4c6216a42c2 100644 (file)
@@ -294,7 +294,7 @@ class OfflineBackupQueueHandler extends QueueHandler
 
         $profile = $user->getProfile();
 
-        $author = ActivityObject::fromProfile($profile);
+        $author = $profile->asActivityObject();
 
         $xs = new XMLStringer();
         $author->outputTo($xs, 'author');