summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_core.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-09-07 19:40:25 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-09-07 19:40:25 +0000
commited9fa764b873d1ae27ab98249a5d3bb31c253bdb (patch)
tree814b3f7b7fef7392bcb34039fd05da3a0f28c5b6 /protocols/Tox/src/tox_core.cpp
parent935c3102e47f424ff2d493d48eef95101dde82da (diff)
Tox:
- change error message when tox core initialization is failed - trying to fix error with keepstatus reconnect git-svn-id: http://svn.miranda-ng.org/main/trunk@15297 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_core.cpp')
-rw-r--r--protocols/Tox/src/tox_core.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/protocols/Tox/src/tox_core.cpp b/protocols/Tox/src/tox_core.cpp
index 242a2eafa9..c8d30cf2ce 100644
--- a/protocols/Tox/src/tox_core.cpp
+++ b/protocols/Tox/src/tox_core.cpp
@@ -31,7 +31,7 @@ bool CToxProto::InitToxCore()
if (nlus.proxyType == PROXYTYPE_SOCKS4 || nlus.proxyType == PROXYTYPE_SOCKS5)
{
- debugLogA("CToxProto::InitToxCore: setting socks user proxy config");
+ debugLogA(__FUNCTION__": setting socks user proxy config");
options->proxy_type = TOX_PROXY_TYPE_SOCKS5;
mir_strcpy((char*)&options->proxy_host[0], nlus.szProxyServer);
options->proxy_port = nlus.wProxyPort;
@@ -41,6 +41,16 @@ bool CToxProto::InitToxCore()
if (LoadToxProfile(options))
{
+ TOX_ERR_NEW initError;
+ tox = tox_new(options, &initError);
+ if (initError != TOX_ERR_NEW_OK)
+ {
+ debugLogA(__FUNCTION__": failed to initialize tox core (%d)", initError);
+ ShowNotification(ToxErrorToString(initError), TranslateT("Unable to initialize tox core"), MB_ICONERROR);
+ tox_options_free(options);
+ return false;
+ }
+
tox_callback_friend_request(tox, OnFriendRequest, this);
tox_callback_friend_message(tox, OnFriendMessage, this);
tox_callback_friend_read_receipt(tox, OnReadReceipt, this);