]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
remove unused profile code from salmonaction
authorEvan Prodromou <evan@status.net>
Sun, 21 Feb 2010 17:54:52 +0000 (12:54 -0500)
committerEvan Prodromou <evan@status.net>
Sun, 21 Feb 2010 17:54:52 +0000 (12:54 -0500)
plugins/OStatus/lib/salmonaction.php

index 41e8322e8904fd677be6c7abd5c533bb6b0ea7b5..abd8d4c83397c4c831814beebf1a56a3f2f4b13b 100644 (file)
@@ -161,77 +161,6 @@ class SalmonAction extends Action
         return Ostatus_profile::ensureActorProfile($this->act);
     }
 
-    /**
-     * @fixme merge into Ostatus_profile::ensureActorProfile and friends
-     */
-    function createProfile()
-    {
-        $actor = $this->act->actor;
-
-        $profile = new Profile();
-
-        $profile->nickname = $this->nicknameFromURI($actor->id);
-
-        if (empty($profile->nickname)) {
-            $profile->nickname = common_nicknamize($actor->title);
-        }
-
-        $profile->fullname   = $actor->title;
-        $profile->bio        = $actor->summary; // XXX: is that right?
-        $profile->profileurl = $actor->link; // XXX: is that right?
-        $profile->created    = common_sql_now();
-
-        $id = $profile->insert();
-
-        if (empty($id)) {
-            common_log_db_error($profile, 'INSERT', __FILE__);
-            throw new Exception("Couldn't save new profile for $actor->id\n");
-        }
-
-        // XXX: add avatars
-
-        $op = new Ostatus_profile();
-
-        $op->profile_id = $id;
-        $op->homeuri    = $actor->id;
-        $op->created    = $profile->created;
-
-        // XXX: determine feed URI from source or Webfinger or whatever
-
-        $id = $op->insert();
-
-        if (empty($id)) {
-            common_log_db_error($op, 'INSERT', __FILE__);
-            throw new Exception("Couldn't save new ostatus profile for $actor->id\n");
-        }
-
-        return $profile;
-    }
-
-    /**
-     * @fixme should be merged into Ostatus_profile
-     */
-    function nicknameFromURI($uri)
-    {
-        preg_match('/(\w+):/', $uri, $matches);
-
-        $protocol = $matches[1];
-
-        switch ($protocol) {
-        case 'acct':
-        case 'mailto':
-            if (preg_match("/^$protocol:(.*)?@.*\$/", $uri, $matches)) {
-                return common_canonical_nickname($matches[1]);
-            }
-            return null;
-        case 'http':
-            return common_url_to_nickname($uri);
-            break;
-        default:
-            return null;
-        }
-    }
-
     function saveNotice()
     {
         $oprofile = $this->ensureProfile();