## Connection Avatars interface Connection Avatars interface — client-side wrappers for the Avatars interface |

## Synopsis

    #include <telepathy-glib/connection.h>

    gboolean            tp_cli_connection_interface_avatars_run_clear_avatar
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             GError **error,
                                                             GMainLoop **loop);
    gboolean            tp_cli_connection_interface_avatars_run_get_avatar_requirements
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             gchar ***out_MIME_Types,
                                                             guint *out_Min_Width,
                                                             guint *out_Min_Height,
                                                             guint *out_Max_Width,
                                                             guint *out_Max_Height,
                                                             guint *out_Max_Bytes,
                                                             GError **error,
                                                             GMainLoop **loop);
    gboolean            tp_cli_connection_interface_avatars_run_get_avatar_tokens
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             const GArray *in_Contacts,
                                                             gchar ***out_Tokens,
                                                             GError **error,
                                                             GMainLoop **loop);
    gboolean            tp_cli_connection_interface_avatars_run_get_known_avatar_tokens
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             const GArray *in_Contacts,
                                                             GHashTable **out_Tokens,
                                                             GError **error,
                                                             GMainLoop **loop);
    gboolean            tp_cli_connection_interface_avatars_run_request_avatar
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             guint in_Contact,
                                                             GArray **out_Data,
                                                             gchar **out_MIME_Type,
                                                             GError **error,
                                                             GMainLoop **loop);
    gboolean            tp_cli_connection_interface_avatars_run_request_avatars
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             const GArray *in_Contacts,
                                                             GError **error,
                                                             GMainLoop **loop);
    gboolean            tp_cli_connection_interface_avatars_run_set_avatar
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             const GArray *in_Avatar,
                                                             const gchar *in_MIME_Type,
                                                             gchar **out_Token,
                                                             GError **error,
                                                             GMainLoop **loop);
    TpProxyPendingCall * tp_cli_connection_interface_avatars_call_clear_avatar
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             tp_cli_connection_interface_avatars_callback_for_clear_avatar callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object);
    TpProxyPendingCall * tp_cli_connection_interface_avatars_call_get_avatar_requirements
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             tp_cli_connection_interface_avatars_callback_for_get_avatar_requirements callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object);
    TpProxyPendingCall * tp_cli_connection_interface_avatars_call_get_avatar_tokens
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             const GArray *in_Contacts,
                                                             tp_cli_connection_interface_avatars_callback_for_get_avatar_tokens callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object);
    TpProxyPendingCall * tp_cli_connection_interface_avatars_call_get_known_avatar_tokens
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             const GArray *in_Contacts,
                                                             tp_cli_connection_interface_avatars_callback_for_get_known_avatar_tokens callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object);
    TpProxyPendingCall * tp_cli_connection_interface_avatars_call_request_avatar
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             guint in_Contact,
                                                             tp_cli_connection_interface_avatars_callback_for_request_avatar callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object);
    TpProxyPendingCall * tp_cli_connection_interface_avatars_call_request_avatars
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             const GArray *in_Contacts,
                                                             tp_cli_connection_interface_avatars_callback_for_request_avatars callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object);
    TpProxyPendingCall * tp_cli_connection_interface_avatars_call_set_avatar
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             const GArray *in_Avatar,
                                                             const gchar *in_MIME_Type,
                                                             tp_cli_connection_interface_avatars_callback_for_set_avatar callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object);
    void                (*tp_cli_connection_interface_avatars_callback_for_clear_avatar)
                                                            (TpConnection *proxy,
                                                             const GError *error,
                                                             gpointer user_data,
                                                             GObject *weak_object);
    void                (*tp_cli_connection_interface_avatars_callback_for_get_avatar_requirements)
                                                            (TpConnection *proxy,
                                                             const gchar **out_MIME_Types,
                                                             guint out_Min_Width,
                                                             guint out_Min_Height,
                                                             guint out_Max_Width,
                                                             guint out_Max_Height,
                                                             guint out_Max_Bytes,
                                                             const GError *error,
                                                             gpointer user_data,
                                                             GObject *weak_object);
    void                (*tp_cli_connection_interface_avatars_callback_for_get_avatar_tokens)
                                                            (TpConnection *proxy,
                                                             const gchar **out_Tokens,
                                                             const GError *error,
                                                             gpointer user_data,
                                                             GObject *weak_object);
    void                (*tp_cli_connection_interface_avatars_callback_for_get_known_avatar_tokens)
                                                            (TpConnection *proxy,
                                                             GHashTable *out_Tokens,
                                                             const GError *error,
                                                             gpointer user_data,
                                                             GObject *weak_object);
    void                (*tp_cli_connection_interface_avatars_callback_for_request_avatar)
                                                            (TpConnection *proxy,
                                                             const GArray *out_Data,
                                                             const gchar *out_MIME_Type,
                                                             const GError *error,
                                                             gpointer user_data,
                                                             GObject *weak_object);
    void                (*tp_cli_connection_interface_avatars_callback_for_request_avatars)
                                                            (TpConnection *proxy,
                                                             const GError *error,
                                                             gpointer user_data,
                                                             GObject *weak_object);
    void                (*tp_cli_connection_interface_avatars_callback_for_set_avatar)
                                                            (TpConnection *proxy,
                                                             const gchar *out_Token,
                                                             const GError *error,
                                                             gpointer user_data,
                                                             GObject *weak_object);
    TpProxySignalConnection * tp_cli_connection_interface_avatars_connect_to_avatar_retrieved
                                                            (TpConnection *proxy,
                                                             tp_cli_connection_interface_avatars_signal_callback_avatar_retrieved callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object,
                                                             GError **error);
    TpProxySignalConnection * tp_cli_connection_interface_avatars_connect_to_avatar_updated
                                                            (TpConnection *proxy,
                                                             tp_cli_connection_interface_avatars_signal_callback_avatar_updated callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object,
                                                             GError **error);
    void                (*tp_cli_connection_interface_avatars_signal_callback_avatar_retrieved)
                                                            (TpConnection *proxy,
                                                             guint arg_Contact,
                                                             const gchar *arg_Token,
                                                             const GArray *arg_Avatar,
                                                             const gchar *arg_Type,
                                                             gpointer user_data,
                                                             GObject *weak_object);
    void                (*tp_cli_connection_interface_avatars_signal_callback_avatar_updated)
                                                            (TpConnection *proxy,
                                                             guint arg_Contact,
                                                             const gchar *arg_New_Avatar_Token,
                                                             gpointer user_data,
                                                             GObject *weak_object);

