The Account Manager is responsible for managing the user's presence for each configured Account. The presence requested for an account also controls whether that account is connected or disconnected in Mission Control.
The presence you desire for each Account should be set as that account's RequestedPresence property. The Account Manager will then attempt to set that presence on the account, connecting or disconnecting the account as required. The CurrentPresence property can be read to find out what the current presence of an account is.
All presence properties in the Account Manager are of type SimplePresence (see Section 5.3.1 ― The SimplePresence Tuple).
Application authors should be aware that lots of applications may be connected to the Telepathy service and may be interested in displaying or editing the user's presence; that some applications may allow more fine-grained control than others.
The Telepathy specification does not delegate the task of setting the presence to any one client, or type of client. Applications should take care not to trample over the configured presence unneccesarily. Applications should not change the value of RequestedPresence (especially when starting up) unless it is because of a change by the user.
Rather than requesting a default presence to bring themselves online, applications can ensure that they're brought online by requesting their channels from the Channel Dispatcher (for example, ensuring the ContactList channels).
Telepathy allows for a separate presence per-Account (e.g. your work account might be Available/"In the Office" and your personal account might be Busy/"Working"). If a user interface cannot display or edit presence with this level of detail, it should provide some visual indication of this (i.e. similar to the way a checkbox might indicate an inconsistent state).
When using an Account Manager with Telepathy, clients are no longer responsible for establishing their own connections, and indeed will vary rarely make use of the ConnectionManager interface. Connections are instead established through the Account Manager.
The Account Manager will attempt to connect any account that meets three requirements: the account must be valid, the account must be enabled, and the requested presence must be something other than Offline.
The Account Manager will attempt to connect any enabled account that has a RequestedPresence other than Connection_Presence_Type_Offline.
For example, to make an account be connected, you might set the presence (Connection_Presence_Type_Available, "available", "Working Hard"). You can watch the properties Connection, ConnectionStatus, ConnectionStatusReason and CurrentPresence to monitor the state of the new connection via the signal AccountPropertyChanged.
|Online Statuses||Offline Statuses|
To disconnect an account for any reason, simply set its status to Offline with the presence (Connection_Presence_Type_Offline, "offline", "").
Enabled accounts can be brought online automatically at the request of the Channel Dispatcher to service a new channel request.
The AutomaticPresence property can be set on an account to any type of user-requestable online presence (i.e. not Connection_Presence_Type_Offline).
It is expected that this property will usually be set to Available, but some other common mode, like Busy, is also acceptable. Like RequestedPresence, clients should only update this property in response to a request from the user.
Enabled accounts with the ConnectAutomatically property set are brought online automatically by the Account Manager without any action required on the part of the user or other software whenever the Account Manager deems it possible to do so.
The ConnectAutomatically property leaves responsibility of determining when it is possible to establish a connection up to the specific implementation of the Account Manager.
For example, an Account Manager that communicates with a hardware information service, such as NetworkManager may only attempt to establish connections when it knows the network is available. A specific Account Manager implementation may choose only to establish connections automatically on a specific type of network (e.g. one that is uncharged).