Skip to content

Commit

Permalink
Cleaned up some debug output.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jul 20, 2009
1 parent 7a1e9f7 commit 204feac
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions archive_jabber.pl
Expand Up @@ -85,9 +85,10 @@ sub fail {
sub flush_startid {
my ($with, $msgid) = @_;
$startids{$with} = $msgid;
return 0 if (not open(LASTID,'>',$lastarchivetmpfname));
my $startval = 0;
$startval = $startid if (defined $startid);
dbgprint("flushing startids (global: $startval, '$with': $msgid)\n");
return 0 if (not open(LASTID,'>',$lastarchivetmpfname));
print LASTID "$startval\n";
foreach(keys %startids) {
my $key = $_;
Expand Down Expand Up @@ -214,10 +215,10 @@ sub signal_catcher {
$lastarchivefname = "$maildir/xmpp_last_archive_msgids.txt";
unlink($lastarchivefname) if ($redo);
if (open(LASTID,'<',$lastarchivefname)) {
my $totalid = <LASTID>;
chomp($totalid);
$startid = $totalid if ($totalid =~ /\A\d+\Z/);
dbgprint("startid (total) == $totalid\n");
my $globalid = <LASTID>;
chomp($globalid);
$startid = $globalid if ($globalid =~ /\A\d+\Z/);
dbgprint("startid (global) == $globalid\n");
while (not eof(LASTID)) {
my $user = <LASTID>;
chomp($user);
Expand Down Expand Up @@ -376,13 +377,7 @@ sub signal_catcher {
$sth->finish();
$link->disconnect();

if (defined $startid) {
dbgprint("Final startid is $startid\n");
} else {
$startid = $newestmsgid;
dbgprint("No definite global startid; using $startid\n");
}

$startid = $newestmsgid if (not defined $startid);
flush_conversation(0);

exit 0;
Expand Down

0 comments on commit 204feac

Please sign in to comment.