#include <presence.h>
An abstraction of a presence stanza.
- Author
- Jakob Schröter js@ca.nosp@m.maya.nosp@m..net
- Since
- 1.0
Definition at line 32 of file presence.h.
Describes the different valid presence types.
Enumerator |
---|
Available |
The entity is online.
|
Chat |
The entity is 'available for chat'.
|
Away |
The entity is away.
|
DND |
The entity is DND (Do Not Disturb).
|
XA |
The entity is XA (eXtended Away).
|
Unavailable |
The entity is offline.
|
Probe |
This is a presence probe.
|
Error |
This is a presence error.
|
Invalid |
The stanza is invalid.
|
Definition at line 42 of file presence.h.
Creates a Presence request.
- Parameters
-
type | The presence type. |
to | The intended receiver. Use an empty JID to create a broadcast packet. |
status | An optional status message (e.g. "gone fishing"). |
priority | An optional presence priority. Legal range is between -128 and +127. Defaults to 0. |
xmllang | An optional xml:lang for the status message. |
Definition at line 72 of file presence.cpp.
void addStatus |
( |
const std::string & |
status, |
|
|
const std::string & |
lang = EmptyString |
|
) |
| |
|
inline |
Adds a (possibly translated) status message.
- Parameters
-
status | The status message. |
lang | The language identifier for the desired language. It must conform to section 2.12 of the XML specification and RFC 3066. |
Definition at line 117 of file presence.h.
Returns the presence's type.
- Returns
- The presence's type.
Definition at line 89 of file presence.h.
Returns the presence priority in the legal range: -128 to +127.
- Returns
- The priority information contained in the stanza, defaults to 0.
Definition at line 131 of file presence.h.
Resets the default status message as well as all language-specific ones.
Definition at line 86 of file presence.cpp.
Sets the presence type.
- Parameters
-
Definition at line 95 of file presence.h.
void setPriority |
( |
int |
priority | ) |
|
Sets the priority. Legal range: -128 to +127.
- Parameters
-
priority | The priority to set. |
Definition at line 93 of file presence.cpp.
const std::string status |
( |
const std::string & |
lang = "default" | ) |
const |
|
inline |
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.
- Parameters
-
lang | The 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. |
- Returns
- The status text set by the sender.
Definition at line 106 of file presence.h.
Returns the presence's type.
- Returns
- The presence's type.
Definition at line 76 of file presence.h.
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.
- Returns
- A pointer to a Tag representation. It is the job of the caller to delete the Tag.
Implements Stanza.
Definition at line 108 of file presence.cpp.
The documentation for this class was generated from the following files: