diff options
Diffstat (limited to 'protocols/ICQCorp/src/corp.cpp')
-rw-r--r-- | protocols/ICQCorp/src/corp.cpp | 60 |
1 files changed, 18 insertions, 42 deletions
diff --git a/protocols/ICQCorp/src/corp.cpp b/protocols/ICQCorp/src/corp.cpp index de702c3217..38355f466b 100644 --- a/protocols/ICQCorp/src/corp.cpp +++ b/protocols/ICQCorp/src/corp.cpp @@ -21,9 +21,10 @@ ///////////////////////////////////////////////////////////////////////////////
-HINSTANCE hInstance;
-char protoName[64];
int hLangpack;
+char protoName[64];
+HINSTANCE hInstance;
+HNETLIBUSER hNetlibUser;
PLUGININFOEX pluginInfo =
{
@@ -37,6 +38,11 @@ PLUGININFOEX pluginInfo = UNICODE_AWARE
};
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
+{
+ return &pluginInfo;
+}
+
//////////////////////////////////////////////////////////////////////////
// Interface information
@@ -70,55 +76,25 @@ BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD reason, LPVOID) ///////////////////////////////////////////////////////////////////////////////
-extern "C" __declspec(dllexport) int Unload()
-{
- UnloadServices();
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
extern "C" __declspec(dllexport) int Load()
{
mir_getLP(&pluginInfo);
+ CMStringA szDescr(FORMAT, "%s connection", protoName);
+ NETLIBUSER nlu = {};
+ nlu.flags = NUF_INCOMING | NUF_OUTGOING;
+ nlu.szSettingsModule = protoName;
+ nlu.szDescriptiveName.a = szDescr.GetBuffer();
+ hNetlibUser = Netlib_RegisterUser(&nlu);
+
LoadServices();
return 0;
}
///////////////////////////////////////////////////////////////////////////////
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
-{
- return &pluginInfo;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
-#ifdef _DEBUG
-void T(char *format, ...)
+extern "C" __declspec(dllexport) int Unload()
{
- char buffer[8196], bufferTime[64];
- va_list list;
- SYSTEMTIME t;
-
- va_start(list, format);
- vsprintf(buffer, format, list);
- va_end(list);
-
- GetLocalTime(&t);
- sprintf(bufferTime, "%.2d:%.2d:%.2d.%.3d ", t.wHour, t.wMinute, t.wSecond, t.wMilliseconds);
-
- static HANDLE hFile = INVALID_HANDLE_VALUE;
- if (hFile == INVALID_HANDLE_VALUE) {
- hFile = CreateFileW(L"ICQ Corp.log", GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_ALWAYS, 0, nullptr);
- SetFilePointer(hFile, 0, nullptr, FILE_END);
- }
-
- DWORD result;
- WriteFile(hFile, bufferTime, (DWORD)mir_strlen(bufferTime), &result, nullptr);
- WriteFile(hFile, buffer, (DWORD)mir_strlen(buffer), &result, nullptr);
+ UnloadServices();
+ return 0;
}
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
|