diff options
author | Evan Prodromou <evan@status.net> | 2010-02-21 14:14:45 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-02-21 14:14:45 -0500 |
commit | 16a43b1154baf967183279c5e291a080cb2d5868 (patch) | |
tree | 5c65ab2a6943ce56a828e1dd0bfca448855a8dea /plugins/OStatus | |
parent | de093537f6c7f3b83817146247fbd9edbed16935 (diff) |
slightly more robust remote profile creation
Diffstat (limited to 'plugins/OStatus')
-rw-r--r-- | plugins/OStatus/classes/Ostatus_profile.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index aab316c34..3b79f32c6 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -709,7 +709,7 @@ class Ostatus_profile extends Memcached_DataObject protected static function getActivityObjectProfile($object) { $uri = self::getActivityObjectProfileURI($object); - return Ostatus_profile::staticGet('homeuri', $uri); + return Ostatus_profile::staticGet('uri', $uri); } protected static function getActorProfileURI($activity) @@ -747,9 +747,9 @@ class Ostatus_profile extends Memcached_DataObject protected static function createActivityObjectProfile($object, $feeduri=null, $salmonuri=null) { - $homeuri = self::getActivityObjectProfileURI($object); + $homeuri = $object->id; $nickname = self::getActivityObjectNickname($object); - $avatar = self::getActivityObjectAvatar($object); + $avatar = self::getActivityObjectAvatar($object); if (!$homeuri) { common_log(LOG_DEBUG, __METHOD__ . " empty actor profile URI: " . var_export($activity, true)); @@ -782,9 +782,9 @@ class Ostatus_profile extends Memcached_DataObject // @todo tags from categories // @todo lat/lon/location? - $ok = $profile->insert(); + $profile_id = $profile->insert(); - if (!$ok) { + if (!$profile_id) { throw new ServerException("Can't save local profile"); } @@ -797,7 +797,7 @@ class Ostatus_profile extends Memcached_DataObject $oprofile->uri = $homeuri; $oprofile->feeduri = $feeduri; $oprofile->salmonuri = $salmonuri; - $oprofile->profile_id = $profile->id; + $oprofile->profile_id = $profile_id; $oprofile->created = common_sql_now(); $oprofile->modified = common_sql_now(); |