diff --git a/PBot/FactoidCommands.pm b/PBot/FactoidCommands.pm index 10bc39b9..ee402df8 100644 --- a/PBot/FactoidCommands.pm +++ b/PBot/FactoidCommands.pm @@ -282,7 +282,7 @@ sub factadd { $self->{pbot}->factoids->add_factoid('text', $from_chan, $nick, $keyword, $text); $self->{pbot}->logger->log("$nick!$user\@$host added [$from_chan] $keyword => $text\n"); - return "/msg $nick '$keyword' added to " . ($from_chan eq '.*' ? 'default channel' : $from_chan) . "."; + return "/msg $nick '$keyword' added to " . ($from_chan eq '.*' ? 'global channel' : $from_chan) . "."; } sub factrem { @@ -314,7 +314,7 @@ sub factrem { $self->{pbot}->logger->log("$nick!$user\@$host removed [$channel][$trigger][" . $factoids->{$channel}->{$trigger}->{action} . "]\n"); $self->{pbot}->factoids->remove_factoid($channel, $trigger); - return "/msg $nick $trigger removed from " . ($channel eq '.*' ? 'default channel' : $channel) . "."; + return "/msg $nick $trigger removed from " . ($channel eq '.*' ? 'global channel' : $channel) . "."; } sub histogram { @@ -388,7 +388,7 @@ sub factinfo { my $created_ago = ago(gettimeofday - $factoids->{$channel}->{$trigger}->{created_on}); my $ref_ago = ago(gettimeofday - $factoids->{$channel}->{$trigger}->{last_referenced_on}) if defined $factoids->{$channel}->{$trigger}->{last_referenced_on}; - $chan = ($channel eq '.*' ? 'default channel' : $channel); + $chan = ($channel eq '.*' ? 'global channel' : $channel); # factoid if($factoids->{$channel}->{$trigger}->{type} eq 'text') { @@ -554,7 +554,7 @@ sub factfind { $i++; if($chan ne $last_chan) { - $text .= $chan eq '.*' ? "[default channel] " : "[$chan] "; + $text .= $chan eq '.*' ? "[global channel] " : "[$chan] "; $last_chan = $chan; } $text .= "$trigger "; @@ -569,11 +569,11 @@ sub factfind { if($i == 1) { chop $text; - return "found one factoid submitted for " . ($last_chan eq '.*' ? 'default channel' : $last_chan) . " " . $argtype . ": '$last_trigger' is '" . $factoids->{$last_chan}->{$last_trigger}->{action} . "'"; + return "found one factoid submitted for " . ($last_chan eq '.*' ? 'global channel' : $last_chan) . " " . $argtype . ": '$last_trigger' is '" . $factoids->{$last_chan}->{$last_trigger}->{action} . "'"; } else { return "$i factoids " . $argtype . ": $text" unless $i == 0; - my $chans = (defined $channel ? ($channel eq '.*' ? 'default channel' : $channel) : 'any channels'); + my $chans = (defined $channel ? ($channel eq '.*' ? 'global channel' : $channel) : 'any channels'); return "No factoids " . $argtype . " submitted for $chans"; } } diff --git a/PBot/Factoids.pm b/PBot/Factoids.pm index 28a872e8..6796e17b 100644 --- a/PBot/Factoids.pm +++ b/PBot/Factoids.pm @@ -120,13 +120,14 @@ sub export_factoids { open FILE, "> $filename" or return "Could not open export path."; my $time = localtime; - print FILE "Generated at $time

Candide's factoids:


\n"; + print FILE "Last updated at $time\n"; + print FILE "

Candide's factoids:


\n"; my $i = 0; foreach my $channel (sort keys %{ $self->factoids->hash }) { - my $chan = $channel eq '.*' ? 'any' : $channel; - print FILE "
\nChannel $chan\n
\n"; + my $chan = $channel eq '.*' ? 'Global channel' : "Channel $channel"; + print FILE "
\n$chan\n
\n"; print FILE "\n"; foreach my $trigger (sort keys %{ $self->factoids->hash->{$channel} }) { if($self->factoids->hash->{$channel}->{$trigger}->{type} eq 'text') { @@ -139,13 +140,14 @@ sub export_factoids { print FILE "\n"; - print FILE "\n\n"; + print FILE "\n\n"; } } print FILE "
$trigger is " . encode_entities($self->factoids->hash->{$channel}->{$trigger}->{action}) . "- submitted by
" . $self->factoids->hash->{$channel}->{$trigger}->{owner} . "
" . localtime($self->factoids->hash->{$channel}->{$trigger}->{created_on}) . "\n
- submitted by " . $self->factoids->hash->{$channel}->{$trigger}->{owner} . "
" . localtime($self->factoids->hash->{$channel}->{$trigger}->{created_on}) . "\n
\n"; } print FILE "
$i factoids memorized.
"; + print FILE "
Last updated at $time\n"; close(FILE); diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index ee489201..30f240f6 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,7 +13,7 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 212, + BUILD_REVISION => 213, BUILD_DATE => "2010-06-28", }; diff --git a/data/factoids b/data/factoids index 6ead1d28..d78f9fa5 100644 --- a/data/factoids +++ b/data/factoids @@ -1,4 +1,3 @@ -[] [##c] action: /say A test in ##c! @@ -23,7 +22,6 @@ ref_count: 2 ref_user: pragma_ type: text -[#botters] [#pbot2] action: /say This is a test in #pbot2! @@ -10581,6 +10579,3 @@ ref_count: 9 ref_user: pragma_ type: text -[dave0] -[poppavic] -[pragma_]