comments: add OpenID-based avatars (libravatar.org)

This requires version 1.04 or later of Libravatar::URL.
master
Francois Marier 2011-03-27 16:22:49 +13:00
parent 83056abb87
commit e2e1b1cd20
1 changed files with 4 additions and 3 deletions

View File

@ -192,9 +192,10 @@ sub preprocess {
eval 'use Libravatar::URL';
if (! $@) {
my $email = IkiWiki::userinfo_get($commentuser, 'email');
if (defined $email) {
if (defined $commentopenid) {
$commentauthoravatar = libravatar_url(openid => $commentopenid, https => $ENV{HTTPS});
}
elsif (my $email = IkiWiki::userinfo_get($commentuser, 'email')) {
$commentauthoravatar = libravatar_url(email => $email, https => $ENV{HTTPS});
}
}