## Description

Most instant messaging protocols allow users to set an icon or avatar. This section documents the auto-generated C wrappers for the Avatar interface, used with TpConnection objects.

## Details

### tp_cli_connection_interface_avatars_run_clear_avatar ()

    gboolean            tp_cli_connection_interface_avatars_run_clear_avatar
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             GError **error,
                                                             GMainLoop **loop);

### Warning

`tp_cli_connection_interface_avatars_run_clear_avatar` is deprecated and should not be used in newly-written code.

Call the method ClearAvatar and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Remove the avatar image for this connection.

`proxy` : | A TpConnection or subclass
`timeout_ms` : | Timeout in milliseconds, or -1 for default
`error` : | If not `NULL`, used to return errors if `FALSE` is returned
`loop` : | If not `NULL`, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with `g_main_loop_quit()`, causing a return of `FALSE` with `error` set to `TP_DBUS_ERROR_CANCELLED`
Returns : | TRUE on success, FALSE and sets `error` on error

### tp_cli_connection_interface_avatars_run_get_avatar_requirements ()

    gboolean            tp_cli_connection_interface_avatars_run_get_avatar_requirements
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             gchar ***out_MIME_Types,
                                                             guint *out_Min_Width,
                                                             guint *out_Min_Height,
                                                             guint *out_Max_Width,
                                                             guint *out_Max_Height,
                                                             guint *out_Max_Bytes,
                                                             GError **error,
                                                             GMainLoop **loop);

### Warning

`tp_cli_connection_interface_avatars_run_get_avatar_requirements` is deprecated and should not be used in newly-written code. Use GetAll to retrieve the D-Bus properties on this interface, falling back to this method on failure.

Call the method GetAvatarRequirements and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Get the required format of avatars on this connection.

