diff options
author | Francois Marier <francois@debian.org> | 2011-03-27 16:22:49 +1300 |
---|---|---|
committer | Francois Marier <francois@debian.org> | 2011-03-30 20:59:18 +1300 |
commit | e2e1b1cd20928e2b80871e5daffaea60738d054e (patch) | |
tree | c148d41f77c4cf4a6e0f9c6f978a1c9fbd5e191a | |
parent | 83056abb8788e55041f2ea535236afd20736a659 (diff) |
comments: add OpenID-based avatars (libravatar.org)
This requires version 1.04 or later of Libravatar::URL.
-rwxr-xr-x | IkiWiki/Plugin/comments.pm | 7 |
1 files 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}); } } |