Callbacks

AccountChannelRequestDelegatedChannelCb (request, channel, *user_data)

BaseClientClassAddDispatchOperationImpl (client, account, connection, channels, dispatch_operation, context)

BaseClientClassHandleChannelsImpl (client, account, connection, channels, requests_satisfied, user_action_time, context)

BaseClientClassObserveChannelsImpl (client, account, connection, channels, dispatch_operation, requests, context)

BaseClientDelegatedChannelsCb (client, channels, *user_data)

BaseConnectionGetUniqueConnectionNameImpl (self)

BaseConnectionProc (self)

BaseConnectionStartConnectingImpl (self)

ChannelWhenReadyCb (channel, error, *user_data)

ConnectionContactsByHandleCb (connection, contacts, failed, error, user_data, weak_object)

ConnectionContactsByIdCb (connection, contacts, requested_ids, failed_id_errors, error, user_data, weak_object)

ConnectionHoldHandlesCb (connection, handle_type, n_handles, handles, error, user_data, weak_object)

ConnectionManagerListCb (cms, n_cms, error, user_data, weak_object)

ConnectionManagerWhenReadyCb (cm, error, user_data, weak_object)

ConnectionNameListCb (names, n, cms, protocols, error, user_data, weak_object)

ConnectionRequestHandlesCb (connection, handle_type, handles, ids, error, user_data, weak_object)

ConnectionUpgradeContactsCb (connection, contacts, error, user_data, weak_object)

ConnectionWhenReadyCb (connection, error, *user_data)

DBusDaemonListNamesCb (bus_daemon, names, error, user_data, weak_object)

DBusDaemonNameOwnerChangedCb (bus_daemon, name, new_owner, *user_data)

DBusPropertiesMixinGetter (object, iface, name, value, getter_data)

DBusPropertiesMixinSetter (object, iface, name, value, setter_data)

GroupMixinAddMemberFunc (obj, handle, message)

GroupMixinRemMemberFunc (obj, handle, message)

GroupMixinRemMemberWithReasonFunc (obj, handle, message, reason)

IntFunc (i, userdata)

PresenceMixinGetMaximumStatusMessageLengthFunc (obj)

PresenceMixinSetOwnStatusFunc (obj, status)

PresenceMixinStatusAvailableFunc (obj, which)

ProxyPrepareAsync (proxy, feature, callback, *user_data)

SimpleApproverAddDispatchOperationImpl (approver, account, connection, channels, dispatch_operation, context, *user_data)

SimpleHandlerHandleChannelsImpl (handler, account, connection, channels, requests_satisfied, user_action_time, context, *user_data)

SimpleObserverObserveChannelsImpl (observer, account, connection, channels, dispatch_operation, requests, context, *user_data)

Details

TelepathyGLib.AccountChannelRequestDelegatedChannelCb(request, channel, *user_data)
Parameters:

Called when a client asked us to delegate channel to another Handler. When this function is called you are no longer handling channel.

New in version 0.15.3.

TelepathyGLib.BaseClientClassAddDispatchOperationImpl(client, account, connection, channels, dispatch_operation, context)
Parameters:

Signature of the implementation of the AddDispatchOperation method.

This function must call either TelepathyGLib.AddDispatchOperationContext.accept(), TelepathyGLib.AddDispatchOperationContext.delay() or TelepathyGLib.AddDispatchOperationContext.fail() on context before it returns.

The implementation can then use TelepathyGLib.ChannelDispatchOperation.handle_with_async() to approve handling of the channels, or TelepathyGLib.ChannelDispatchOperation.claim_async() to take responsibility for handling or closing them”.

New in version 0.11.5.

TelepathyGLib.BaseClientClassHandleChannelsImpl(client, account, connection, channels, requests_satisfied, user_action_time, context)
Parameters:

Signature of the implementation of the HandleChannels method.

This function must call either TelepathyGLib.HandleChannelsContext.accept(), TelepathyGLib.HandleChannelsContext.delay() or TelepathyGLib.HandleChannelsContext.fail() on context before it returns.

New in version 0.11.6.

TelepathyGLib.BaseClientClassObserveChannelsImpl(client, account, connection, channels, dispatch_operation, requests, context)
Parameters:

Signature of the implementation of the ObserveChannels method.

This function must call either TelepathyGLib.ObserveChannelsContext.accept(), TelepathyGLib.ObserveChannelsContext.delay() or TelepathyGLib.ObserveChannelsContext.fail() on context before it returns.

New in version 0.11.5.

TelepathyGLib.BaseClientDelegatedChannelsCb(client, channels, *user_data)
Parameters:

