TpBaseClient

TpBaseClient — base class for Telepathy clients on D-Bus

Functions

void tp_base_client_add_observer_filter_variant ()
void tp_base_client_add_observer_filter ()
void tp_base_client_take_observer_filter ()
void tp_base_client_set_observer_recover ()
void tp_base_client_set_observer_delay_approvers ()
void (*TpBaseClientClassObserveChannelImpl) ()
void tp_base_client_implement_observe_channel ()
void tp_base_client_add_approver_filter_variant ()
void tp_base_client_add_approver_filter ()
void tp_base_client_take_approver_filter ()
void (*TpBaseClientClassAddDispatchOperationImpl) ()
void tp_base_client_implement_add_dispatch_operation ()
void tp_base_client_add_handler_capabilities ()
void tp_base_client_add_handler_capabilities_varargs ()
void tp_base_client_add_handler_capability ()
void tp_base_client_add_handler_filter_variant ()
void tp_base_client_add_handler_filter ()
void tp_base_client_take_handler_filter ()
void tp_base_client_be_a_handler ()
void (*TpBaseClientClassHandleChannelImpl) ()
void tp_base_client_implement_handle_channel ()
GList * tp_base_client_dup_handled_channels ()
gboolean tp_base_client_is_handling_channel ()
void tp_base_client_delegate_channels_async ()
gboolean tp_base_client_delegate_channels_finish ()
void (*TpBaseClientDelegatedChannelsCb) ()
void tp_base_client_set_delegated_channels_callback ()
void tp_channel_dispatcher_present_channel_async ()
gboolean tp_channel_dispatcher_present_channel_finish ()
GList * tp_base_client_dup_pending_requests ()
void tp_base_client_set_handler_bypass_approval ()
void tp_base_client_set_handler_request_notification ()
gboolean tp_base_client_register ()
void tp_base_client_unregister ()
const gchar * tp_base_client_get_bus_name ()
const gchar * tp_base_client_get_object_path ()
GDBusConnection * tp_base_client_get_dbus_connection ()
const gchar * tp_base_client_get_name ()
gboolean tp_base_client_get_uniquify_name ()

Properties

GDBusConnection * dbus-connection Read / Write / Construct Only
TpClientFactory * factory Read / Write / Construct Only
gchar * name Read / Write / Construct Only
gboolean uniquify-name Read / Write / Construct Only

Signals

void request-added Has Details
void request-removed Has Details

Types and Values

Object Hierarchy

    GObject
    ╰── TpBaseClient
        ├── TpSimpleApprover
        ├── TpSimpleHandler
        ╰── TpSimpleObserver

Implemented Interfaces

TpBaseClient implements TpSvcClient, TpSvcClientObserver, TpSvcClientApprover, TpSvcClientHandler and TpSvcClientInterfaceRequests.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This base class makes it easier to write TpSvcClient implementations. Subclasses should usually pass the filters they want and override the D-Bus methods they implement.

For many applications, the provided TpSimpleObserver, TpSimpleApprover and TpSimpleHandler subclasses can be used instead of deriving from this class.

Functions

tp_base_client_add_observer_filter_variant ()

void
tp_base_client_add_observer_filter_variant
                               (TpBaseClient *self,
                                GVariant *filter);

Register a new channel class as Observer.ObserverChannelFilter. The TpBaseClientClass.observe_channel virtual method will be called whenever a new channel's properties match the ones in filter .

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.observe_channel.

If the variant is floating (see g_variant_ref_sink()), ownership will be taken, allowing for uses like this:

1
2
3
4
5
tp_base_client_add_observer_filter_variant (client,
   g_variant_new_parsed ("{ %s: <%s>, %s: <%u>, ... }",
       TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_TEXT,
       TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, (guint32) TP_ENTITY_TYPE_CONTACT,
       ...));

Parameters

self

a client

 

filter

a variant of type G_VARIANT_TYPE_VARDICT.

[transfer none]

Since 0.19.10


tp_base_client_add_observer_filter ()

void
tp_base_client_add_observer_filter (TpBaseClient *self,
                                    TpChannelFilter *filter);

Register a new filter to match channels as an Observer.

The TpBaseClientClass.observe_channel virtual method will be called whenever a new channel's properties match the ones in filter .

This method can be called more than once. If it is, the client will be an Observer for any channel that matches any of the filters. For instance, this Client:

