From 9b45dbb35a3fb8a9885b72da231bf03671979d86 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sat, 23 May 2015 19:43:54 +0000 Subject: Tox: updated tox core git-svn-id: http://svn.miranda-ng.org/main/trunk@13792 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/api_main.cpp | 4 ++-- protocols/Tox/src/tox_options.cpp | 6 +++--- protocols/Tox/src/tox_profile.cpp | 15 +++++++++++---- protocols/Tox/src/tox_proto.h | 2 +- protocols/Tox/src/version.h | 2 +- 5 files changed, 18 insertions(+), 11 deletions(-) (limited to 'protocols/Tox/src') diff --git a/protocols/Tox/src/api_main.cpp b/protocols/Tox/src/api_main.cpp index 1e04f74ef0..b9812bfbcd 100644 --- a/protocols/Tox/src/api_main.cpp +++ b/protocols/Tox/src/api_main.cpp @@ -12,9 +12,9 @@ void tox_options_free(struct Tox_Options *options) CreateFunction(__FUNCTION__)(options); } -Tox *tox_new(const struct Tox_Options *options, const uint8_t *data, size_t length, TOX_ERR_NEW *error) +Tox *tox_new(const struct Tox_Options *options, TOX_ERR_NEW *error) { - return CreateFunction(__FUNCTION__)(options, data, length, error); + return CreateFunction(__FUNCTION__)(options, error); } void tox_kill(Tox *tox) diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index 40cfa41e49..71cbb5fd7e 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -74,16 +74,16 @@ void CToxOptionsMain::ProfileCreate_OnClick(CCtrlButton*) HANDLE hProfile = CreateFile(profilePath.c_str(), GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); if (hProfile == NULL) { - // TODO: warh error + m_proto->debugLogA(__FUNCTION__": failed to create tox profile"); return; } CloseHandle(hProfile); TOX_ERR_NEW initError; - m_proto->tox = tox_new(NULL, NULL, 0, &initError); + m_proto->tox = tox_new(NULL, &initError); if (initError != TOX_ERR_NEW_OK) { - // TODO: warh error + m_proto->debugLogA(__FUNCTION__": failed to load tox profile (%d)", initError); return; } } diff --git a/protocols/Tox/src/tox_profile.cpp b/protocols/Tox/src/tox_profile.cpp index c422dcc947..4e2f450dfd 100644 --- a/protocols/Tox/src/tox_profile.cpp +++ b/protocols/Tox/src/tox_profile.cpp @@ -16,7 +16,7 @@ std::tstring CToxProto::GetToxProfilePath(const TCHAR *accountName) return profilePath; } -bool CToxProto::LoadToxProfile(const Tox_Options *options) +bool CToxProto::LoadToxProfile(Tox_Options *options) { debugLogA(__FUNCTION__": loading tox profile"); @@ -78,8 +78,15 @@ bool CToxProto::LoadToxProfile(const Tox_Options *options) size -= TOX_PASS_ENCRYPTION_EXTRA_LENGTH; } + if (data) + { + options->savedata_data = data; + options->savedata_length = size; + options->savedata_type = TOX_SAVEDATA_TYPE_TOX_SAVE; + } + TOX_ERR_NEW initError; - tox = tox_new(options, data, size, &initError); + tox = tox_new(options, &initError); if (initError != TOX_ERR_NEW_OK) { debugLogA(__FUNCTION__": failed to load tox profile (%d)", initError); @@ -146,8 +153,8 @@ INT_PTR CToxProto::OnCopyToxID(WPARAM, LPARAM) } CToxPasswordEditor::CToxPasswordEditor(CToxProto *proto) : -CToxDlgBase(proto, IDD_PASSWORD, false), ok(this, IDOK), -password(this, IDC_PASSWORD), savePermanently(this, IDC_SAVEPERMANENTLY) + CToxDlgBase(proto, IDD_PASSWORD, false), ok(this, IDOK), + password(this, IDC_PASSWORD), savePermanently(this, IDC_SAVEPERMANENTLY) { ok.OnClick = Callback(this, &CToxPasswordEditor::OnOk); } diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index bdb9b82c7d..f532d4f5c1 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -84,7 +84,7 @@ private: std::tstring GetToxProfilePath(); static std::tstring CToxProto::GetToxProfilePath(const TCHAR *accountName); - bool LoadToxProfile(const Tox_Options *options); + bool LoadToxProfile(Tox_Options *options); void SaveToxProfile(); INT_PTR __cdecl OnCopyToxID(WPARAM, LPARAM); diff --git a/protocols/Tox/src/version.h b/protocols/Tox/src/version.h index 6e494bddca..0d7396ac76 100644 --- a/protocols/Tox/src/version.h +++ b/protocols/Tox/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 11 #define __RELEASE_NUM 1 -#define __BUILD_NUM 5 +#define __BUILD_NUM 6 #include -- cgit v1.2.3