Called when a client asked us to delegate channels to another Handler. When this function is called client is not longer handling channels.

New in version 0.15.3.

TelepathyGLib.BaseConnectionGetUniqueConnectionNameImpl(self)
Parameters:

self (TelepathyGLib.BaseConnection) – The implementation, a subclass of TelepathyGLib.BaseConnection

Returns:

a name for this connection which will be unique within this connection manager process, as a string which the caller must free with GLib.free.

Return type:

str

Signature of the get_unique_connection_name virtual method on TelepathyGLib.BaseConnection.

TelepathyGLib.BaseConnectionProc(self)
Parameters:

self (TelepathyGLib.BaseConnection) – The connection object

Signature of a virtual method on TelepathyGLib.BaseConnection that takes no additional parameters and returns nothing.

TelepathyGLib.BaseConnectionStartConnectingImpl(self)
Parameters:

self (TelepathyGLib.BaseConnection) – The connection object

Returns:

False if failure has already occurred, else True.

Return type:

bool

Signature of an implementation of the start_connecting method of TelepathyGLib.BaseConnection.

On entry, the implementation may assume that it is in state NEW.

If True is returned, the Connect D-Bus method succeeds; the implementation must either have already set the status to CONNECTED by calling TelepathyGLib.BaseConnection.change_status(), or have arranged for a status change to either state DISCONNECTED or CONNECTED to be signalled by calling TelepathyGLib.BaseConnection.change_status() at some later time. If the status is still NEW after returning True, TelepathyGLib.BaseConnection will automatically change it to CONNECTING for reason REQUESTED.

If False is returned, the error will be raised from Connect as an exception. If the status is not DISCONNECTED after False is returned, TelepathyGLib.BaseConnection will automatically change it to DISCONNECTED with a reason appropriate to the error; NetworkError results in NETWORK_ERROR, PermissionDenied results in AUTHENTICATION_FAILED, and all other errors currently result in NONE_SPECIFIED.

All except the simplest connection managers are expected to implement this asynchronously, returning True in most cases and changing the status to CONNECTED or DISCONNECTED later.

TelepathyGLib.ChannelWhenReadyCb(channel, error, *user_data)
Parameters:

Signature of a callback passed to tp_channel_call_when_ready(), which will be called exactly once, when the channel becomes ready or invalid (whichever happens first)

Deprecated since version 0.17.6.

TelepathyGLib.ConnectionContactsByHandleCb(connection, contacts, failed, error, user_data, weak_object)
Parameters:

Signature of a callback used to receive the result of TelepathyGLib.Connection.get_contacts_by_handle().

If an unrecoverable error occurs (for instance, if connection becomes disconnected) the whole operation fails, and no contacts or invalid handles are returned.

If some or even all of the handles passed to TelepathyGLib.Connection.get_contacts_by_handle() were not valid, this is not considered to be a failure. error will be None in this situation, contacts will contain contact objects for those handles that were valid (possibly none of them), and invalid will contain the handles that were not valid.

New in version 0.7.18.

TelepathyGLib.ConnectionContactsByIdCb(connection, contacts, requested_ids, failed_id_errors, error, user_data, weak_object)
Parameters:

Signature of a callback used to receive the result of TelepathyGLib.Connection.get_contacts_by_id().

requested_ids contains the IDs that were converted to handles successfully. The normalized form of requested_ids[i] is TelepathyGLib.Contact.get_identifier (contacts[i]).

If some or even all of the ids passed to TelepathyGLib.Connection.get_contacts_by_id() were not valid, this is not considered to be a fatal error. error will be None in this situation, contacts will contain contact objects for those IDs that were valid (it may be empty), and failed_id_errors will map the IDs that were not valid to a corresponding GLib.Error (if the connection manager complies with the Telepathy spec, it will have domain %TP_ERROR and code TelepathyGLib.Error.INVALID_HANDLE).

If an unrecoverable error occurs (for instance, if connection becomes disconnected) the whole operation fails, and no contacts or requested IDs are returned. failed_id_errors will contain all the IDs that were requested, mapped to a corresponding GLib.Error (either one indicating that the ID was invalid, if that was determined before the fatal error occurred, or a copy of error).

New in version 0.7.18.

TelepathyGLib.ConnectionHoldHandlesCb(connection, handle_type, n_handles, handles, error, user_data, weak_object)
Parameters:

Signature of the callback called when TelepathyGLib.Connection.hold_handles() succeeds or fails.

On success, the caller has a reference to each handle in handles.

Since telepathy-glib version 0.13.8, the handles will remain valid until connection becomes invalid (signalled by TelepathyGLib.Proxy ::invalidated). In earlier versions, they could be released with TelepathyGLib.Connection.unref_handles().