1
2
3
4
5
6
7
8
9
filter = tp_channel_filter_new_for_text_chats ();
tp_base_client_add_observer_filter (client, filter);
g_object_unref (filter);

filter = tp_channel_filter_new_for_file_transfer (NULL);
tp_channel_filter_require_target_is_contact (filter);
tp_channel_filter_require_requested (filter, FALSE);
tp_base_client_add_observer_filter (client, filter);
g_object_unref (filter);

will be notified about all Text channels, and also about 1-1 incoming Call channels.

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.observe_channel.

Parameters

self

a TpBaseClient

 

filter

a filter

 

Since 0.99.8


tp_base_client_take_observer_filter ()

void
tp_base_client_take_observer_filter (TpBaseClient *self,
                                     TpChannelFilter *filter);

The same as tp_base_client_add_observer_filter(), but also takes ownership of the filter. This makes it more convenient to call in simple situations:

Parameters

self

a TpBaseClient

 

filter

a filter.

[transfer full]

Since 0.99.8


tp_base_client_set_observer_recover ()

void
tp_base_client_set_observer_recover (TpBaseClient *self,
                                     gboolean recover);

Set whether the channel dispatcher should attempt to recover this Observer if it crashes. (This is implemented by setting the value of its Recover D-Bus property.)

Normally, Observers are only notified when new channels appear. If an Observer is set to recover, when it registers with tp_base_client_register(), it will also be told about any channels that already existed before it started.

For Observers that are activatable as a D-Bus service, if the Observer exits or crashes while there are any channels that match its filter, it will automatically be restarted by service-activation.

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.observe_channel.

Parameters

self

a TpBaseClient

 

recover

the value of the Observer.Recover property

 

Since 0.11.5


tp_base_client_set_observer_delay_approvers ()

void
tp_base_client_set_observer_delay_approvers
                               (TpBaseClient *self,
                                gboolean delay);

Set whether the channel dispatcher should wait for tp_observe_channel_context_accept() or tp_observe_channel_context_fail() to be called before calling TpBaseClientClass.add_dispatch_operation on appropriate Approvers.

This is implemented by setting the value of the DelayApprovers D-Bus property.

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.observe_channel.

Parameters

self

a TpBaseClient

 

delay

the value of the Observer.DelayApprovers property

 

Since 0.13.16


TpBaseClientClassObserveChannelImpl ()

void
(*TpBaseClientClassObserveChannelImpl)
                               (TpBaseClient *client,
                                TpAccount *account,
                                TpConnection *connection,
                                TpChannel *channel,
                                TpChannelDispatchOperation *dispatch_operation,
                                GList *requests,
                                TpObserveChannelContext *context);

Signature of the implementation of the ObserveChannel method.

This function must call either tp_observe_channel_context_accept(), tp_observe_channel_context_delay() or tp_observe_channel_context_fail() on context before it returns.

Parameters

client

a TpBaseClient instance

 

account

a TpAccount with TP_ACCOUNT_FEATURE_CORE, and any other features added via tp_client_factory_add_account_features(), prepared if possible

 

connection

a TpConnection with TP_CONNECTION_FEATURE_CORE, and any other features added via tp_client_factory_add_connection_features(), prepared if possible

 

channel

a TpChannel, with TP_CHANNEL_FEATURE_CORE, and any other features added via tp_client_factory_add_channel_features(), prepared if possible

 

dispatch_operation

a TpChannelDispatchOperation or NULL; the dispatch_operation is not guaranteed to be prepared.

[allow-none]

requests

a GList of TpChannelRequest having their object-path defined but are not guaranteed to be prepared.

[element-type TelepathyGLib.ChannelRequest]

context

a TpObserveChannelContext representing the context of this D-Bus call

 

tp_base_client_implement_observe_channel ()

void
tp_base_client_implement_observe_channel
                               (TpBaseClientClass *klass,
                                TpBaseClientClassObserveChannelImpl impl);

Called by subclasses to define the actual implementation of the ObserveChannel() D-Bus method.

This is exactly equivalent to setting the TpBaseClientClass.observe_channel function pointer.

Parameters

klass

the TpBaseClientClass of the object

 

impl

the TpBaseClientClassObserveChannelImpl function implementing ObserveChannel()

 

Since 0.11.5


tp_base_client_add_approver_filter_variant ()

