TelepathyGLib.AccountManager¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when an account from manager is disabled. |
|
Emitted when an account from manager is enabled. |
|
Emitted when an account is removed from manager. |
|
Emitted when the validity on account changes. |
|
Emitted when the most available presence on manager changes. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class TelepathyGLib.AccountManager(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The Telepathy Account Manager stores real-time communication accounts and their configuration, places accounts online on request, and manipulates accounts’ presence, nicknames and avatars.
TelepathyGLib.AccountManager
is the “top level” object. Since 0.16 it always has a non-None
TelepathyGLib.Proxy
:factory
, and itsTelepathyGLib.Proxy
:factory
will be propagated to all other objects likeTelepathyGLib.AccountManager
->TelepathyGLib.Account
->TelepathyGLib.Connection
->TelepathyGLib.Contact
andTelepathyGLib.Channel
. This means that desired features set on that factory will be prepared on all those objects. If aTelepathyGLib.Proxy
:factory
is not specified when theTelepathyGLib.AccountManager
is constructed, it will use aTelepathyGLib.AutomaticClientFactory
.TelepathyGLib.AccountManager
example
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include>
New in version 0.7.32.
- classmethod can_set_default()¶
- Returns:
True
ifTelepathyGLib.AccountManager.set_default
() has already successfully been called in this process,False
otherwise.- Return type:
Check if
TelepathyGLib.AccountManager.set_default
() has already successfully been called.New in version 0.19.6.
- classmethod dup()¶
- Returns:
an account manager proxy on the starter or session bus, or
None
if it wasn’t possible to get a dbus daemon proxy for the appropriate bus- Return type:
Returns an account manager proxy on the D-Bus daemon on which this process was activated (if it was launched by D-Bus service activation), or the session bus (otherwise). This account manager will always have the result of
TelepathyGLib.DBusDaemon.dup
() as itsTelepathyGLib.Proxy
:dbus-daemon
.The returned
TelepathyGLib.AccountManager
is cached; the sameTelepathyGLib.AccountManager
object will be returned by this function repeatedly, as long as at least one reference exists. Note that the returnedTelepathyGLib.AccountManager
is not guaranteed to be ready on return.If
TelepathyGLib.AccountManager.set_default
() has been called successfully, thatTelepathyGLib.AccountManager
will be returned. Otherwise, a newTelepathyGLib.AccountManager
will be created the first time this function is called, using a newTelepathyGLib.AutomaticClientFactory
as itsTelepathyGLib.Proxy
:factory
.New in version 0.9.0.
- classmethod get_feature_quark_core()¶
- Returns:
the quark used for representing the core feature of a
TelepathyGLib.AccountManager
- Return type:
New in version 0.9.0.
- classmethod init_known_interfaces()¶
Ensure that the known interfaces for
TelepathyGLib.AccountManager
have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument %TP_TYPE_ACCOUNT_MANAGER.New in version 0.7.32.
- classmethod new(bus_daemon)¶
- Parameters:
bus_daemon (
TelepathyGLib.DBusDaemon
) – Proxy for the D-Bus daemon- Returns:
a new reference to an account manager proxy
- Return type:
Convenience function to create a new account manager proxy. The returned
TelepathyGLib.AccountManager
is not guaranteed to be prepared on return. ItsTelepathyGLib.Proxy
:factory
will be a newTelepathyGLib.AutomaticClientFactory
for bus_daemon.Use
TelepathyGLib.AccountManager.dup
() instead if you want an account manager proxy on the starter or session bus (which is almost always the right thing for Telepathy).
- classmethod new_with_factory(factory)¶
- Parameters:
factory (
TelepathyGLib.SimpleClientFactory
) – aTelepathyGLib.SimpleClientFactory
- Returns:
a new reference to an account manager proxy
- Return type:
Convenience function to create a new account manager proxy. The returned
TelepathyGLib.AccountManager
is not guaranteed to be ready on return.Should be used only by applications having their own
TelepathyGLib.SimpleClientFactory
subclass. Usually this should be done at application startup and followed by a call toTelepathyGLib.AccountManager.set_default
() to ensure other libraries/plugins will use this custom factory as well.
- create_account_async(connection_manager, protocol, display_name, parameters, properties, callback, *user_data)¶
- Parameters:
connection_manager (
str
) – the name of a connection managerprotocol (
str
) – the name of a protocoldisplay_name (
str
) – the display name for the accountparameters ({
str
:GObject.Value
}) – parameters for the new accountproperties ({
str
:GObject.Value
}) – properties for the new accountcallback (
Gio.AsyncReadyCallback
orNone
) – a callback to call when the request is satisfied
Requests an asynchronous create of an account on the account manager self. When the operation is finished, callback will be called. You can then call
TelepathyGLib.AccountManager.create_account_finish
() to get the result of the operation.The
TelepathyGLib.Account
returned byTelepathyGLib.AccountManager.create_account_finish
() will already have %TP_ACCOUNT_FEATURE_CORE prepared, along with all features previously passed toTelepathyGLib.SimpleClientFactory.add_account_features
() for the account manager’sTelepathyGLib.Proxy
:factory
.It is usually better to use
TelepathyGLib.AccountRequest
instead, particularly when using high-level language bindings.New in version 0.9.0.
- create_account_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
a new
TelepathyGLib.Account
which was just created on success, otherwiseNone
- Return type:
Finishes an async create account operation, and returns a new
TelepathyGLib.Account
object. It has %TP_ACCOUNT_FEATURE_CORE prepared, along with all features previously passed toTelepathyGLib.SimpleClientFactory.add_account_features
() for the account manager’sTelepathyGLib.Proxy
:factory
.The caller must keep a ref to the returned object using
GObject.Object.ref
() if it is to be kept beyond the lifetime of result.New in version 0.9.0.
- dup_valid_accounts()¶
- Returns:
a newly allocated
GLib.List
of reffed valid accounts in self- Return type:
Returns a newly allocated
GLib.List
of reffed valid accounts in self. The list must be freed with g_list_free_full() andGObject.Object.unref
() after used.The returned
TelepathyGLib.Account
s are guaranteed to have %TP_ACCOUNT_FEATURE_CORE prepared, along with all features previously passed toTelepathyGLib.SimpleClientFactory.add_account_features
() for the account manager’sTelepathyGLib.Proxy
:factory
.The list of valid accounts returned is not guaranteed to have been retrieved until %TP_ACCOUNT_MANAGER_FEATURE_CORE is prepared (
TelepathyGLib.Proxy.prepare_async
() has returned). Until this feature has been prepared, an empty list (None
) will be returned.New in version 0.19.9.
- enable_restart()¶
Enable autostarting the account manager D-Bus service. This means that the account manager will be restarted if it disappears from the bus.
- ensure_account(path)¶
- Parameters:
path (
str
) – the object path for an account- Returns:
a new
TelepathyGLib.Account
at path, orNone
if path is not a valid account path.- Return type:
Lookup an account in the account manager self. If the desired account has already been ensured then the same object will be returned, otherwise it will create a new
TelepathyGLib.Account
and add it to self. As a result, if self thinks that the account doesn’t exist, this will still add it to self to avoid races.The account will be constructed via this account manager’s
TelepathyGLib.Proxy
:factory
(so it will be of an appropriateTelepathyGLib.Account
subclass if the factory returns one), but does not necessarily have any features prepared yet. UseTelepathyGLib.Proxy.prepare_async
() to prepare features, using the contents ofTelepathyGLib.SimpleClientFactory.dup_account_features
() as a parameter if you want to prepare the same features that would normally be used.The caller must keep a ref to the returned object using
GObject.Object.ref
() if it is to be kept.New in version 0.9.0.
Deprecated since version ???: New code should call
TelepathyGLib.SimpleClientFactory.ensure_account
() on this object’sTelepathyGLib.Proxy
:factory
instead, which ensures that a new reference is returned.
- get_most_available_presence()¶
- Returns:
the most available presence across all accounts
- status:
a string to fill with the actual status
- message:
a string to fill with the actual status message
- Return type:
(
TelepathyGLib.ConnectionPresenceType
, status:str
, message:str
)
Gets the most available presence over all accounts in self. This function does not average presences across all accounts, but it merely finds the “most available” presence. As a result, there is a guarantee that there exists at least one account in self with the returned presence.
If no accounts are enabled or valid the output will be (
TelepathyGLib.ConnectionPresenceType.OFFLINE
, “offline”, “”).Since 0.17.5, if the only connected accounts does not implement
TelepathyGLib.IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE
, the output will be (TelepathyGLib.ConnectionPresenceType.AVAILABLE
, “available”, “”).The return value of this function is not guaranteed to have been retrieved until
TelepathyGLib.Proxy.prepare_async
() has finished; until then, the value will be the same as if no accounts are enabled or valid.New in version 0.9.0.
- get_valid_accounts()¶
- Returns:
a newly allocated
GLib.List
of valid accounts in self- Return type:
Returns a newly allocated
GLib.List
of valid accounts in self. The list must be freed with g_list_free() after used. None of the accounts in the returned list are guaranteed to be ready.Note that the
TelepathyGLib.Account
s in the returnedGLib.List
are not reffed before returning from this function. One could ref every item in the list like the following example:GList *accounts; account = tp_account_manager_get_valid_accounts (manager); g_list_foreach (accounts, (GFunc) g_object_ref, NULL);
The returned
TelepathyGLib.Account
s are guaranteed to have %TP_ACCOUNT_FEATURE_CORE prepared, along with all features previously passed toTelepathyGLib.SimpleClientFactory.add_account_features
() for the account manager’sTelepathyGLib.Proxy
:factory
.The list of valid accounts returned is not guaranteed to have been retrieved until %TP_ACCOUNT_MANAGER_FEATURE_CORE is prepared (
TelepathyGLib.Proxy.prepare_async
() has returned). Until this feature has been prepared, an empty list (None
) will be returned.New in version 0.9.0.
Deprecated since version 0.19.9: New code should use
TelepathyGLib.AccountManager.dup_valid_accounts
() instead.
- set_all_requested_presences(type, status, message)¶
- Parameters:
type (
TelepathyGLib.ConnectionPresenceType
) – a presence type to requeststatus (
str
) – a status to requestmessage (
str
) – a status message to request
Iterates through the accounts in self and requests the presence (type, status and message). Note that the presence requested here is merely a request, and if might not be satisfiable.
You can find the most available presence across all accounts by calling
TelepathyGLib.AccountManager.get_most_available_presence
().Setting a requested presence on all accounts will have no effect until
TelepathyGLib.Proxy.prepare_async
() (or the older tp_account_manager_prepare_async()) has finished.New in version 0.9.0.
- set_default()¶
Define the
TelepathyGLib.AccountManager
singleton that will be returned byTelepathyGLib.AccountManager.dup
().This function may only be called before the first call to
TelepathyGLib.AccountManager.dup
(), and may not be called more than once. Applications which use a customTelepathyGLib.SimpleClientFactory
and want the defaultTelepathyGLib.AccountManager
to use that factory should call this after callingTelepathyGLib.AccountManager.new_with_factory
().Unlike
TelepathyGLib.AccountManager.dup
(), this function will keep an internal reference to self, so it will never be destroyed.Note that self must use the default
TelepathyGLib.DBusDaemon
as returned byTelepathyGLib.DBusDaemon.dup
()New in version 0.15.5.
Signal Details¶
- TelepathyGLib.AccountManager.signals.account_disabled(account_manager, account)¶
- Signal Name:
account-disabled
- Flags:
- Parameters:
account_manager (
TelepathyGLib.AccountManager
) – The object which received the signalaccount (
TelepathyGLib.Account
) – aTelepathyGLib.Account
Emitted when an account from manager is disabled.
New in version 0.9.0.
- TelepathyGLib.AccountManager.signals.account_enabled(account_manager, account)¶
- Signal Name:
account-enabled
- Flags:
- Parameters:
account_manager (
TelepathyGLib.AccountManager
) – The object which received the signalaccount (
TelepathyGLib.Account
) – aTelepathyGLib.Account
Emitted when an account from manager is enabled.
account is guaranteed to have %TP_ACCOUNT_FEATURE_CORE prepared, along with all the features previously passed to the
TelepathyGLib.Proxy
:factory
‘sTelepathyGLib.SimpleClientFactory.add_account_features
().New in version 0.9.0.
- TelepathyGLib.AccountManager.signals.account_removed(account_manager, account)¶
- Signal Name:
account-removed
- Flags:
- Parameters:
account_manager (
TelepathyGLib.AccountManager
) – The object which received the signalaccount (
TelepathyGLib.Account
) – aTelepathyGLib.Account
Emitted when an account is removed from manager.
New in version 0.9.0.
- TelepathyGLib.AccountManager.signals.account_validity_changed(account_manager, account, valid)¶
- Signal Name:
account-validity-changed
- Flags:
- Parameters:
account_manager (
TelepathyGLib.AccountManager
) – The object which received the signalaccount (
TelepathyGLib.Account
) – aTelepathyGLib.Account
Emitted when the validity on account changes.
This signal is also used to indicate a new account that did not previously exist has been added (with valid set to
True
).If valid is
True
, account is guaranteed to have %TP_ACCOUNT_FEATURE_CORE prepared, along with all the features previously passed to theTelepathyGLib.Proxy
:factory
‘sTelepathyGLib.SimpleClientFactory.add_account_features
().New in version 0.9.0.
- TelepathyGLib.AccountManager.signals.most_available_presence_changed(account_manager, presence, status, message)¶
- Signal Name:
most-available-presence-changed
- Flags:
- Parameters:
account_manager (
TelepathyGLib.AccountManager
) – The object which received the signalpresence (
int
) – new presence typestatus (
str
) – new statusmessage (
str
) – new status message
Emitted when the most available presence on manager changes.
New in version 0.9.0.