This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
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
When a new incoming channel (one with
When a new outgoing channel (one with
A specification of the channels that this channel handler can deal with.
This property works in exactly the same way as the
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.
If true, channels destined for this handler are automatically handled, without invoking approvers.
For service-activatable handlers, this property should be specified in the handler's .client file as follows:
[im.telepathy.v1.Client.Handler] BypassApproval=true
So far, all client capabilities are defined by the
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
im.telepathy.v1.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:
[im.telepathy.v1.Client.Handler.Capabilities] im.telepathy.v1.Channel.Interface.MediaSignalling/ice-udp=true im.telepathy.v1.Channel.Interface.MediaSignalling/audio/speex=true im.telepathy.v1.Channel.Interface.MediaSignalling/video/theora=true im.telepathy.v1.Channel.Interface.MediaSignalling/video/h264=true
Like 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.
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.
Called by the channel dispatcher when this client should handle this channel, or when this client should present a channel that it is already handling to the user (e.g. bring it into the foreground).
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 channel to another handler, or close the channel.
If closing the channel, it is RECOMMENDED that the channel
dispatcher attempts to use
After HandleChannel returns successfully, the client process is considered to be responsible for the channel until it its unique name disappears from the bus.
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.
The Channel object. Its well-known bus name is the same as that of the Connection.
Properties of the channel, equivalent to
the properties in
The requests satisfied by this channel.
If the handler implements Requests, this tells it
that this channel matches previous
There can be more than one, if they were EnsureChannel requests.
Additional information about this channel. Currently defined keys are:
request-properties
- a{oa{sv}}When more keys are defined for this dictionary, all will be optional; handlers MAY safely ignore any entry in this dictionary.
A list of the channels that this process is currently handling.
There is no change notification.
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.
Otherwise, when a process released a temporary Client name, channels that it handled because of that Client name would no longer be state-recoverable.