From 40ca3f169e61d1273d47ddcee277bbc5bcb6ffdf Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sun, 10 Aug 2014 16:10:24 +0000 Subject: Tox: first approach to saving and restoring data git-svn-id: http://svn.miranda-ng.org/main/trunk@10145 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_account.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'protocols/Tox/src/tox_account.cpp') diff --git a/protocols/Tox/src/tox_account.cpp b/protocols/Tox/src/tox_account.cpp index 9c59965bc7..c63328f6ac 100644 --- a/protocols/Tox/src/tox_account.cpp +++ b/protocols/Tox/src/tox_account.cpp @@ -45,9 +45,22 @@ void CToxProto::ConnectionThread(void*) { DoBootstrap(); + uint8_t name[TOX_MAX_NAME_LENGTH + 1]; + uint16_t namelen = tox_get_self_name(tox, name); + name[namelen] = 0; + if (tox_isconnected(tox)) { isConnected = true; + + char dataPath[MAX_PATH]; + mir_snprintf(dataPath, MAX_PATH, "%s\\%s.tox", VARS("%miranda_profile%\\%miranda_profilename%"), m_tszUserName); + + SaveToxData(dataPath); + + char idstring3[200] = { 0 }; + get_id(tox, idstring3); + break; } -- cgit v1.2.3