Gjsify LogoGjsify Logo

A proxy object for a Telepathy connection. There are no interesting public struct fields.

(Changed in 0.7.12: the layout of the structure is visible, allowing subclassing.)

Hierarchy

Index

Constructors

Properties

Methods

Constructors

Properties

balance: number

The Amount field of the Balance.AccountBalance property.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_BALANCE.

See Also: tp_connection_get_balance()

balance_currency: string

The Currency field of the Balance.AccountBalance property.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_BALANCE.

See Also: tp_connection_get_balance()

balance_scale: number

The Scale field of the Balance.AccountBalance property.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_BALANCE.

See Also: tp_connection_get_balance()

balance_uri: string

The Balance.ManageCreditURI property.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_BALANCE.

blocked_contacts: object[]

A #GPtrArray of blocked #TpContact. Changes are notified using the #TpConnection::blocked-contacts-changed signal.

These TpContact objects have been prepared with the desired features. See tp_simple_client_factory_add_contact_features() to define which features needs to be prepared on them.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_BLOCKING.

bus_name: string

The D-Bus bus name for this object. Read-only except during construction.

can_change_contact_list: boolean

If true, presence subscription and publication can be changed using the RequestSubscription, AuthorizePublication and RemoveContacts methods.

Rational: link-local XMPP, presence is implicitly published to everyone in the local subnet, so the user cannot control their presence publication.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES or %TP_CONNECTION_FEATURE_CONTACT_LIST.

can_report_abusive: boolean

If this property is %TRUE, contacts may be reported as abusive to the server administrators by setting report_abusive to %TRUE when calling tp_connection_block_contacts_async().

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_BLOCKING.

The %TpCapabilities object representing the capabilities of this connection, or NULL if we don't know yet.

To wait for valid capability information, call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CAPABILITIES.

cm_name: string

This connection's connection manager name.

connection_manager_name: string

This connection's connection manager name.

connection_ready: boolean

Initially %FALSE; changes to %TRUE when the connection has gone to CONNECTED status, introspection has finished and it's ready for use.

By the time this property becomes %TRUE, any extra interfaces will have been set up and the #TpProxy:interfaces property will have been populated.

This is similar to %TP_CONNECTION_FEATURE_CONNECTED, except that once it has changed to %TRUE, it remains %TRUE even if the connection has been invalidated.

contact_groups: string[]

The names of all groups that currently exist. This may be a larger set than the union of all #TpContact:contact-groups properties, if the connection allows groups to be empty.

This property's value is not meaningful until the #TpConnection:contact-list-state property has become %TP_CONTACT_LIST_STATE_SUCCESS.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_GROUPS.

contact_list_persists: boolean

If true, presence subscriptions (in both directions) on this connection are stored by the server or other infrastructure.

If false, presence subscriptions on this connection are not stored.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES or %TP_CONNECTION_FEATURE_CONTACT_LIST.

contact_list_state: number

The progress made in retrieving the contact list.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES or %TP_CONNECTION_FEATURE_CONTACT_LIST.

dbus_daemon: DBusDaemon

The D-Bus daemon for this object (this object itself, if it is a TpDBusDaemon). Read-only except during construction.

disjoint_groups: boolean

True if each contact can be in at most one group; false if each contact can be in many groups.

This property cannot change after the connection has moved to the %TP_CONNECTION_STATUS_CONNECTED state. Until then, its value is undefined, and it may change at any time, without notification.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_GROUPS.

The #TpSimpleClientFactory used to create this proxy, or %NULL if this proxy was not created through a factory.

g_type_instance: TypeInstance
group_storage: number

Indicates the extent to which contacts' groups can be set and stored.

This property cannot change after the connection has moved to the %TP_CONNECTION_STATUS_CONNECTED state. Until then, its value is undefined, and it may change at any time, without notification.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_GROUPS.

interfaces: string[]

Known D-Bus interface names for this object.

object_path: string

The D-Bus object path for this object. Read-only except during construction.

protocol_name: string

The connection's machine-readable protocol name, such as "jabber", "msn" or "local-xmpp". Recommended names for most protocols can be found in the Telepathy D-Bus Interface Specification.

request_uses_message: boolean

If true, the Message parameter to RequestSubscription is likely to be significant, and user interfaces SHOULD prompt the user for a message to send with the request; a message such as "I would like to add you to my contact list", translated into the local user's language, might make a suitable default.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES or %TP_CONNECTION_FEATURE_CONTACT_LIST.

self_contact: TelepathyGLib.Contact

A #TpContact representing the local user on this connection, or %NULL if not yet available.

If the local user's unique identifier changes (for instance by using /nick on IRC), this property will change to a different #TpContact object representing the new identifier, and #GObject::notify will be emitted.

The #TpContact object is guaranteed to have all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared.

To wait for a non-%NULL self-contact (and other properties), call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONNECTED.

self_handle: number

The %TP_HANDLE_TYPE_CONTACT handle of the local user on this connection, or 0 if we don't know yet or if the connection has become invalid.

This may change if the local user's unique identifier changes (for instance by using /nick on IRC), in which case #GObject::notify will be emitted.

To wait for a valid self-handle (and other properties), call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONNECTED.

status: number

This connection's status, or %TP_UNKNOWN_CONNECTION_STATUS if we don't know yet.

To wait for a valid status (and other properties), call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CORE.

Since version 0.11.3, the change to status %TP_CONNECTION_STATUS_CONNECTED is delayed slightly, until introspection of the connection has finished.

status_reason: number

To wait for a valid status (and other properties), call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CORE.