void
tp_base_client_add_approver_filter_variant
                               (TpBaseClient *self,
                                GVariant *filter);

Register a new channel class as Approver.ApproverChannelFilter. The TpBaseClientClass.add_dispatch_operation virtual method will be called whenever a new channel's properties match the ones in filter .

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.add_dispatch_operation.

If the variant is floating (see g_variant_ref_sink()), ownership will be taken. See tp_base_client_add_observer_filter_variant() for more details.

Parameters

self

a client

 

filter

a variant of type G_VARIANT_TYPE_VARDICT.

[transfer none]

Since 0.19.10


tp_base_client_add_approver_filter ()

void
tp_base_client_add_approver_filter (TpBaseClient *self,
                                    TpChannelFilter *filter);

Register a new filter to match channels as an Approver.

The TpBaseClientClass.add_dispatch_operation virtual method will be called whenever a new channel's properties match the ones in filter .

This method can be called more than once. If it is, the client will be an Approver for any channel that matches any of the filters. See tp_base_client_add_observer_filter().

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.add_dispatch_operation.

Parameters

self

a TpBaseClient

 

filter

a filter

 

Since 0.99.8


tp_base_client_take_approver_filter ()

void
tp_base_client_take_approver_filter (TpBaseClient *self,
                                     TpChannelFilter *filter);

The same as tp_base_client_add_approver_filter(), but also takes ownership of the filter. This makes it more convenient to call in simple situations:

Parameters

self

a TpBaseClient

 

filter

a filter.

[transfer full]

Since 0.99.8


TpBaseClientClassAddDispatchOperationImpl ()

void
(*TpBaseClientClassAddDispatchOperationImpl)
                               (TpBaseClient *client,
                                TpAccount *account,
                                TpConnection *connection,
                                TpChannel *channel,
                                TpChannelDispatchOperation *dispatch_operation,
                                TpAddDispatchOperationContext *context);

Signature of the implementation of the AddDispatchOperation method.

This function must call either tp_add_dispatch_operation_context_accept(), tp_add_dispatch_operation_context_delay() or tp_add_dispatch_operation_context_fail() on context before it returns.

The implementation can then use tp_channel_dispatch_operation_handle_with_async() to approve handling of the channels, or tp_channel_dispatch_operation_claim_async() to take responsibility for handling or closing them".

Parameters

client

a TpBaseClient instance

 

account

a TpAccount with TP_ACCOUNT_FEATURE_CORE, and any other features added via tp_client_factory_add_account_features(), prepared if possible

 

connection

a TpConnection with TP_CONNECTION_FEATURE_CORE, and any other features added via tp_client_factory_add_connection_features(), prepared if possible

 

channel

a TpChannel with TP_CHANNEL_FEATURE_CORE, and any other features added via tp_client_factory_add_channel_features(), prepared if possible

 

dispatch_operation

a TpChannelDispatchOperation having TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE prepared if possible

 

context

a TpObserveChannelContext representing the context of this D-Bus call

 

Since 0.11.5


tp_base_client_implement_add_dispatch_operation ()

void
tp_base_client_implement_add_dispatch_operation
                               (TpBaseClientClass *klass,
                                TpBaseClientClassAddDispatchOperationImpl impl);

Called by subclasses to define the actual implementation of the AddDispatchOperation() D-Bus method.

Since 0.11.13 this is exactly equivalent to setting the TpBaseClientClass.add_dispatch_operation function pointer.

Parameters

klass

the TpBaseClientClass of the object

 

impl

the TpBaseClientClassAddDispatchOperationImpl function implementing AddDispatchOperation()

 

Since 0.11.5


tp_base_client_add_handler_capabilities ()

void
tp_base_client_add_handler_capabilities
                               (TpBaseClient *self,
                                const gchar * const *tokens);

Add several capability tokens to this client. These are used to signal that Telepathy connection managers should advertise certain capabilities to other contacts, such as the ability to receive audio/video calls using particular streaming protocols and codecs.

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.handle_channel.

Parameters

self

a client, which must not have been registered with tp_base_client_register() yet

 

tokens

capability tokens as defined by the Telepathy D-Bus API Specification.

[array zero-terminated=1][element-type utf8]

Since 0.11.6


tp_base_client_add_handler_capabilities_varargs ()

