diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-02-15 15:17:05 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-02-15 15:17:05 +0000 |
commit | e8f11470ac52bc89e955630d69ed8229a06acc79 (patch) | |
tree | 1922fc5a543da79dc8db3ffab647bf885f01fa87 /protocols/Tox/src/tox_accounts.cpp | |
parent | fd3c3c5c71590bb18372f84e18a51b07671dfa55 (diff) |
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
Diffstat (limited to 'protocols/Tox/src/tox_accounts.cpp')
-rw-r--r-- | protocols/Tox/src/tox_accounts.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
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 @@ -30,4 +30,27 @@ int CToxProto::UninitAccount(CToxProto *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 |