]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/finishremotesubscribe.php
First crack at Twitter-like JSON search results for the API
[quix0rs-gnu-social.git] / actions / finishremotesubscribe.php
index f9094a50cafa91fd2b240d3df930229d9f7471e8..acfacbdc1c4c4582372ec5b5a480e57442975fe9 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)
@@ -277,7 +283,7 @@ class FinishremotesubscribeAction extends Action
         $fetcher = Auth_Yadis_Yadis::getHTTPFetcher();
         $result = $fetcher->post($req->get_normalized_http_url(),
                                  $req->to_postdata(),
-                                 array('User-Agent' => 'Laconica/' . LACONICA_VERSION));
+                                 array('User-AgentLaconica/' . LACONICA_VERSION));
 
         common_debug('got result: "'.print_r($result,true).'"', __FILE__);