Content deleted Content added
Updating published sources: OrphanReferenceFixer: * When scanning old revisions, don't throw errors when RevDel was used SourceUploader: * $api->warn, not $self->warn |
Updating published sources: SourceUploader: * Redirect all shutoff talk pages to the main talk page, they're unwatched otherwise. |
||
Line 329:
} else {
$api->log("Created $page");
}
}
my $tpage=$page;
$tpage=~s/^User:/User talk:/;
my $txt=$tpage;
$txt=~s!^(User talk:[^/]+)/.*!#REDIRECT [[$1]]\n\nThis page is unwatched. Please direct comments to [[$1]].!;
$tok=$api->edittoken($tpage);
if($tok->{'code'} eq 'shutoff'){
$api->warn("Task disabled: ".$tok->{'content'}."\n");
return 300;
}
return 60 if($tok->{'code'} ne 'success');
if(($tok->{'revisions'}[0]{'*'} // '') ne $txt){
my $r=$api->edit($tok, $txt, 'Redirect useless unwatched talk page to someplace useful.', 1, 1);
if($r->{'code'} ne 'success'){
$api->warn("Write error for $tpage: ".$r->{'error'}."\n");
return 60;
} else {
$api->log("Created $tpage");
}
}
|