TelepathyGLib.ChannelDispatchOperation¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
The |
||
r/w/co |
The |
||
r/w/co |
The |
||
[ |
r |
Possible handlers for the channels |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when a channel has closed before it could be claimed or handled. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class TelepathyGLib.ChannelDispatchOperation(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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 codeTelepathyGLib.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 theTelepathyGLib.Proxy
::invalidated
signal will be emitted with the domain %TP_DBUS_ERRORS and the error codeTelepathyGLib.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 codeTelepathyGLib.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 aTelepathyGLib.BaseClient
.Since 0.16,
TelepathyGLib.ChannelDispatchOperation
always has a non-None
TelepathyGLib.Proxy
:factory
, which will be propagated to theTelepathyGLib.Account
,TelepathyGLib.Connection
andTelepathyGLib.Channel
.New in version 0.7.32.
- 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 daemonobject_path (
str
) – The non-None
object path of this channel dispatch operationimmutable_properties ({
object
:object
}) – As many as are known of the immutable D-Bus properties of this channel dispatch operation, orNone
if none are known
- Raises:
- 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:
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 aTelepathyGLib.BaseClient
- claim_async(callback, *user_data)¶
- Parameters:
callback (
Gio.AsyncReadyCallback
orNone
) – a callback to call when the call returns
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 forTelepathyGLib.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
) – aGio.AsyncResult
- Raises:
- Returns:
- Return type:
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:
client (
TelepathyGLib.BaseClient
) – theTelepathyGLib.BaseClient
claiming selfcallback (
Gio.AsyncReadyCallback
orNone
) – a callback to call when the call returns
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 forTelepathyGLib.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
) – aGio.AsyncResult
- Raises:
- Returns:
- Return type:
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:
callback (
Gio.AsyncReadyCallback
orNone
) – a callback to call when the request has been satisfied
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 forTelepathyGLib.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
) – aGio.AsyncResult
- Raises:
- Returns:
True
if the Claim() call was successful and Close() has at least been attempted on all the channels, otherwiseFalse
- Return type:
Finishes an async operation initiated using
TelepathyGLib.ChannelDispatchOperation.close_channels_async
().New in version 0.15.1.
- destroy_channels_async(callback, *user_data)¶
- Parameters:
callback (
Gio.AsyncReadyCallback
orNone
) – a callback to call when the request has been satisfied
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 forTelepathyGLib.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
) – aGio.AsyncResult
- Raises:
- Returns:
True
if the Claim() call was successful andTelepathyGLib.Channel.destroy_async
() has at least been attempted on all the channels, otherwiseFalse
- Return type:
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:
Returns a
GLib.PtrArray
containing theTelepathyGLib.Channel
of this ChannelDispatchOperation. The returned array and itsTelepathyGLib.Channel
are only valid while self is valid - copy array and reference channels withGObject.Object.ref
() if needed.New in version 0.19.9.
- handle_with_async(handler, callback, *user_data)¶
- Parameters:
handler (
str
orNone
) – The well-known bus name (starting withTelepathyGLib.CLIENT_BUS_NAME_BASE
) of the channel handler that should handle the channel, orNone
if the client has no preferred channel handlercallback (
Gio.AsyncReadyCallback
orNone
) – a callback to call when the call returns
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 theTelepathyGLib.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 ofTelepathyGLib.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
) – aGio.AsyncResult
- Raises:
- Returns:
True
if the HandleWith() call was successful, otherwiseFalse
- Return type:
Finishes an async call to HandleWith().
New in version 0.11.5.
- handle_with_time_async(handler, user_action_time, callback, *user_data)¶
- Parameters:
handler (
str
orNone
) – The well-known bus name (starting withTelepathyGLib.CLIENT_BUS_NAME_BASE
) of the channel handler that should handle the channel, orNone
if the client has no preferred channel handleruser_action_time (
int
) – the time at which user action occurred, or one of the special valuesTelepathyGLib.USER_ACTION_TIME_NOT_USER_ACTION
or %TP_USER_ACTION_TIME_CURRENT_TIMEcallback (
Gio.AsyncReadyCallback
orNone
) – a callback to call when the call returns
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
) – aGio.AsyncResult
- Raises:
- Returns:
True
if the HandleWithTime() call was successful, otherwiseFalse
- Return type:
Finishes an async call to HandleWithTime().
New in version 0.11.7.
- leave_channels_async(reason, message, callback, *user_data)¶
- Parameters:
reason (
TelepathyGLib.ChannelGroupChangeReason
) – the leave reasonmessage (
str
) – the leave messagecallback (
Gio.AsyncReadyCallback
orNone
) – a callback to call when the request has been satisfied
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 forTelepathyGLib.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
) – aGio.AsyncResult
- Raises:
- Returns:
True
if the Claim() call was successful andTelepathyGLib.Channel.leave_async
() has at least been attempted on all the channels, otherwiseFalse
- Return type:
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:
- Parameters:
channel_dispatch_operation (
TelepathyGLib.ChannelDispatchOperation
) – The object which received the signalchannel (
TelepathyGLib.Channel
) – theTelepathyGLib.Channel
that closeddomain (
int
) – domain of aGLib.Error
indicating why the channel has been closedcode (
int
) – error code of aGLib.Error
indicating why the channel has been closedmessage (
str
) – a message associated with the error
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:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
A
GLib.PtrArray
containing theTelepathyGLib.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:
- Default Value:
- Flags:
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¶
-
A #GStrv containing the well known bus names (starting with
TelepathyGLib.CLIENT_BUS_NAME_BASE
) of the possible Handlers for the channelsRead-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.