Is there anyway to make the actionHandlers case insensitive? So $irc->registerActionhandler(SMARTIRC_TYPE_CHANNEL, '!op*', $bot, 'op'); would catch !op, !Op, !oP, !OP ? Or is it in the manual and I am just too blind to see it at 1am?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There you see examples like this: "/php/i" would match PHP and php and Php, whatever... its case insensitive, but you probably noticed the slashes, there I ran into problems with SmatIRC....
because those slashes are automaticly added by SmartIRC, so you can't put anything after the slash...
In your case the final regex looks like: "/!op*/"
So a fix woukd be to remove those automaticly added slashes, but then most scripts would be broken, because they are needed....
but I could check if the given regex contains slashes, then I just use it as it is without adding anything... that would work..
I will change that soon in the CVS version...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
replacing SmartIRC.php, SmartIRC/defines.php and SmartIRC/messagehandler.php is enough...
so if you want case insensitive comparinson use this as regex for the actionhandler: /^!op/i
that means, !op has to be at the beginning of the message (^) and the comparison is done case insensitive (/i)
so !op !oP !OP !Op would work...
please tell me the results...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-05-05
With the latest SmartIRC.php from CVS it appears to be working perfectly
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there anyway to make the actionHandlers case insensitive? So $irc->registerActionhandler(SMARTIRC_TYPE_CHANNEL, '!op*', $bot, 'op'); would catch !op, !Op, !oP, !OP ? Or is it in the manual and I am just too blind to see it at 1am?
that is a regex, to be more accurate a preg_match() (see http://www.php.net/manual/en/function.preg-match.php\)
There you see examples like this: "/php/i" would match PHP and php and Php, whatever... its case insensitive, but you probably noticed the slashes, there I ran into problems with SmatIRC....
because those slashes are automaticly added by SmartIRC, so you can't put anything after the slash...
In your case the final regex looks like: "/!op*/"
So a fix woukd be to remove those automaticly added slashes, but then most scripts would be broken, because they are needed....
but I could check if the given regex contains slashes, then I just use it as it is without adding anything... that would work..
I will change that soon in the CVS version...
I am also interested about this. So I will be happy to see a fix. Where can the CVS be found for this project?
it's now in CVS, you can get the latest version from:
http://cvs.php.net/cvs.php/pear/Net_SmartIRC
replacing SmartIRC.php, SmartIRC/defines.php and SmartIRC/messagehandler.php is enough...
so if you want case insensitive comparinson use this as regex for the actionhandler: /^!op/i
that means, !op has to be at the beginning of the message (^) and the comparison is done case insensitive (/i)
so !op !oP !OP !Op would work...
please tell me the results...
With the latest SmartIRC.php from CVS it appears to be working perfectly
nice to hear that... probably 0.6.0 the next release will include it....