gloox  1.0.28
Public Member Functions | List of all members
MessageSessionHandler Class Referenceabstract

#include <messagesessionhandler.h>

Public Member Functions

virtual ~MessageSessionHandler ()
 
virtual void handleMessageSession (MessageSession *session)=0
 

Detailed Description

A virtual interface which can be reimplemented to receive incoming message sessions.

Derived classes can be registered as MessageSessionHandlers with the Client. If you have registered as a MessageSessionHandler by calling ClientBase::registerMessageSessionHandler(), handleMessageSession() will be called if a message stanza arrives for which there is no MessageSession yet.

Author
Jakob Schröter js@ca.nosp@m.maya.nosp@m..net
Since
0.8

Definition at line 34 of file messagesessionhandler.h.

Constructor & Destructor Documentation

◆ ~MessageSessionHandler()

virtual ~MessageSessionHandler ( )
inlinevirtual

Virtual Destructor.

Definition at line 40 of file messagesessionhandler.h.

Member Function Documentation

◆ handleMessageSession()

virtual void handleMessageSession ( MessageSession session)
pure virtual

Reimplement this function if you want to be notified about incoming messages by means of automatically created MessageSessions. You receive ownership of the supplied session (not the stanza) and are responsible for deleting it at the end of its life.

Note
Make sure to read the note in ClientBase::registerMessageSessionHandler() regarding the feeding of decorators.
You should never delete the MessageSession manually. Instead call ClientBase::disposeMessageSession() when you no longer need the session.
If you don't need the MessageSession, you should not dispose it here. You will get an endless loop if you do.
You should register your MessageHandler here, or else the first message (that caused the MessageSession to be created) may get lost.
Parameters
sessionThe new MessageSession.

The documentation for this class was generated from the following file: