This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
The user-defined status message, e.g. "Back soon!".
Clients SHOULD set the status message for the local user to the empty string, unless the user has actually provided a specific message (i.e. one that conveys more information than the Status).
User interfaces SHOULD regard an empty status message as unset, and MAY replace it with a localized string corresponding to the Status or Type.
The string identifier of the desired status. Possible status
identifiers are defined in the
Clients MUST NOT set a status whose string value they do not recognise, even if its presence type in Statuses matches what the user requested.
Suppose a protocol has statuses that include 'phone' (of type BUSY) and 'in-a-meeting' (of type BUSY), but there is no generic 'busy' status.
If the user requests "Busy" status from a menu, a client author might be tempted to pick an arbitrary status that has type BUSY. However, on this protocol, neither of the choices would be appropriate, and incorrect information about the user would be conveyed.
Statuses whose
To go offline, call
Request that the presence status and status message are published for
the connection. Changes will be indicated by
This method may be called on a newly-created connection while it is still in the DISCONNECTED state, to request that when the connection connects, it will do so with the selected status.
In DISCONNECTED state the
Presence information in the same format as for the
The definition of the connection presence types Unknown and Offline means that if a connection manager will return Unknown for contacts not on the subscribe list, it MUST delay the reply to this method call until it has found out which contacts are, in fact, on the subscribe list.
A dictionary where the keys are the presence statuses that are available on this connection, and the values are the corresponding presence types.
While the connection is in the DISCONNECTED state, it contains the set of presence statuses allowed to be set before connecting. The connection manager will attempt to set the appropriate status when the connection becomes connected, but cannot necessarily guarantee it. The available statuses cannot change until the connection status changes, so there is no change notification.
While the connection is in the CONNECTED state, this property contains the set of presence statuses which are actually available on this protocol. This set is constant for the remaining lifetime of the connection, so again, there is no change notification.
While the connection is in the CONNECTING state, the value of this property is undefined and SHOULD NOT be used. It can change at any time without notification (in particular, any cached values from when the connection was in the DISCONNECTED or CONNECTING state MUST NOT be assumed to still be correct when the state has become CONNECTED).
This property MUST include the special statuses "unknown" and "error" if and only if the connection manager can emit them as a contact's status.
The same struct that would be returned by
This interface is for services which have a concept of presence which can be published for yourself and monitored on your contacts.
Presence on an individual (yourself or one of your contacts) is
modelled as a status and a status message. Valid statuses are defined
per connection, and a list of those that can be set on youself
can be obtained from the
Each status has an arbitrary string identifier which should have an agreed meaning between the connection manager and any client which is expected to make use of it. The following well-known values should be used where possible to allow clients to identify common choices:
status identifier | Connection_Presence_Type | comments |
---|---|---|
available | Connection_Presence_Type_Available | |
away | Connection_Presence_Type_Away | |
brb | Connection_Presence_Type_Away | Be Right Back (a more specific form of Away) |
busy | Connection_Presence_Type_Busy | |
dnd | Connection_Presence_Type_Busy | Do Not Disturb (a more specific form of Busy) |
xa | Connection_Presence_Type_Extended_Away | Extended Away |
hidden | Connection_Presence_Type_Hidden | Also known as "Invisible" or "Appear Offline" |
offline | Connection_Presence_Type_Offline | |
unknown | Connection_Presence_Type_Unknown | special, see below |
error | Connection_Presence_Type_Error | special, see below |
As well as these well-known status identifiers, every status also has
a numerical type value chosen from
These numerical types exist so that even if a client does not understand the string identifier being used, and hence cannot present the presence to the user to set on themselves, it may display an approximation of the presence if it is set on a contact.
As well as the normal status identifiers, there are two special ones that may be present: 'unknown' with type Unknown and 'error' with type Error. 'unknown' indicates that it is impossible to determine the presence of a contact at this time, for example because it's not on the 'subscribe' list and the protocol only allows one to determine the presence of contacts you're subscribed to. 'error' indicates that there was a failure in determining the status of a contact.
If the connection has a 'subscribe' contact list,