[Telepathy] Proposed standard MC API
robert.mcqueen at collabora.co.uk
Thu Aug 16 11:20:57 PDT 2007
Sjoerd Simons wrote:
> On Wed, Aug 01, 2007 at 03:31:32PM +0100, George Wright wrote:
>> GetOnlineAccounts ( ) -> ao
>> Returns the object paths of all the accounts which are
>> currently online.
>> ConnectAll ( ) -> nothing
>> Requests all accounts go online with the default presence.
>> SetGlobalPresence ( u: presence_state, s: message ) -> nothing
>> Set a global presence and message on all accounts, putting accounts
>> online if necessary.
These two functions can all go away in favour of a SetMatchingPresence,
which has the same params as FindAccounts and takes a presence state and
message. Then you can manipulate all accounts by providing empty
parameters, or all "enabled" accounts by providing whatever group your
client uses to represent that.
Note that FindAccounts should take an array of groups, so you can match
accounts which belong to all of a given set of groups. This means
providing an empty array of groups will match all accounts.
> Also as you noted else where. This function kinda makes ConnectAll redundant.
> Although i'm wondering if SetGlobalPresence should really have putting
> connection online as a side-effect, seems somewhat counter-intuitive.
I don't think so, why should people be concerned with manipulating
presence and "is the CM connected" independently? There's not really a
state that is connected but doesn't imply a presence anyway, and on
protocols that don't have any you can represent connectedness as
"available" vs "offline".
> As a side note.. First putting the connection online and setting the presence
> directly afterwards is quite inefficient for telepathy-salut and possibly
> others. CM Clients (The MC in this case) should first try to setup the presence
> and only then connect.
There's a spec branch in merge monkey (if not merged?) which allows you
to set presence when accounts are offline, which means you can go
directly from offline to invisible, etc. MC should try to use this, and
only fall back to directly calling Connect if it's unavailable.
More information about the Telepathy