Delta Chat Core C Interface
|
Set up another device. More...
#include <deltachat.h>
Public Member Functions | |
char * | dc_backup_provider_get_qr (const dc_backup_provider_t *backup_provider) |
Returns the QR code text that will offer the backup to other devices. | |
char * | dc_backup_provider_get_qr_svg (const dc_backup_provider_t *backup_provider) |
Returns the QR code SVG image that will offer the backup to other devices. | |
dc_backup_provider_t * | dc_backup_provider_new (dc_context_t *context) |
Creates an object for sending a backup to another device. | |
void | dc_backup_provider_unref (dc_backup_provider_t *backup_provider) |
Frees a dc_backup_provider_t object. | |
void | dc_backup_provider_wait (dc_backup_provider_t *backup_provider) |
Waits for the sending to finish. | |
Set up another device.
char * dc_backup_provider_get_qr | ( | const dc_backup_provider_t * | backup_provider | ) |
Returns the QR code text that will offer the backup to other devices.
The QR code contains a ticket which will validate the backup and provide authentication for both the provider and the recipient.
The scanning device should call the scanned text to dc_check_qr(). If dc_check_qr() returns DC_QR_BACKUP, the backup transfer can be started using dc_get_backup().
backup_provider | The backup provider object as created by dc_backup_provider_new(). |
char * dc_backup_provider_get_qr_svg | ( | const dc_backup_provider_t * | backup_provider | ) |
Returns the QR code SVG image that will offer the backup to other devices.
This works like dc_backup_provider_qr() but returns the text of a rendered SVG image containing the QR code.
backup_provider | The backup provider object as created by dc_backup_provider_new(). |
dc_backup_provider_t * dc_backup_provider_new | ( | dc_context_t * | context | ) |
Creates an object for sending a backup to another device.
The backup is sent to through a peer-to-peer channel which is bootstrapped by a QR-code. The backup contains the entire state of the account including credentials. This can be used to setup a new device.
This is a blocking call as some preparations are made like e.g. exporting the database. Once this function returns, the backup is being offered to remote devices. To wait until one device received the backup, use dc_backup_provider_wait(). Alternatively abort the operation using dc_stop_ongoing_process().
During execution of the job DC_EVENT_IMEX_PROGRESS is sent out to indicate state and progress.
context | The context. |
void dc_backup_provider_unref | ( | dc_backup_provider_t * | backup_provider | ) |
Frees a dc_backup_provider_t object.
If the provider has not yet finished, as indicated by dc_backup_provider_wait() or the DC_EVENT_IMEX_PROGRESS event with value of 0 (failed) or 1000 (succeeded), this will also abort any in-progress transfer. If this aborts the provider a DC_EVENT_IMEX_PROGRESS event with value 0 (failed) will be emitted.
backup_provider | The backup provider object as created by dc_backup_provider_new(). |
void dc_backup_provider_wait | ( | dc_backup_provider_t * | backup_provider | ) |
Waits for the sending to finish.
This is a blocking call and should only be called once.
backup_provider | The backup provider object as created by dc_backup_provider_new(). If NULL is given nothing is done. |