presence stanza
Click on the red underlined text to get to the source
... availability (offline or online, along with various sub-states of the
latter and optional user-defined descriptive text), and to notify
other entities of that availability. Presence stanzas are also used
to negotiate and manage subscriptions to the presence of other
entities.
...
...
The 'type' attribute of a presence stanza is OPTIONAL. A presence
stanza that does not possess a 'type' attribute is used to signal to
the server that the sender ...
...
The 'type' attribute of a presence stanza is OPTIONAL. A presence
stanza that does not possess a 'type' attribute is used to signal to
the server that the sender is online and available for communication.
...
... request for another entity's current presence, or an error related to
a previously-sent presence stanza. If included, the 'type' attribute
MUST have one of the following values:
...
... o error -- An error has occurred regarding processing or delivery of
a previously-sent presence stanza.
For detailed information regarding presence semantics ...
...
As described under extended namespaces (Section 2.4), a presence
stanza MAY contain any properly-namespaced child element.
...
... In accordance with the default namespace declaration, by default a
presence stanza is qualified by the 'jabber:client' or
...
... jabber:server' namespace, which defines certain allowable children
of presence stanzas. If the presence stanza is of type "error", it
MUST include an <error/> child; for details, see [XMPP-CORE ...
... namespace, which defines certain allowable children
of presence stanzas. If the presence stanza is of type "error", it
MUST include an <error/> child; for details, see [XMPP-CORE]. If the
...
... MUST include an <error/> child; for details, see [XMPP-CORE]. If the
presence stanza possesses no 'type' attribute, it MAY contain any of
the following child elements ...
... the following child elements (note that the <status/> child MAY be
sent in a presence stanza of type "unavailable" or, for historical
reasons, "subscribe ...
... XML
character data that specifies the particular availability status of
an entity or specific resource. A presence stanza MUST NOT contain
more than one <show/> element. The <show/> element ...
... one of the following (additional availability types could be defined
through a properly-namespaced child element of the presence stanza):
o away -- The entity ...
... priority level of the resource. The
value MUST be an integer between -128 and +127. A presence stanza
MUST NOT contain more than one <priority/> element ...
... stanzas for the
purpose of providing additional functionality. Thus a message or
presence stanza MAY contain one or more optional child elements
specifying content that extends the meaning of the message (e.g., an
...
...
* If an entity receives a message or presence stanza that
contains XML data qualified by a namespace ...
... Exchanging presence information is made relatively straightforward
within XMPP by using presence stanzas. However, we see here a
contrast to the handling of messages: although a client MAY send
...
... address, normally presence notifications (i.e., presence stanzas with
no 'type' or of type "unavailable" and with no 'to' address ...
... subscribers). This broadcast model does not apply to
subscription-related presence stanzas or presence stanzas of type
"error", but to presence notifications ...
... broadcast model does not apply to
subscription-related presence stanzas or presence stanzas of type
"error", but to presence notifications only as defined above. (Note:
...
... client.)
For information regarding the syntax of presence stanzas as well as
their defined attributes and child elements, refer to [XMPP-CORE ...
... client SHOULD send initial presence
to the server in order to signal its availability for communications.
As defined herein, the initial presence stanza (1) MUST possess no
'to' address (signalling that it is meant to be broadcasted ...
...
1. Send presence probes (i.e., presence stanzas whose 'type'
attribute is set to a value of "probe") from the full JID ...
... Upon receiving initial presence from the user, the contact's server
MUST deliver the user's presence stanza to the full JIDs
(<contact@example.org/resource>) associated with all of the contact's
...
... (Section 10.10)).
If the user's server receives a presence stanza of type "error" in
response to the initial presence that it sent to a contact on behalf
of the user, it SHOULD NOT send further presence updates to that
...
... response to the initial presence that it sent to a contact on behalf
of the user, it SHOULD NOT send further presence updates to that
contact (until and unless it receives a presence stanza from the
contact).
...
... broadcasting at any time during its session by
sending a presence stanza with no 'to' address and either no 'type'
attribute or a 'type' attribute with a value of "unavailable ...
... availability.)
If the presence stanza lacks a 'type' attribute (i.e., expresses
availability), the user's server MUST broadcast the full XML ...
... broadcast the full XML of that
presence stanza to all contacts (1) that are in the user's roster
with a subscription type of "from" or "both", (2) to whom the user
...
... session (as well as to any of the user's other available resources).
If the presence stanza has a 'type' attribute set to a value of
"unavailable", the user's server MUST broadcast ...
... broadcast the full XML of that
presence stanza to all entities that fit the above description, as
well as to any entities to which the user has sent directed available
presence during the user's session ...
... state of "From", "From + Pending Out", or "Both" (as defined
under Subscription States (Section 9)), the contact's server MUST
return a presence stanza of type "error" in response to the
presence probe (however, if a server receives a presence probe ...
... presence probe by sending to the user the
full XML of the last presence stanza of type "unavailable"
received by the server ...
... presence probe by sending to the user
the full XML of the last presence stanza with no 'to' attribute
received by the server from each of the contact's available
...
... A user MAY send directed presence to another entity (i.e., a presence
stanza with a 'to' attribute whose value is the JID of the other
entity ...
... route or deliver the
full XML of that presence stanza to the entity but MUST NOT
modify the contact's status regarding available presence
broadcast ...
... client SHOULD gracefully
become unavailable by sending a final presence stanza that possesses
no 'to' attribute and that possesses a 'type' attribute whose value
is "unavailable ...
... no 'to' attribute and that possesses a 'type' attribute whose value
is "unavailable" (optionally, the final presence stanza MAY contain
one or more <status/> elements specifying the reason why the user is
...
... directed unavailable presence to that entity). Any presence stanza
with no 'type' attribute and no 'to' attribute that is sent after
sending directed unavailable presence ...
...
A subscription request is a presence stanza whose 'type' attribute
has a value of "subscribe". If the subscription request ...
... be available and therefore MUST NOT send subscription requests to
it.) However, if the user receives a presence stanza of type
"subscribe" from a contact to whom the user has already granted
...
... previously-granted subscription. Subscriptions are managed within
XMPP by sending presence stanzas containing specially-defined
attributes.
...
... subscribe to another entity's presence is made by
sending a presence stanza of type "subscribe".
...
... subscription request from another entity, it
MUST either approve the request by sending a presence stanza of type
"subscribed" or refuse the request by sending a presence stanza of
...
... MUST either approve the request by sending a presence stanza of type
"subscribed" or refuse the request by sending a presence stanza of
type "unsubscribed".
...
...
If a user would like to cancel a previously-granted subscription
request, it sends a presence stanza of type "unsubscribed".
...
... unsubscribe from the presence of another
entity, it sends a presence stanza of type "unsubscribe".
...
... 3. If the user wants to request a subscription to the contact's
presence information, the user's client MUST send a presence
stanza of type='subscribe' to the contact:
...
... group/> child shown above.
5. The user's server MUST also stamp the presence stanza of type
"subscribe" with the user's bare JID ...
... host than
the user, the user's server MUST route the presence stanza to the
contact's server for delivery to the contact (this case is
...
... assumed throughout; however, if the contact is served by the same
host, then the server can simply deliver the presence stanza
directly):
...
... subscribe'/>
Note: If the user's server receives a presence stanza of type "error"
from the contact's server, it MUST deliver the error stanza to the
...
... user, whose client MAY determine that the error is in response to the
outgoing presence stanza of type "subscribe" it sent previously
(e.g., by tracking an 'id' attribute) and then choose to resend the
...
... subscribe" request or revert the roster to its previous state by
sending a presence stanza of type "unsubscribe" to the contact.
...
...
6. Upon receiving the presence stanza of type "subscribe" addressed
to the contact, the contact's server MUST determine if there is
...
... roster set specifying the desired nickname and group for the user
(if any); and (2) MUST send a presence stanza of type
"subscribed" to the user in order to approve the subscription
request.
...
... IQ result to the sending resource indicating the
success of the roster set; (3) MUST route the presence stanza of
type "subscribed" to the user, first stamping the 'from' address
...
... to='user@example.com'/>
Note: If the contact's server receives a presence stanza of type
"error" from the user's server, it MUST deliver the error stanza to
...
... the contact, whose client MAY determine that the error is in response
to the outgoing presence stanza of type "subscribed" it sent
previously (e.g., by tracking an 'id' attribute) and then choose to
resend the "subscribed" notification ...
... notification or revert the roster to its
previous state by sending a presence stanza of type "unsubscribed" to
the user.
...
...
8. Upon receiving the presence stanza of type "subscribed" addressed
to the user, the user's server MUST first verify that the contact
is in the user's roster with either of the following states: (a)
...
... subscribe'. If the contact is not
in the user's roster with either of those states, the user's
server MUST silently ignore the presence stanza of type
"subscribed" (i.e., it MUST NOT route it to the user, modify the
...
... user's roster, or generate a roster push to the user's available
resources). If the contact is in the user's roster with either
of those states, the user's server (1) MUST deliver the presence
stanza of type "subscribed" from the contact to the user; (2)
MUST initiate a roster push to all of the user's available
resources that have requested the roster, containing an updated
...
... roster item for the contact with the 'subscription' attribute set
to a value of "to"; and (3) MUST deliver the available presence
stanza received from each of the contact's available resources to
each of the user's available resources:
...
...
9. Upon receiving the presence stanza of type "subscribed", the user
SHOULD acknowledge receipt of that subscription state
...
... state
notification through either "affirming" it by sending a presence
stanza of type "subscribe" to the contact or "denying" it by
sending a presence stanza ...
... presence
stanza of type "subscribe" to the contact or "denying" it by
sending a presence stanza of type "unsubscribe" to the contact;
this step does not necessarily affect the subscription state ...
... 1. If the contact wants to refuse the request, the contact's client
MUST send a presence stanza of type "unsubscribed" to the user
(instead of the presence stanza ...
... presence stanza of type "unsubscribed" to the user
(instead of the presence stanza of type "subscribed" sent in Step
6 of Section 8.2):
...
...
2. As a result, the contact's server MUST route the presence stanza
of type "unsubscribed" to the user, first stamping the 'from'
...
...
3. Upon receiving the presence stanza of type "unsubscribed"
addressed to the user, the user's server (1) MUST deliver that
...
... unsubscribed"
addressed to the user, the user's server (1) MUST deliver that
presence stanza to the user and (2) MUST initiate a roster push
to all of the user's available resources that have requested the
roster, containing an updated roster item ...
...
4. Upon receiving the presence stanza of type "unsubscribed", the
user SHOULD acknowledge receipt of that subscription state ...
... state
notification through either "affirming" it by sending a presence
stanza of type "unsubscribe" to the contact or "denying" it by
...
... unsubscribe" to the contact or "denying" it by
sending a presence stanza of type "subscribe" to the contact;
this step does not necessarily affect the subscription state ...
... subscribe' attribute in the roster
item; and (2) MUST route the presence stanza of type "subscribe"
to the user, first stamping the 'from' address ...
... subscribe'/>
Note: If the contact's server receives a presence stanza of type
"error" from the user's server, it MUST deliver the error stanza to
...
... the contact, whose client MAY determine that the error is in response
to the outgoing presence stanza of type "subscribe" it sent
previously (e.g., by tracking an 'id' attribute) and then choose to
...
... subscribe" request or revert the roster to its previous
state by sending a presence stanza of type "unsubscribe" to the user.
...
...
3. Upon receiving the presence stanza of type "subscribe" addressed
to the user, the user's server must determine if there is at
...
... subscription request is defined in Section 8.3.1). In this case,
the user's client MUST send a presence stanza of type
"subscribed" to the contact in order to approve the subscription
request.
...
... 'subscription' attribute set to a value of "both"; (2) MUST route
the presence stanza of type "subscribed" to the contact, first
stamping the 'from' address as the bare JID ...
... of the user; and (3) MUST send to the contact the full XML of the
last presence stanza with no 'to' attribute received by the
server from each of the user's available resources (subject to
...
... to='contact@example.org'/>
Note: If the user's server receives a presence stanza of type "error"
from the contact's server, it MUST deliver the error stanza to the
...
... user, whose client MAY determine that the error is in response to the
outgoing presence stanza of type "subscribed" it sent previously
(e.g., by tracking an 'id' attribute) and then choose to resend the
subscription request ...
... subscription request or revert the roster to its previous state by
sending a presence stanza of type "unsubscribed" to the contact.
...
...
5. Upon receiving the presence stanza of type "subscribed" addressed
to the contact, the contact's server MUST first verify that the
user is in the contact's roster with either of the following
...
... subscribe'. If the user is not in
the contact's roster with either of those states, the contact's
server MUST silently ignore the presence stanza of type
"subscribed" (i.e., it MUST NOT route it to the contact, modify
...
... available resources). If the user is in the contact's roster
with either of those states, the contact's server (1) MUST
deliver the presence stanza of type "subscribed" from the user to
the contact; (2) MUST initiate a roster push to all available
resources associated with the contact that have requested the
...
... roster item for the user with the
'subscription' attribute set to a value of "both"; and (3) MUST
deliver the available presence stanza received from each of the
user's available resources to each of the contact's available
resources:
...
...
6. Upon receiving the presence stanza of type "subscribed", the
contact SHOULD acknowledge receipt of that subscription state
...
... state
notification through either "affirming" it by sending a presence
stanza of type "subscribe" to the user or "denying" it by sending
a presence stanza ...
... presence
stanza of type "subscribe" to the user or "denying" it by sending
a presence stanza of type "unsubscribe" to the user; this step
does not necessarily affect the subscription state ...
... 1. If the user wants to refuse the request, the user's client MUST
send a presence stanza of type "unsubscribed" to the contact
(instead of the presence stanza ...
... presence stanza of type "unsubscribed" to the contact
(instead of the presence stanza of type "subscribed" sent in Step
3 of Section 8.3):
...
...
2. As a result, the user's server MUST route the presence stanza of
type "unsubscribed" to the contact, first stamping the 'from'
...
...
3. Upon receiving the presence stanza of type "unsubscribed"
addressed to the contact, the contact's server (1) MUST deliver
...
... unsubscribed"
addressed to the contact, the contact's server (1) MUST deliver
that presence stanza to the contact; and (2) MUST initiate a
roster push to all available resources associated with the
contact that have requested the roster, containing an updated
...
...
4. Upon receiving the presence stanza of type "unsubscribed", the
contact SHOULD acknowledge receipt of that subscription state ...
... state
notification through either "affirming" it by sending a presence
stanza of type "unsubscribe" to the user or "denying" it by
sending a presence stanza ...
... presence
stanza of type "unsubscribe" to the user or "denying" it by
sending a presence stanza of type "subscribe" to the user; this
step does not necessarily affect the subscription state ...
... 1. If the user wants to unsubscribe from the contact's presence
information, the user MUST send a presence stanza of type
"unsubscribe" to the contact:
...
... 'subscription' attribute set to a value of "none"; and (2) MUST
route the presence stanza of type "unsubscribe" to the contact,
first stamping the 'from' address ...
...
3. Upon receiving the presence stanza of type "unsubscribe"
addressed to the contact, the contact's server (1) MUST initiate
...
...
4. Upon receiving the presence stanza of type "unsubscribe", the
contact SHOULD acknowledge receipt of that subscription state ...
... state
notification through either "affirming" it by sending a presence
stanza of type "unsubscribed" to the user or "denying" it by
sending a presence stanza ...
... presence
stanza of type "unsubscribed" to the user or "denying" it by
sending a presence stanza of type "subscribed" to the user; this
step does not necessarily affect the subscription state (see
...
... Section 9.4).
5. The contact's server then (1) MUST send a presence stanza of type
"unsubscribed" to the user; and (2) SHOULD send unavailable
presence ...
... unavailable'/>
6. When the user's server receives the presence stanzas of type
"unsubscribed" and "unavailable ...
...
7. Upon receiving the presence stanza of type "unsubscribed", the
user SHOULD acknowledge receipt of that subscription state ...
... state
notification through either "affirming" it by sending a presence
stanza of type "unsubscribe" to the contact or "denying" it by
sending a presence stanza ...
... presence
stanza of type "unsubscribe" to the contact or "denying" it by
sending a presence stanza of type "subscribe" to the contact;
this step does not necessarily affect the subscription state ...
... 1. If the user wants to unsubscribe from the contact's presence
information, the user MUST send a presence stanza of type
"unsubscribe" to the contact:
...
... 'subscription' attribute set to a value of "from"; and (2) MUST
route the presence stanza of type "unsubscribe" to the contact,
first stamping the 'from' address ...
...
3. Upon receiving the presence stanza of type "unsubscribe"
addressed to the contact, the contact's server (1) MUST initiate
...
...
4. Upon receiving the presence stanza of type "unsubscribe", the
contact SHOULD acknowledge receipt of that subscription state ...
... state
notification through either "affirming" it by sending a presence
stanza of type "unsubscribed" to the user or "denying" it by
sending a presence stanza ...
... presence
stanza of type "unsubscribed" to the user or "denying" it by
sending a presence stanza of type "subscribed" to the user; this
step does not necessarily affect the subscription state ...
... Section 9.4).
5. The contact's server then (1) MUST send a presence stanza of type
"unsubscribed" to the user; and (2) SHOULD send unavailable
presence ...
... unavailable'/>
6. When the user's server receives the presence stanzas of type
"unsubscribed" and "unavailable ...
...
7. Upon receiving the presence stanza of type "unsubscribed", the
user SHOULD acknowledge receipt of that subscription state ...
... state
notification through either "affirming" it by sending a presence
stanza of type "unsubscribe" to the contact or "denying" it by
sending a presence stanza ...
... presence
stanza of type "unsubscribe" to the contact or "denying" it by
sending a presence stanza of type "subscribe" to the contact;
this step does not necessarily affect the subscription state ...
...
1. If the contact wants to cancel the user's subscription, the
contact MUST send a presence stanza of type "unsubscribed" to the
user:
...
... 'subscription' attribute set to a value of "none"; (2) MUST route
the presence stanza of type "unsubscribed" to the user, first
stamping the 'from' address ...
...
3. Upon receiving the presence stanza of type "unsubscribed"
addressed to the user, the user's server (1) MUST initiate a
...
...
4. Upon receiving the presence stanza of type "unsubscribed", the
user SHOULD acknowledge receipt of that subscription state ...
... state
notification through either "affirming" it by sending a presence
stanza of type "unsubscribe" to the contact or "denying" it by
sending a presence stanza ...
... presence
stanza of type "unsubscribe" to the contact or "denying" it by
sending a presence stanza of type "subscribe" to the contact;
...
...
1. If the contact wants to cancel the user's subscription, the
contact MUST send a presence stanza of type "unsubscribed" to the
user:
...
... 'subscription' attribute set to a value of "to"; (2) MUST route
the presence stanza of type "unsubscribed" to the user, first
stamping the 'from' address ...
...
3. Upon receiving the presence stanza of type "unsubscribed"
addressed to the user, the user's server (1) MUST initiate a
...
...
4. Upon receiving the presence stanza of type "unsubscribed", the
user SHOULD acknowledge receipt of that subscription state ...
... state
notification through either "affirming" it by sending a presence
stanza of type "unsubscribe" to the contact or "denying" it by
sending a presence stanza ...
... presence
stanza of type "unsubscribe" to the contact or "denying" it by
sending a presence stanza of type "subscribe" to the contact;
this step does not necessarily affect the subscription state ...
...
Upon receiving the presence stanza of type "unsubscribe", the
contact's server (1) MUST initiate a roster push to all available
...
...
Upon receiving the presence stanza of type "unsubscribed", the
contact's server (1) MUST initiate a roster push to all available
...
...
Upon receiving the presence stanza of type "unavailable" addressed to
the contact, the contact's server MUST deliver the unavailable
presence ...
...
This section provides detailed information about subscription states
and server handling of subscription-related presence stanzas (i.e.,
presence stanzas of type "subscribe ...
... and server handling of subscription-related presence stanzas (i.e.,
presence stanzas of type "subscribe", "subscribed", "unsubscribe",
...
... synchronization regarding subscription states, the user's
server MUST without exception route all outbound presence stanzas of
type "subscribe" or "unsubscribe ...
...
The user's server SHOULD NOT route a presence stanza of type
"subscribed" or "unsubscribed" to the contact if the stanza ...
... When the user's server receives a subscription request for the user
from the contact (i.e., a presence stanza of type "subscribe"), it
MUST deliver that request to the user for approval if the user has
...
... already granted the contact access to the user's presence
information, the user's server SHOULD auto-reply to an inbound
presence stanza of type "subscribe" from the contact by sending a
presence stanza ...
... presence stanza of type "subscribe" from the contact by sending a
presence stanza of type "subscribed" to the contact on behalf of the
user; this rule enables the contact to resynchronize the subscription
state ...
... stanza
When the user's server receives a presence stanza of type
"unsubscribe" for the user from the contact, if the stanza ...
... a subscription state change from the user's perspective then the
user's server SHOULD auto-reply by sending a presence stanza of type
"unsubscribed" to the contact on behalf of the user, MUST deliver the
...
... stanza
When the user's server receives a presence stanza of type
"subscribed" for the user from the contact, it MUST NOT deliver the
stanza ...
... there is no pending outbound request for access to the contact's
presence information. If there is a pending outbound request for
access to the contact's presence information and the inbound presence
stanza of type "subscribed" results in a subscription state change,
the user's server MUST deliver the stanza ...
... the subscription state. If the user already has access to the
contact's presence information, the inbound presence stanza of type
"subscribed" does not result in a subscription state change;
...
... +------------------------------------------------------------------+
When the user's server receives a presence stanza of type
"unsubscribed" for the user from the contact, it MUST deliver the
...
...
When a server receives an inbound presence stanza of type "subscribe"
(i.e., a subscription request ...
... require acknowledgement in the case of subscription requests, i.e.,
presence stanzas of type "subscribe"). In order to require
acknowledgement, a server SHOULD send the request or notification ...
... notification to the user.
Because a user's server MUST automatically generate outbound presence
stanzas of type "unsubscribe" and "unsubscribed" upon receiving ...
... (Section 8.6)), the server MUST treat a roster remove request as
equivalent to sending both of those presence stanzas for purposes of
determining whether to continue sending subscription state change
...
... broadcasted to entities that are
subscribed to a user's presence information. Thus this includes
presence stanzas with no 'type' attribute or of type='unavailable'
only.
...
... in Server Rules for Handling XML Stanzas (Section 11), and (2)
the handling of subscription-related presence stanzas (and
corresponding generation of roster pushes) specified in
Integration of Roster Items ...
... broadcasted to the user because the
user is currently subscribed to a contact's presence information.
Thus this includes presence stanzas with no 'type' attribute or of
type='unavailable' only.
...
... broadcasted to contacts because
those contacts are currently subscribed to the user's presence
information. Thus this includes presence stanzas with no 'type'
attribute or of type='unavailable' only.
...
... group, or
subscription status (or globally). Note that this includes
subscription-related presence stanzas, which are excluded by Blocking
Inbound Presence Notifications (Section 10.10). The following
examples illustrate the protocol.
...
...
If a blocked entity attempts to send message or presence stanzas to
the user, the user's server SHOULD silently drop the stanza and MUST
...
... recipient's server (a) SHOULD silently ignore the stanza (i.e.,
neither deliver it nor return an error) if it is a presence
stanza, (b) MUST return a <service-unavailable/> stanza ...
... stanza (i.e., neither deliver it
nor return an error) if it is a presence stanza, (b) MUST return
a <service-unavailable ...
... resource>).
2. For presence stanzas other than those of type "probe", the
server MUST deliver the stanza ...
... (i.e., when the user next creates an available resource); in
addition, the server MUST continue to deliver presence
stanzas of type "subscribe" until the user either approves or
denies the subscription request ...
... Presence
Subscriptions (Section 5.1.6)).
2. For all other presence stanzas, the server SHOULD silently
ignore the stanza by not storing it for later delivery ...
... XML
stanzas as defined by the XML schemas, including the 'type'
attribute of message and presence stanzas as well as their child
elements
...
... (Section 11)).
o When a server processes an inbound presence stanza of type "probe"
whose intended recipient is a user associated with one of the
...
... Client and Server Presence Responsibilities (Section 5.1)).
o When a server processes an outbound presence stanza with no type
or of type "unavailable", it MUST follow the rules defined under
...
