diff --git a/lib/App/Controller/Apiv1.pm b/lib/App/Controller/Apiv1.pm index eaa3ba6..cf9009c 100644 --- a/lib/App/Controller/Apiv1.pm +++ b/lib/App/Controller/Apiv1.pm @@ -74,7 +74,7 @@ sub api_post_paste { }); if ($c->param('redirect')) { - $c->redirect_to("/pastebin/$id"); + $c->redirect_to("/p/$id"); } }; diff --git a/lib/App/Controller/Paste.pm b/lib/App/Controller/Paste.pm index 6deec3e..e022319 100644 --- a/lib/App/Controller/Paste.pm +++ b/lib/App/Controller/Paste.pm @@ -21,7 +21,6 @@ sub routes { $route->(get => '/edit' => 'to_root'); $route->(get => '/' => 'root'); - $route->(post => '/paste' => 'post_paste'); $route->(get => '/edit/:pasteid' => 'edit_paste'); $route->(get => '/raw/:pasteid' => 'raw_paste'); $route->(get => '/pastebin/:pasteid' => 'get_paste'); @@ -42,31 +41,6 @@ sub root { $c->render("page"); }; -sub post_paste { - my $c = shift; - - my @args = map {($c->param($_))} qw/paste name desc chan expire language/; - - my $id = $c->paste->insert_pastebin(@args); - my ($code, $who, $desc, $channel) = @args; - - # TODO select which one based on config -# TODO make this use the config, or http params for the url - -# FIXME do this properly -# if (my $type = App::Spamfilter::is_spam($c, $who, $desc, $code)) { -# warn "I thought this was spam! $type"; - if ($channel) { # TODO config for allowing announcements - my $words = qr/nigger|jew|spic|tranny|trannies|fuck|shit|piss|cunt|asshole/i; - unless ($code =~ $words || $who =~ $words || $desc =~ $words) { - $c->perlbot->announce($channel, $who, substr($desc, 0, 40), "https://perlbot.pl/pastebin/$id"); - } - } - - $c->redirect_to('/pastebin/'.$id); - #$c->render(text => "post accepted! $id"); -}; - sub edit_paste { my $c = shift;