#include <lastactivity.h>
Inherits IqHandler.
Inheritance diagram for LastActivity:
Public Member Functions | |
LastActivity (ClientBase *parent, Disco *disco) | |
virtual | ~LastActivity () |
void | query (const JID &jid) |
void | registerLastActivityHandler (LastActivityHandler *lah) |
void | removeLastActivityHandler () |
void | resetIdleTimer () |
virtual bool | handleIqID (Stanza *stanza, int context) |
virtual bool | handleIq (Stanza *stanza) |
LastActivity can be used to query remote entities about their last activity time as well as answer incoming last-activity-queries.
Definition at line 37 of file lastactivity.h.
LastActivity | ( | ClientBase * | parent, | |
Disco * | disco | |||
) |
Constructs a new LastActivity object.
Definition at line 27 of file lastactivity.cpp.
~LastActivity | ( | ) | [virtual] |
Virtual destructor.
Definition at line 35 of file lastactivity.cpp.
void query | ( | const JID & | jid | ) |
Queries the given JID for their last activity. The result can be received by reimplementing LastActivityHandler::handleLastActivityResult() and LastActivityHandler::handleLastActivityError().
Definition at line 39 of file lastactivity.cpp.
void registerLastActivityHandler | ( | LastActivityHandler * | lah | ) | [inline] |
Use this function to register an object as handler for incoming results of Last-Activity queries. Only one handler is possible at a time.
lah | The object to register as handler. |
Definition at line 63 of file lastactivity.h.
void removeLastActivityHandler | ( | ) | [inline] |
Use this function to un-register the LastActivityHandler set earlier.
Definition at line 68 of file lastactivity.h.
void resetIdleTimer | ( | ) |
Use this function to reset the idle timer. By default the number of seconds since the instantiation will be used.
Definition at line 123 of file lastactivity.cpp.
bool handleIqID | ( | Stanza * | stanza, | |
int | context | |||
) | [virtual] |
Reimplement this function if you want to be notified about incoming IQs with a specific value of the id
attribute. You have to enable tracking of those IDs using Client::trackID()
. This is usually useful for IDs that generate a positive reply, i.e. <iq type='result' id='reg'/> where a namespace filter wouldn't work.
stanza | The complete Stanza. | |
context | A value to restore context, stored with ClientBase::trackID(). |
Implements IqHandler.
Definition at line 98 of file lastactivity.cpp.
bool handleIq | ( | Stanza * | stanza | ) | [virtual] |
Reimplement this function if you want to be notified about incoming IQs.
stanza | The complete Stanza. |
Implements IqHandler.
Definition at line 54 of file lastactivity.cpp.