void
tp_base_client_add_handler_capabilities_varargs
                               (TpBaseClient *self,
                                const gchar *first_token,
                                ...);

Convenience C API equivalent to calling tp_base_client_add_handler_capability() for each capability token.

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.handle_channel.

Parameters

self

a client, which must not have been registered with tp_base_client_register() yet

 

first_token

a capability token from the Telepathy D-Bus API Specification

 

...

more tokens, ending with NULL

 

Since 0.11.6


tp_base_client_add_handler_capability ()

void
tp_base_client_add_handler_capability (TpBaseClient *self,
                                       const gchar *token);

Add one capability token to this client, as if via tp_base_client_add_handler_capabilities().

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.handle_channel.

Parameters

self

a client, which must not have been registered with tp_base_client_register() yet

 

token

a capability token as defined by the Telepathy D-Bus API Specification

 

Since 0.11.6


tp_base_client_add_handler_filter_variant ()

void
tp_base_client_add_handler_filter_variant
                               (TpBaseClient *self,
                                GVariant *filter);

Register a new channel class as Handler.HandlerChannelFilter. The TpBaseClientClass.handle_channel virtual method will be called whenever a new channel's properties match the ones in filter .

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.handle_channel.

If the variant is floating (see g_variant_ref_sink()), ownership will be taken. See tp_base_client_add_observer_filter_variant() for more details.

Parameters

self

a client

 

filter

a variant of type G_VARIANT_TYPE_VARDICT.

[transfer none]

Since 0.19.10


tp_base_client_add_handler_filter ()

void
tp_base_client_add_handler_filter (TpBaseClient *self,
                                   TpChannelFilter *filter);

Register a new filter to match channels as a Handler.

The TpBaseClientClass.handle_channel virtual method will be called whenever a new channel's properties match the ones in filter .

This method can be called more than once. If it is, the client will be a Handler for any channel that matches any of the filters. See tp_base_client_add_observer_filter().

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.handle_channel.

Parameters

self

a TpBaseClient

 

filter

a filter

 

Since 0.99.8


tp_base_client_take_handler_filter ()

void
tp_base_client_take_handler_filter (TpBaseClient *self,
                                    TpChannelFilter *filter);

The same as tp_base_client_add_handler_filter(), but also takes ownership of the filter. This makes it more convenient to call in simple situations:

Parameters

self

a TpBaseClient

 

filter

a filter.

[transfer full]

Since 0.99.8


tp_base_client_be_a_handler ()

void
tp_base_client_be_a_handler (TpBaseClient *self);

Register self as a Client.Handler with an empty list of filters. This is useful if you want to create a client that only handle channels for which it's the PreferredHandler.

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.handle_channel.

Parameters

self

a TpBaseClient

 

Since 0.11.6


TpBaseClientClassHandleChannelImpl ()

void
(*TpBaseClientClassHandleChannelImpl) (TpBaseClient *client,
                                       TpAccount *account,
                                       TpConnection *connection,
                                       TpChannel *channel,
                                       GList *requests_satisfied,
                                       gint64 user_action_time,
                                       TpHandleChannelContext *context);

Signature of the implementation of the HandleChannel method.

This function must call either tp_handle_channel_context_accept(), tp_handle_channel_context_delay() or tp_handle_channel_context_fail() on context before it returns.

Parameters

client

a TpBaseClient instance

 

account

a TpAccount with TP_ACCOUNT_FEATURE_CORE, and any other features added via tp_client_factory_add_account_features(), prepared if possible

 

connection

a TpConnection with TP_CONNECTION_FEATURE_CORE, and any other features added via tp_client_factory_add_connection_features(), prepared if possible

 

channel

a TpChannel, with TP_CHANNEL_FEATURE_CORE, and any other features added via tp_client_factory_add_channel_features(), prepared if possible

 

requests_satisfied

a GList of TpChannelRequest having their object-path defined but are not guaranteed to be prepared.

[element-type TelepathyGLib.ChannelRequest]

user_action_time

the time at which user action occurred, or one of the special values TP_USER_ACTION_TIME_NOT_USER_ACTION or TP_USER_ACTION_TIME_CURRENT_TIME (see “user-action-time” for details)

 

context

a TpHandleChannelContext representing the context of this D-Bus call

 

Since 0.11.6


tp_base_client_implement_handle_channel ()