`proxy` : | A TpConnection or subclass
`timeout_ms` : | Timeout in milliseconds, or -1 for default
`out_MIME_Types` : | Used to return an 'out' argument if `TRUE` is returned: An array of supported MIME types (eg image/jpeg)
`out_Min_Width` : | Used to return an 'out' argument if `TRUE` is returned: The minimum image width in pixels
`out_Min_Height` : | Used to return an 'out' argument if `TRUE` is returned: The minimum image height in pixels
`out_Max_Width` : | Used to return an 'out' argument if `TRUE` is returned: The maximum image width in pixels, or 0 if there is no limit
`out_Max_Height` : | Used to return an 'out' argument if `TRUE` is returned: The maximum image height in pixels, or 0 if there is no limit
`out_Max_Bytes` : | Used to return an 'out' argument if `TRUE` is returned: The maximum image size in bytes, or 0 if there is no limit
`error` : | If not `NULL`, used to return errors if `FALSE` is returned
`loop` : | If not `NULL`, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with `g_main_loop_quit()`, causing a return of `FALSE` with `error` set to `TP_DBUS_ERROR_CANCELLED`
Returns : | TRUE on success, FALSE and sets `error` on error

### tp_cli_connection_interface_avatars_run_get_avatar_tokens ()

    gboolean            tp_cli_connection_interface_avatars_run_get_avatar_tokens
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             const GArray *in_Contacts,
                                                             gchar ***out_Tokens,
                                                             GError **error,
                                                             GMainLoop **loop);

### Warning

`tp_cli_connection_interface_avatars_run_get_avatar_tokens` is deprecated and should not be used in newly-written code. Use GetKnownAvatarTokens instead.

Call the method GetAvatarTokens and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Get the unique tokens for all of the given contacts' avatars. Using this method in new Telepathy clients is deprecated; use <tp:member-ref>GetKnownAvatarTokens</tp:member-ref> instead.

`proxy` : | A TpConnection or subclass
`timeout_ms` : | Timeout in milliseconds, or -1 for default
`in_Contacts` : | Used to pass an 'in' argument: An array of handles representing contacts
`out_Tokens` : | Used to return an 'out' argument if `TRUE` is returned: An array of avatar tokens or empty strings (if no avatar is set) in the same order as the given array of contact handles
`error` : | If not `NULL`, used to return errors if `FALSE` is returned
`loop` : | If not `NULL`, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with `g_main_loop_quit()`, causing a return of `FALSE` with `error` set to `TP_DBUS_ERROR_CANCELLED`
Returns : | TRUE on success, FALSE and sets `error` on error

### tp_cli_connection_interface_avatars_run_get_known_avatar_tokens ()

    gboolean            tp_cli_connection_interface_avatars_run_get_known_avatar_tokens
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             const GArray *in_Contacts,
                                                             GHashTable **out_Tokens,
                                                             GError **error,
                                                             GMainLoop **loop);

### Warning

`tp_cli_connection_interface_avatars_run_get_known_avatar_tokens` is deprecated and should not be used in newly-written code.

Call the method GetKnownAvatarTokens and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Get the unique tokens for the given contacts' avatars. These tokens can be persisted across connections, and should be used by the client to check whether the avatars have been updated. For handles other than the self handle, only tokens that are already known are returned; an empty token means the given contact has no avatar. However, a CM must always have the tokens for the self handle if one is set (even if it is set to no avatar). On protocols where the avatar does not persist between connections, a CM should omit the self handle from the returned map until an avatar is explicitly set or cleared.

`proxy` : | A TpConnection or subclass
`timeout_ms` : | Timeout in milliseconds, or -1 for default
`in_Contacts` : | Used to pass an 'in' argument: An array of handles representing contacts
`out_Tokens` : | Used to return an 'out' argument if `TRUE` is returned: A dictionary of handles mapped to avatar tokens, containing only the known avatar tokens.
`error` : | If not `NULL`, used to return errors if `FALSE` is returned
`loop` : | If not `NULL`, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with `g_main_loop_quit()`, causing a return of `FALSE` with `error` set to `TP_DBUS_ERROR_CANCELLED`
Returns : | TRUE on success, FALSE and sets `error` on error

### tp_cli_connection_interface_avatars_run_request_avatar ()

    gboolean            tp_cli_connection_interface_avatars_run_request_avatar
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             guint in_Contact,
                                                             GArray **out_Data,
                                                             gchar **out_MIME_Type,
                                                             GError **error,
                                                             GMainLoop **loop);

### Warning

`tp_cli_connection_interface_avatars_run_request_avatar` is deprecated and should not be used in newly-written code. Use RequestAvatars instead.

