Interface Client.Handler

Interface Index (Compact) | Summary | Description | Methods | Properties | Types

Methods

HandleChannels (o: Account, o: Connection, a(oa{sv}): Channels, ao: Requests_Satisfied, t: User_Action_Time, a{sv}: Handler_Info) nothing

Properties

HandlerChannelFilter aa{sv} ( Channel_Class_List) Read only
BypassApproval b Read only
Capabilities as ( Handler_Capability_Token_List) Read only
HandledChannels ao Read only

Types

Handler_Capability_Token Simple Type s
Added in 0.17.26. (as a stable interface)
Objects implementing this interface must also implement:

Description

Handlers are the user interface for a channel. They turn an abstract Telepathy channel into something the user wants to see, like a text message stream or an audio and/or video call.

For its entire lifetime, each channel on a connection known to the channel dispatcher is either being processed by the channel dispatcher, or being handled by precisely one Handler.

Because each channel is only handled by one Handler, handlers may perform actions that only make sense to do once, such as acknowledging Text messages, doing the actual streaming for StreamedMedia channels with the MediaSignalling interface, or transferring the file in FileTransfer channels.

When a new incoming channel (one with Requested = FALSE) is offered to Approvers by the channel dispatcher, it also offers the Approvers a list of all the running or activatable handlers whose HandlerChannelFilter property (possibly as cached in the .client file) indicates that they are able to handle the channel. The Approvers can choose one of those channel handlers to handle the channel.

When a new outgoing channel (one with Requested = TRUE) appears, the channel dispatcher passes it to an appropriate channel handler automatically.

Methods

(Permalink)

HandleChannels (o: Account, o: Connection, a(oa{sv}): Channels, ao: Requests_Satisfied, t: User_Action_Time, a{sv}: Handler_Info) → nothing

Parameters

  • Account — o
  • The Account with which the channels are associated. The well-known bus name to use is that of the AccountManager.
  • Connection — o
  • The Connection with which the channels are associated. The well-known bus name to use can be derived from this object path by removing the leading '/' and replacing all subsequent '/' by '.'.
  • Channels — a(oa{sv}) (Channel_Details_List)
  • The channels and their immutable properties. Their well-known bus name is the same as that of the Connection.
  • Requests_Satisfied — ao
  • The requests satisfied by these channels.

    Rationale:

    If the handler implements Requests, this tells it that these channels match previous AddRequest calls that it may have received.

    There can be more than one, if they were EnsureChannel requests.

  • User_Action_Time — t
  • The time at which user action occurred, or 0 if this channel is to be handled for some reason not involving user action. Handlers SHOULD use this for focus-stealing prevention, if applicable. This property has the same semantic as User_Action_Timestamp but is unsigned for historical reasons.
  • Handler_Info — a{sv}
  • Additional information about these channels. Currently defined keys are:

    request-properties - a{oa{sv}}
    A map from ChannelRequest paths listed in Requests_Satisfied to Qualified_Property_Value_Maps containing namespaced immutable properties of each request.

    When more keys are defined for this dictionary, all will be optional; handlers MAY safely ignore any entry in this dictionary.

Called by the channel dispatcher when this client should handle these channels, or when this client should present channels that it is already handling to the user (e.g. bring them into the foreground).

Rationale:

Clients are expected to know what channels they're already handling, and which channel object path corresponds to which window or tab. This can easily be done using a hash table keyed by channels' object paths.

This method can raise any D-Bus error. If it does, the handler is assumed to have failed or crashed, and the channel dispatcher MUST recover in an implementation-specific way; it MAY attempt to dispatch the channels to another handler, or close the channels.

If closing the channels, it is RECOMMENDED that the channel dispatcher attempts to close the channels using Channel.Close, but resorts to calling Channel.Interface.Destroyable.Destroy (if available) or ignoring the channel (if not) if the same handler repeatedly fails to handle channels.

After HandleChannels returns successfully, the client process is considered to be responsible for the channel until it its unique name disappears from the bus.

Rationale:

If a process has multiple Client bus names - some temporary and some long-lived - and drops one of the temporary bus names in order to reduce the set of channels that it will handle, any channels that it is already handling should remain unaffected.

