summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_accounts.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-10-06 19:23:04 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-10-06 19:23:04 +0000
commit8efc51aefbfcc6a41d9acabe9383a337500b0049 (patch)
tree8d86530327e674d551cf61580d1daaf2a07d9262 /protocols/Tox/src/tox_accounts.cpp
parentcea7fc1a7e6b72703914d7a92763bb4236976db6 (diff)
Tox: - password dialog for encrypted profile
git-svn-id: http://svn.miranda-ng.org/main/trunk@10713 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_accounts.cpp')
-rw-r--r--protocols/Tox/src/tox_accounts.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/protocols/Tox/src/tox_accounts.cpp b/protocols/Tox/src/tox_accounts.cpp
index 875996b9a8..09eb5932c2 100644
--- a/protocols/Tox/src/tox_accounts.cpp
+++ b/protocols/Tox/src/tox_accounts.cpp
@@ -20,16 +20,24 @@ CToxProto* CToxProto::InitAccount(const char* protoName, const wchar_t* userName
(LPARAM)userName);
}
- CToxProto *ppro = new CToxProto(protoName, userName);
- accounts.insert(ppro);
+ CToxProto *proto = new CToxProto(protoName, userName);
+ if (proto->InitToxCore())
+ {
+ accounts.insert(proto);
+ }
+ else
+ {
+ delete proto;
+ proto = NULL;
+ }
- return ppro;
+ return proto;
}
-int CToxProto::UninitAccount(CToxProto* ppro)
+int CToxProto::UninitAccount(CToxProto* proto)
{
- accounts.remove(ppro);
- delete ppro;
+ accounts.remove(proto);
+ delete proto;
return 0;
} \ No newline at end of file