]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/recentchanges.pm
openid: Fix handling of utf-8 nicknames.
[ikiwiki.git] / IkiWiki / Plugin / recentchanges.pm
index 7eba931be537be30790b094598c16536aa42a15f..758b98348d126aa572a537f9f0b359e5baffbb5e 100644 (file)
@@ -11,8 +11,6 @@ sub import {
        hook(type => "getsetup", id => "recentchanges", call => \&getsetup);
        hook(type => "checkconfig", id => "recentchanges", call => \&checkconfig);
        hook(type => "refresh", id => "recentchanges", call => \&refresh);
-       hook(type => "pageactions", id => "recentchanges", call => \&pageactions,
-               first => 1);
        hook(type => "pagetemplate", id => "recentchanges", call => \&pagetemplate);
        hook(type => "htmlize", id => "_change", call => \&htmlize);
        # Load goto to fix up links from recentchanges
@@ -62,20 +60,7 @@ sub refresh ($) {
        }
 }
 
-# Enable the recentchanges link on wiki pages.
-sub pageactions (@) {
-       my %params=@_;
-       my $page=$params{page};
-
-       if (defined $config{recentchangespage} && $config{rcs} &&
-           $page ne $config{recentchangespage}) {
-               return htmllink($page, $page, $config{recentchangespage},
-                       gettext("RecentChanges"));
-       }
-}
-
-# Backwards compatability for templates still using
-# RECENTCHANGESURL.
+# Enable the recentchanges link.
 sub pagetemplate (@) {
        my %params=@_;
        my $template=$params{template};
@@ -129,12 +114,11 @@ sub store ($$$) {
        ];
        push @{$change->{pages}}, { link => '...' } if $is_excess;
 
-       # See if the committer is an openid.
        $change->{author}=$change->{user};
        my $oiduser=eval { IkiWiki::openiduser($change->{user}) };
        if (defined $oiduser) {
                $change->{authorurl}=$change->{user};
-               $change->{user}=$oiduser;
+               $change->{user}=defined $change->{nickname} ? $change->{nickname} : $oiduser;
        }
        elsif (length $config{cgiurl}) {
                $change->{authorurl} = IkiWiki::cgiurl(