From e8f11470ac52bc89e955630d69ed8229a06acc79 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sun, 15 Feb 2015 15:17:05 +0000 Subject: Tox: - refactoring - nodes settings in db are ansi now - added work with tox network git-svn-id: http://svn.miranda-ng.org/main/trunk@12124 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_accounts.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'protocols/Tox/src/tox_accounts.cpp') diff --git a/protocols/Tox/src/tox_accounts.cpp b/protocols/Tox/src/tox_accounts.cpp index afcac8e4a6..edefe94051 100644 --- a/protocols/Tox/src/tox_accounts.cpp +++ b/protocols/Tox/src/tox_accounts.cpp @@ -29,5 +29,28 @@ int CToxProto::UninitAccount(CToxProto *proto) accounts.remove(proto); delete proto; + return 0; +} + +int CToxProto::OnAccountLoaded(WPARAM, LPARAM) +{ + HookProtoEvent(ME_OPT_INITIALISE, &CToxProto::OnOptionsInit); + HookProtoEvent(ME_USERINFO_INITIALISE, &CToxProto::OnUserInfoInit); + HookProtoEvent(ME_MSG_PRECREATEEVENT, &CToxProto::OnPreCreateMessage); + + return 0; +} + +int CToxProto::OnAccountRenamed(WPARAM, LPARAM lParam) +{ + PROTOACCOUNT *account = (PROTOACCOUNT*)lParam; + + std::tstring newPath = GetToxProfilePath(); + TCHAR oldPath[MAX_PATH]; + mir_sntprintf(oldPath, MAX_PATH, _T("%s\\%s.tox"), VARST(_T("%miranda_userdata%")), accountName); + _trename(oldPath, newPath.c_str()); + mir_free(accountName); + accountName = mir_tstrdup(m_tszUserName); + return 0; } \ No newline at end of file -- cgit v1.2.3