From: dms Date: Wed, 31 Jan 2001 13:18:20 +0000 (+0000) Subject: added 'identify [nick]' X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3ec7d692f53e712dd2782c1576695517bf6ef8e0;p=infobot.git added 'identify [nick]' git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@283 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/src/Process.pl b/src/Process.pl index f891f44..4d2423c 100644 --- a/src/Process.pl +++ b/src/Process.pl @@ -107,6 +107,37 @@ sub process { return if ($retval eq $noreply); } + # 'identify' + if ($msgType =~ /private/ and $message =~ s/^identify//) { + $message =~ s/^\s+|\s+$//g; + my @array = split / /, $message; + + if ($who =~ /^_default$/i) { + &pSReply("you are too eleet."); + return; + } + + if (!scalar @array or scalar @array > 2) { + &help("identify"); + return; + } + + my $do_nick = $array[1] || $who; + + if (!exists $users{$do_nick}) { + &pSReply("nick $do_nick is not in user list."); + return; + } + + my $mask = "*!$user@".&makeHostMask($host); + ### TODO: prevent adding multiple dupe masks? + ### TODO: make &addHostMask() CMD? + &pSReply("Added $mask for $do_nick..."); + $users{$do_nick}{HOSTS}{$mask} = 1; + + return; + } + ### # once useless messages have been parsed out, we match them. ###