MessageFilter Class Reference

Virtual base class for message filters. More...

#include <messagefilter.h>

Inherited by ChatStateFilter, InBandBytestream, and MessageEventFilter.

Inheritance diagram for MessageFilter:

Inheritance graph
[legend]
Collaboration diagram for MessageFilter:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MessageFilter (MessageSession *parent)
virtual ~MessageFilter ()
virtual void attachTo (MessageSession *session)
virtual void decorate (Tag *tag)=0
virtual void filter (Stanza *stanza)=0

Protected Attributes

MessageSessionm_parent

Detailed Description

Virtual base class for message filters.

A message filter is fed with all messages passing through a MessageSession. It can modify the XML/XMPP structure and/or the message content at will. Messages arriving from the server as well as messages sent to the server can be altered.

Messages to be sent out are presented to the filter via the decorate() function, incoming messages can be filtered in the -- filter() method.

Author:
Jakob Schroeter <js@camaya.net>
Since:
0.8

Definition at line 38 of file messagefilter.h.


Constructor & Destructor Documentation

MessageFilter ( MessageSession parent  ) 

Constructor.

Parameters:
parent The MessageSession to attach to.

Definition at line 20 of file messagefilter.cpp.

~MessageFilter (  )  [virtual]

Virtual Destructor.

Definition at line 27 of file messagefilter.cpp.


Member Function Documentation

void attachTo ( MessageSession session  )  [virtual]

Attaches this MessageFilter to the given MessageSession and hooks it into the session's filter chain. If this filter was attached to a different MessageSession before, it is unregistered there prior to registering it with the new session.

Parameters:
session The MessageSession to hook into.

Definition at line 33 of file messagefilter.cpp.

Referenced by MessageFilter::MessageFilter().

virtual void decorate ( Tag tag  )  [pure virtual]

This function receives a message right before it is sent out (there may be other filters which get to see the message after this filter, though).

Parameters:
tag The tag to decorate. It contains the message to be sent.

Implemented in ChatStateFilter, InBandBytestream, and MessageEventFilter.

virtual void filter ( Stanza stanza  )  [pure virtual]

This function receives a message stanza right after it was received (there may be other filters which got to see the stanza before this filter, though).

Parameters:
stanza The complete message stanza.

Implemented in ChatStateFilter, InBandBytestream, and MessageEventFilter.


The documentation for this class was generated from the following files:
Generated on Tue May 1 14:20:25 2007 for gloox by  doxygen 1.5.1