For convenience, the handle type and handles requested by the caller are passed through to this callback on success, so the caller does not have to include them in user_data.

Deprecated since version ???: See TelepathyGLib.Connection.hold_handles().

TelepathyGLib.ConnectionManagerListCb(cms, n_cms, error, user_data, weak_object)
Parameters:

Signature of the callback supplied to TelepathyGLib.list_connection_managers().

Since 0.11.3, TelepathyGLib.list_connection_managers() will wait for %TP_CONNECTION_MANAGER_FEATURE_CORE to be prepared on each connection manager passed to callback, unless an error occurred while launching that connection manager.

New in version 0.7.1.

TelepathyGLib.ConnectionManagerWhenReadyCb(cm, error, user_data, weak_object)
Parameters:

Called as the result of tp_connection_manager_call_when_ready(). If the connection manager’s protocol and parameter information could be retrieved, error is None and cm is considered to be ready. Otherwise, error is non-None and cm is not ready.

Deprecated since version ???: since 0.17.6, use TelepathyGLib.Proxy.prepare_async() instead

TelepathyGLib.ConnectionNameListCb(names, n, cms, protocols, error, user_data, weak_object)
Parameters:
  • names ([str]) – None-terminated array of n connection bus names, or None on error

  • n (int) – number of names (not including the final None), or 0 on error

  • cms ([str]) – None-terminated array of n connection manager names (e.g. “gabble”) in the same order as names, or None on error

  • protocols ([str]) – None-terminated array of n protocol names as defined in the Telepathy spec (e.g. “jabber”) in the same order as names, or None on error

  • error (GLib.Error) – None on success, or an error that occurred

  • user_data (object or None) – user-supplied data

  • weak_object (GObject.Object) – user-supplied weakly referenced object

Signature of the callback supplied to TelepathyGLib.list_connection_names().

New in version 0.7.1.

TelepathyGLib.ConnectionRequestHandlesCb(connection, handle_type, handles, ids, error, user_data, weak_object)
Parameters:

Signature of the callback called when TelepathyGLib.Connection.request_handles() succeeds or fails.

On success, the caller has a reference to each handle in handles.

Since telepathy-glib version 0.13.8, the handles will remain valid until connection becomes invalid (signalled by TelepathyGLib.Proxy ::invalidated). In earlier versions, they could be released with TelepathyGLib.Connection.unref_handles().

For convenience, the handle type and IDs requested by the caller are passed through to this callback, so the caller does not have to include them in user_data.

Deprecated since version ???: See TelepathyGLib.Connection.request_handles().

TelepathyGLib.ConnectionUpgradeContactsCb(connection, contacts, error, user_data, weak_object)
Parameters:

Signature of a callback used to receive the result of TelepathyGLib.Connection.upgrade_contacts().

If an unrecoverable error occurs (for instance, if connection becomes disconnected) it is indicated by error, but the contacts in contacts are still provided.

New in version 0.7.18.

TelepathyGLib.ConnectionWhenReadyCb(connection, error, *user_data)
Parameters:

Signature of a callback passed to tp_connection_call_when_ready(), which will be called exactly once, when the connection becomes ready or invalid (whichever happens first)

Deprecated since version 0.17.6.

TelepathyGLib.DBusDaemonListNamesCb(bus_daemon, names, error, user_data, weak_object)
Parameters:

Signature of a callback for functions that list bus names.

New in version 0.7.35.

TelepathyGLib.DBusDaemonNameOwnerChangedCb(bus_daemon, name, new_owner, *user_data)
Parameters:

The signature of the callback called by TelepathyGLib.DBusDaemon.watch_name_owner().

New in version 0.7.1.

TelepathyGLib.DBusPropertiesMixinGetter(object, iface, name, value, getter_data)
Parameters:

Signature of a callback used to get the value of a property.

For simplicity, in this mixin we don’t allow getting a property to fail; implementations must always be prepared to return *something*.

TelepathyGLib.DBusPropertiesMixinSetter(object, iface, name, value, setter_data)
Parameters:
Returns:

True on success, False (setting error) on failure

Return type:

bool

Signature of a callback used to get the value of a property.

TelepathyGLib.GroupMixinAddMemberFunc(obj, handle, message)
Parameters:
  • obj (GObject.Object) – An object implementing the group interface with this mixin

  • handle (int) – The handle of the contact to be added

  • message (str) – A message to be sent if the protocol supports it

Returns:

True on success, False with error set on error

Return type:

bool

