diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-02-09 23:13:11 +0000 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-02-09 18:18:28 -0500 |
commit | 80429ca70c5ec3f057197914ea9817a25c4a86c7 (patch) | |
tree | 4d2454b09ccacdaaa5119fa36fdddb386238f4a8 | |
parent | 0d586524874560c51277b90f33bcbed164748f6d (diff) |
Fixed remote subscribe avatar problems
Had some Avatar file-copying issues; seem to be fixed.
-rw-r--r-- | actions/finishremotesubscribe.php | 8 | ||||
-rw-r--r-- | actions/userauthorization.php | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/actions/finishremotesubscribe.php b/actions/finishremotesubscribe.php index f9094a50c..76db887de 100644 --- a/actions/finishremotesubscribe.php +++ b/actions/finishremotesubscribe.php @@ -237,7 +237,13 @@ class FinishremotesubscribeAction extends Action { $temp_filename = tempnam(sys_get_temp_dir(), 'listener_avatar'); copy($url, $temp_filename); - return $profile->setOriginal($temp_filename); + $imagefile = new ImageFile($profile->id, $temp_filename); + $filename = Avatar::filename($profile->id, + image_type_to_extension($imagefile->type), + null, + common_timestamp()); + rename($temp_filename, Avatar::path($filename)); + return $profile->setOriginal($filename); } function access_token($omb) diff --git a/actions/userauthorization.php b/actions/userauthorization.php index 7455a41a6..ed17ceec9 100644 --- a/actions/userauthorization.php +++ b/actions/userauthorization.php @@ -330,7 +330,13 @@ class UserauthorizationAction extends Action { $temp_filename = tempnam(sys_get_temp_dir(), 'listenee_avatar'); copy($url, $temp_filename); - return $profile->setOriginal($temp_filename); + $imagefile = new ImageFile($profile->id, $temp_filename); + $filename = Avatar::filename($profile->id, + image_type_to_extension($imagefile->type), + null, + common_timestamp()); + rename($temp_filename, Avatar::path($filename)); + return $profile->setOriginal($filename); } function showAcceptMessage($tok) |