In VCS-committed anonymous comments, link to url.

master
Amitai Schlair 2015-01-07 16:19:58 -05:00
parent de2e3faece
commit 3a19663d48
1 changed files with 12 additions and 16 deletions

View File

@ -223,22 +223,9 @@ sub preprocess {
$commentauthor = gettext("Anonymous"); $commentauthor = gettext("Anonymous");
} }
$commentstate{$page}{commentuser} = $commentuser;
$commentstate{$page}{commentopenid} = $commentopenid;
$commentstate{$page}{commentip} = $commentip;
$commentstate{$page}{commentauthor} = $commentauthor;
$commentstate{$page}{commentauthorurl} = $commentauthorurl;
$commentstate{$page}{commentauthoravatar} = $params{avatar};
if (! defined $pagestate{$page}{meta}{author}) {
$pagestate{$page}{meta}{author} = $commentauthor;
}
if (! defined $pagestate{$page}{meta}{authorurl}) {
$pagestate{$page}{meta}{authorurl} = $commentauthorurl;
}
if ($config{comments_allowauthor}) { if ($config{comments_allowauthor}) {
if (defined $params{claimedauthor}) { if (defined $params{claimedauthor}) {
$pagestate{$page}{meta}{author} = $params{claimedauthor}; $commentauthor = $params{claimedauthor};
} }
if (defined $params{url}) { if (defined $params{url}) {
@ -250,12 +237,21 @@ sub preprocess {
} }
if (safeurl($url)) { if (safeurl($url)) {
$pagestate{$page}{meta}{authorurl} = $url; $commentauthorurl = $url;
} }
} }
} }
else {
$commentstate{$page}{commentuser} = $commentuser;
$commentstate{$page}{commentopenid} = $commentopenid;
$commentstate{$page}{commentip} = $commentip;
$commentstate{$page}{commentauthor} = $commentauthor;
$commentstate{$page}{commentauthorurl} = $commentauthorurl;
$commentstate{$page}{commentauthoravatar} = $params{avatar};
if (! defined $pagestate{$page}{meta}{author}) {
$pagestate{$page}{meta}{author} = $commentauthor; $pagestate{$page}{meta}{author} = $commentauthor;
}
if (! defined $pagestate{$page}{meta}{authorurl}) {
$pagestate{$page}{meta}{authorurl} = $commentauthorurl; $pagestate{$page}{meta}{authorurl} = $commentauthorurl;
} }