summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_netlib.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Tox/src/tox_netlib.cpp')
-rw-r--r--protocols/Tox/src/tox_netlib.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_netlib.cpp b/protocols/Tox/src/tox_netlib.cpp
new file mode 100644
index 0000000000..a2fea7a615
--- /dev/null
+++ b/protocols/Tox/src/tox_netlib.cpp
@@ -0,0 +1,22 @@
+#include "common.h"
+
+void CToxProto::InitNetlib()
+{
+ wchar_t name[128];
+ mir_sntprintf(name, SIZEOF(name), TranslateT("%s connection"), m_tszUserName);
+
+ NETLIBUSER nlu = {0};
+ nlu.cbSize = sizeof(nlu);
+ nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE;
+ nlu.ptszDescriptiveName = name;
+ nlu.szSettingsModule = m_szModuleName;
+ hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+
+ debugLogA("Setting protocol/module name to '%s'", m_szModuleName);
+}
+
+void CToxProto::UninitNetlib()
+{
+ Netlib_CloseHandle(hNetlibUser);
+ hNetlibUser = NULL;
+}