gloox
1.0.28
|
#include <chatstatefilter.h>
Public Member Functions | |
ChatStateFilter (MessageSession *parent) | |
virtual | ~ChatStateFilter () |
void | setChatState (ChatStateType state) |
void | registerChatStateHandler (ChatStateHandler *csh) |
void | removeChatStateHandler () |
virtual void | decorate (Message &msg) |
virtual void | filter (Message &msg) |
Public Member Functions inherited from MessageFilter | |
MessageFilter (MessageSession *parent) | |
virtual | ~MessageFilter () |
virtual void | attachTo (MessageSession *session) |
Protected Attributes | |
ChatStateHandler * | m_chatStateHandler |
ChatStateType | m_lastSent |
bool | m_enableChatStates |
This class adds Chat State Notifications (XEP-0085) support to a MessageSession.
This implementation of Chat States is fully transparent to the user of the class. If the remote entity does not request chat states, ChatStateFilter will not send any, even if the user requests it. (This is required by the protocol specification.) You MUST annouce this capability by use of Disco (associated namespace is XMLNS_CHAT_STATES). (This is also required by the protocol specification.)
Definition at line 43 of file chatstatefilter.h.
ChatStateFilter | ( | MessageSession * | parent | ) |
Constructs a new Chat State filter for a MessageSession.
parent | The MessageSession to decorate. |
Definition at line 24 of file chatstatefilter.cpp.
|
virtual |
Virtual destructor.
Definition at line 30 of file chatstatefilter.cpp.
|
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).
msg | The tag to decorate. It contains the message to be sent. |
Implements MessageFilter.
Definition at line 62 of file chatstatefilter.cpp.
|
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).
msg | The complete message stanza. |
Implements MessageFilter.
Definition at line 34 of file chatstatefilter.cpp.
|
inline |
The ChatStateHandler registered here will receive Chat States according to XEP-0085.
csh | The ChatStateHandler to register. |
Definition at line 74 of file chatstatefilter.h.
|
inline |
This function clears the internal pointer to the ChatStateHandler. Chat States will not be delivered anymore after calling this function until another ChatStateHandler is registered.
Definition at line 82 of file chatstatefilter.h.
void setChatState | ( | ChatStateType | state | ) |
Use this function to set a chat state as defined in XEP-0085.
state | The state to set. |
Definition at line 49 of file chatstatefilter.cpp.
|
protected |
A handler for incoming chat state changes.
Definition at line 93 of file chatstatefilter.h.
|
protected |
Indicates whether or not chat states are currently enabled.
Definition at line 99 of file chatstatefilter.h.
|
protected |
Holds the state sent last.
Definition at line 96 of file chatstatefilter.h.