Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 22 additions & 21 deletions ping.pl
Original file line number Diff line number Diff line change
Expand Up @@ -108,30 +108,31 @@
# a pair of double-quotes means "ditto", and acts as if we entered
# the last thing that was in our TagTime log file.

$resp = $last_doing;
}

# refetch the task numbers from task file; they may have changed.
if(-e $tskf) {
if(open(F, "<$tskf")) {
%tags = (); # empty the hash first.
while(<F>) {
if(/^\-{4,}/ || /^x\s/i) { last; }
if(/^(\d+)\s+\S/) { $tags{$1} = gettags($_); }
$tagstr = $last_doing;
$comments = "";
} else {
# refetch the task numbers from task file; they may have changed.
if(-e $tskf) {
if(open(F, "<$tskf")) {
%tags = (); # empty the hash first.
while(<F>) {
if(/^\-{4,}/ || /^x\s/i) { last; }
if(/^(\d+)\s+\S/) { $tags{$1} = gettags($_); }
}
close(F);
} else {
print "ERROR: Can't read task file ($tskf) again\n";
$eflag++;
}
close(F);
} else {
print "ERROR: Can't read task file ($tskf) again\n";
$eflag++;
}
}

$tagstr = trim(strip($resp));
$comments = trim(stripc($resp));
$tagstr =~ s/\b(\d+)\b/($tags{$1} eq "" ? "$1" : "$1 ").$tags{$1}/eg;
$tagstr =~ s/\b(\d+)\b/tsk $1/;
$tagstr .= $autotags;
$tagstr =~ s/\s+/\ /g;
$tagstr = trim(strip($resp));
$comments = trim(stripc($resp));
$tagstr =~ s/\b(\d+)\b/($tags{$1} eq "" ? "$1" : "$1 ").$tags{$1}/eg;
$tagstr =~ s/\b(\d+)\b/tsk $1/;
$tagstr .= $autotags;
$tagstr =~ s/\s+/\ /g;
}
$a = annotime("$t $tagstr $comments", $t)."\n";
} while($tagstr ne "" &&
($enforcenums && ($tagstr !~ /\b(\d+|non|afk)\b/) ||
Expand Down