Call the method RequestAvatar and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Request the avatar for a given contact. Using this method in new Telepathy clients is deprecated; use RequestAvatars instead.

`proxy` : | A TpConnection or subclass
`timeout_ms` : | Timeout in milliseconds, or -1 for default
`in_Contact` : | Used to pass an 'in' argument: An integer handle for the contact to request the avatar for
`out_Data` : | Used to return an 'out' argument if `TRUE` is returned: An array of bytes containing the image data
`out_MIME_Type` : | Used to return an 'out' argument if `TRUE` is returned: A string containing the image MIME type (eg image/jpeg), or empty if unknown
`error` : | If not `NULL`, used to return errors if `FALSE` is returned
`loop` : | If not `NULL`, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with `g_main_loop_quit()`, causing a return of `FALSE` with `error` set to `TP_DBUS_ERROR_CANCELLED`
Returns : | TRUE on success, FALSE and sets `error` on error

### tp_cli_connection_interface_avatars_run_request_avatars ()

    gboolean            tp_cli_connection_interface_avatars_run_request_avatars
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             const GArray *in_Contacts,
                                                             GError **error,
                                                             GMainLoop **loop);

### Warning

`tp_cli_connection_interface_avatars_run_request_avatars` is deprecated and should not be used in newly-written code.

Call the method RequestAvatars and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Request avatars for a number of contacts. The <tp:member-ref>AvatarRetrieved</tp:member-ref> signal is emitted for each avatar retrieved. If the handles are valid but retrieving an avatar fails (for any reason, including the contact not having an avatar) the AvatarRetrieved signal is not emitted for that contact.

`proxy` : | A TpConnection or subclass
`timeout_ms` : | Timeout in milliseconds, or -1 for default
`in_Contacts` : | Used to pass an 'in' argument: The contacts to retrieve avatars for
`error` : | If not `NULL`, used to return errors if `FALSE` is returned
`loop` : | If not `NULL`, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with `g_main_loop_quit()`, causing a return of `FALSE` with `error` set to `TP_DBUS_ERROR_CANCELLED`
Returns : | TRUE on success, FALSE and sets `error` on error

### tp_cli_connection_interface_avatars_run_set_avatar ()

    gboolean            tp_cli_connection_interface_avatars_run_set_avatar
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             const GArray *in_Avatar,
                                                             const gchar *in_MIME_Type,
                                                             gchar **out_Token,
                                                             GError **error,
                                                             GMainLoop **loop);

### Warning

`tp_cli_connection_interface_avatars_run_set_avatar` is deprecated and should not be used in newly-written code.

Call the method SetAvatar and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Set a new avatar image for this connection. The avatar image must respect the requirements obtained by <tp:member-ref>GetAvatarRequirements</tp:member-ref>.

`proxy` : | A TpConnection or subclass
`timeout_ms` : | Timeout in milliseconds, or -1 for default
`in_Avatar` : | Used to pass an 'in' argument: An array of bytes representing the avatar image data
`in_MIME_Type` : | Used to pass an 'in' argument: A string representing the image MIME type
`out_Token` : | Used to return an 'out' argument if `TRUE` is returned: The string token of the new avatar
`error` : | If not `NULL`, used to return errors if `FALSE` is returned
`loop` : | If not `NULL`, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with `g_main_loop_quit()`, causing a return of `FALSE` with `error` set to `TP_DBUS_ERROR_CANCELLED`
Returns : | TRUE on success, FALSE and sets `error` on error

### tp_cli_connection_interface_avatars_call_clear_avatar ()

    TpProxyPendingCall * tp_cli_connection_interface_avatars_call_clear_avatar
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             tp_cli_connection_interface_avatars_callback_for_clear_avatar callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object);

Start a ClearAvatar method call.

Remove the avatar image for this connection.

`proxy` : | the TpProxy
`timeout_ms` : | the timeout in milliseconds, or -1 to use the default
`callback` : | called when the method call succeeds or fails; may be `NULL` to make a "fire and forget" call with no reply tracking
`user_data` : | user-supplied data passed to the callback; must be `NULL` if `callback` is `NULL`
`destroy` : | called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be `NULL` if `callback` is `NULL`
`weak_object` : | If not `NULL`, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be `NULL` if `callback` is `NULL`
Returns : | a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.

