]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/finishremotesubscribe.php
Merge branch '0.7.x' of git@gitorious.org:laconica/dev into 0.7.x
[quix0rs-gnu-social.git] / actions / finishremotesubscribe.php
index f9094a50cafa91fd2b240d3df930229d9f7471e8..76db887deb4dca85f0347e5c46a18a4ee5021e82 100644 (file)
@@ -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)