15 #include "lastactivity.h"
17 #include "discohandler.h"
18 #include "clientbase.h"
20 #include "lastactivityhandler.h"
37 m_status = tag->
cdata();
52 static const std::string filter =
"/iq/query[@xmlns='" +
XMLNS_LAST +
"']"
53 "|/presence/query[@xmlns='" +
XMLNS_LAST +
"']";
59 Tag* t =
new Tag(
"query" );
69 : m_lastActivityHandler( 0 ), m_parent( parent ),
70 m_active( time ( 0 ) )
94 m_parent->
send( iq,
this, 0 );
105 m_parent->
send( re );
112 if( !m_lastActivityHandler )
129 m_active = time( 0 );
void addFeature(const std::string &feature)
StanzaError error() const
bool setXmlns(const std::string &xmlns, const std::string &prefix=EmptyString)
void removeIDHandler(IqHandler *ih)
An abstraction of an IQ stanza.
void removeIqHandler(IqHandler *ih, int exttype)
void registerIqHandler(IqHandler *ih, int exttype)
void addExtension(const StanzaExtension *se)
virtual Tag * tag() const
void registerStanzaExtension(StanzaExtension *ext)
const std::string XMLNS_LAST
This is an abstraction of a LastActivity Query that can be used in XEP-0012 as well as XEP-0256...
virtual const std::string & filterString() const
const std::string & status() const
bool setCData(const std::string &cdata)
virtual void handleIqID(const IQ &iq, int context)
void query(const JID &jid)
The namespace for the gloox library.
This class abstracts a stanza extension, which is usually an element in a specific namespace...
const std::string & xmlns() const
virtual Disco * disco() const
const std::string & findAttribute(const std::string &name) const
bool hasAttribute(const std::string &name, const std::string &value=EmptyString) const
virtual bool handleIq(const IQ &iq)
LastActivity(ClientBase *parent)
const std::string cdata() const
bool addAttribute(Attribute *attr)
const std::string & name() const
virtual void handleLastActivityError(const JID &jid, StanzaError error)=0
const std::string getID()
const Error * error() const
virtual void handleLastActivityResult(const JID &jid, long seconds, const std::string &status)=0
void removeFeature(const std::string &feature)
const std::string & id() const
const std::string EmptyString
This is the common base class for a Jabber/XMPP Client and a Jabber Component.
const StanzaExtension * findExtension(int type) const
This is an abstraction of an XML element.