set_photo_async


Description:

[ Version ( since = "0.8.0" ) ]
public async bool set_photo_async (ContactsService service, uint8? data, size_t length, string? content_type, Cancellable? cancellable) throws Error

Sets the contact's photo to data or, if data is null, deletes the contact's photo.

content_type must be specified if data is non-null. this, service, data and content_type are all reffed and copied when this function is called, so can safely be unreffed after this function returns.

When the operation is finished, callback will be called. You can then call set_photo_async.end to get the results of the operation.

For more details, see set_photo, which is the synchronous version of this function.

If cancellable is not null, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error g_io_error_cancelled will be returned by set_photo_async.end.

If there is an error setting the photo, a gdata_service_error_protocol_error error will be returned by set_photo_async.end.

Parameters:

this

a ContactsContact

service

a ContactsService

data

the image data, or null

length

the image length, in bytes

content_type

the content type of the image, or null

cancellable

optional Cancellable object, or null

callback

a TaskReadyCallback to call when the photo has been set, or null

user_data

data to pass to the callback function