From: Francois Marier Date: Sun, 27 Mar 2011 03:22:49 +0000 (+1300) Subject: comments: add OpenID-based avatars (libravatar.org) X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e2e1b1cd20928e2b80871e5daffaea60738d054e;p=ikiwiki.git comments: add OpenID-based avatars (libravatar.org) This requires version 1.04 or later of Libravatar::URL. --- diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 2f2a515b9..bccb977e3 100755 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -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}); } }