Provides an interface for filtering messages. More...
Inherited by IrcQmlFilter, and IrcQmlFilter.
Public Member Functions | |
virtual | ~IrcMessageFilter () |
virtual bool | messageFilter (IrcMessage *message)=0 |
IrcMessageFilter may be used to intercept messages before IrcConnection::messageReceived() is emitted and the messages get delivered further. In order to use IrcMessageFilter, it must be installed via IrcConnection::installMessageFilter().
Message filtering is mostly useful for handling specific replies before the rest of the application receives it. This way there is no need to for example ignore and hide such replies later in the application code.
The following example sends a PING command after each PRIVMSG command. A consequent PONG reply from the server verifies that the PRIVMSG has been also processed.
|
inlinevirtual |
Destructs the message filter.
The message filter is automatically removed from any connection(s) it is installed on.
|
pure virtual |
Reimplement this function to filter messages from installed connections.
Return true
to filter the message out, i.e. stop it being handled further; otherwise return false
.