TelepathyGLib.ChannelDispatchOperation

g GObject.Object GObject.Object TelepathyGLib.Proxy TelepathyGLib.Proxy GObject.Object->TelepathyGLib.Proxy TelepathyGLib.ChannelDispatchOperation TelepathyGLib.ChannelDispatchOperation TelepathyGLib.Proxy->TelepathyGLib.ChannelDispatchOperation

Subclasses:

None

Methods

Inherited:

TelepathyGLib.Proxy (11), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

get_feature_quark_core ()

class

init_known_interfaces ()

class

new (bus_daemon, object_path, immutable_properties)

claim_async (callback, *user_data)

claim_finish (result)

claim_with_async (client, callback, *user_data)

claim_with_finish (result)

close_channels_async (callback, *user_data)

close_channels_finish (result)

destroy_channels_async (callback, *user_data)

destroy_channels_finish (result)

get_channels ()

handle_with_async (handler, callback, *user_data)

handle_with_finish (result)

handle_with_time_async (handler, user_action_time, callback, *user_data)

handle_with_time_finish (result)

leave_channels_async (reason, message, callback, *user_data)

leave_channels_finish (result)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

TelepathyGLib.Proxy (5)

Name

Type

Flags

Short Description

account

TelepathyGLib.Account

r/w/co

The TelepathyGLib.Account of this channel dispatch operation

channels

GLib.PtrArray

r/w/co

The TelepathyGLib.Channel to be dispatched

connection

TelepathyGLib.Connection

r/w/co

The TelepathyGLib.Connection of this channel dispatch operation

possible-handlers

[str]

r

Possible handlers for the channels

Signals

Inherited:

TelepathyGLib.Proxy (2), GObject.Object (1)

Name

Short Description

channel-lost

Emitted when a channel has closed before it could be claimed or handled.

Fields

Inherited:

TelepathyGLib.Proxy (2), GObject.Object (1)

Name

Type

Access

Description

parent

TelepathyGLib.Proxy

r

Class Details

class TelepathyGLib.ChannelDispatchOperation(**kwargs)
Bases:

TelepathyGLib.Proxy

Abstract:

No

Structure:

TelepathyGLib.ChannelDispatchOperationClass

One of the channel dispatcher’s functions is to offer incoming channels to Approver clients for approval. An approver should generally ask the user whether they want to participate in the requested communication channels (join the chat or chatroom, answer the call, accept the file transfer, or whatever is appropriate). A collection of channels offered in this way is represented by a ChannelDispatchOperation object.

If the user wishes to accept the communication channels, the approver should call tp_cli_channel_dispatch_operation_call_handle_with() to indicate the user’s or approver’s preferred handler for the channels (the empty string indicates no particular preference, and will cause any suitable handler to be used).

If the user wishes to reject the communication channels, or if the user accepts the channels and the approver will handle them itself, the approver should call tp_cli_channel_dispatch_operation_call_claim(). If this method succeeds, the approver immediately has control over the channels as their primary handler, and may do anything with them (in particular, it may close them in whatever way seems most appropriate).

There are various situations in which the channel dispatch operation will be closed, causing the TelepathyGLib.Proxy ::invalidated signal to be emitted. If this happens, the approver should stop prompting the user.

Because all approvers are launched simultaneously, the user might respond to another approver; if this happens, the TelepathyGLib.Proxy ::invalidated signal will be emitted with the domain %TP_DBUS_ERRORS and the error code TelepathyGLib.DBusError.OBJECT_REMOVED.

If a channel closes, the TelepathyGLib.ChannelDispatchOperation ::channel-lost signal is emitted. If all channels close, there is nothing more to dispatch, so the TelepathyGLib.Proxy ::invalidated signal will be emitted with the domain %TP_DBUS_ERRORS and the error code TelepathyGLib.DBusError.OBJECT_REMOVED.

If the channel dispatcher crashes or exits, the TelepathyGLib.Proxy ::invalidated signal will be emitted with the domain %TP_DBUS_ERRORS and the error code TelepathyGLib.DBusError.NAME_OWNER_LOST. In a high-quality implementation, the dispatcher should be restarted, at which point it will create new channel dispatch operations for any undispatched channels, and the approver will be notified again.

Creating a TelepathyGLib.ChannelDispatchOperation directly is deprecated: it should only be created via a TelepathyGLib.BaseClient.

Since 0.16, TelepathyGLib.ChannelDispatchOperation always has a non-None TelepathyGLib.Proxy :factory, which will be propagated to the TelepathyGLib.Account, TelepathyGLib.Connection and TelepathyGLib.Channel.

New in version 0.7.32.

classmethod get_feature_quark_core()
Return type:

int

classmethod init_known_interfaces()

Ensure that the known interfaces for TelepathyGLib.ChannelDispatchOperation 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_CHANNEL_DISPATCH_OPERATION.

New in version 0.7.32.