### tp_cli_connection_interface_avatars_call_get_avatar_requirements ()

    TpProxyPendingCall * tp_cli_connection_interface_avatars_call_get_avatar_requirements
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             tp_cli_connection_interface_avatars_callback_for_get_avatar_requirements callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object);

### Warning

`tp_cli_connection_interface_avatars_call_get_avatar_requirements` is deprecated and should not be used in newly-written code. Use GetAll to retrieve the D-Bus properties on this interface, falling back to this method on failure.

Start a GetAvatarRequirements method call.

Get the required format of avatars on this connection.

`proxy` : | the TpProxy
`timeout_ms` : | the timeout in milliseconds, or -1 to use the default
`callback` : | called when the method call succeeds or fails; may be `NULL` to make a "fire and forget" call with no reply tracking
`user_data` : | user-supplied data passed to the callback; must be `NULL` if `callback` is `NULL`
`destroy` : | called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be `NULL` if `callback` is `NULL`
`weak_object` : | If not `NULL`, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be `NULL` if `callback` is `NULL`
Returns : | a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.

### tp_cli_connection_interface_avatars_call_get_avatar_tokens ()

    TpProxyPendingCall * tp_cli_connection_interface_avatars_call_get_avatar_tokens
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             const GArray *in_Contacts,
                                                             tp_cli_connection_interface_avatars_callback_for_get_avatar_tokens callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object);

### Warning

`tp_cli_connection_interface_avatars_call_get_avatar_tokens` is deprecated and should not be used in newly-written code. Use GetKnownAvatarTokens instead.

Start a GetAvatarTokens method call.

Get the unique tokens for all of the given contacts' avatars. Using this method in new Telepathy clients is deprecated; use <tp:member-ref>GetKnownAvatarTokens</tp:member-ref> instead.

`proxy` : | the TpProxy
`timeout_ms` : | the timeout in milliseconds, or -1 to use the default
`in_Contacts` : | Used to pass an 'in' argument: An array of handles representing contacts
`callback` : | called when the method call succeeds or fails; may be `NULL` to make a "fire and forget" call with no reply tracking
`user_data` : | user-supplied data passed to the callback; must be `NULL` if `callback` is `NULL`
`destroy` : | called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be `NULL` if `callback` is `NULL`
`weak_object` : | If not `NULL`, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be `NULL` if `callback` is `NULL`
Returns : | a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.

### tp_cli_connection_interface_avatars_call_get_known_avatar_tokens ()

    TpProxyPendingCall * tp_cli_connection_interface_avatars_call_get_known_avatar_tokens
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             const GArray *in_Contacts,
                                                             tp_cli_connection_interface_avatars_callback_for_get_known_avatar_tokens callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object);

Start a GetKnownAvatarTokens method call.

Get the unique tokens for the given contacts' avatars. These tokens can be persisted across connections, and should be used by the client to check whether the avatars have been updated. For handles other than the self handle, only tokens that are already known are returned; an empty token means the given contact has no avatar. However, a CM must always have the tokens for the self handle if one is set (even if it is set to no avatar). On protocols where the avatar does not persist between connections, a CM should omit the self handle from the returned map until an avatar is explicitly set or cleared.

`proxy` : | the TpProxy
`timeout_ms` : | the timeout in milliseconds, or -1 to use the default
`in_Contacts` : | Used to pass an 'in' argument: An array of handles representing contacts
`callback` : | called when the method call succeeds or fails; may be `NULL` to make a "fire and forget" call with no reply tracking
`user_data` : | user-supplied data passed to the callback; must be `NULL` if `callback` is `NULL`
`destroy` : | called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be `NULL` if `callback` is `NULL`
`weak_object` : | If not `NULL`, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be `NULL` if `callback` is `NULL`
Returns : | a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.

### tp_cli_connection_interface_avatars_call_request_avatar ()

    TpProxyPendingCall * tp_cli_connection_interface_avatars_call_request_avatar
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             guint in_Contact,
                                                             tp_cli_connection_interface_avatars_callback_for_request_avatar callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object);

### Warning

`tp_cli_connection_interface_avatars_call_request_avatar` is deprecated and should not be used in newly-written code. Use RequestAvatars instead.

Start a RequestAvatar method call.

Request the avatar for a given contact. Using this method in new Telepathy clients is deprecated; use RequestAvatars instead.

