Commit e227e5d6 authored by Mario's avatar Mario Committed by Mario

provide prebuilt grayscale kitties for default_profile_photo()


(cherry picked from commit 2c060a23)
parent dad1fea5
a temp folder for cached avatar generation
......@@ -10,17 +10,17 @@
function cavatar_load() {
\Zotlabs\Extend\Hook::register('create_channel_photo', 'addon/cavatar/cavatar.php', 'cavatar_channel_photo');
// \Zotlabs\Extend\Hook::register('default_profile_photo', 'addon/cavatar/cavatar.php', 'cavatar_default_profile_photo');
// $old = get_config('system','default_profile_photo',EMPTY_STR);
// if($old !== 'cavatar') {
// set_config('cavatar','original_profile_photo',$old);
// }
// set_config('system','default_profile_photo','cavatar');
\Zotlabs\Extend\Hook::register('default_profile_photo', 'addon/cavatar/cavatar.php', 'cavatar_default_profile_photo');
$old = get_config('system','default_profile_photo',EMPTY_STR);
if($old !== 'cavatar') {
set_config('cavatar','original_profile_photo',$old);
}
set_config('system','default_profile_photo','cavatar');
}
function cavatar_unload() {
\Zotlabs\Extend\Hook::unregister('create_channel_photo', 'addon/cavatar/cavatar.php', 'cavatar_channel_photo');
// \Zotlabs\Extend\Hook::unregister('default_profile_photo', 'addon/cavatar/cavatar.php', 'cavatar_default_profile_photo');
\Zotlabs\Extend\Hook::unregister('default_profile_photo', 'addon/cavatar/cavatar.php', 'cavatar_default_profile_photo');
set_config('system','default_profile_photo',get_config('cavatar','original_profile_photo',EMPTY_STR));
}
......@@ -33,7 +33,8 @@ function cavatar_channel_photo(&$x) {
function cavatar_default_profile_photo(&$x) {
if($x['scheme'] === 'cavatar') {
$x['url'] = 'cavatar?f=&seed=' . random_string(14) . '&size=' . $x['size'];
//$x['url'] = 'cavatar?f=&seed=' . random_string(14) . '&size=' . $x['size'];
$x['url'] = 'addon/cavatar/cache/cavatar-' . $x['size'] . '.png';
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment