SourceForge Logo


Boucherot::signal - XChat-like signal handling for Boucherot project.


  use Boucherot::signal;

  # Notice that using this without Boucherot running is useless.


Implement the XChat-like signal handling.


package Boucherot::signal


 -$ handlers : [ handler1 : Boucherot::Handler, ... ] : Array


 +$ reset_handlers( handler1 : Boucherot::Handler, ... ) :
 +$ add_handlers( handler1 : Boucherot::Handler, ... ) : 
 +$ EMIT_SIGNAL( signal : SCALAR, session : SCALAR, ... ) :
 -$ quote ( string : SCALAR ) : SCALAR



 +$ reset_handlers( handler1 : Boucherot::Handler, ... ) :

Reset the handlers for the signal management.

Once this function has been called, all the EMIT_SIGNAL calls will call the execute_print_handler on those handlers.


 +$ add_handlers( handler1 : Boucherot::Handler, ... ) :

Add some new handlers to the existing ones for the signal management.


 +$ EMIT_SIGNAL( signal : SCALAR, session : SCALAR, ... ) :

Emit a signal. A signal is something that broadcast over the whole Boucherot engine a ``signal''. A signal is usually something that generate a log line into the channels.

If someone is speaking into #channel, this will create a XP_TE_CHANMSG signal. This is a signal event. This will also create a message event PRIVMSG. So what is the difference, and why having two methods for the same thing ?

First, as long as XChat Perl API can accept both, Boucherot should accept both if Boucherot wants to emulate XChat Perl API.

But... There are small difference. Some messages won't create a signal. For exemple unknow server messages, or PING/PONG message from server or even 353 (the user list of a channel). There are also some signal that ARE NOT generated by a message. Like BP_TE_OPENDIALOG (when a new dialog is opening) or any DCC signal.

Notice that if User1 give voice to User2 User3 User4 in the same time, this will create 1 message :User1! MODE #channel +vvv u2 u3 u4 but 3 signals XP_TE_CHANVOICE.


 -$ quote ( string : SCALAR ) : SCALAR

Quote a string. A sting like this:

'Hey, what's "doga" ? /\'

will look like:

'Hey, what\'s \"doga\" ? /\\'

Char like 0x02 0x03 and 0x17 are will be transformed into \002 \003 \017.


This class was written by Arthibus Gissehel <> in 2000.


This class is part of the Boucherot project.

The EMIT_SIGNAL idea comes from the XChat project. So please notice that those data are ``Copyright (c) 1998-2000 By Peter Zelezny.'' (see XChat project for more informations about Copyright).