Signature of the callback used to add a member to the group. This should perform the necessary operations in the underlying IM protocol to cause the member to be added.

TelepathyGLib.GroupMixinRemMemberFunc(obj, handle, message)
Parameters:
  • obj (GObject.Object) – An object implementing the group interface with this mixin

  • handle (int) – The handle of the contact to be removed

  • message (str) – A message to be sent if the protocol supports it

Returns:

True on success, False with error set on error

Return type:

bool

Signature of the callback used to remove a member from the group. This should perform the necessary operations in the underlying IM protocol to cause the member to be removed.

TelepathyGLib.GroupMixinRemMemberWithReasonFunc(obj, handle, message, reason)
Parameters:
Returns:

True on success, False with error set on error

Return type:

bool

Signature of the callback used to remove a member from the group. This should perform the necessary operations in the underlying IM protocol to cause the member to be removed.

Set this with tp_group_mixin_class_set_remove_with_reason_func(), .

TelepathyGLib.IntFunc(i, userdata)
Parameters:
  • i (int) – The relevant integer

  • userdata (object or None) – Opaque user data

A callback function acting on unsigned integers.

TelepathyGLib.PresenceMixinGetMaximumStatusMessageLengthFunc(obj)
Parameters:

obj (GObject.Object) – An object with this mixin.

Returns:

the maximum number of UTF-8 characters which may appear in a status message, or 0 if there is no limit.

Return type:

int

Signature of a callback used to determine the maximum length of status messages. If this callback is provided and returns non-zero, the TelepathyGLib.PresenceMixinSetOwnStatusFunc implementation is responsible for truncating the message to fit this limit, if necessary.

New in version 0.14.5.

TelepathyGLib.PresenceMixinSetOwnStatusFunc(obj, status)
Parameters:
Returns:

True if the operation was successful, False if not.

Return type:

bool

Signature of the callback used to commit changes to the user’s own presence status in SetStatuses. It is also used in ClearStatus and RemoveStatus to reset the user’s own status back to the “default” one with a None status argument.

The optional_arguments hash table in status, if not None, will have been filtered so it only contains recognised parameters, so the callback need not (and cannot) check for unrecognised parameters. However, the types of the parameters are not currently checked, so the callback is responsible for doing so.

The callback is responsible for emitting PresenceUpdate, if appropriate, by calling tp_presence_mixin_emit_presence_update().

TelepathyGLib.PresenceMixinStatusAvailableFunc(obj, which)
Parameters:
Returns:

True if the status can be set on this connection; False if not.

Return type:

bool

Signature of a callback to be used to determine if a given presence status can be set on the connection. Most users of this mixin do not need to supply an implementation of this callback: the value of TelepathyGLib.PresenceStatusSpec.self is enough to determine whether this is a user-settable presence, so None should be passed to tp_presence_mixin_class_init() for this callback.

One place where this callback may be needed is on XMPP: not all server implementation support the user becoming invisible. So an XMPP implementation would implement this function, so that—once connected—the hidden status is only available if the server supports it. Before the connection is connected, this callback should return True for every status that might possibly be supported: this allows the user to at least try to sign in as invisible.

TelepathyGLib.ProxyPrepareAsync(proxy, feature, callback, *user_data)
Parameters:

Function called when feature has to be prepared for proxy.

TelepathyGLib.SimpleApproverAddDispatchOperationImpl(approver, account, connection, channels, dispatch_operation, context, *user_data)
Parameters:

Signature of the implementation of the AddDispatchOperation method.

This function must call either TelepathyGLib.AddDispatchOperationContext.accept(), TelepathyGLib.AddDispatchOperationContext.delay() or TelepathyGLib.AddDispatchOperationContext.fail() on context before it returns.

New in version 0.11.5.

TelepathyGLib.SimpleHandlerHandleChannelsImpl(handler, account, connection, channels, requests_satisfied, user_action_time, context, *user_data)
Parameters:

Signature of the implementation of the HandleChannels method.

This function must call either TelepathyGLib.HandleChannelsContext.accept(), TelepathyGLib.HandleChannelsContext.delay() or TelepathyGLib.HandleChannelsContext.fail() on context before it returns.

New in version 0.11.6.

TelepathyGLib.SimpleObserverObserveChannelsImpl(observer, account, connection, channels, dispatch_operation, requests, context, *user_data)
Parameters:

Signature of the implementation of the ObserveChannels method.

This function must call either TelepathyGLib.ObserveChannelsContext.accept(), TelepathyGLib.ObserveChannelsContext.delay() or TelepathyGLib.ObserveChannelsContext.fail() on context before it returns.

New in version 0.11.5.