void
tp_base_client_implement_handle_channel
                               (TpBaseClientClass *klass,
                                TpBaseClientClassHandleChannelImpl impl);

Called by subclasses to define the actual implementation of the HandleChannel() D-Bus method.

Since 0.11.13 this is exactly equivalent to setting the TpBaseClientClass.handle_channel function pointer.

Parameters

klass

the TpBaseClientClass of the object

 

impl

the TpBaseClientClassHandleChannelImpl function implementing HandleCHannels()

 

tp_base_client_dup_handled_channels ()

GList *
tp_base_client_dup_handled_channels (TpBaseClient *self);

Returns the set of channels currently handled by this base client or by any other TpBaseClient with which it shares a unique name.

Parameters

self

a TpBaseClient

 

Returns

the handled channels.

[transfer full][element-type TelepathyGLib.Channel]

Since 0.19.9


tp_base_client_is_handling_channel ()

gboolean
tp_base_client_is_handling_channel (TpBaseClient *self,
                                    TpChannel *channel);

Check if self is currently handling channel .

Parameters

self

a TpBaseClient

 

channel

a TpChannel

 

Returns

TRUE if self is handling channel , FALSE otherwise

Since 0.14.5


tp_base_client_delegate_channels_async ()

void
tp_base_client_delegate_channels_async
                               (TpBaseClient *self,
                                GList *channels,
                                gint64 user_action_time,
                                const gchar *preferred_handler,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Asynchronously calls DelegateChannels on the ChannelDispatcher to try stopping handling channels and pass them to another Handler. You can then call tp_base_client_delegate_channels_finish() to get the result of the operation.

Parameters

self

a TpBaseClient

 

channels

a GList of TpChannel handled by self .

[element-type TelepathyGLib.Channel]

user_action_time

the time at which user action occurred, or TP_USER_ACTION_TIME_NOT_USER_ACTION if this delegation request is for some reason not involving user action.

 

preferred_handler

Either the well-known bus name (starting with TP_CLIENT_BUS_NAME_BASE) of the preferred handler for the channels, or NULL to indicate that any handler but self would be acceptable.

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since 0.15.0


tp_base_client_delegate_channels_finish ()

gboolean
tp_base_client_delegate_channels_finish
                               (TpBaseClient *self,
                                GAsyncResult *result,
                                GPtrArray **delegated,
                                GHashTable **not_delegated,
                                GError **error);

Finishes an async channels delegation request started using tp_base_client_delegate_channels_async().

Parameters

self

a TpBaseClient

 

result

a GAsyncResult

 

delegated

if not NULL, used to return a GPtrArray containing the TpChannels which have been properly delegated.

[out][element-type TelepathyGLib.Channel][transfer container]

not_delegated

if not not NULL, used to return a GHashTable mapping TpChannels which have not been delegated to a GError explaining the reason of the failure.

[out][element-type TelepathyGLib.Channel GLib.Error][transfer container]

error

a GError to fill

 

Returns

TRUE if the operation succeed, delegated and not_delegated can be used to know the channels that self is not handling any more, otherwise FALSE.

Since 0.15.0


TpBaseClientDelegatedChannelsCb ()

void
(*TpBaseClientDelegatedChannelsCb) (TpBaseClient *client,
                                    GPtrArray *channels,
                                    gpointer user_data);

Called when a client asked us to delegate channels to another Handler. When this function is called client is not longer handling channels .

Parameters

client

a TpBaseClient instance

 

channels

a GPtrArray of TpChannel.

[element-type TelepathyGLib.Channel]

user_data

arbitrary user-supplied data passed to tp_base_client_set_delegated_channels_callback()

 

Since 0.15.3


tp_base_client_set_delegated_channels_callback ()

void
tp_base_client_set_delegated_channels_callback
                               (TpBaseClient *self,
                                TpBaseClientDelegatedChannelsCb callback,
                                gpointer user_data,
                                GDestroyNotify destroy);

Turn on support for the im.telepathy.v1.ChannelRequest.DelegateToPreferredHandler hint.

When receiving a request containing this hint, self will automatically delegate the channels to the preferred handler of the request and then call callback to inform the client that it is no longer handling those channels.

Parameters

self

a TpBaseClient implementing Handler

 

callback

function called when channels currently handled by self are delegated, may not be NULL

 

user_data

arbitrary user-supplied data passed to callback

 

destroy

called with the user_data as argument, when self is destroyed

 

Since 0.15.3


tp_channel_dispatcher_present_channel_async ()

void
tp_channel_dispatcher_present_channel_async
                               (TpChannelDispatcher *self,
                                TpChannel *channel,
                                gint64 user_action_time,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Asynchronously calls PresentChannel on the ChannelDispatcher to ask to the handler of channel to re-present it to the user. You can then call tp_channel_dispatcher_present_channel_finish() to get the result of the operation.

Parameters

self

a TpChannelDispatcher

 

channel

a TpChannel

 

user_action_time

the time at which user action occurred, or TP_USER_ACTION_TIME_NOT_USER_ACTION if this presentation request is for some reason not involving user action.

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since 0.15.0


tp_channel_dispatcher_present_channel_finish ()

gboolean
tp_channel_dispatcher_present_channel_finish
                               (TpChannelDispatcher *self,
                                GAsyncResult *result,
                                GError **error);

Finishes an async channel presentation request started using tp_channel_dispatcher_present_channel_async().

Parameters

self

a TpBaseClient

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the call succeeded, otherwise FALSE.

Since 0.15.0


tp_base_client_dup_pending_requests ()

GList *
tp_base_client_dup_pending_requests (TpBaseClient *self);

Only works if tp_base_client_set_handler_request_notification() has been called. Returns the list of requests self is likely be asked to handle.

Parameters

self

a TpBaseClient

 

Returns

a GList of TpChannelRequest.

[transfer full][element-type TelepathyGLib.ChannelRequest]

Since 0.19.9


tp_base_client_set_handler_bypass_approval ()

void
tp_base_client_set_handler_bypass_approval
                               (TpBaseClient *self,
                                gboolean bypass_approval);

Set whether the channels destined for this handler are automatically handled, without invoking approvers. (This is implemented by setting the value of its BypassApproval D-Bus property.)

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.handle_channel.

Parameters

self

a TpBaseClient

 

bypass_approval

the value of the Handler.BypassApproval property

 

Since 0.11.6


tp_base_client_set_handler_request_notification ()

void
tp_base_client_set_handler_request_notification
                               (TpBaseClient *self);

Indicate that self is a Handler willing to be notified about requests for channels that it is likely to be asked to handle. This means that the “request-added” and “request-removed” signals will be fired and tp_base_client_get_pending_requests() will return the list of pending requests.

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.handle_channel.

Parameters

self

a TpBaseClient

 

Since 0.11.6


tp_base_client_register ()

gboolean
tp_base_client_register (TpBaseClient *self,
                         GError **error);

Publish self as an available client. After this method is called, as long as it continues to exist, it will receive and process whatever events were requested via the various filters.

Methods that set the filters and other immutable state, such as tp_base_client_add_observer_filter_variant(), cannot be called after this one.

Parameters

self

a TpBaseClient, which must not have been registered with tp_base_client_register() yet

 

error

used to indicate the error if FALSE is returned

 

Returns

TRUE if the client was registered successfully

Since 0.11.5


tp_base_client_unregister ()

void
tp_base_client_unregister (TpBaseClient *self);

Remove this client object from D-Bus, if tp_base_client_register() has already been called.

If the object is not registered, this method may be called, but has no effect.

Releasing the last reference to the object also has the same effect as calling this method, but this method should be preferred, as it has more deterministic behaviour.

If the object still exists, tp_base_client_register() may be used to attempt to register it again.

Parameters

self

a client, which may already have been registered with tp_base_client_register(), or not

 

Since 0.11.6


tp_base_client_get_bus_name ()

const gchar *
tp_base_client_get_bus_name (TpBaseClient *self);

Return the bus name of self . Note that doesn't mean the client is actually owning this name; for example if tp_base_client_register() has not been called yet or failed.

Parameters

self

a TpBaseClient

 

Returns

the bus name of the client

Since 0.11.5


tp_base_client_get_object_path ()

const gchar *
tp_base_client_get_object_path (TpBaseClient *self);

Return the object path of self . Note that doesn't mean the client is actually registered on this path; for example if tp_base_client_register() has not been called yet or failed.

Parameters

self

a TpBaseClient

 

Returns

the object path of the client

Since 0.11.5


tp_base_client_get_dbus_connection ()

GDBusConnection *
tp_base_client_get_dbus_connection (TpBaseClient *self);

Return the “dbus-connection” construct-only property, which represents the D-Bus connection used to export this client object.

The returned object's reference count is not incremented, so it is not necessarily valid after self is destroyed.

Parameters

self

a TpBaseClient

 

Returns

the value of “dbus-connection”.

[transfer none]

Since 0.99.10


tp_base_client_get_name ()

const gchar *
tp_base_client_get_name (TpBaseClient *self);

Return the “name” construct-only property, which is used as part of the bus name and object path.

Parameters

self

a TpBaseClient

 

Returns

the value of “name”

Since 0.11.11


tp_base_client_get_uniquify_name ()

gboolean
tp_base_client_get_uniquify_name (TpBaseClient *self);

Return the “uniquify-name” construct-only property; if this is true, the bus name and object path will be made unique by appending a suffix that includes the D-Bus unique name and a per-process counter.

Parameters

self

a TpBaseClient

 

Returns

the value of “uniquify-name”

Since 0.11.11

Types and Values

struct TpBaseClient

struct TpBaseClient;

Data structure representing a generic TpSvcClient implementation.

Since 0.11.5


struct TpBaseClientClass

struct TpBaseClientClass {
    GObjectClass parent_class;
    TpBaseClientClassObserveChannelImpl observe_channel;
    TpBaseClientClassAddDispatchOperationImpl add_dispatch_operation;
    TpBaseClientClassHandleChannelImpl handle_channel;
};

The class of a TpBaseClient.

The virtual methods observe_channel , add_dispatch_operation and handle_channel can be also implemented by calling tp_base_client_implement_observe_channel(), tp_base_client_implement_add_dispatch_operation() and tp_base_client_implement_handle_channel(). This is compatible with telepathy-glib versions older than 0.11.13.

Members

GObjectClass parent_class;

the parent class

 

TpBaseClientClassObserveChannelImpl observe_channel;

the function called to observe newly-created channels matching this client's observer filter

 

TpBaseClientClassAddDispatchOperationImpl add_dispatch_operation;

the function called to request user approval of unrequested (incoming) channels matching this client's approver filter (since 0.11.13)

 

TpBaseClientClassHandleChannelImpl handle_channel;

the function called to handle channels matching this client's handler filter

 

Since 0.11.5

Property Details

The “dbus-connection” property

  “dbus-connection”          GDBusConnection *

This object's connection to D-Bus. Read-only except during construction.

This property can't be NULL after construction.

Flags: Read / Write / Construct Only

Since 0.99.10


The “factory” property

  “factory”                  TpClientFactory *

Factory for this base client, used to look up or create TpAccount objects.

Flags: Read / Write / Construct Only

Since 0.15.5


The “name” property

  “name”                     gchar *

The name of the client. This is used to register the D-Bus service name and object path of the service.

This property can't be NULL.

Flags: Read / Write / Construct Only

Default value: NULL

Since 0.11.5


The “uniquify-name” property

  “uniquify-name”            gboolean

If TRUE, tp_base_client_register() will append an unique token to the service bus name and object path to ensure they are unique.

Flags: Read / Write / Construct Only

Default value: FALSE

Since 0.11.5

Signal Details

The “request-added” signal

void
user_function (TpBaseClient     *self,
               TpAccount        *account,
               TpChannelRequest *request,
               gpointer          user_data)

Emitted when a channels have been requested, and that if the request is successful, they will probably be handled by this Handler.

This signal is only fired if tp_base_client_set_handler_request_notification() has been called on self previously.

Parameters

self

a TpBaseClient

 

account

the TpAccount on which the request was made, with TP_ACCOUNT_FEATURE_CORE, and any other features added via tp_client_factory_add_account_features(), prepared if possible

 

request

a TpChannelRequest having its object-path defined but is not guaranteed to be prepared.

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

Since 0.11.6


The “request-removed” signal

void
user_function (TpBaseClient     *self,
               TpChannelRequest *request,
               gchar            *error,
               gchar            *message,
               gpointer          user_data)

Emitted when a request has failed and should be disregarded.

This signal is only fired if tp_base_client_set_handler_request_notification() has been called on self previously.

Parameters

self

a TpBaseClient

 

request

the TpChannelRequest being removed

 

error

the name of the D-Bus error with which the request failed.

 

message

any message supplied with the D-Bus error.

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

Since 0.11.6