Clean up some stuff
This commit is contained in:
parent
32fb9d0268
commit
246001b242
|
@ -85,7 +85,6 @@ any [qw{GET POST}], '/sign' => sub ($c) {
|
|||
$c->stash(status => 400)
|
||||
}
|
||||
else {
|
||||
my $new_message_id =
|
||||
$c->message->create_post($name, $message, $url, $spam);
|
||||
|
||||
if ($spam) {
|
||||
|
@ -93,7 +92,9 @@ any [qw{GET POST}], '/sign' => sub ($c) {
|
|||
}
|
||||
# Send this notification if there's a Webhook URL
|
||||
elsif (app->mode() eq 'production' && -s '.tom.url') {
|
||||
my ($url_file, $url, $webhook);
|
||||
my ($new_message_id, $url_file, $url, $webhook);
|
||||
|
||||
$new_message_id = $c->message->get_last_message_id();
|
||||
|
||||
open($url_file, '.tom.url') || die "$@";
|
||||
chomp($url = <$url_file>);
|
||||
|
|
|
@ -76,8 +76,6 @@ sub get_spam($self, $this_page = undef) {
|
|||
}
|
||||
|
||||
sub create_post($self, $name, $message, $url = undef, $spam = 1) {
|
||||
my $message_id = $self->get_last_message_id();
|
||||
|
||||
if ($url) {
|
||||
$self->pg->db->query(<<~'END_SQL', $name, $message, $url, $spam)
|
||||
INSERT INTO messages (visitor_name, message, homepage_url, is_spam)
|
||||
|
@ -90,8 +88,6 @@ sub create_post($self, $name, $message, $url = undef, $spam = 1) {
|
|||
VALUES (?, ?, ?);
|
||||
END_SQL
|
||||
}
|
||||
|
||||
++$message_id;
|
||||
}
|
||||
|
||||
sub max_posts($self, $value = undef) {
|
||||
|
|
Loading…
Reference in a new issue