summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_core.cpp
diff options
context:
space:
mode:
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);