TelepathyGLib.Capabilities

g GObject.Object GObject.Object TelepathyGLib.Capabilities TelepathyGLib.Capabilities GObject.Object->TelepathyGLib.Capabilities

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

dup_channel_classes_variant ()

get_channel_classes ()

is_specific_to_contact ()

supports_audio_call (handle_type)

supports_audio_video_call (handle_type)

supports_contact_search ()

supports_dbus_tubes (handle_type, service_name)

supports_file_transfer ()

supports_file_transfer_description ()

supports_file_transfer_initial_offset ()

supports_file_transfer_timestamp ()

supports_file_transfer_uri ()

supports_room_list ()

supports_sms ()

supports_stream_tubes (handle_type, service)

supports_text_chatrooms ()

supports_text_chats ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

channel-classes-variant

GLib.Variant

r

The channel classes supported

contact-specific

bool

r/w/co

True if this object describes the capabilities of a particular contact

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class TelepathyGLib.Capabilities(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

TelepathyGLib.CapabilitiesClass

An object representing capabilities a TelepathyGLib.Connection or TelepathyGLib.Contact supports.

New in version 0.11.3.

dup_channel_classes_variant()
Returns:

the value of the TelepathyGLib.Capabilities :channel-classes-variant property

Return type:

GLib.Variant

Return the TelepathyGLib.Capabilities :channel-classes-variant property

New in version 0.19.0.

get_channel_classes()
Return type:

[{object: object}]

New in version 0.11.3.

is_specific_to_contact()
Returns:

the same bool as the TelepathyGLib.Capabilities :contact-specific property

Return type:

bool

New in version 0.11.3.

supports_audio_call(handle_type)
Parameters:

handle_type (TelepathyGLib.HandleType) – the handle type of the call; TelepathyGLib.HandleType.CONTACT for private, TelepathyGLib.HandleType.ROOM or TelepathyGLib.HandleType.NONE for conference (depending on the protocol)

Returns:

True if a channel request containing Call as ChannelType, handle_type as TargetHandleType, a True value for InitialAudio and an identifier of the appropriate type can be expected to work, False otherwise.

Return type:

bool

Return whether audio calls can be established, for instance by calling TelepathyGLib.AccountChannelRequest.new_audio_call(), followed by TelepathyGLib.AccountChannelRequest.set_target_id() with handle_type.

To check whether requests using TelepathyGLib.AccountChannelRequest.set_target_contact() would work, set handle_type to TelepathyGLib.HandleType.CONTACT.

New in version 0.17.6.

supports_audio_video_call(handle_type)
Parameters:

handle_type (TelepathyGLib.HandleType) – the handle type of the call; TelepathyGLib.HandleType.CONTACT for private, TelepathyGLib.HandleType.ROOM or TelepathyGLib.HandleType.NONE for conference (depending on the protocol)

Returns:

True if a channel request containing Call as ChannelType, handle_type as TargetHandleType, a True value for InitialAudio/InitialVideo and an identifier of the appropriate type can be expected to work, False otherwise.

Return type:

bool

Return whether audio/video calls can be established, for instance by calling TelepathyGLib.AccountChannelRequest.new_audio_video_call(), followed by TelepathyGLib.AccountChannelRequest.set_target_id() with handle_type.

To check whether requests using TelepathyGLib.AccountChannelRequest.set_target_contact() would work, set handle_type to TelepathyGLib.HandleType.CONTACT.

New in version 0.17.6.

Returns:

True if TelepathyGLib.ContactSearch can be used.

with_limit:

if not None, used to return True if the limit parameter to TelepathyGLib.ContactSearch.new_async() and TelepathyGLib.ContactSearch.reset_async() can be nonzero

with_server:

if not None, used to return True if the server parameter to TelepathyGLib.ContactSearch.new_async() and TelepathyGLib.ContactSearch.reset_async() can be non-None

Return type:

(bool, with_limit: bool, with_server: bool)

Return whether this protocol or connection can perform contact searches. Optionally, also return whether a limited number of results can be specified, and whether alternative servers can be searched.

New in version 0.13.11.

supports_dbus_tubes(handle_type, service_name)
Parameters:
Returns:

True if the contact or connection supports this type of D-Bus tubes.

Return type:

bool

If the TelepathyGLib.Capabilities :contact-specific property is True, this function checks if the contact associated with this TelepathyGLib.Capabilities supports D-Bus tubes with handle_type as TargetHandleType. If service_name is not None, it also checks if it supports stream tubes with service as TelepathyGLib.PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME.

If the TelepathyGLib.Capabilities :contact-specific property is False, this function checks if the connection supports requesting D-Bus tube channels with handle_type as ChannelType. The service_name argument is unused in this case.

New in version 0.13.0.

supports_file_transfer()
Returns:

True if a channel request containing FileTransfer as ChannelType, HandleTypeContact as TargetHandleType and a contact identifier can be expected to work, False otherwise.

Return type:

bool

Return whether private file transfer can be established by providing a contact identifier.

New in version 0.17.6.

supports_file_transfer_description()
Returns:

True if requests as described for TelepathyGLib.Capabilities.supports_file_transfer() can also specify the outgoing file’s description

Return type:

bool

New in version 0.19.0.

supports_file_transfer_initial_offset()
Returns:

True if requests as described for TelepathyGLib.Capabilities.supports_file_transfer() can also specify an initial offset greater than 0

Return type:

bool

Return whether an initial offset other than 0 can be specified on outgoing file transfers. This can be used to resume partial transfers, by omitting the part that has already been sent.

New in version 0.19.0.

supports_file_transfer_timestamp()
Returns:

True if requests as described for TelepathyGLib.Capabilities.supports_file_transfer() can also specify the outgoing file’s timestamp

Return type:

bool

New in version 0.19.0.

supports_file_transfer_uri()
Returns:

True if requests as described for TelepathyGLib.Capabilities.supports_file_transfer() can also specify the outgoing file’s URI

Return type:

bool

New in version 0.19.0.

supports_room_list()
Returns:

True if a channel request containing RoomList as ChannelType, HandleTypeNone as TargetHandleType can be expected to work, False otherwise.

with_server:

if not None, used to return True if the TelepathyGLib.PROP_CHANNEL_TYPE_ROOM_LIST_SERVER property can be defined when requesting a RoomList channel.

Return type:

(bool, with_server: bool)

Discovers whether this protocol or connection supports listing rooms. Specifically, if this function returns True, a room list channel can be requested as follows:

GHashTable *request;
TpAccountChannelRequest *req;

request = tp_asv_new (
    TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
      TP_IFACE_CHANNEL_TYPE_ROOM_LIST,
    TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_NONE,
    NULL);

req = tp_account_channel_request_new (account, request,
   TP_USER_ACTION_TIME_CURRENT_TIME);

tp_account_channel_request_create_and_handle_channel_async (req, NULL,
    create_channel_cb, NULL);

g_object_unref (req);
g_hash_table_unref (request);

If with_server is set to True, a list of rooms on a particular server can be requested as follows:

/\* Same code as above but with request defined using: *\/
request = tp_asv_new (
    TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
      TP_IFACE_CHANNEL_TYPE_ROOM_LIST,
    TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_NONE,
    TP_PROP_CHANNEL_TYPE_ROOM_LIST_SERVER, G_TYPE_STRING,
      "characters.shakespeare.lit",
    NULL);

New in version 0.13.14.

supports_sms()
Returns:

True if a channel request containing Text as ChannelType, HandleTypeContact as TargetHandleType, a channel identifier and TelepathyGLib.PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL set to True can be expected to work, False otherwise.

Return type:

bool

If the TelepathyGLib.Capabilities :contact-specific property is False, this function checks if SMS text channels can be requested with the connection associated with this TelepathyGLib.Capabilities.

If the TelepathyGLib.Capabilities :contact-specific property is True, this function checks if the contact associated with this TelepathyGLib.Capabilities supports SMS text channels.

New in version 0.19.0.

supports_stream_tubes(handle_type, service)
Parameters:
Returns:

True if the contact or connection supports this type of stream tubes.

Return type:

bool

If the TelepathyGLib.Capabilities :contact-specific property is True, this function checks if the contact associated with this TelepathyGLib.Capabilities supports stream tubes with handle_type as TargetHandleType. If service is not None, it also checks if it supports stream tubes with service as TelepathyGLib.PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE.

If the TelepathyGLib.Capabilities :contact-specific property is False, this function checks if the connection supports requesting stream tube channels with handle_type as ChannelType. The service argument is unused in this case.

New in version 0.13.0.

supports_text_chatrooms()
Returns:

True if a channel request containing Text as ChannelType, HandleTypeRoom as TargetHandleType and a channel identifier can be expected to work, False otherwise.

Return type:

bool

If the TelepathyGLib.Capabilities :contact-specific property is False, this function checks if named text chatrooms can be joined by providing a chatroom identifier, for instance by calling TelepathyGLib.AccountChannelRequest.new_text() followed by TelepathyGLib.AccountChannelRequest.set_target_id() with TelepathyGLib.HandleType.ROOM.

If the TelepathyGLib.Capabilities :contact-specific property is True, this function checks if the contact associated with this TelepathyGLib.Capabilities can be invited to named text chatrooms.

If the protocol is such that chatrooms can be joined or contacts can be invited, but only via a more elaborate D-Bus API than normal (because more information is needed), then this method will return False.

New in version 0.11.3.

supports_text_chats()
Returns:

True if a channel request containing Text as ChannelType, HandleTypeContact as TargetHandleType and a contact identifier can be expected to work, False otherwise.

Return type:

bool

Return whether private text channels can be established by providing a contact identifier, for instance by calling TelepathyGLib.AccountChannelRequest.new_text() followed by TelepathyGLib.AccountChannelRequest.set_target_contact().

If the protocol is such that text chats can be established, but only via a more elaborate D-Bus API than normal (because more information is needed), then this method will return False.

New in version 0.11.3.

Property Details

TelepathyGLib.Capabilities.props.channel_classes_variant
Name:

channel-classes-variant

Type:

GLib.Variant

Default Value:

None

Flags:

READABLE

The underlying data structure used by Telepathy to represent the requests that can succeed.

This can be used by advanced clients to determine whether an unusually complex request would succeed. See the Telepathy D-Bus API Specification for details of how to interpret the returned GLib.Variant of type a(a{sv}as).

The higher-level methods like TelepathyGLib.Capabilities.supports_text_chats() are likely to be more useful to the majority of clients.

New in version 0.19.0.

TelepathyGLib.Capabilities.props.contact_specific
Name:

contact-specific

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Whether this object accurately describes the capabilities of a particular contact, or if it’s only a guess based on the capabilities of the underlying connection.