### COMMAND HOOK IMPLEMENTATION.
# addCmdHook("SECTION", 'TEXT_HOOK',
-# (CODEREF => 'Blah',
+# (CODEREF => 'Blah',
# Forker => 1,
# CheckModule => 1, # ???
# Module => 'blah.pl' # preload module.
# RUN IF ADDRESSED.
sub parseCmdHook {
my ($hashname, $line) = @_;
- $line =~ /^(\S+)( (.*))?$/;
+ $line =~ s/^\s+|\s+$//g; # again.
+ $line =~ /^(\S+)(\s+(.*))?$/;
my $cmd = $1; # command name is whitespaceless.
my $flatarg = $3;
my @args = split(/\s+/, $flatarg || '');
next;
}
- &status("hooks($hashname): $cmd matched '$ident'");
+ &status("hooks($hashname): $cmd matched '$ident' '$flatarg'");
my %hash = %{ ${"hooks_$hashname"}{$ident} };
if (!scalar keys %hash) {
'Forker' => 1, 'Identifier' => 'kernel',
'Cmdstats' => 'Kernel', 'NoArgs' => 1) );
&addCmdHook("extra", 'listauth', ('CODEREF' => 'CmdListAuth',
- 'Identifier' => 'search', Module => 'factoids',
+ 'Identifier' => 'search', Module => 'factoids',
'Help' => 'listauth') );
&addCmdHook("extra", 'quote', ('CODEREF' => 'Quote::Quote',
'Forker' => 1, 'Identifier' => 'quote',
'Forker' => 1) );
&addCmdHook("extra", '(botmail|message)', ('CODEREF' => 'botmail::parse',
'Identifier' => 'botmail', 'Cmdstats' => 'botmail') );
+&addCmdHook("extra", 'httpdtype', ('CODEREF' => 'HTTPDtype::HTTPDtype',
+ 'Identifier' => 'httpdtype', 'Cmdstats' => 'httpdtype',
+ 'Forker' => 1) );
###
### END OF ADDING HOOKS.
return;
}
- my $debiancmd = 'conflicts?|depends?|desc|file|info|provides?';
+ my $debiancmd = 'conflicts?|depends?|desc|file|(?:d)?info|provides?';
$debiancmd .= '|recommends?|suggests?|maint|maintainer';
if ($message =~ /^($debiancmd)(\s+(.*))?$/i) {
}
# google searching. Simon++
- if ($message =~ /^(?:search\s+)?($w3search_regex)\s+for\s+['"]?(.*?)["']?\s*\?*$/i) {
+ if ($message =~ /^(?:search\s+)?($w3search_regex)\s+(?:for\s+)?['"]?(.*?)["']?\s*\?*$/i) {
return unless (&hasParam("wwwsearch"));
&Forker("wwwsearch", sub { &W3Search::W3Search($1,$2); } );
$reply .= " (".&Time2String(time() - $userstats{lc $seen[0]}{'Join'}).")";
}
- if (&IsParam("seenStats")) {
+ if (&IsChanConf("seenStats") > 0) {
my $i;
$i = $userstats{lc $seen[0]}{'Count'};
$reply .= ". Has said a total of \002$i\002 messages" if (defined $i);