classmethod new(bus_daemon, object_path, immutable_properties)
Parameters:
  • bus_daemon (TelepathyGLib.DBusDaemon) – Proxy for the D-Bus daemon

  • object_path (str) – The non-None object path of this channel dispatch operation

  • immutable_properties ({object: object}) – As many as are known of the immutable D-Bus properties of this channel dispatch operation, or None if none are known

Raises:

GLib.Error

Returns:

a new reference to an channel dispatch operation proxy, or None if object_path is not syntactically valid or the channel dispatcher is not running

Return type:

TelepathyGLib.ChannelDispatchOperation

Convenience function to create a new channel dispatch operation proxy.

The immutable_properties argument is not yet used.

Deprecated since version 0.19.9: New code should get TelepathyGLib.ChannelDispatchOperation objects from a TelepathyGLib.BaseClient

claim_async(callback, *user_data)
Parameters:

Called by an approver to claim channels for handling internally. If this method is called successfully, the process calling this method becomes the handler for the channel.

If successful, this method will cause the TelepathyGLib.Proxy ::invalidated signal to be emitted, in the same way as for TelepathyGLib.ChannelDispatchOperation.handle_with_async().

This method may fail because the dispatch operation has already been completed. Again, see TelepathyGLib.ChannelDispatchOperation.handle_with_async() for more details. The approver MUST NOT attempt to interact with the channels further in this case.

New in version 0.11.5.

Deprecated since version ???: since 0.15.0. Use TelepathyGLib.ChannelDispatchOperation.claim_with_async()

claim_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

True if the Claim() call was successful, otherwise False

Return type:

bool

Finishes an async call to Claim().

New in version 0.11.5.

Deprecated since version ???: since 0.15.0. Use TelepathyGLib.ChannelDispatchOperation.claim_with_finish()

claim_with_async(client, callback, *user_data)
Parameters:

Called by an approver to claim channels for handling internally. If this method is called successfully, the process calling this method becomes the handler for the channel.

If successful, this method will cause the TelepathyGLib.Proxy ::invalidated signal to be emitted, in the same way as for TelepathyGLib.ChannelDispatchOperation.handle_with_async().

This method may fail because the dispatch operation has already been completed. Again, see TelepathyGLib.ChannelDispatchOperation.handle_with_async() for more details. The approver MUST NOT attempt to interact with the channels further in this case.

This is an improved version of TelepathyGLib.ChannelDispatchOperation.claim_async() as it tells client about the new channels being handled.

%TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE feature must be prepared before calling this function.

New in version 0.15.0.

claim_with_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

True if the Claim() call was successful, otherwise False

Return type:

bool

Finishes an async call to Claim() initiated using TelepathyGLib.ChannelDispatchOperation.claim_with_async().

New in version 0.15.0.

close_channels_async(callback, *user_data)
Parameters:

Called by an approver to claim channels and close them all right away. If this method is called successfully, self has been claimed and TelepathyGLib.Channel.close_async() has been called on all of its channels.

If successful, this method will cause the TelepathyGLib.Proxy ::invalidated signal to be emitted, in the same way as for TelepathyGLib.ChannelDispatchOperation.handle_with_async().

This method may fail because the dispatch operation has already been completed. Again, see TelepathyGLib.ChannelDispatchOperation.handle_with_async() for more details.

%TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE feature must be prepared before calling this function.

New in version 0.15.1.

close_channels_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

True if the Claim() call was successful and Close() has at least been attempted on all the channels, otherwise False

Return type:

bool

Finishes an async operation initiated using TelepathyGLib.ChannelDispatchOperation.close_channels_async().

New in version 0.15.1.

destroy_channels_async(callback, *user_data)
Parameters:

Called by an approver to claim channels and destroy them all right away. If this method is called successfully, self has been claimed and TelepathyGLib.Channel.destroy_async() has been called on all of its channels.

If successful, this method will cause the TelepathyGLib.Proxy ::invalidated signal to be emitted, in the same way as for TelepathyGLib.ChannelDispatchOperation.handle_with_async().

This method may fail because the dispatch operation has already been completed. Again, see TelepathyGLib.ChannelDispatchOperation.handle_with_async() for more details.

%TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE feature must be prepared before calling this function.

New in version 0.15.2.

destroy_channels_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

True if the Claim() call was successful and TelepathyGLib.Channel.destroy_async() has at least been attempted on all the channels, otherwise False

Return type:

bool

Finishes an async operation initiated using TelepathyGLib.ChannelDispatchOperation.destroy_channels_async().

New in version 0.15.2.

get_channels()
Returns:

the value of TelepathyGLib.ChannelDispatchOperation :channels

Return type:

[TelepathyGLib.Channel]

Returns a GLib.PtrArray containing the TelepathyGLib.Channel of this ChannelDispatchOperation. The returned array and its TelepathyGLib.Channel are only valid while self is valid - copy array and reference channels with GObject.Object.ref() if needed.

