]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #2416. Twitter API pulls in avatars from twitter for new users.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 17 Mar 2011 01:33:55 +0000 (01:33 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 17 Mar 2011 01:33:55 +0000 (01:33 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8743 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/twitter_api/lib/twitter_api.php

index c7c31c76db24506a04b031c440ee5028f9bf8999..167dbe0f504747bb5796c4ccacf6505546b05c75 100644 (file)
@@ -178,6 +178,14 @@ function twitter_api_login() {
  * @param unknown_type $file_location
  */
 function twitter_api_update_user_avatar($user, $file_location) {
+       // twitter's images have a few suffixes:
+       // _normal
+       // _resonably_small
+       // _mini
+       // the twitter app here returns _normal.  We want standard, so remove the suffix.
+       // @todo Should probably check that it's an image file.
+       $file_location = str_replace('_normal.jpg', '.jpg', $file_location);
+
        $sizes = array(
                'topbar' => array(16, 16, TRUE),
                'tiny' => array(25, 25, TRUE),
@@ -202,6 +210,9 @@ function twitter_api_update_user_avatar($user, $file_location) {
                $filehandler->write($image);
                $filehandler->close();
        }
+       
+       // update user's icontime
+       $user->icontime = time();
 
        return TRUE;
 }