`proxy` : | the TpProxy
`timeout_ms` : | the timeout in milliseconds, or -1 to use the default
`in_Contact` : | Used to pass an 'in' argument: An integer handle for the contact to request the avatar for
`callback` : | called when the method call succeeds or fails; may be `NULL` to make a "fire and forget" call with no reply tracking
`user_data` : | user-supplied data passed to the callback; must be `NULL` if `callback` is `NULL`
`destroy` : | called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be `NULL` if `callback` is `NULL`
`weak_object` : | If not `NULL`, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be `NULL` if `callback` is `NULL`
Returns : | a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.

### tp_cli_connection_interface_avatars_call_request_avatars ()

    TpProxyPendingCall * tp_cli_connection_interface_avatars_call_request_avatars
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             const GArray *in_Contacts,
                                                             tp_cli_connection_interface_avatars_callback_for_request_avatars callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object);

Start a RequestAvatars method call.

Request avatars for a number of contacts. The <tp:member-ref>AvatarRetrieved</tp:member-ref> signal is emitted for each avatar retrieved. If the handles are valid but retrieving an avatar fails (for any reason, including the contact not having an avatar) the AvatarRetrieved signal is not emitted for that contact.

`proxy` : | the TpProxy
`timeout_ms` : | the timeout in milliseconds, or -1 to use the default
`in_Contacts` : | Used to pass an 'in' argument: The contacts to retrieve avatars for
`callback` : | called when the method call succeeds or fails; may be `NULL` to make a "fire and forget" call with no reply tracking
`user_data` : | user-supplied data passed to the callback; must be `NULL` if `callback` is `NULL`
`destroy` : | called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be `NULL` if `callback` is `NULL`
`weak_object` : | If not `NULL`, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be `NULL` if `callback` is `NULL`
Returns : | a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.

### tp_cli_connection_interface_avatars_call_set_avatar ()

    TpProxyPendingCall * tp_cli_connection_interface_avatars_call_set_avatar
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             const GArray *in_Avatar,
                                                             const gchar *in_MIME_Type,
                                                             tp_cli_connection_interface_avatars_callback_for_set_avatar callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object);

Start a SetAvatar method call.

Set a new avatar image for this connection. The avatar image must respect the requirements obtained by <tp:member-ref>GetAvatarRequirements</tp:member-ref>.

`proxy` : | the TpProxy
`timeout_ms` : | the timeout in milliseconds, or -1 to use the default
`in_Avatar` : | Used to pass an 'in' argument: An array of bytes representing the avatar image data
`in_MIME_Type` : | Used to pass an 'in' argument: A string representing the image MIME type
`callback` : | called when the method call succeeds or fails; may be `NULL` to make a "fire and forget" call with no reply tracking
`user_data` : | user-supplied data passed to the callback; must be `NULL` if `callback` is `NULL`
`destroy` : | called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be `NULL` if `callback` is `NULL`
`weak_object` : | If not `NULL`, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be `NULL` if `callback` is `NULL`
Returns : | a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.

### tp_cli_connection_interface_avatars_callback_for_clear_avatar ()

    void                (*tp_cli_connection_interface_avatars_callback_for_clear_avatar)
                                                            (TpConnection *proxy,
                                                             const GError *error,
                                                             gpointer user_data,
                                                             GObject *weak_object);

Signature of the callback called when a ClearAvatar method call succeeds or fails.

`proxy` : | the proxy on which the call was made
`error` : | `NULL` on success, or an error on failure
`user_data` : | user-supplied data
`weak_object` : | user-supplied object

### tp_cli_connection_interface_avatars_callback_for_get_avatar_requirements ()

    void                (*tp_cli_connection_interface_avatars_callback_for_get_avatar_requirements)
                                                            (TpConnection *proxy,
                                                             const gchar **out_MIME_Types,
                                                             guint out_Min_Width,
                                                             guint out_Min_Height,
                                                             guint out_Max_Width,
                                                             guint out_Max_Height,
                                                             guint out_Max_Bytes,
                                                             const GError *error,
                                                             gpointer user_data,
                                                             GObject *weak_object);

### Warning

`tp_cli_connection_interface_avatars_callback_for_get_avatar_requirements` is deprecated and should not be used in newly-written code. Use GetAll to retrieve the D-Bus properties on this interface, falling back to this method on failure.