New in version 0.19.9.

handle_with_async(handler, callback, *user_data)
Parameters:

Called by an approver to accept a channel bundle and request that the given handler be used to handle it.

If successful, this method will cause the TelepathyGLib.Proxy ::invalidated signal to be emitted with the TelepathyGLib.DBusError.OBJECT_REMOVED error code.

However, this method may fail because the dispatch has already been completed and the object has already gone. If this occurs, it indicates that another approver has asked for the bundle to be handled by a particular handler. The approver MUST NOT attempt to interact with the channels further in this case, unless it is separately invoked as the handler.

Approvers which are also channel handlers SHOULD use TelepathyGLib.ChannelDispatchOperation.claim_async() instead of TelepathyGLib.ChannelDispatchOperation.handle_with_async() to request that they can handle a channel bundle themselves.

New in version 0.11.5.

handle_with_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

True if the HandleWith() call was successful, otherwise False

Return type:

bool

Finishes an async call to HandleWith().

New in version 0.11.5.

handle_with_time_async(handler, user_action_time, callback, *user_data)
Parameters:

A variant of TelepathyGLib.ChannelDispatchOperation.handle_with_async() allowing the approver to pass an user action time. This timestamp will be passed to the Handler when HandleChannels is called.

If an X server timestamp for the user action causing this method call is available, user_action_time should be this timestamp (for instance, the result of gdk_event_get_time() if it is not %GDK_CURRENT_TIME). Otherwise, it may be TelepathyGLib.USER_ACTION_TIME_NOT_USER_ACTION to behave as if there was no user action or it happened a long time ago, or %TP_USER_ACTION_TIME_CURRENT_TIME to have the Handler behave as though the user action had just happened (resembling, but not numerically equal to, %GDK_CURRENT_TIME).

This method has been introduced in telepathy-mission-control 5.5.0.

New in version 0.11.7.

handle_with_time_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

True if the HandleWithTime() call was successful, otherwise False

Return type:

bool

Finishes an async call to HandleWithTime().

New in version 0.11.7.

leave_channels_async(reason, message, callback, *user_data)
Parameters:

Called by an approver to claim channels and leave them all right away. If this method is called successfully, self has been claimed and TelepathyGLib.Channel.leave_async() has been called on all of its channels.

If successful, this method will cause the TelepathyGLib.Proxy ::invalidated signal to be emitted, in the same way as for TelepathyGLib.ChannelDispatchOperation.handle_with_async().

This method may fail because the dispatch operation has already been completed. Again, see TelepathyGLib.ChannelDispatchOperation.handle_with_async() for more details.

%TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE feature must be prepared before calling this function.

New in version 0.15.2.

leave_channels_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

True if the Claim() call was successful and TelepathyGLib.Channel.leave_async() has at least been attempted on all the channels, otherwise False

Return type:

bool

Finishes an async operation initiated using TelepathyGLib.ChannelDispatchOperation.leave_channels_async().

New in version 0.15.2.

Signal Details

TelepathyGLib.ChannelDispatchOperation.signals.channel_lost(channel_dispatch_operation, channel, domain, code, message)
Signal Name:

channel-lost

Flags:

RUN_LAST, DETAILED

Parameters:

Emitted when a channel has closed before it could be claimed or handled.

New in version 0.11.5.

Property Details

TelepathyGLib.ChannelDispatchOperation.props.account
Name:

account

Type:

TelepathyGLib.Account

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The TelepathyGLib.Account with which the connection and channels are associated.

Read-only except during construction.

This is not guaranteed to be set until TelepathyGLib.Proxy.prepare_async() has finished preparing %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE.

New in version 0.11.5.

TelepathyGLib.ChannelDispatchOperation.props.channels
Name:

channels

Type:

GLib.PtrArray

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

A GLib.PtrArray containing the TelepathyGLib.Channel to be dispatched.

Read-only.

This is not guaranteed to be set until TelepathyGLib.Proxy.prepare_async() has finished preparing %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE.

New in version 0.11.5.

TelepathyGLib.ChannelDispatchOperation.props.connection
Name:

connection

Type:

TelepathyGLib.Connection

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The TelepathyGLib.Connection with which the channels are associated.

Read-only except during construction.

This is not guaranteed to be set until TelepathyGLib.Proxy.prepare_async() has finished preparing %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE.

New in version 0.11.5.

TelepathyGLib.ChannelDispatchOperation.props.possible_handlers
Name:

possible-handlers

Type:

[str]

Default Value:

[]

Flags:

READABLE

A #GStrv containing the well known bus names (starting with TelepathyGLib.CLIENT_BUS_NAME_BASE) of the possible Handlers for the channels

Read-only except during construction.

This is not guaranteed to be set until TelepathyGLib.Proxy.prepare_async() has finished preparing %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE.

New in version 0.11.5.