diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-17 01:33:55 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-17 01:33:55 +0000 |
commit | 5c19cb8ef65a8d3c07472240e2138ff8bb6c2431 (patch) | |
tree | d1b96e1459db92db2d4c2786ecb13a446c114b9c /mod/twitter_api/lib | |
parent | 0a6f7c1914cf78655d4700a84269faadf7ef69e3 (diff) | |
download | elgg-5c19cb8ef65a8d3c07472240e2138ff8bb6c2431.tar.gz elgg-5c19cb8ef65a8d3c07472240e2138ff8bb6c2431.tar.bz2 |
Fixes #2416. Twitter API pulls in avatars from twitter for new users.
git-svn-id: http://code.elgg.org/elgg/trunk@8743 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/twitter_api/lib')
-rw-r--r-- | mod/twitter_api/lib/twitter_api.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mod/twitter_api/lib/twitter_api.php b/mod/twitter_api/lib/twitter_api.php index c7c31c76d..167dbe0f5 100644 --- a/mod/twitter_api/lib/twitter_api.php +++ b/mod/twitter_api/lib/twitter_api.php @@ -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; } |