gloox  1.0.27
Public Types | Public Member Functions | List of all members
Subscription Class Reference

#include <subscription.h>

Inheritance diagram for Subscription:
Inheritance graph

Public Types

enum  S10nType {
  Subscribe , Subscribed , Unsubscribe , Unsubscribed ,

Public Member Functions

 Subscription (S10nType type, const JID &to, const std::string &status=EmptyString, const std::string &xmllang=EmptyString)
virtual ~Subscription ()
S10nType subtype () const
const std::string status (const std::string &lang="default") const
virtual Tagtag () const
- Public Member Functions inherited from Stanza
virtual ~Stanza ()
void setFrom (const JID &from)
const JIDfrom () const
const JIDto () const
const std::string & id () const
const Errorerror () const
const std::string & xmlLang () const
void addExtension (const StanzaExtension *se)
const StanzaExtensionfindExtension (int type) const
template<class T >
const T * findExtension (int type) const
const StanzaExtensionListextensions () const
void removeExtensions ()
void setEmbeddedStanza ()
bool hasEmbeddedStanza () const
StanzaembeddedStanza () const
TagembeddedTag () const

Additional Inherited Members

- Protected Member Functions inherited from Stanza
 Stanza (Tag *tag)
 Stanza (const JID &to)

Detailed Description

An abstraction of a subscription stanza.

Jakob Schröter

Definition at line 31 of file subscription.h.

Member Enumeration Documentation

◆ S10nType

enum S10nType

Describes the different valid message types.


A subscription request.


A subscription notification.


An unsubscription request.


An unsubscription notification.


The stanza is invalid.

Definition at line 41 of file subscription.h.

Constructor & Destructor Documentation

◆ Subscription()

Subscription ( S10nType  type,
const JID to,
const std::string &  status = EmptyString,
const std::string &  xmllang = EmptyString 

Creates a Subscription request.

typeThe presence type.
toThe intended receiver. Use an empty JID to create a broadcast packet.
statusAn optional status message (e.g. "please authorize me").
xmllangAn optional xml:lang for the status message.

Definition at line 43 of file subscription.cpp.

◆ ~Subscription()

~Subscription ( )


Definition at line 50 of file subscription.cpp.

Member Function Documentation

◆ status()

const std::string status ( const std::string &  lang = "default") const

Returns the status text of a presence stanza for the given language if available. If the requested language is not available, the default status text (without a xml:lang attribute) will be returned.

langThe language identifier for the desired language. It must conform to section 2.12 of the XML specification and RFC 3066. If empty, the default body will be returned, if any.
The status text set by the sender.

Definition at line 80 of file subscription.h.

◆ subtype()

S10nType subtype ( ) const

Returns the subscription stanza's type.

The subscription stanza's type.

Definition at line 69 of file subscription.h.

◆ tag()

Tag * tag ( ) const

Creates a Tag representation of the Stanza. The Tag is completely independent of the Stanza and will not be updated when the Stanza is modified.

A pointer to a Tag representation. It is the job of the caller to delete the Tag.

Implements Stanza.

Definition at line 55 of file subscription.cpp.

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