From e2e1b1cd20928e2b80871e5daffaea60738d054e Mon Sep 17 00:00:00 2001 From: Francois Marier Date: Sun, 27 Mar 2011 16:22:49 +1300 Subject: comments: add OpenID-based avatars (libravatar.org) This requires version 1.04 or later of Libravatar::URL. --- IkiWiki/Plugin/comments.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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}); } } -- cgit v1.2.3