1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-14 04:53:02 +01:00

toxcore API changes to tox_new

This commit is contained in:
Jfreegman 2015-05-24 17:36:13 -04:00
parent 231078b6b9
commit 36640224af
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63

View File

@ -640,7 +640,11 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW
(uint8_t *) plain, &pwerr);
if (pwerr == TOX_ERR_DECRYPTION_OK) {
m = tox_new(tox_opts, (uint8_t *) plain, plain_len, new_err);
tox_opts->savedata_type = TOX_SAVEDATA_TYPE_TOX_SAVE;
tox_opts->savedata_data = (uint8_t *) plain;
tox_opts->savedata_length = plain_len;
m = tox_new(tox_opts, new_err);
if (m == NULL) {
fclose(fp);
@ -658,7 +662,11 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW
}
}
} else { /* data is not encrypted */
m = tox_new(tox_opts, (uint8_t *) data, len, new_err);
tox_opts->savedata_type = TOX_SAVEDATA_TYPE_TOX_SAVE;
tox_opts->savedata_data = (uint8_t *) data;
tox_opts->savedata_length = len;
m = tox_new(tox_opts, new_err);
if (m == NULL) {
fclose(fp);
@ -671,7 +679,9 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW
if (file_exists(data_path))
exit_toxic_err("failed in load_toxic", FATALERR_FILEOP);
m = tox_new(tox_opts, NULL, 0, new_err);
tox_opts->savedata_type = TOX_SAVEDATA_TYPE_NONE;
m = tox_new(tox_opts, new_err);
if (m == NULL)
return NULL;