mirror of
https://github.com/perlbot/perlbuut-pastebin
synced 2025-06-07 22:26:01 -04:00
More fixes. Brought announcement back hopefully
This commit is contained in:
parent
ccb4e90463
commit
b86769b4bd
2 changed files with 7 additions and 7 deletions
|
@ -34,7 +34,7 @@ sub api_get_paste {
|
||||||
username => $row->{who},
|
username => $row->{who},
|
||||||
description => $row->{desc},
|
description => $row->{desc},
|
||||||
language => $row->{language},
|
language => $row->{language},
|
||||||
output => get_eval($pasteid, $row->{paste})
|
output => $c->eval->get_eval($pasteid, $row->{paste}, $row->{language})
|
||||||
};
|
};
|
||||||
|
|
||||||
$c->render(json => $data);
|
$c->render(json => $data);
|
||||||
|
@ -61,9 +61,9 @@ sub api_post_paste {
|
||||||
# if (my $type = App::Spamfilter::is_spam($c, $who, $desc, $code)) {
|
# if (my $type = App::Spamfilter::is_spam($c, $who, $desc, $code)) {
|
||||||
# warn "I thought this was spam! $type";
|
# warn "I thought this was spam! $type";
|
||||||
# } else {
|
# } else {
|
||||||
# if ($channel) { # TODO config for allowing announcements
|
if ($channel) { # TODO config for allowing announcements
|
||||||
# IRC::Perlbot::announce($channel, $who, substr($desc, 0, 40), "https://perlbot.pl/pastebin/$id");
|
$c->perlbot->announce($channel, $who, substr($desc, 0, 40), "https://perlbot.pl/pastebin/$id");
|
||||||
## }
|
}
|
||||||
# }
|
# }
|
||||||
|
|
||||||
$c->render(json => {
|
$c->render(json => {
|
||||||
|
|
|
@ -53,9 +53,9 @@ sub post_paste {
|
||||||
# FIXME do this properly
|
# FIXME do this properly
|
||||||
# if (my $type = App::Spamfilter::is_spam($c, $who, $desc, $code)) {
|
# if (my $type = App::Spamfilter::is_spam($c, $who, $desc, $code)) {
|
||||||
# warn "I thought this was spam! $type";
|
# warn "I thought this was spam! $type";
|
||||||
# } else {
|
if ($channel) { # TODO config for allowing announcements
|
||||||
# IRC::Perlbot::announce($c->param('chan'), $c->param('name'), substr($c->param('desc'), 0, 40), "https://perlbot.pl/pastebin/$id");
|
$c->perlbot->announce($channel, $who, substr($desc, 0, 40), "https://perlbot.pl/pastebin/$id");
|
||||||
# }
|
}
|
||||||
|
|
||||||
$c->redirect_to('/pastebin/'.$id);
|
$c->redirect_to('/pastebin/'.$id);
|
||||||
#$c->render(text => "post accepted! $id");
|
#$c->render(text => "post accepted! $id");
|
||||||
|
|
Loading…
Add table
Reference in a new issue