summaryrefslogtreecommitdiff
path: root/plugins/OStatus/lib/salmonaction.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-02-21 12:54:52 -0500
committerEvan Prodromou <evan@status.net>2010-02-21 12:54:52 -0500
commit09e2d181be3b72b1d8134273b9fdfa280895627c (patch)
tree019ae506b9e2c81ff20c749e0d9a58895f2718ac /plugins/OStatus/lib/salmonaction.php
parent727773cdfa8f229babbfe8a620645f2f4db9bbd8 (diff)
remove unused profile code from salmonaction
Diffstat (limited to 'plugins/OStatus/lib/salmonaction.php')
-rw-r--r--plugins/OStatus/lib/salmonaction.php71
1 files changed, 0 insertions, 71 deletions
diff --git a/plugins/OStatus/lib/salmonaction.php b/plugins/OStatus/lib/salmonaction.php
index 41e8322e8..abd8d4c83 100644
--- a/plugins/OStatus/lib/salmonaction.php
+++ b/plugins/OStatus/lib/salmonaction.php
@@ -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();