]> git.donarmstrong.com Git - infobot.git/commitdiff
don't drop part of message when no #channel
authortimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 6 Jan 2006 04:32:56 +0000 (04:32 +0000)
committertimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 6 Jan 2006 04:32:56 +0000 (04:32 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@1247 c11ca15a-4712-0410-83d8-924469b57eb5

src/Modules/OnJoin.pl

index 68389b5d995be2ac5bd0588adf8b2fed4fb612fb..5b3fbf6a6e47897d63c749c720754135b629b74c 100644 (file)
@@ -1,9 +1,9 @@
 #
 # OnJoin.pl: emit a message when a user enters the channel
 #    Author: Corey Edwards <tensai@zmonkey.org>
-#   Version: v0.2
+#   Version: v0.2.1
 #   Created: 20051222
-#   Updated: 20060102
+#   Updated: 20060105
 
 use strict;
 
@@ -34,7 +34,7 @@ sub onjoin {
 # set and get messages
 sub Cmdonjoin {
        $_ = shift;
-       m/(\S*)( (\S*)( (.*)|)|)/;
+       m/(\S*)(\s*(\S*)(\s*(.*)|)|)/;
        my $ch = $1;
        my $nick = $3;
        my $msg = $5;
@@ -45,7 +45,7 @@ sub Cmdonjoin {
 
        # see if they specified a channel
        if ($ch !~ m/^\#/ && $ch ne '_default'){
-               $msg = $nick;
+               $msg = $nick . ($msg ? " $msg" : '');
                $nick = $ch;
                $ch = $chan;
        }