summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorFrancois Marier <francois@debian.org>2011-03-27 16:22:49 +1300
committerFrancois Marier <francois@debian.org>2011-03-30 20:59:18 +1300
commite2e1b1cd20928e2b80871e5daffaea60738d054e (patch)
treec148d41f77c4cf4a6e0f9c6f978a1c9fbd5e191a /IkiWiki
parent83056abb8788e55041f2ea535236afd20736a659 (diff)
comments: add OpenID-based avatars (libravatar.org)
This requires version 1.04 or later of Libravatar::URL.
Diffstat (limited to 'IkiWiki')
-rwxr-xr-xIkiWiki/Plugin/comments.pm7
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});
}
}