Properties

Accessed using the org.freedesktop.DBus.Properties interface.
(Permalink)

HandlerChannelFilter — aa{sv} (Channel_Class_List)

Read only

A specification of the channels that this channel handler can deal with. It will be offered to approvers as a potential channel handler for bundles that contain only suitable channels, or for suitable channels that must be handled separately.

This property works in exactly the same way as the Client.Observer.ObserverChannelFilter property. In particular, it cannot change while the handler process continues to own the corresponding Client bus name.

In the .client file, it is represented in the same way as ObserverChannelFilter, but the group has the same name as this interface and the keys start with HandlerChannelFilter instead of ObserverChannelFilter.

(Permalink)

BypassApproval — b

Read only

If true, channels destined for this handler are automatically handled, without invoking approvers.

Rationale:

The intended usage is to allow a client handling one channel to pick up closely related channels. Suppose a client capable of handling both Text and StreamedMedia, org.freedesktop.Telepathy.Client.Empathy, is handling a StreamedMedia channel. That client can take a second well-known bus name, say org.freedesktop.Telepathy.Client.Empathy._1._42.Bundle1, and configure an object at /org/freedesktop/Telepathy/Client/Empathy/_1/_42/Bundle1 with BypassApproval = TRUE, whose HandlerChannelFilter matches closely related Text channels by their Bundle property.

For service-activatable handlers, this property should be specified in the handler's .client file as follows:

[org.freedesktop.Telepathy.Client.Handler]
BypassApproval=true
(Permalink)

Capabilities — as (Handler_Capability_Token_List)

Read only

The set of additional capabilities supported by this handler. This describes things like support for streamed media codecs and NAT traversal mechanisms: see the Contact Capabilities interface for more details.

For handlers that have a .client file, the channel dispatcher may discover this property from the org.freedesktop.Telepathy.Client.Handler.Capabilities group; for each capability, that group contains a key whose name is the capability, with value true. Keys with other values SHOULD NOT appear in this group.

For instance, the .client file for a streamed media handler that supports ICE-UDP NAT traversal, Speex audio, and Theora and H264 video might contain this group:

[org.freedesktop.Telepathy.Client.Handler.Capabilities]
org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/ice-udp=true
org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/audio/speex=true
org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/video/theora=true
org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/video/h264=true

Like the HandlerChannelFilter property, this property cannot change while the Handler owns its Client bus name. However, the .client file, if any, can change (due to upgrades or installation of pluggable codecs), and the capabilities really supported by the handler might not exactly match what is cached in the .client file.

Rationale:

The client file is installed statically and is intended to list codecs etc. that the handler guarantees it can support (e.g. by having a hard dependency on them), whereas the running handler process might be able to find additional codecs.

(Permalink)

HandledChannels — ao

Read only

A list of the channels that this process is currently handling.

There is no change notification.

Rationale:

This property exists for state recovery - it makes it possible for channel handling to survive a ChannelDispatcher crash.

If the channel dispatcher is automatically replaced, the replacement can discover all Handlers by looking for the Client well-known bus names, and discover which channels they are currently handling. Once this has been done, all unhandled channels can be re-dispatched, and the only issue visible to the user is that unhandled channels that they have already approved might be sent back to Approvers.

The value of this property SHOULD be the same for all Client instances that share a unique bus name, and SHOULD include all channels that are being handled, even if they were conceptually handled by a different Client instance.

Rationale:

Otherwise, when a process released a temporary Client name, channels that it handled because of that Client name would no longer be state-recoverable.

Types

Simple Type (Permalink)

Handler_Capability_Token — s

A DBus_Interface, followed by a slash '/' character and an identifier for a capability defined by that interface. The capability identifier SHOULD be in lower case. If an interface references an external specification which is case-insensitive (such as MIME), then names from that specification MUST be normalized to lower-case before providing them to this Telepathy API, so that implementations can safely rely on simple byte-by-byte comparison.
Rationale:
These aren't D-Bus core Properties, and we want them to look visibly different.

So far, all client capabilities are defined by the MediaSignalling interface.