The reason why #TpConnection:status changed to its current value, or TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED if unknown. know yet.

name: string

Methods

  • add_client_interest(interested_in: string): void
  • Subscribe to any opt-in change notifications for interested_in.

    For contact information, use #TpContact instead, which will call this automatically.

    Parameters

    • interested_in: string

      a string identifying an interface or part of an interface to which this connection will subscribe

    Returns void

  • Add the given contacts to the given group, creating it if necessary.

    For this to work properly self must have interface %TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS.

    Parameters

    • group: string

      the group to alter.

    • contacts: TelepathyGLib.Contact[]

      An array of #TpContact objects to include in the group.

    • callback: AsyncReadyCallback

      a callback to call when the operation finishes

    Returns void

  • For each of the given contacts, request that the local user's presence is sent to that contact, i.e. that their #TpContact:publish-state property becomes %TP_SUBSCRIPTION_STATE_YES.

    For this to work properly self must have interface %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST.

    Parameters

    Returns void

  • authorize_publication_finish(result: AsyncResult): boolean
  • bind_connection_status_to_property(target: object, target_property: string, invert: boolean): Binding
  • Binds the :status of self to the boolean property of another object using a #GBinding such that the target_property will be set to %TRUE when self is connected (and invert is %FALSE).

    target_property will be synchronised immediately (%G_BINDING_SYNC_CREATE). invert can be interpreted as analogous to %G_BINDING_INVERT_BOOLEAN.

    For instance, this function can be used to bind the GtkWidget:sensitive property to only make a widget sensitive when the account is connected.

    See g_object_bind_property() for more information.

    Parameters

    • target: object

      the target #GObject

    • target_property: string

      the property on target to bind (must be %G_TYPE_BOOLEAN)

    • invert: boolean

      %TRUE if you wish to invert the value of target_property (i.e. %FALSE if connected)

    Returns Binding

  • Creates a binding between source_property on source and target_property on target.

    Whenever the source_property is changed the target_property is updated using the same value. For instance:

      g_object_bind_property (action, "active", widget, "sensitive", 0);
    

    Will result in the "sensitive" property of the widget #GObject instance to be updated with the same value of the "active" property of the action #GObject instance.

    If flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: if target_property on target changes then the source_property on source will be updated as well.

    The binding will automatically be removed when either the source or the target instances are finalized. To remove the binding without affecting the source and the target you can just call g_object_unref() on the returned #GBinding instance.

    Removing the binding by calling g_object_unref() on it must only be done if the binding, source and target are only used from a single thread and it is clear that both source and target outlive the binding. Especially it is not safe to rely on this if the binding, source or target can be finalized from different threads. Keep another reference to the binding and use g_binding_unbind() instead to be on the safe side.

    A #GObject can have multiple bindings.

    Parameters

    • source_property: string

      the property on source to bind

    • target: GObject.Object

      the target #GObject

    • target_property: string

      the property on target to bind

    • flags: BindingFlags

      flags to pass to #GBinding

    Returns Binding

  • Creates a binding between source_property on source and target_property on target, allowing you to set the transformation functions to be used by the binding.

    This function is the language bindings friendly version of g_object_bind_property_full(), using #GClosures instead of function pointers.

    Parameters

    • source_property: string

      the property on source to bind

    • target: GObject.Object

      the target #GObject

    • target_property: string

      the property on target to bind

    • flags: BindingFlags

      flags to pass to #GBinding

    • transform_to: TClosure<any, any>

      a #GClosure wrapping the transformation function from the source to the target, or %NULL to use the default

    • transform_from: TClosure<any, any>

      a #GClosure wrapping the transformation function from the target to the source, or %NULL to use the default

    Returns Binding

  • Direct the server to block contacts.

    Parameters

    • contacts: TelepathyGLib.Contact[]

      An array of #TpContact objects to block

    • report_abusive: boolean

      If %TRUE, report these contacts as abusive to the server administrators as well as blocking them. See #TpConnection:can-report-abusive to discover whether reporting abuse is supported. If #TpConnection:can-report-abusive is %FALSE, this parameter will be ignored.

    • callback: AsyncReadyCallback

      a callback to call when the operation finishes

    Returns void

  • can_set_contact_alias(): boolean
  • dbus_error_to_gerror(dbus_error: string, debug_message: string): void
  • Convert a D-Bus error name into a GError as if it was returned by a method on this proxy. This method is useful when D-Bus error names are emitted in signals, such as Connection.ConnectionError and Group.MembersChangedDetailed.

    Parameters

    • dbus_error: string

      a D-Bus error name, for instance from the callback for tp_cli_connection_connect_to_connection_error()

    • debug_message: string

      a debug message that accompanied the error name, or %NULL

    Returns void

  • disconnect(id: number): void
  • Disconnect the connection.

    This method is intended for use by AccountManager implementations, such as Mission Control. To disconnect a connection managed by an AccountManager, either use tp_account_request_presence_async() or tp_account_set_enabled_async(), depending whether the intention is to put the account offline temporarily, or disable it longer-term.

    Parameters

    Returns void

  • Create a #TpContact object and make any asynchronous method calls necessary to ensure that all the features specified in features are ready for use (if they are supported at all).

    It is not an error to put features in features even if the connection manager doesn't support them - users of this method should have a static list of features they would like to use if possible, and use it for all connection managers.

    Parameters

    • id: string

      A strings representing the desired contact by its identifier in the IM protocol (an XMPP JID, SIP URI, MSN Passport, AOL screen-name etc.)

    • features: ContactFeature[]

      An array of features that must be ready for use (if supported) before the callback is called (may be %NULL if n_features is 0)

    • callback: AsyncReadyCallback

      A user callback to call when the contact is ready

    Returns void

  • Try to return an existing contact object or create a new contact object immediately.

    If tp_connection_has_immortal_handles() would return %TRUE and identifier is non-%NULL, this function always succeeds.

    On connections without immortal handles, it is not possible to guarantee that handle remains valid without making asynchronous D-Bus calls, so it might be necessary to delay processing of messages or other events until a #TpContact can be constructed asynchronously, for instance by using tp_connection_get_contacts_by_id().

    Similarly, if identifier is %NULL, it might not be possible to find the identifier for handle without making asynchronous D-Bus calls, so it might be necessary to delay processing of messages or other events until a #TpContact can be constructed asynchronously, for instance by using tp_connection_get_contacts_by_handle().

    Parameters

    • handle: number

      a handle of type %TP_HANDLE_TYPE_CONTACT

    • identifier: string

      the normalized identifier (XMPP JID, etc.) corresponding to handle, or %NULL if not known

    Returns TelepathyGLib.Contact

  • Returns a newly allocated #GList of supported contact info fields for this connection. The list must be freed with tp_contact_info_spec_list_free().

    To wait for valid supported fields, call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_INFO.

    This property cannot change after self goes to the Connected state.

    Returns ContactInfoFieldSpec[]

  • Retrieves the user's contact list. In general, blocked contacts are not included in this list. The #TpContact objects returned are guaranteed to have all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared.

    Before calling this method, you must first call tp_proxy_prepare_async() with the %TP_CONNECTION_FEATURE_CONTACT_LIST feature, and verify that #TpConnection:contact-list-state is set to %TP_CONTACT_LIST_STATE_SUCCESS.

    Returns TelepathyGLib.Contact[]

  • If the connection has disconnected, return the D-Bus error name with which it disconnected (in particular, this is %TP_ERROR_STR_CANCELLED if it was disconnected by a user request).

    Otherwise, return %NULL, without altering details.

    Returns [string, GLib.Variant]

  • emit(sigName: "balance-changed", balance: number, balance_scale: number, balance_currency: string, ...args: any[]): void
  • emit(sigName: "blocked-contacts-changed", added: TelepathyGLib.Contact[], removed: TelepathyGLib.Contact[], ...args: any[]): void
  • emit(sigName: "contact-list-changed", added: TelepathyGLib.Contact[], removed: TelepathyGLib.Contact[], ...args: any[]): void
  • emit(sigName: "group-renamed", old_name: string, new_name: string, ...args: any[]): void
  • emit(sigName: "groups-created", added: string[], ...args: any[]): void
  • emit(sigName: "groups-removed", added: string[], ...args: any[]): void
  • emit(sigName: "notify::balance", ...args: any[]): void
  • emit(sigName: "notify::balance-currency", ...args: any[]): void
  • emit(sigName: "notify::balance-scale", ...args: any[]): void
  • emit(sigName: "notify::balance-uri", ...args: any[]): void
  • emit(sigName: "notify::blocked-contacts", ...args: any[]): void
  • emit(sigName: "notify::can-change-contact-list", ...args: any[]): void
  • emit(sigName: "notify::can-report-abusive", ...args: any[]): void
  • emit(sigName: "notify::capabilities", ...args: any[]): void
  • emit(sigName: "notify::cm-name", ...args: any[]): void
  • emit(sigName: "notify::connection-manager-name", ...args: any[]): void
  • emit(sigName: "notify::connection-ready", ...args: any[]): void
  • emit(sigName: "notify::contact-groups", ...args: any[]): void
  • emit(sigName: "notify::contact-list-persists", ...args: any[]): void
  • emit(sigName: "notify::contact-list-state", ...args: any[]): void
  • emit(sigName: "notify::disjoint-groups", ...args: any[]): void
  • emit(sigName: "notify::group-storage", ...args: any[]): void
  • emit(sigName: "notify::protocol-name", ...args: any[]): void
  • emit(sigName: "notify::request-uses-message", ...args: any[]): void
  • emit(sigName: "notify::self-contact", ...args: any[]): void
  • emit(sigName: "notify::self-handle", ...args: any[]): void
  • emit(sigName: "notify::status", ...args: any[]): void
  • emit(sigName: "notify::status-reason", ...args: any[]): void
  • emit(sigName: "notify::bus-name", ...args: any[]): void
  • emit(sigName: "notify::dbus-daemon", ...args: any[]): void
  • emit(sigName: "notify::factory", ...args: any[]): void
  • emit(sigName: "notify::interfaces", ...args: any[]): void
  • emit(sigName: "notify::object-path", ...args: any[]): void
  • emit(sigName: string, ...args: any[]): void
  • force_floating(): void
  • This function is intended for #GObject implementations to re-enforce a [floating][floating-ref] object reference. Doing this is seldom required: all #GInitiallyUnowneds are created with a floating reference which usually just needs to be sunken by calling g_object_ref_sink().

    Returns void

  • freeze_notify(): void
  • Increases the freeze count on object. If the freeze count is non-zero, the emission of "notify" signals on object is stopped. The signals are queued until the freeze count is decreased to zero. Duplicate notifications are squashed so that at most one #GObject::notify signal is emitted for each property modified while the object is frozen.

    This is necessary for accessors that modify multiple properties to prevent premature notification while the object is still being modified.

    Returns void

  • Return the the #TpAccount associated with this connection. Will return %NULL if self was not acquired from a #TpAccount via tp_account_get_connection(), or if the account object got finalized in the meantime (#TpConnection does not keep a strong ref on its #TpAccount).

    Returns TelepathyGLib.Account

  • get_balance(): [boolean, number, number, string]
  • If self has a valid account balance, returns %TRUE and sets the variables pointed to by balance, scale and currency to the appropriate fields of the Balance.AccountBalance property.

    The monetary value of the balance is expressed as a fixed-point number, balance, with a decimal scale defined by scale; for instance a balance of 1234 with scale of 2 represents a value of "12.34" in the currency represented by currency.

    Requires %TP_CONNECTION_FEATURE_BALANCE to be prepared.

    Returns [boolean, number, number, string]

  • get_balance_uri(): string
  • get_bus_name(): string
  • get_can_change_contact_list(): boolean
  • get_cm_name(): string
  • get_connection_manager_name(): string
  • get_contact_attributes(timeout_ms: number, handles: number[], interfaces: string, hold: boolean, callback: GObject.Callback, weak_object: GObject.Object): void
  • Return (via a callback) any number of attributes of the given handles.

    Since telepathy-glib version 0.13.8, the handles will remain valid until connection becomes invalid (signalled by #TpProxy::invalidated). In earlier versions, if hold was %TRUE, the callback would hold a reference to them which could be released with tp_connection_unref_handles().

    This is a thin wrapper around the GetContactAttributes D-Bus method, and should be used in preference to tp_cli_connection_interface_contacts_call_get_contact_attributes(); mixing this function, tp_connection_hold_handles(), tp_connection_unref_handles(), and #TpContact with direct use of the RequestHandles, HoldHandles and GetContactAttributes D-Bus methods is unwise, as #TpConnection and #TpContact perform client-side reference counting of handles. The #TpContact API provides a higher-level abstraction which should usually be used instead.

    callback will later be called with the attributes of those of the given handles that were valid. Invalid handles are simply omitted from the parameter to the callback.

    If hold is %TRUE, the callback is given one reference to each handle that appears as a key in the callback's attributes parameter.

    Parameters

    • timeout_ms: number

      the timeout in milliseconds, or -1 to use the default

    • handles: number[]

      an array of handles

    • interfaces: string

      a #GStrv of interfaces

    • hold: boolean

      if %TRUE, the callback will hold one reference to each valid handle

    • callback: GObject.Callback

      called on success or failure (unless weak_object has become unreferenced)

    • weak_object: GObject.Object

      if not %NULL, an object to be weakly referenced: if it is destroyed, callback will not be called

    Returns void

  • get_contact_groups(): string[]
  • Returns the flags describing how contact info (vCards) behaves on this connection

    To wait for valid contact info flags, call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_INFO.

    This property cannot change after self goes to the Connected state.

    Returns ContactInfoFlags

  • Returns a newly allocated #GList of supported contact info fields for this connection. The list must be freed with g_list_free() after used.

    Note that the #TpContactInfoFieldSpecs in the returned #GList are not dupped before returning from this function. One could copy every item in the list using tp_contact_info_field_spec_copy().

    To wait for valid supported fields, call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_INFO.

    This property cannot change after self goes to the Connected state.

    Returns ContactInfoFieldSpec[]

  • get_contact_list_attributes(timeout_ms: number, interfaces: string, hold: boolean, callback: GObject.Callback, weak_object: GObject.Object): void
  • Return (via a callback) the contacts on the contact list and any number of their attributes.

    Since telepathy-glib version 0.13.8, the handles will remain valid until connection becomes invalid (signalled by #TpProxy::invalidated). In earlier versions, if hold was %TRUE, the callback would hold a reference to them which could be released with tp_connection_unref_handles().

    This is a thin wrapper around the RequestContactList D-Bus method, and should be used in preference to lower-level functions; it is similar to tp_connection_get_contact_attributes().

    The #TpContact API provides a higher-level abstraction which should usually be used instead.

    If hold is %TRUE, the callback is given a reference to each handle that appears as a key in the callback's attributes parameter.

    Parameters

    • timeout_ms: number

      the timeout in milliseconds (using a large timeout is recommended)

    • interfaces: string

      a #GStrv of interfaces

    • hold: boolean

      if %TRUE, the callback will hold one reference to each handle it receives

    • callback: GObject.Callback

      called on success or failure (unless weak_object has become unreferenced)

    • weak_object: GObject.Object

      if not %NULL, an object to be weakly referenced: if it is destroyed, callback will not be called

    Returns void

  • get_contact_list_persists(): boolean
  • Create a number of #TpContact objects and make asynchronous method calls to hold their handles and ensure that all the features specified in features are ready for use (if they are supported at all).

    It is not an error to put features in features even if the connection manager doesn't support them - users of this method should have a static list of features they would like to use if possible, and use it for all connection managers.

    Parameters

    • handles: number[]

      An array of handles of type %TP_HANDLE_TYPE_CONTACT representing the desired contacts

    • features: number[]

      An array of features that must be ready for use (if supported) before the callback is called (may be %NULL if n_features is 0)

    • callback: ConnectionContactsByHandleCb

      A user callback to call when the contacts are ready

    • weak_object: GObject.Object

      An object to pass to the callback, which will be weakly referenced; if this object is destroyed, the operation will be cancelled

    Returns void

  • Create a number of #TpContact objects and make asynchronous method calls to obtain their handles and ensure that all the features specified in features are ready for use (if they are supported at all).

    It is not an error to put features in features even if the connection manager doesn't support them - users of this method should have a static list of features they would like to use if possible, and use it for all connection managers.

    Parameters

    • ids: string[]

      An array of strings representing the desired contacts by their identifiers in the IM protocol (XMPP JIDs, SIP URIs, MSN Passports, AOL screen-names etc.)

    • features: ContactFeature[]

      An array of features that must be ready for use (if supported) before the callback is called (may be %NULL if n_features is 0)

    • callback: ConnectionContactsByIdCb

      A user callback to call when the contacts are ready

    • weak_object: GObject.Object

      An object to pass to the callback, which will be weakly referenced; if this object is destroyed, the operation will be cancelled

    Returns void

  • get_data(key?: string): object
  • Gets a named field from the objects table of associations (see g_object_set_data()).

    Parameters

    • Optional key: string

      name of the key for that association

    Returns object

  • get_detailed_error(): [string, HashTable<string | number | symbol, string | number | boolean>]
  • If the connection has disconnected, return the D-Bus error name with which it disconnected (in particular, this is %TP_ERROR_STR_CANCELLED if it was disconnected by a user request).

    Otherwise, return %NULL, without altering details.

    Returns [string, HashTable<string | number | symbol, string | number | boolean>]

  • get_disjoint_groups(): boolean
  • get_object_path(): string
  • get_property(property_name?: string, value?: any): void
  • Gets a property of an object.

    The value can be:

    • an empty #GValue initialized by %G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
    • a #GValue initialized with the expected type of the property
    • a #GValue initialized with a type to which the expected type of the property can be transformed

    In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling g_value_unset().

    Note that g_object_get_property() is really intended for language bindings, g_object_get() is much more convenient for C programming.

    Parameters

    • Optional property_name: string

      the name of the property to get

    • Optional value: any

      return location for the property value

    Returns void

  • get_protocol_name(): string
  • get_qdata(quark: number): object
  • get_request_uses_message(): boolean
  • get_self_handle(): number
  • Return the %TP_HANDLE_TYPE_CONTACT handle of the local user on this connection, or 0 if the self-handle is not known yet or the connection has become invalid (the TpProxy::invalidated signal).

    The returned handle is not necessarily valid forever (the notify::self-handle signal will be emitted if it changes, which can happen on protocols such as IRC). Construct a #TpContact object if you want to track the local user's identifier in the protocol, or other information like their presence status, over time.

    Returns number

  • getv(names: string[], values: any[]): void
  • Gets n_properties properties for an object. Obtained properties will be set to values. All properties must be valid. Warnings will be emitted and undefined behaviour may result if invalid properties are passed in.

    Parameters

    • names: string[]

      the names of each property to get

    • values: any[]

      the values of each property to get

    Returns void

  • has_immortal_handles(): boolean
  • Return %TRUE if this connection is known to not destroy handles (#TpHandle) until it disconnects.

    On such connections, if you know that a handle maps to a particular identifier now, then you can rely on that handle mapping to that identifier for the whole lifetime of the connection.

    Returns boolean

  • has_interface(iface: string): boolean
  • Return whether this proxy is known to have a particular interface. In versions older than 0.11.11, this was a macro wrapper around tp_proxy_has_interface_by_id().

    For objects that discover their interfaces at runtime, this method will indicate that interfaces are missing until they are known to be present. In subclasses that define features for use with tp_proxy_prepare_async(), successfully preparing the "core" feature for that subclass (such as %TP_CHANNEL_FEATURE_CORE or %TP_CONNECTION_FEATURE_CORE) implies that the interfaces are known.

    Parameters

    • iface: string

      the D-Bus interface required, as a string

    Returns boolean

  • has_interface_by_id(iface: number): boolean
  • Return whether this proxy is known to have a particular interface, by its quark ID. This is equivalent to using g_quark_to_string() followed by tp_proxy_has_interface(), but more efficient.

    Parameters

    • iface: number

      quark representing the D-Bus interface required

    Returns boolean

  • Hold (ensure a reference to) the given handles, if they are valid.

    If they are valid, the callback will later be called with the given handles; if not all of them are valid, the callback will be called with an error.

    This function, along with tp_connection_unref_handles(), tp_connection_get_contact_attributes() and #TpContact, keeps a client-side reference count of handles; you should not use the RequestHandles, HoldHandles and GetContactAttributes D-Bus methods directly as well as these functions.

    Parameters

    • timeout_ms: number

      the timeout in milliseconds, or -1 to use the default

    • handle_type: HandleType

      the handle type

    • handles: number[]

      an array of handles

    • callback: ConnectionHoldHandlesCb

      called on success or failure (unless weak_object has become unreferenced)

    • weak_object: GObject.Object

      if not %NULL, an object to be weakly referenced: if it is destroyed, callback will not be called

    Returns void

  • is_floating(): boolean
  • is_prepared(feature: number): boolean
  • Return %TRUE if feature has been prepared successfully, or %FALSE if feature has not been requested, has not been prepared yet, or is not available on this object at all.

    (For instance, if feature is %TP_CHANNEL_FEATURE_CHAT_STATES and self is a #TpChannel in a protocol that doesn't actually implement chat states, or is not a #TpChannel at all, then this method will return %FALSE.)

    To prepare features, call tp_proxy_prepare_async().

    Parameters

    • feature: number

      a feature that is supported by self's class

    Returns boolean

  • notify(property_name: string): void
  • Emits a "notify" signal for the property property_name on object.

    When possible, eg. when signaling a property change from within the class that registered the property, you should use g_object_notify_by_pspec() instead.

    Note that emission of the notify signal may be blocked with g_object_freeze_notify(). In this case, the signal emissions are queued and will be emitted (in reverse order) when g_object_thaw_notify() is called.

    Parameters

    • property_name: string

      the name of a property installed on the class of object.

    Returns void

  • Emits a "notify" signal for the property specified by pspec on object.

    This function omits the property name lookup, hence it is faster than g_object_notify().

    One way to avoid using g_object_notify() from within the class that registered the properties, and using g_object_notify_by_pspec() instead, is to store the GParamSpec used with g_object_class_install_property() inside a static array, e.g.:

      enum
    {
    PROP_0,
    PROP_FOO,
    PROP_LAST
    };

    static GParamSpec *properties[PROP_LAST];

    static void
    my_object_class_init (MyObjectClass *klass)
    {
    properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
    0, 100,
    50,
    G_PARAM_READWRITE);
    g_object_class_install_property (gobject_class,
    PROP_FOO,
    properties[PROP_FOO]);
    }

    and then notify a change on the "foo" property with:

      g_object_notify_by_pspec (self, properties[PROP_FOO]);
    

    Parameters

    • pspec: ParamSpec

      the #GParamSpec of a property installed on the class of object.

    Returns void

  • parse_object_path(): [boolean, string, string]
  • If the object path of connection is in the correct form, set protocol and cm_name, return TRUE. Otherwise leave them unchanged and return FALSE.

    Returns [boolean, string, string]

  • #TpProxy itself does not support any features, but subclasses like #TpChannel can support features, which can either be core functionality like %TP_CHANNEL_FEATURE_CORE, or extended functionality like %TP_CHANNEL_FEATURE_CHAT_STATES.

    Proxy instances start with no features prepared. When features are requested via tp_proxy_prepare_async(), the proxy starts to do the necessary setup to use those features.

    tp_proxy_prepare_async() always waits for core functionality of the proxy's class to be prepared, even if it is not specifically requested: for instance, because %TP_CHANNEL_FEATURE_CORE is core functionality of a #TpChannel,

    |[ TpChannel *channel = ...;

    tp_proxy_prepare_async (channel, NULL, callback, user_data);



    is equivalent to

    |[
    TpChannel *channel = ...;
    GQuark features[] = { TP_CHANNEL_FEATURE_CORE, 0 };

    tp_proxy_prepare_async (channel, features, callback, user_data);

    If a feature represents core functionality (like %TP_CHANNEL_FEATURE_CORE), failure to prepare it will result in tp_proxy_prepare_async() finishing unsuccessfully: if failure to prepare the feature indicates that the proxy is no longer useful, it will also emit #TpProxy::invalidated.

    If a feature represents non-essential functionality (like %TP_CHANNEL_FEATURE_CHAT_STATES), or is not supported by the object at all, then failure to prepare it is not fatal: tp_proxy_prepare_async() will complete successfully, but tp_proxy_is_prepared() will still return %FALSE for the feature, and accessor methods for the feature will typically return a dummy value.

    Some #TpProxy subclasses automatically start to prepare their core features when instantiated, and features will sometimes become prepared as a side-effect of other actions, but to ensure that a feature is present you must generally call tp_proxy_prepare_async() and wait for the result.

    Parameters

    • features: number[]

      an array of desired features, ending with 0; %NULL is equivalent to an array containing only 0

    • callback: AsyncReadyCallback

      if not %NULL, called exactly once, when the features have all been prepared or failed to prepare, or after the proxy is invalidated

    Returns void

  • Check for error in a call to tp_proxy_prepare_async(). An error here generally indicates that either the asynchronous call was cancelled, or self has emitted #TpProxy::invalidated.

    Parameters

    • result: AsyncResult

      the result passed to the callback of tp_proxy_prepare_async()

    Returns boolean

  • Increases the reference count of object.

    Since GLib 2.56, if GLIB_VERSION_MAX_ALLOWED is 2.56 or greater, the type of object will be propagated to the return type (using the GCC typeof() extension), so any casting the caller needs to do on the return type must be explicit.

    Returns GObject.Object

  • Increase the reference count of object, and possibly remove the [floating][floating-ref] reference, if object has a floating reference.

    In other words, if the object is floating, then this call "assumes ownership" of the floating reference, converting it to a normal reference by clearing the floating flag while leaving the reference count unchanged. If the object is not floating, then this call adds a new normal reference increasing the reference count by one.

    Since GLib 2.56, the type of object will be propagated to the return type under the same conditions as for g_object_ref().

    Returns GObject.Object

  • Requests to refresh the #TpContact:contact-info property on each contact from contacts, requesting it from the network if an up-to-date version is not cached locally. "notify::contact-info" will be emitted when the contact's information are updated.

    If %TP_CONTACT_FEATURE_CONTACT_INFO is not yet set on a contact, it will be set before its property gets updated.

    Parameters

    Returns void

  • Remove the given contacts from the contact list entirely. It is protocol-dependent whether this works, and under which circumstances.

    For this to work properly self must have interface %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST.

    Parameters

    Returns void

  • Remove the given contacts from the given group. If there are no members left in the group afterwards, the group MAY itself be removed.

    For this to work properly self must have interface %TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS.

    Parameters

    • group: string

      the group to alter.

    • contacts: TelepathyGLib.Contact[]

      An array of #TpContact objects to remove from the group.

    • callback: AsyncReadyCallback

      a callback to call when the operation finishes

    Returns void

  • Remove all members from the given group, then remove the group itself.

    For this to work properly self must have interface %TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS.

    Parameters

    • group: string

      the group to remove.

    • callback: AsyncReadyCallback

      a callback to call when the operation finishes

    Returns void

  • rename_group_async(old_name: string, new_name: string, callback: AsyncReadyCallback): void
  • Rename the given old_name.

    On protocols where groups behave like tags, this is an API short-cut for adding all of the group's members to a group with the new name, then removing the old group.

    For this to work properly self must have interface %TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS.

    Parameters

    • old_name: string

      the group to rename

    • new_name: string

      the new name for the group

    • callback: AsyncReadyCallback

      a callback to call when the operation finishes

    Returns void

  • Request the handles corresponding to the given identifiers, and if they are valid, hold (ensure a reference to) the corresponding handles.

    If they are valid, the callback will later be called with the given handles; if not all of them are valid, the callback will be called with an error.

    Parameters

    • timeout_ms: number

      the timeout in milliseconds, or -1 to use the default

    • handle_type: HandleType

      the handle type

    • ids: string[]

      an array of string identifiers for which handles are required, terminated by %NULL (must not be %NULL or empty)

    • callback: ConnectionRequestHandlesCb

      called on success or failure (unless weak_object has become unreferenced)

    • weak_object: GObject.Object

      if not %NULL, an object to be weakly referenced: if it is destroyed, callback will not be called

    Returns void

  • Request that the given contacts allow the local user to subscribe to their presence, i.e. that their #TpContact:subscribe-state property becomes %TP_SUBSCRIPTION_STATE_YES.

    For this to work properly self must have interface %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST.

    Parameters

    • contacts: TelepathyGLib.Contact[]

      An array of #TpContact objects to whom requests are to be sent.

    • message: string

      an optional plain-text message from the user, to send to those contacts with the subscription request.

    • callback: AsyncReadyCallback

      a callback to call when the operation finishes

    Returns void

  • request_subscription_finish(result: AsyncResult): boolean
  • run_dispose(): void
  • Releases all references to other objects. This can be used to break reference cycles.

    This function should only be called from object system implementations.

    Returns void

  • Requests an asynchronous set of the contact info of self. When the operation is finished, callback will be called. You can then call tp_connection_set_contact_info_finish() to get the result of the operation.

    This method should not be expected to succeed if the result of tp_connection_get_contact_info_flags() does not include %TP_CONTACT_INFO_FLAG_CAN_SET.

    Parameters

    Returns void

  • set_data(key: string, data?: object): void
  • Each object carries around a table of associations from strings to pointers. This function lets you set an association.

    If the object already had an association with that name, the old association will be destroyed.

    Internally, the key is converted to a #GQuark using g_quark_from_string(). This means a copy of key is kept permanently (even after object has been finalized) — so it is recommended to only use a small, bounded set of values for key in your program, to avoid the #GQuark storage growing unbounded.

    Parameters

    • key: string

      name of the key

    • Optional data: object

      data to associate with that key

    Returns void

  • Add the given contacts to the given group (creating it if necessary), and remove all other members.

    For this to work properly self must have interface %TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS.

    Parameters

    • group: string

      the group to alter.

    • contacts: TelepathyGLib.Contact[]

      An array of #TpContact objects members for the group. If this set is empty, this method MAY remove the group.

    • callback: AsyncReadyCallback

      a callback to call when the operation finishes

    Returns void

  • set_property(property_name: string, value?: any): void
  • steal_data(key?: string): object
  • Remove a specified datum from the object's data associations, without invoking the association's destroy handler.

    Parameters

    • Optional key: string

      name of the key

    Returns object

  • steal_qdata(quark: number): object
  • This function gets back user data pointers stored via g_object_set_qdata() and removes the data from object without invoking its destroy() function (if any was set). Usually, calling this function is only required to update user data pointers with a destroy notifier, for example:

    void
    object_add_to_user_list (GObject *object,
    const gchar *new_string)
    {
    // the quark, naming the object data
    GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
    // retrieve the old string list
    GList *list = g_object_steal_qdata (object, quark_string_list);

    // prepend new string
    list = g_list_prepend (list, g_strdup (new_string));
    // this changed 'list', so we need to set it again
    g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
    }
    static void
    free_string_list (gpointer data)
    {
    GList *node, *list = data;

    for (node = list; node; node = node->next)
    g_free (node->data);
    g_list_free (list);
    }

    Using g_object_get_qdata() in the above example, instead of g_object_steal_qdata() would have left the destroy function set, and thus the partial string list would have been freed upon g_object_set_qdata_full().

    Parameters

    • quark: number

      A #GQuark, naming the user data pointer

    Returns object

  • thaw_notify(): void
  • Reverts the effect of a previous call to g_object_freeze_notify(). The freeze count is decreased on object and when it reaches zero, queued "notify" signals are emitted.

    Duplicate notifications for each property are squashed so that at most one #GObject::notify signal is emitted for each property, in the reverse order in which they have been queued.

    It is an error to call this function when the freeze count is zero.

    Returns void

  • Attempt to set the given contacts' #TpContact:publish-state property to %TP_SUBSCRIPTION_STATE_NO, i.e. stop sending presence to them.

    For this to work properly self must have interface %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST.

    Parameters

    Returns void

  • unref(): void
  • Decreases the reference count of object. When its reference count drops to 0, the object is finalized (i.e. its memory is freed).

    If the pointer to the #GObject may be reused in future (for example, if it is an instance variable of another object), it is recommended to clear the pointer to %NULL rather than retain a dangling pointer to a potentially invalid #GObject instance. Use g_clear_object() for this.

    Returns void

  • unref_handles(handle_type: HandleType, handles: number[]): void
  • Do nothing. In versions of telepathy-glib prior to 0.13.8, this released a reference to the handles in handles.

    Parameters

    • handle_type: HandleType

      a handle type

    • handles: number[]

      an array of n_handles handles

    Returns void

  • Attempt to set the given contacts' #TpContact:subscribe-state property to %TP_SUBSCRIPTION_STATE_NO, i.e. stop receiving their presence.

    For this to work properly self must have interface %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST.

    Parameters

    Returns void

  • Given several #TpContact objects, make asynchronous method calls ensure that all the features specified in features are ready for use (if they are supported at all).

    It is not an error to put features in features even if the connection manager doesn't support them - users of this method should have a static list of features they would like to use if possible, and use it for all connection managers.

    Parameters

    • contacts: TelepathyGLib.Contact[]

      An array of #TpContact objects associated with self

    • features: ContactFeature[]

      An array of features that must be ready for use (if supported) before the callback is called

    • callback: ConnectionUpgradeContactsCb

      A user callback to call when the contacts are ready

    • weak_object: GObject.Object

      An object to pass to the callback, which will be weakly referenced; if this object is destroyed, the operation will be cancelled

    Returns void

  • Given several #TpContact objects, make asynchronous method calls ensure that all the features specified in features are ready for use (if they are supported at all).

    It is not an error to put features in features even if the connection manager doesn't support them - users of this method should have a static list of features they would like to use if possible, and use it for all connection managers.

    Parameters

    • contacts: TelepathyGLib.Contact[]

      An array of #TpContact objects associated with self

    • features: ContactFeature[]

      An array of features that must be ready for use (if supported) before the callback is called

    • callback: AsyncReadyCallback

      A user callback to call when the contacts are ready

    Returns void

  • vfunc_constructed(): void
  • vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: ParamSpec): void
  • vfunc_dispose(): void
  • vfunc_finalize(): void
  • vfunc_get_property(property_id: number, value?: any, pspec?: ParamSpec): void
  • Emits a "notify" signal for the property property_name on object.

    When possible, eg. when signaling a property change from within the class that registered the property, you should use g_object_notify_by_pspec() instead.

    Note that emission of the notify signal may be blocked with g_object_freeze_notify(). In this case, the signal emissions are queued and will be emitted (in reverse order) when g_object_thaw_notify() is called.

    virtual

    Parameters

    Returns void

  • vfunc_set_property(property_id: number, value?: any, pspec?: ParamSpec): void
  • watch_closure(closure: TClosure<any, any>): void
  • This function essentially limits the life time of the closure to the life time of the object. That is, when the object is finalized, the closure is invalidated by calling g_closure_invalidate() on it, in order to prevent invocations of the closure with a finalized (nonexisting) object. Also, g_object_ref() and g_object_unref() are added as marshal guards to the closure, to ensure that an extra reference count is held on object during invocation of the closure. Usually, this function will be called on closures that use this object as closure data.

    Parameters

    • closure: TClosure<any, any>

      #GClosure to watch

    Returns void

  • compat_control(what: number, data: object): number
  • get_feature_quark_aliasing(): number
  • get_feature_quark_avatar_requirements(): number
  • get_feature_quark_balance(): number
  • get_feature_quark_capabilities(): number
  • get_feature_quark_connected(): number
  • get_feature_quark_contact_blocking(): number
  • get_feature_quark_contact_groups(): number
  • get_feature_quark_contact_info(): number
  • get_feature_quark_contact_list(): number
  • get_feature_quark_contact_list_properties(): number
  • get_feature_quark_core(): number
  • init_known_interfaces(): void
  • Ensure that the known interfaces for TpConnection 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_CONNECTION.

    Returns void

  • Find the #GParamSpec with the given name for an interface. Generally, the interface vtable passed in as g_iface will be the default vtable from g_type_default_interface_ref(), or, if you know the interface has already been loaded, g_type_default_interface_peek().

    Parameters

    • g_iface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface

    • property_name: string

      name of a property to look up.

    Returns ParamSpec

  • Add a property to an interface; this is only useful for interfaces that are added to GObject-derived types. Adding a property to an interface forces all objects classes with that interface to have a compatible property. The compatible property could be a newly created #GParamSpec, but normally g_object_class_override_property() will be used so that the object class only needs to provide an implementation and inherits the property description, default value, bounds, and so forth from the interface property.

    This function is meant to be called from the interface's default vtable initialization function (the class_init member of #GTypeInfo.) It must not be called after after class_init has been called for any object types implementing this interface.

    If pspec is a floating reference, it will be consumed.

    Parameters

    • g_iface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface.

    • pspec: ParamSpec

      the #GParamSpec for the new property

    Returns void

  • Lists the properties of an interface.Generally, the interface vtable passed in as g_iface will be the default vtable from g_type_default_interface_ref(), or, if you know the interface has already been loaded, g_type_default_interface_peek().

    Parameters

    • g_iface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface

    Returns ParamSpec[]

  • Parameters

    • dbus: DBusDaemon

      a D-Bus daemon; may not be %NULL

    • bus_name: string

      the well-known or unique name of the connection process; if well-known, this function will make a blocking call to the bus daemon to resolve the unique name. May be %NULL if object_path is not, in which case a well-known name will be derived from object_path.

    • object_path: string

      the object path of the connection process. May be %NULL if bus_name is a well-known name, in which case the object path will be derived from bus_name.

    Returns TelepathyGLib.Connection

  • Creates a new instance of a #GObject subtype and sets its properties.

    Construction parameters (see %G_PARAM_CONSTRUCT, %G_PARAM_CONSTRUCT_ONLY) which are not explicitly specified are set to their default values.

    Parameters

    • object_type: GType<unknown>

      the type id of the #GObject subtype to instantiate

    • parameters: GObject.Parameter[]

      an array of #GParameter

    Returns GObject.Object

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method