Signature of the callback called when a GetAvatarRequirements method call succeeds or fails.

`proxy` : | the proxy on which the call was made
`out_MIME_Types` : | Used to return an 'out' argument if `error` is `NULL`: An array of supported MIME types (eg image/jpeg)
`out_Min_Width` : | Used to return an 'out' argument if `error` is `NULL`: The minimum image width in pixels
`out_Min_Height` : | Used to return an 'out' argument if `error` is `NULL`: The minimum image height in pixels
`out_Max_Width` : | Used to return an 'out' argument if `error` is `NULL`: The maximum image width in pixels, or 0 if there is no limit
`out_Max_Height` : | Used to return an 'out' argument if `error` is `NULL`: The maximum image height in pixels, or 0 if there is no limit
`out_Max_Bytes` : | Used to return an 'out' argument if `error` is `NULL`: The maximum image size in bytes, or 0 if there is no limit
`error` : | `NULL` on success, or an error on failure
`user_data` : | user-supplied data
`weak_object` : | user-supplied object

### tp_cli_connection_interface_avatars_callback_for_get_avatar_tokens ()

    void                (*tp_cli_connection_interface_avatars_callback_for_get_avatar_tokens)
                                                            (TpConnection *proxy,
                                                             const gchar **out_Tokens,
                                                             const GError *error,
                                                             gpointer user_data,
                                                             GObject *weak_object);

### Warning

`tp_cli_connection_interface_avatars_callback_for_get_avatar_tokens` is deprecated and should not be used in newly-written code. Use GetKnownAvatarTokens instead.

Signature of the callback called when a GetAvatarTokens method call succeeds or fails.

`proxy` : | the proxy on which the call was made
`out_Tokens` : | Used to return an 'out' argument if `error` is `NULL`: An array of avatar tokens or empty strings (if no avatar is set) in the same order as the given array of contact handles
`error` : | `NULL` on success, or an error on failure
`user_data` : | user-supplied data
`weak_object` : | user-supplied object

### tp_cli_connection_interface_avatars_callback_for_get_known_avatar_tokens ()

    void                (*tp_cli_connection_interface_avatars_callback_for_get_known_avatar_tokens)
                                                            (TpConnection *proxy,
                                                             GHashTable *out_Tokens,
                                                             const GError *error,
                                                             gpointer user_data,
                                                             GObject *weak_object);

Signature of the callback called when a GetKnownAvatarTokens method call succeeds or fails.

`proxy` : | the proxy on which the call was made
`out_Tokens` : | Used to return an 'out' argument if `error` is `NULL`: A dictionary of handles mapped to avatar tokens, containing only the known avatar tokens.
`error` : | `NULL` on success, or an error on failure
`user_data` : | user-supplied data
`weak_object` : | user-supplied object

### tp_cli_connection_interface_avatars_callback_for_request_avatar ()

    void                (*tp_cli_connection_interface_avatars_callback_for_request_avatar)
                                                            (TpConnection *proxy,
                                                             const GArray *out_Data,
                                                             const gchar *out_MIME_Type,
                                                             const GError *error,
                                                             gpointer user_data,
                                                             GObject *weak_object);

### Warning

`tp_cli_connection_interface_avatars_callback_for_request_avatar` is deprecated and should not be used in newly-written code. Use RequestAvatars instead.

Signature of the callback called when a RequestAvatar method call succeeds or fails.

`proxy` : | the proxy on which the call was made
`out_Data` : | Used to return an 'out' argument if `error` is `NULL`: An array of bytes containing the image data
`out_MIME_Type` : | Used to return an 'out' argument if `error` is `NULL`: A string containing the image MIME type (eg image/jpeg), or empty if unknown
`error` : | `NULL` on success, or an error on failure
`user_data` : | user-supplied data
`weak_object` : | user-supplied object

### tp_cli_connection_interface_avatars_callback_for_request_avatars ()

    void                (*tp_cli_connection_interface_avatars_callback_for_request_avatars)
                                                            (TpConnection *proxy,
                                                             const GError *error,
                                                             gpointer user_data,
                                                             GObject *weak_object);

Signature of the callback called when a RequestAvatars method call succeeds or fails.

`proxy` : | the proxy on which the call was made
`error` : | `NULL` on success, or an error on failure
`user_data` : | user-supplied data
`weak_object` : | user-supplied object

