]> git.donarmstrong.com Git - infobot.git/commitdiff
closed 17554 -- re-add part/leave to DCC CHAT only
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sun, 20 Aug 2000 14:17:57 +0000 (14:17 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sun, 20 Aug 2000 14:17:57 +0000 (14:17 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@55 c11ca15a-4712-0410-83d8-924469b57eb5

src/Modules/UserDCC.pl

index 5bef15555390f301e0554c4b92722031fc0087f5..8478822fd93f99175d54dfe6a3aced67e556edea 100644 (file)
@@ -125,6 +125,27 @@ sub userDCC {
        return $noreply;
     }
 
+    # part.
+    if ($message =~ /^part(\s+(\S+))?$/i) {
+       return $noreply unless (&hasFlag("o"));
+       my $jchan = $2;
+
+       if ($jchan !~ /^$mask{chan}$/) {
+           &msg($who, "error, invalid chan.");
+           &help("part");
+           return $noreply;
+       }
+
+       if (!&validChan($jchan)) {
+           &msg($who, "error, I'm not on that chan.");
+           return $noreply;
+       }
+
+       &msg($jchan, "Leaving. (courtesy of $who).");
+       &part($jchan);
+       return $noreply;
+    }
+
     # ignore.
     if ($message =~ /^ignore(\s+(\S+))?$/i) {
        return $noreply unless (&hasFlag("o"));