Bug 24104

Summary: TpAccountManager: have a concept of the global presence that new accounts get
Product: Telepathy Reporter: Simon McVittie <smcv>
Component: tp-specAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED MOVED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: enhancement    
Priority: medium CC: marco.barisione, vinaysubscribe
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 25472, 32956    

Description Simon McVittie 2009-09-23 04:45:13 UTC
From Bug #24061:

> > > TpConnectionPresenceType tp_account_manager_get_requested_global_presence (
> > >     TpAccountManager *manager, gchar **status, gchar **message);
> > 
> > Can this be removed? I'm not sure why we need it.
>
> Basically the issue (as discussed at various points) is that we can't know from
> the AM what the user last set as a presence. This is particularily annoying
> when creating a new account, as we don't know what its initial status should
> be. This function allows one to at least have a proper default. Ofcourse it
> only works as long as the presence setter and the account UI are the same
> process, which hopefully will stop being so during the G2.29 series.

We should have a proper way to do this over D-Bus (which I'd prefer phrased as "the default presence for new accounts" rather than "the global presence"), and when we do, we can add *that* to the TpAM API.
Comment 1 Simon McVittie 2010-04-22 04:05:12 UTC
Straw-man API:

property AccountManager.DefaultPresence: (uss)
    The default RequestedPresence with which to create new accounts, if
    none is specified in the _CreateAccount_ call.

method AccountManager.SetAllPresences(u, s, s) -> nothing
    Set DefaultPresence according to the arguments, then set the
    RequestedPresence of every account to the same value.

Please also consider Bug #26752 when working on this; it might be best to spec and implement both of these features at the same time.
Comment 2 Simon McVittie 2010-07-12 09:50:05 UTC
On Bug #29021, wjt writes:
> It would be nice if the default value of ConnectAutomatically and
> AutomaticPresence could be configured (by tonking properties on AM, say).
> 
> It would also be nice to be able to configure these two properties globally,
> say by tonking some other properties on AM. Then Empathy could show UI like
> this:
> 
>   [×] Automatically connect on startup
> 
>   Default status: ( ) Available
>                   (o) Busy
>                   ( ) Invisible
> 
> and implement it by setting two properties rather than 2 × n properties.

We have a number of related things:

* default requested presence for new accounts (can be offline)

* default automatic presence for new accounts (cannot be offline)

* whether accounts should connect automatically if connectivity is available

Regardless of the value of ConnectAutomatically, accounts will also connect with AutomaticPresence if a channel is requested, which is why AutomaticPresence is only allowed to be an online presence.

A possible API:

property AccountManager.DefaultConnectAutomatically: b r/w
    The default ConnectAutomatically state with which to create new accounts,
    if none is specified in the _CreateAccount_ call.

method AccountManager.SetAllConnectAutomatically(b) -> nothing
    Set DefaultConnectAutomatically, and the ConnectAutomatically properties
    of all accounts, to the given value.

property AccountManager.DefaultAutomaticPresence: (uss) r/w
    The default AutomaticPresence with which to create new accounts, if
    none is specified in the _CreateAccount_ call.

method AccountManager.SetAllAutomaticPresences(u, s, s) -> nothing
    Set DefaultAutomaticPresence, and the AutomaticPresence properties
    of all accounts, to the given value.

method AccountManager.SetAllPresences(u, s, s, b: Save_Default) -> nothing
    Set the RequestedPresence of every account to the same value.
    If Save_Default is TRUE, and the presence is not offline, also
    set DefaultAutomaticPresence, and the AutomaticPresence properties
    of all accounts, to that value.

addendum to RequestedPresence:
    If ConnectAutomatically is TRUE, the RequestedPresence of a new account
    defaults to its AutomaticPresence; otherwise, it defaults to
    (Offline, "offline", "").
Comment 3 GitLab Migration User 2019-12-03 20:19:07 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/telepathy/telepathy-spec/issues/37.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.