From 3680a37aaaf9fd7eff8d38e09ab2e845254c4f41 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sat, 31 Jan 2026 22:39:28 +0100 Subject: [PATCH] Only connect to newsserver if there are approved posts. Signed-off-by: Thomas Hochstein --- ChangeLog | 1 + bin/poster.pl | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a813cd9..26759d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ huhu 0.11.0 (unreleased) * Add shell to new huhu mod users. * Add wrapper script for read-mail.pl * Drop more headers. +* Only connect to newsserver if there are approved posts. huhu 0.10 (unknown) * huhu reports version 0.09 (from MOD/Displaylib.pm), but has code diff --git a/bin/poster.pl b/bin/poster.pl index 6088024..bc03158 100755 --- a/bin/poster.pl +++ b/bin/poster.pl @@ -110,7 +110,6 @@ if ($sign_pgpmoose && DEBUG > 1) print "News::Article::sign_pgpmoose enabled.\n"; } -my Net::NNTP $nntp = connect_nntp(\%config); my $dbi = MOD::DBIUtils->new(\%config) || die "Can't connect to database"; @@ -118,6 +117,9 @@ my $dbi = MOD::DBIUtils->new(\%config) || # i.e. all posts in the state 'moderated'. my $dataref = $dbi->select_unposted(); +# Only connect to newsserver if there are approved posts +my Net::NNTP $nntp = connect_nntp(\%config) if $dataref->rows; + #Schleife ueber alle selektierten Postings #Einlesen des Postings, Header anpassen,anschliessend posten #und das das posted-Bit in der Datenbank setzen.