### tp_cli_connection_interface_avatars_callback_for_set_avatar ()

    void                (*tp_cli_connection_interface_avatars_callback_for_set_avatar)
                                                            (TpConnection *proxy,
                                                             const gchar *out_Token,
                                                             const GError *error,
                                                             gpointer user_data,
                                                             GObject *weak_object);

Signature of the callback called when a SetAvatar method call succeeds or fails.

`proxy` : | the proxy on which the call was made
`out_Token` : | Used to return an 'out' argument if `error` is `NULL`: The string token of the new avatar
`error` : | `NULL` on success, or an error on failure
`user_data` : | user-supplied data
`weak_object` : | user-supplied object

### tp_cli_connection_interface_avatars_connect_to_avatar_retrieved ()

    TpProxySignalConnection * tp_cli_connection_interface_avatars_connect_to_avatar_retrieved
                                                            (TpConnection *proxy,
                                                             tp_cli_connection_interface_avatars_signal_callback_avatar_retrieved callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object,
                                                             GError **error);

Connect a handler to the signal AvatarRetrieved.

Emitted when the avatar for a contact has been retrieved.

`proxy` : | A TpConnection or subclass
`callback` : | Callback to be called when the signal is received
`user_data` : | User-supplied data for the callback
`destroy` : | Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns `NULL`
`weak_object` : | A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected
`error` : | If not `NULL`, used to raise an error if `NULL` is returned
Returns : | a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or `NULL` if the proxy does not have the desired interface or has become invalid.

### tp_cli_connection_interface_avatars_connect_to_avatar_updated ()

    TpProxySignalConnection * tp_cli_connection_interface_avatars_connect_to_avatar_updated
                                                            (TpConnection *proxy,
                                                             tp_cli_connection_interface_avatars_signal_callback_avatar_updated callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object,
                                                             GError **error);

Connect a handler to the signal AvatarUpdated.

Emitted when the avatar for a contact has been updated, or first discovered on this connection. If the token differs from the token associated with the client's cached avatar for this contact, the new avatar should be requested with <tp:member-ref>RequestAvatars</tp:member-ref>.

`proxy` : | A TpConnection or subclass
`callback` : | Callback to be called when the signal is received
`user_data` : | User-supplied data for the callback
`destroy` : | Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns `NULL`
`weak_object` : | A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected
`error` : | If not `NULL`, used to raise an error if `NULL` is returned
Returns : | a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or `NULL` if the proxy does not have the desired interface or has become invalid.

### tp_cli_connection_interface_avatars_signal_callback_avatar_retrieved ()

    void                (*tp_cli_connection_interface_avatars_signal_callback_avatar_retrieved)
                                                            (TpConnection *proxy,
                                                             guint arg_Contact,
                                                             const gchar *arg_Token,
                                                             const GArray *arg_Avatar,
                                                             const gchar *arg_Type,
                                                             gpointer user_data,
                                                             GObject *weak_object);

Represents the signature of a callback for the signal AvatarRetrieved.

`proxy` : | The proxy on which `tp_cli_connection_interface_avatars_connect_to_avatar_retrieved()` was called
`arg_Contact` : | The contact whose avatar has been retrieved
`arg_Token` : | The token corresponding to the avatar
`arg_Avatar` : | An array of bytes containing the image data
`arg_Type` : | A string containing the image MIME type (eg image/jpeg), or empty if unknown
`user_data` : | User-supplied data
`weak_object` : | User-supplied weakly referenced object

### tp_cli_connection_interface_avatars_signal_callback_avatar_updated ()

    void                (*tp_cli_connection_interface_avatars_signal_callback_avatar_updated)
                                                            (TpConnection *proxy,
                                                             guint arg_Contact,
                                                             const gchar *arg_New_Avatar_Token,
                                                             gpointer user_data,
                                                             GObject *weak_object);

Represents the signature of a callback for the signal AvatarUpdated.

`proxy` : | The proxy on which `tp_cli_connection_interface_avatars_connect_to_avatar_updated()` was called
`arg_Contact` : | An integer handle for the contact whose avatar has changed
`arg_New_Avatar_Token` : | Unique token for their new avatar
`user_data` : | User-supplied data
`weak_object` : | User-supplied weakly referenced object

## See Also

TpConnection