aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2012-04-08 23:20:31 +0200
committerKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2012-04-09 21:22:09 +0200
commit1f9fe8b5eeebfb6bc1275cba7dbb4daac1a2e910 (patch)
tree422051d2f57a2fb1be7be3cac9fef274d062d819 /include
parent93ffba58cc10fc793821ba16de88cdfb271ea5b8 (diff)
downloadvolse-hubzilla-1f9fe8b5eeebfb6bc1275cba7dbb4daac1a2e910.tar.gz
volse-hubzilla-1f9fe8b5eeebfb6bc1275cba7dbb4daac1a2e910.tar.bz2
volse-hubzilla-1f9fe8b5eeebfb6bc1275cba7dbb4daac1a2e910.zip
Remove Gravatar from core and add new hook avatar_lookup.
This patch removes all occurances of Gravatar from friendica's core and adds a new hook "avatar_lookup" inside the function avatar_img($email) where the new *avatar-plugins should hook in. I haven't touched the language files yet. Are they updated automatically somehow?
Diffstat (limited to 'include')
-rw-r--r--include/network.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/include/network.php b/include/network.php
index 59705634b..58cef4756 100644
--- a/include/network.php
+++ b/include/network.php
@@ -694,16 +694,14 @@ function allowed_email($email) {
if(! function_exists('avatar_img')) {
function avatar_img($email) {
- $size = 175;
- $opt = 'identicon'; // psuedo-random geometric pattern if not found
- $rating = 'pg';
- $hash = md5(trim(strtolower($email)));
+ $avatar['size'] = 175;
+ $avatar['email'] = $email;
+ $avatar['url'] = '';
- $url = 'http://www.gravatar.com/avatar/' . $hash . '.jpg'
- . '?s=' . $size . '&d=' . $opt . '&r=' . $rating;
+ call_hooks('avatar_lookup', $avatar);
- logger('gravatar: ' . $email . ' ' . $url);
- return $url;
+ logger('Avatar: ' . $avatar['email'] . ' ' . $avatar['url']);
+ return $avatar['url'];
}}