summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-09-11 19:28:53 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-09-11 19:28:53 +0000
commit274cffbbffa950ddf286092b52f03f76ec61a301 (patch)
tree5aeb062d27c79d1fbc15eaf033da943630bcbf84
parent482be69d327aef60a9a654b8cc6a5e6646d095de (diff)
slightly refactored MRA
git-svn-id: http://svn.miranda-ng.org/main/trunk@1564 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/MRA/Mra.cpp394
-rw-r--r--protocols/MRA/Mra.h334
-rw-r--r--protocols/MRA/Mra.vcxproj22
-rw-r--r--protocols/MRA/Mra.vcxproj.filters66
-rw-r--r--protocols/MRA/MraAdvancedSearch.cpp390
-rw-r--r--protocols/MRA/MraAntiSpam.cpp668
-rw-r--r--protocols/MRA/MraAntiSpam.h12
-rw-r--r--protocols/MRA/MraAvatars.cpp856
-rw-r--r--protocols/MRA/MraAvatars.h19
-rw-r--r--protocols/MRA/MraChat.cpp354
-rw-r--r--protocols/MRA/MraChat.h21
-rw-r--r--protocols/MRA/MraConstans.h847
-rw-r--r--protocols/MRA/MraFilesQueue.cpp1505
-rw-r--r--protocols/MRA/MraFilesQueue.h17
-rw-r--r--protocols/MRA/MraIcons.cpp156
-rw-r--r--protocols/MRA/MraIcons.h9
-rw-r--r--protocols/MRA/MraMPop.cpp308
-rw-r--r--protocols/MRA/MraMPop.h15
-rw-r--r--protocols/MRA/MraMRIMProxy.cpp302
-rw-r--r--protocols/MRA/MraMRIMProxy.h14
-rw-r--r--protocols/MRA/MraOfflineMsg.cpp378
-rw-r--r--protocols/MRA/MraOfflineMsg.h2
-rw-r--r--protocols/MRA/MraPlaces.h11758
-rw-r--r--protocols/MRA/MraPopUp.cpp261
-rw-r--r--protocols/MRA/MraPopUp.h12
-rw-r--r--protocols/MRA/MraProto.cpp814
-rw-r--r--protocols/MRA/MraProto.h396
-rw-r--r--protocols/MRA/MraRTFMsg.cpp482
-rw-r--r--protocols/MRA/MraRTFMsg.h10
-rw-r--r--protocols/MRA/MraSelectEMail.cpp253
-rw-r--r--protocols/MRA/MraSelectEMail.h6
-rw-r--r--protocols/MRA/MraSendCommand.cpp1267
-rw-r--r--protocols/MRA/MraSendCommand.h26
-rw-r--r--protocols/MRA/MraSendQueue.cpp144
-rw-r--r--protocols/MRA/MraSendQueue.h10
-rw-r--r--protocols/MRA/Mra_functions.cpp2759
-rw-r--r--protocols/MRA/Mra_options.cpp345
-rw-r--r--protocols/MRA/Mra_proto.cpp3360
-rw-r--r--protocols/MRA/Mra_svcs.cpp2783
-rw-r--r--protocols/MRA/Readme_MRA.txt14
-rw-r--r--protocols/MRA/Sdk/Base64.h22
-rw-r--r--protocols/MRA/Sdk/BuffToLowerCase.h4
-rw-r--r--protocols/MRA/Sdk/FIFOMT.h6
-rw-r--r--protocols/MRA/Sdk/InternetTime.h34
-rw-r--r--protocols/MRA/Sdk/ListMT.h10
-rw-r--r--protocols/MRA/Sdk/RC4.h4
-rw-r--r--protocols/MRA/Sdk/SHA1.h34
-rw-r--r--protocols/MRA/Sdk/SocketFunctions.h10
-rw-r--r--protocols/MRA/Sdk/StrHexToNum.h36
-rw-r--r--protocols/MRA/Sdk/StrToNum.h36
-rw-r--r--protocols/MRA/proto.h267
-rw-r--r--protocols/MRA/proto_mra/Proto_MRA.vcxproj8
-rw-r--r--protocols/MRA/resource.rc387
-rw-r--r--protocols/MRA/version.h6
-rw-r--r--protocols/MRA/version.rc57
-rw-r--r--protocols/MRA/xstatus_MRA/xstatus_MRA.vcxproj8
56 files changed, 15032 insertions, 17286 deletions
diff --git a/protocols/MRA/Mra.cpp b/protocols/MRA/Mra.cpp
index 0fefddf18e..92a361ce61 100644
--- a/protocols/MRA/Mra.cpp
+++ b/protocols/MRA/Mra.cpp
@@ -1,379 +1,171 @@
#include "Mra.h"
-
MRA_SETTINGS masMraSettings;
int hLangpack;
-PLUGININFOEX pluginInfoEx={
- sizeof(PLUGININFOEX),
- PROTOCOL_DISPLAY_NAME_ORIGA,
- PLUGIN_VERSION_DWORD,
- "Provides support for Mail.ru agent Instant Messenger protocol.",
- "Rozhuk Ivan",
- "Rozhuk_I@mail.ru",
- "© 2006-2011 Rozhuk Ivan",
- "http://miranda-ng.org/",
- UNICODE_AWARE,
+PLUGININFOEX pluginInfoEx = {
+ sizeof(PLUGININFOEX),
+ PROTOCOL_DISPLAY_NAME_ORIGA,
+ __VERSION_DWORD,
+ "Provides support for Mail.ru agent Instant Messenger protocol.",
+ "Rozhuk Ivan",
+ "Rozhuk_I@mail.ru",
+ "© 2006-2011 Rozhuk Ivan",
+ "http://miranda-ng.org/",
+ UNICODE_AWARE,
// {E7C48BAB-8ACE-4CB3-8446-D4B73481F497}
{ 0xe7c48bab, 0x8ace, 0x4cb3, { 0x84, 0x46, 0xd4, 0xb7, 0x34, 0x81, 0xf4, 0x97 } }
};
-int OnModulesLoaded (WPARAM wParam,LPARAM lParam);
-int OnPreShutdown (WPARAM wParam,LPARAM lParam);
-void VersionConversions ();
-
+int OnModulesLoaded (WPARAM wParam, LPARAM lParam);
+int OnPreShutdown (WPARAM wParam, LPARAM lParam);
-BOOL WINAPI DllMain(HINSTANCE hInstance,DWORD dwReason,LPVOID Reserved)
+BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID Reserved)
{
- switch(dwReason){
+ switch (dwReason) {
case DLL_PROCESS_ATTACH:
- bzero(&masMraSettings,sizeof(masMraSettings));
- masMraSettings.hInstance=hInstance;
- masMraSettings.hHeap=HeapCreate(0,0,0);//GetProcessHeap();
- masMraSettings.bLoggedIn=FALSE;
- masMraSettings.dwStatusMode=ID_STATUS_OFFLINE;
- masMraSettings.dwDesiredStatusMode=ID_STATUS_OFFLINE;
- DisableThreadLibraryCalls((HMODULE)hInstance);
+ bzero(&masMraSettings, sizeof(masMraSettings));
+ masMraSettings.hInstance = hInstance;
+ masMraSettings.hHeap = HeapCreate(0, 0, 0);//GetProcessHeap();
+ DisableThreadLibraryCalls(hInstance);
break;
+
case DLL_PROCESS_DETACH:
HeapDestroy(masMraSettings.hHeap);
- masMraSettings.hHeap=NULL;
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- break;
+ masMraSettings.hHeap = NULL;
}
- return(TRUE);
+ return TRUE;
}
-extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL,MIID_LAST};
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST};
extern "C" MRA_API PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
- return(&pluginInfoEx);
+ return &pluginInfoEx;
}
-extern "C" MRA_API int Load(void)
+///////////////////////////////////////////////////////////////////////////////
+// Protocol instances
+
+static int sttCompareProtocols(const CMraProto *p1, const CMraProto *p2)
{
- SIZE_T dwBuffLen;
- WCHAR szBuff[MAX_FILEPATH];
- LPSTR lpszFullFileName=(LPSTR)szBuff;
- LPWSTR lpwszFileName;
- PROTOCOLDESCRIPTOR pd={0};
+ return lstrcmp(p1->m_tszUserName, p2->m_tszUserName);
+}
+LIST<CMraProto> g_Instances(1, sttCompareProtocols);
- mir_getLP(&pluginInfoEx);
+///////////////////////////////////////////////////////////////////////////////
+static CMraProto* mraProtoInit(const char* pszProtoName, const TCHAR* tszUserName)
+{
+ CMraProto *ppro = new CMraProto( pszProtoName, tszUserName );
+ g_Instances.insert(ppro);
+ return ppro;
+}
- // Get module name from DLL file name
- if (GetModuleFileName(masMraSettings.hInstance,szBuff,MAX_FILEPATH))
- {
- WCHAR sztmBuff[MAX_FILEPATH];
- if ((dwBuffLen=GetFullPathName(szBuff,MAX_FILEPATH,sztmBuff,&lpwszFileName)))
- {
- dwBuffLen=(lstrlenW(lpwszFileName)-4);
- //lpwszFileName=L"MRA.dll";
- //dwBuffLen=3;
- masMraSettings.dwModuleNameLen=(dwBuffLen<MAXMODULELABELLENGTH)? dwBuffLen:(MAXMODULELABELLENGTH-1);
- memmove(masMraSettings.wszModuleName,lpwszFileName,(masMraSettings.dwModuleNameLen*sizeof(WCHAR)));
- CharUpperBuff(masMraSettings.wszModuleName,masMraSettings.dwModuleNameLen);
- masMraSettings.wszModuleName[masMraSettings.dwModuleNameLen]=0;
- WideCharToMultiByte(MRA_CODE_PAGE,0,masMraSettings.wszModuleName,(masMraSettings.dwModuleNameLen+1),masMraSettings.szModuleName,MAXMODULELABELLENGTH,NULL,NULL);
-
- if (DB_Mra_GetByte(NULL,"UseDisplayModuleName",TRUE))
- {
- masMraSettings.dwDisplayModuleNameLen=mir_sntprintf(masMraSettings.wszDisplayModuleName,SIZEOF(masMraSettings.wszDisplayModuleName),L"%s: %S",PROTOCOL_NAMEW,PROTOCOL_DISPLAY_NAME_ORIGA);
- }else{
- memmove(masMraSettings.wszDisplayModuleName,masMraSettings.wszModuleName,(masMraSettings.dwModuleNameLen*sizeof(WCHAR)));
- masMraSettings.dwDisplayModuleNameLen=masMraSettings.dwModuleNameLen;
- masMraSettings.szDisplayModuleName[masMraSettings.dwDisplayModuleNameLen]=0;
- }
- WideCharToMultiByte(MRA_CODE_PAGE,0,masMraSettings.wszDisplayModuleName,(masMraSettings.dwDisplayModuleNameLen+1),masMraSettings.szDisplayModuleName,MAX_PATH,NULL,NULL);
- }
- }
+static int mraProtoUninit(CMraProto *ppro)
+{
+ g_Instances.remove(ppro);
+ delete ppro;
+ return 0;
+}
- // load libs
- if (GetModuleFileName(NULL,szBuff,MAX_FILEPATH))
- {//
- DWORD dwErrorCode;
+extern "C" MRA_API int Load(void)
+{
+ mir_getLP(&pluginInfoEx);
+
+ size_t dwBuffLen;
+ WCHAR szBuff[MAX_FILEPATH];
+ LPSTR lpszFullFileName = (LPSTR)szBuff;
+ LPWSTR lpwszFileName;
- masMraSettings.dwMirWorkDirPathLen=GetFullPathName(szBuff,MAX_FILEPATH,masMraSettings.szMirWorkDirPath,&lpwszFileName);
- if (masMraSettings.dwMirWorkDirPathLen)
- {
- masMraSettings.dwMirWorkDirPathLen-=lstrlenW(lpwszFileName);
- masMraSettings.szMirWorkDirPath[masMraSettings.dwMirWorkDirPathLen]=0;
+ // load libs
+ if (GetModuleFileName(NULL, szBuff, MAX_FILEPATH)) {
+ masMraSettings.dwMirWorkDirPathLen = GetFullPathName(szBuff, MAX_FILEPATH, masMraSettings.szMirWorkDirPath, &lpwszFileName);
+ if (masMraSettings.dwMirWorkDirPathLen) {
+ masMraSettings.dwMirWorkDirPathLen -= lstrlenW(lpwszFileName);
+ masMraSettings.szMirWorkDirPath[masMraSettings.dwMirWorkDirPathLen] = 0;
// load xstatus icons lib
- dwErrorCode=FindFile(masMraSettings.szMirWorkDirPath,masMraSettings.dwMirWorkDirPathLen,L"xstatus_MRA.dll",-1,szBuff,SIZEOF(szBuff),(DWORD*)&dwBuffLen);
- if (dwErrorCode==NO_ERROR)
- {
- masMraSettings.hDLLXStatusIcons=LoadLibraryEx(szBuff,NULL,/*LOAD_LIBRARY_AS_DATAFILE*/0);
- if (masMraSettings.hDLLXStatusIcons)
- {
- if ((dwBuffLen=LoadStringW(masMraSettings.hDLLXStatusIcons,IDS_IDENTIFY,szBuff,MAX_FILEPATH))==0 || CompareStringW(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,L"# Custom Status Icons #",23,szBuff,dwBuffLen)!=CSTR_EQUAL)
- {
+ DWORD dwErrorCode = FindFile(masMraSettings.szMirWorkDirPath, masMraSettings.dwMirWorkDirPathLen, L"xstatus_MRA.dll", -1, szBuff, SIZEOF(szBuff), (DWORD*)&dwBuffLen);
+ if (dwErrorCode == NO_ERROR) {
+ masMraSettings.hDLLXStatusIcons = LoadLibraryEx(szBuff, NULL, 0);
+ if (masMraSettings.hDLLXStatusIcons) {
+ if ((dwBuffLen = LoadStringW(masMraSettings.hDLLXStatusIcons, IDS_IDENTIFY, szBuff, MAX_FILEPATH)) == 0 || CompareStringW( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, L"# Custom Status Icons #", 23, szBuff, dwBuffLen) != CSTR_EQUAL) {
FreeLibrary(masMraSettings.hDLLXStatusIcons);
- masMraSettings.hDLLXStatusIcons=NULL;
+ masMraSettings.hDLLXStatusIcons = NULL;
}
}
}
// load zlib
- dwErrorCode=FindFile(masMraSettings.szMirWorkDirPath,masMraSettings.dwMirWorkDirPathLen,L"zlib.dll",-1,szBuff,SIZEOF(szBuff),(DWORD*)&dwBuffLen);
- if (dwErrorCode!=NO_ERROR) dwErrorCode=FindFile(masMraSettings.szMirWorkDirPath,masMraSettings.dwMirWorkDirPathLen,L"zlib1.dll",-1,szBuff,SIZEOF(szBuff),(DWORD*)&dwBuffLen);
- if (dwErrorCode==NO_ERROR)
- {// load xstatus icons lib
- masMraSettings.hDLLZLib=LoadLibraryEx(szBuff,NULL,0);
- if (masMraSettings.hDLLZLib)
- {
- masMraSettings.lpfnCompress2=(HANDLE)GetProcAddress(masMraSettings.hDLLZLib,"compress2");
- masMraSettings.lpfnUncompress=(HANDLE)GetProcAddress(masMraSettings.hDLLZLib,"uncompress");
+ dwErrorCode = FindFile(masMraSettings.szMirWorkDirPath, masMraSettings.dwMirWorkDirPathLen, L"zlib.dll", -1, szBuff, SIZEOF(szBuff), (DWORD*)&dwBuffLen);
+ if (dwErrorCode == NO_ERROR) {
+ masMraSettings.hDLLZLib = LoadLibraryEx(szBuff, NULL, 0);
+ if (masMraSettings.hDLLZLib) {
+ masMraSettings.lpfnCompress2 = (HANDLE)GetProcAddress(masMraSettings.hDLLZLib, "compress2");
+ masMraSettings.lpfnUncompress = (HANDLE)GetProcAddress(masMraSettings.hDLLZLib, "uncompress");
}
}
}
}
- InitializeCriticalSectionAndSpinCount(&masMraSettings.csCriticalSectionSend,0);
- MraSendQueueInitialize(0,&masMraSettings.hSendQueueHandle);
- MraFilesQueueInitialize(0,&masMraSettings.hFilesQueueHandle);
- MraMPopSessionQueueInitialize(&masMraSettings.hMPopSessionQueue);
-
- FifoMTInitialize(&masMraSettings.ffmtAPCQueue,0);
- masMraSettings.hWaitEventThreadAPCHandle=CreateEvent(NULL,FALSE,FALSE,NULL);
- InterlockedExchange((volatile LONG*)&masMraSettings.dwAPCThreadRunning,TRUE);
- masMraSettings.hThreadAPC=(HANDLE)mir_forkthread((pThreadFunc)MraUserAPCThreadProc,NULL);
- if (masMraSettings.hThreadAPC==NULL)
- {
- MraAPCQueueDestroy(&masMraSettings.ffmtAPCQueue);
- CloseHandle(masMraSettings.hWaitEventThreadAPCHandle);
- masMraSettings.hWaitEventThreadAPCHandle=NULL;
- DuplicateHandle(GetCurrentProcess(),GetCurrentThread(),GetCurrentProcess(),&masMraSettings.hThreadAPC,THREAD_SET_CONTEXT,FALSE,0);
- DebugPrintCRLFW(L"Fail on create event APC thread, using miranda main thread");
- MessageBoxW(NULL,L"Fail on create event APC thread, using miranda main thread",PROTOCOL_DISPLAY_NAMEW,(MB_OK|MB_ICONINFORMATION));
- }//*/
-
- masMraSettings.hHookModulesLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,OnModulesLoaded);
- masMraSettings.hHookPreShutdown=HookEvent(ME_SYSTEM_PRESHUTDOWN,OnPreShutdown);
-
- LoadServices();
-
- //pd.cbSize=sizeof(pd);
- pd.cbSize=PROTOCOLDESCRIPTOR_V3_SIZE;
- pd.szName=PROTOCOL_NAMEA;
- pd.type=PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE,0,(LPARAM)&pd);
+ HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
+
+ PROTOCOLDESCRIPTOR pd = {0};
+ pd.cbSize = sizeof(pd);
+ pd.szName = "MRA";
+ pd.type = PROTOTYPE_PROTOCOL;
+ pd.fnInit = (pfnInitProto)mraProtoInit;
+ pd.fnUninit = (pfnUninitProto)mraProtoUninit;
+ CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
DebugPrintCRLFW(L"Load - DONE");
-return(0);
+ return 0;
}
-
extern "C" MRA_API int Unload(void)
{
- UnloadServices();
- //if (hHookOnUserInfoInit) UnhookEvent(hHookOnUserInfoInit);
- if (masMraSettings.hHookPreShutdown) {UnhookEvent(masMraSettings.hHookPreShutdown); masMraSettings.hHookPreShutdown=NULL;}
- if (masMraSettings.hHookModulesLoaded) {UnhookEvent(masMraSettings.hHookModulesLoaded); masMraSettings.hHookModulesLoaded=NULL;}
-
- Netlib_CloseHandle(masMraSettings.hNetlibUser);
- masMraSettings.hNetlibUser=NULL;
-
- MraMPopSessionQueueDestroy(masMraSettings.hMPopSessionQueue);
- masMraSettings.hMPopSessionQueue=NULL;
-
- MraFilesQueueDestroy(masMraSettings.hFilesQueueHandle);
- masMraSettings.hFilesQueueHandle=NULL;
-
- MraSendQueueDestroy(masMraSettings.hSendQueueHandle);
- masMraSettings.hSendQueueHandle=NULL;
-
- DeleteCriticalSection(&masMraSettings.csCriticalSectionSend);
- SecureZeroMemory(&masMraSettings.csCriticalSectionSend,sizeof(CRITICAL_SECTION));
-
- if (masMraSettings.hDLLXStatusIcons)
- {
+ if (masMraSettings.hDLLXStatusIcons) {
FreeLibrary(masMraSettings.hDLLXStatusIcons);
- masMraSettings.hDLLXStatusIcons=NULL;
+ masMraSettings.hDLLXStatusIcons = NULL;
}
- if (masMraSettings.hDLLZLib)
- {
+ if (masMraSettings.hDLLZLib) {
FreeLibrary(masMraSettings.hDLLZLib);
- masMraSettings.hDLLZLib=NULL;
- masMraSettings.lpfnCompress2=NULL;
- masMraSettings.lpfnUncompress=NULL;
+ masMraSettings.hDLLZLib = NULL;
+ masMraSettings.lpfnCompress2 = NULL;
+ masMraSettings.lpfnUncompress = NULL;
}
DebugPrintCRLFW(L"Unload - DONE");
- return(0);
+ return 0;
}
-static int OnModulesLoaded(WPARAM wParam,LPARAM lParam)
+static int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- WCHAR szBuffer[MAX_PATH];
- NETLIBUSER nlu={0};
-
- mir_sntprintf(szBuffer,SIZEOF(szBuffer),L"%s %s",PROTOCOL_NAMEW,TranslateW(L"plugin connections"));
- nlu.cbSize=sizeof(nlu);
- nlu.flags=(NUF_INCOMING|NUF_OUTGOING|NUF_HTTPCONNS|NUF_UNICODE);
- nlu.szSettingsModule=PROTOCOL_NAMEA;
- nlu.ptszDescriptiveName=szBuffer;
- masMraSettings.hNetlibUser=(HANDLE)CallService(MS_NETLIB_REGISTERUSER,0,(LPARAM)&nlu);
-
-#ifdef _DEBUG
- // всех в offline // тк unsaved values сохраняются их нужно инициализировать
- for(HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
- {// функция сама проверяет принадлежность контакта к MRA
- SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,(SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS),-1,-1,0,0,ID_STATUS_OFFLINE,NULL,0,NULL,0,NULL,0);
- }
-#else
- // unsaved values
- DB_Mra_CreateResidentSetting("Status");// NOTE: XStatus cannot be temporary
- DB_Mra_CreateResidentSetting("LogonTS");
- DB_Mra_CreateResidentSetting("ContactID");
- DB_Mra_CreateResidentSetting("GroupID");
- DB_Mra_CreateResidentSetting("ContactFlags");
- DB_Mra_CreateResidentSetting("ContactSeverFlags");
- DB_Mra_CreateResidentSetting("HooksLocked");
- DB_Mra_CreateResidentSetting(DBSETTING_CAPABILITIES);
- DB_Mra_CreateResidentSetting(DBSETTING_XSTATUSNAME);
- DB_Mra_CreateResidentSetting(DBSETTING_XSTATUSMSG);
- DB_Mra_CreateResidentSetting(DBSETTING_BLOGSTATUSTIME);
- DB_Mra_CreateResidentSetting(DBSETTING_BLOGSTATUSID);
- DB_Mra_CreateResidentSetting(DBSETTING_BLOGSTATUS);
- DB_Mra_CreateResidentSetting(DBSETTING_BLOGSTATUSMUSIC);
-
- // всех в offline // тк unsaved values сохраняются их нужно инициализировать
- for(HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
- {// функция сама проверяет принадлежность контакта к MRA
- SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,(SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS),-1,-1,0,0,ID_STATUS_OFFLINE,NULL,0,NULL,0,NULL,0);
- }
-#endif
-
- MraAvatarsQueueInitialize(&masMraSettings.hAvatarsQueueHandle);
-
- VersionConversions();
-
MraAntiSpamLoadBadWordsW();
LoadModules();
-
- InterlockedExchange((volatile LONG*)&masMraSettings.dwGlobalPluginRunning,TRUE);
+ InterlockedExchange((volatile LONG*)&masMraSettings.dwGlobalPluginRunning, TRUE);
DebugPrintCRLFW(L"OnModulesLoaded - DONE");
-return(0);
+ return 0;
}
-
-int OnPreShutdown(WPARAM wParam,LPARAM lParam)
+int OnPreShutdown(WPARAM wParam, LPARAM lParam)
{
- InterlockedExchange((volatile LONG*)&masMraSettings.dwGlobalPluginRunning,FALSE);
-
- MraSetStatus(ID_STATUS_OFFLINE,0);
-
- MraAvatarsQueueDestroy(masMraSettings.hAvatarsQueueHandle);
- masMraSettings.hAvatarsQueueHandle=NULL;
-
- if (masMraSettings.hThreadWorker)
- {
- if (IsThreadAlive(masMraSettings.hThreadWorker)) WaitForSingleObjectEx(masMraSettings.hThreadWorker,(WAIT_FOR_THREAD_TIMEOUT*1000),FALSE);
- masMraSettings.hThreadWorker=NULL;
- }
-
- InterlockedExchange((volatile LONG*)&masMraSettings.dwAPCThreadRunning,FALSE);
- if (masMraSettings.hWaitEventThreadAPCHandle)
- if (IsThreadAlive(masMraSettings.hThreadAPC))
- {
- SetEvent(masMraSettings.hWaitEventThreadAPCHandle);
- }else{
- CloseHandle(masMraSettings.hWaitEventThreadAPCHandle);
- //WaitForSingleObjectEx(masMraSettings.hThreadAPC,(WAIT_FOR_THREAD_TIMEOUT*1000),FALSE); // no wait - dead lock.
- masMraSettings.hWaitEventThreadAPCHandle=NULL;
- masMraSettings.hThreadAPC=NULL;
- }
+ InterlockedExchange((volatile LONG*)&masMraSettings.dwGlobalPluginRunning, FALSE);
UnloadModules();
MraAntiSpamFreeBadWords();
DebugPrintCRLFW(L"OnPreShutdown - DONE");
-return(0);
-}
-
-
-
-void VersionConversions()
-{
- /*switch(DB_Mra_GetDword(NULL,"LastPluginVersion",PLUGIN_MAKE_VERSION(0,0,0,0))) {
- default:
- case PLUGIN_MAKE_VERSION(1,14,0,0):
- case PLUGIN_MAKE_VERSION(1,14,0,1):
- case PLUGIN_MAKE_VERSION(1,14,0,2):
- DB_Mra_DeleteValue(NULL,"MirVer");
- DB_Mra_DeleteValue(NULL,"MessagesCountSend");
- DB_Mra_DeleteValue(NULL,"MRAClient");
- DB_Mra_DeleteValue(NULL,"MRAClientVer");
- DB_Mra_DeleteValue(NULL,"MRAClientCapabilities");
- DB_Mra_DeleteValue(NULL,"Status");
- DB_Mra_DeleteValue(NULL,"ContactID");
- DB_Mra_DeleteValue(NULL,"GroupID");
- DB_Mra_DeleteValue(NULL,"ContactSeverFlags");
- DB_Mra_DeleteValue(NULL,"HooksLocked");
- for(HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
- {
- DB_Mra_DeleteValue(hContact,"MessagesCountSend");
- DB_Mra_DeleteValue(hContact,"MRAClient");
- DB_Mra_DeleteValue(hContact,"MRAClientVer");
- DB_Mra_DeleteValue(hContact,"MRAClientCapabilities");
- DB_Mra_DeleteValue(hContact,"Status");
- DB_Mra_DeleteValue(hContact,"ContactID");
- DB_Mra_DeleteValue(hContact,"GroupID");
- DB_Mra_DeleteValue(hContact,"ContactSeverFlags");
- DB_Mra_DeleteValue(hContact,"HooksLocked");
- }
- case PLUGIN_MAKE_VERSION(1,14,0,3):
- case PLUGIN_MAKE_VERSION(1,14,0,4):
- case PLUGIN_MAKE_VERSION(1,14,0,5):
- case PLUGIN_MAKE_VERSION(1,14,0,6):
- case PLUGIN_MAKE_VERSION(1,14,0,7):
- //case PLUGIN_MAKE_VERSION(1,14,1,0):
- DB_Mra_SetByte(NULL,DBSETTING_XSTATUSID,(BYTE)DB_Mra_GetDword(NULL,DBSETTING_XSTATUSID,MRA_MIR_XSTATUS_NONE));
- for(HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
- {
- if (IsContactMra(hContact)) DB_Mra_SetByte(hContact,DBSETTING_XSTATUSID,(BYTE)DB_Mra_GetDword(hContact,DBSETTING_XSTATUSID,MRA_MIR_XSTATUS_NONE));
- }
- case PLUGIN_MAKE_VERSION(1,16,0,2):
- DB_Mra_DeleteValue(NULL,"CvtSmilesToTags");
- case PLUGIN_MAKE_VERSION(1,16,0,3):
- for(HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
- {
- if (IsContactMra(hContact)==FALSE) DB_Mra_DeleteValue(hContact,DBSETTING_XSTATUSID);
- }
- case PLUGIN_MAKE_VERSION(0,0,0,0):// no previos version
- MraAntiSpamResetBadWordsList();
- case PLUGIN_VERSION_DWORD:// current version
- break;
- }*/
-
- DB_Mra_SetDword(NULL,"LastPluginVersion",PLUGIN_VERSION_DWORD);
-
-
-
- {// pass conv
- char szPass[MAX_PATH];
- SIZE_T dwPassSize;
-
- if(DB_Mra_GetStaticStringA(NULL,"Password",(LPSTR)szPass,SIZEOF(szPass),&dwPassSize))
- {//bit of a security hole here, since it's easy to extract a password from an edit box
- CallService(MS_DB_CRYPT_DECODESTRING,(dwPassSize+1),(LPARAM)szPass);
-
- SetPassDB(szPass,dwPassSize);
-
- SecureZeroMemory(szPass,sizeof(szPass));
- DB_Mra_DeleteValue(NULL,"Password");
- }
- }
+ return 0;
}
diff --git a/protocols/MRA/Mra.h b/protocols/MRA/Mra.h
index f3998f06da..0d4857d2d3 100644
--- a/protocols/MRA/Mra.h
+++ b/protocols/MRA/Mra.h
@@ -17,7 +17,7 @@
#include <Wincrypt.h>
#include <Ntsecapi.h>
#include <Commdlg.h>
-//#include <strsafe.h>
+#include <malloc.h>
#include <stdio.h>
#include <time.h>
#include <DebugFunctions.h>
@@ -25,21 +25,22 @@
#include <uxtheme.h>
#include <SocketFunctions.h>
-#define bzero(pvDst,count) memset(pvDst,0,count)
+#define bzero(pvDst, count) memset(pvDst, 0, count)
#include <timefuncs.h>
#include "../../plugins/zlib/zlib.h"
-//int ZEXPORT uncompress(unsigned char*dest,uLongf *destLen,const Bytef *source,uLong sourceLen);
-typedef int (*PUNCOMPRESS)(unsigned char*,DWORD*,unsigned char*,DWORD);
-//int ZEXPORT compress2(Bytef *dest,uLongf *destLen,const Bytef *source,uLong sourceLen,int level);
-typedef int (*PCOMPRESS2)(unsigned char*,DWORD*,unsigned char*,DWORD,int);
+//int ZEXPORT uncompress(unsigned char*dest, uLongf *destLen, const Bytef *source, uLong sourceLen);
+typedef int (*PUNCOMPRESS)(unsigned char*, DWORD*, unsigned char*, DWORD);
+//int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen, int level);
+typedef int (*PCOMPRESS2)(unsigned char*, DWORD*, unsigned char*, DWORD, int);
#define MIRANDA_VER 0x0A00
-// http://miranda.svn.sourceforge.net/viewvc/miranda/trunk/miranda/include/?sortby=file
+// http://miranda.svn.sourceforge.net/viewvc/miranda/trunk/miranda/include/?sortby = file
#include <newpluginapi.h>
#include <m_system.h>
+#include <m_system_cpp.h>
#include <m_protocols.h>
#include <m_clc.h>
#include <m_clist.h>
@@ -51,6 +52,7 @@ typedef int (*PCOMPRESS2)(unsigned char*,DWORD*,unsigned char*,DWORD,int);
#include <m_options.h>
#include <m_protomod.h>
#include <m_protosvc.h>
+#include <m_protoint.h>
#include <m_skin.h>
#include <m_userinfo.h>
#include <m_utils.h>
@@ -67,6 +69,7 @@ typedef int (*PCOMPRESS2)(unsigned char*,DWORD*,unsigned char*,DWORD,int);
#include <m_chat.h>
#include <m_extraicons.h>
#include <m_music.h>
+#include <m_icq.h>
#include <m_proto_listeningto.h>
@@ -89,7 +92,7 @@ typedef int (*PCOMPRESS2)(unsigned char*,DWORD*,unsigned char*,DWORD,int);
// LPS
typedef struct
{
- SIZE_T dwSize;
+ size_t dwSize;
union {
LPSTR lpszData;
@@ -118,29 +121,34 @@ struct MRA_ADDR_LIST
MRA_ADDR_LIST_ITEM *pmaliAddress;
};
+#include "MraConstans.h"
+#include "MraProto.h"
// структура содержащая информацию по построению меню или расширеных иконок
struct GUI_DISPLAY_ITEM
{
- LPSTR lpszName; // имя сервиса, оно же имя в иколибе
- LPWSTR lpwszDescr; // текстовое описание отображаемое юзеру
- LONG defIcon; // иконка из ресурсов
- MIRANDASERVICE lpFunc; // функция вызываемая меню
+ LPSTR lpszName; // имя сервиса, оно же имя в иколибе
+ LPWSTR lpwszDescr; // текстовое описание отображаемое юзеру
+ LONG defIcon; // иконка из ресурсов
+ ServiceFunc lpFunc; // функция вызываемая меню
};
-
// структура содержащая информацию о сервисах/функциях
struct SERVICE_ITEM
{
LPSTR lpszName; // имя сервиса, оно же имя в иколибе
- MIRANDASERVICE lpFunc; // функция вызываемая
+ ServiceFunc lpFunc; // функция вызываемая
};
+extern const GUI_DISPLAY_ITEM gdiMenuItems[];
+extern const GUI_DISPLAY_ITEM gdiContactMenuItems[];
+extern const GUI_DISPLAY_ITEM gdiExtraStatusIconsItems[];
-
+extern const int gdiMenuItemsCount;
+extern const int gdiContactMenuItemsCount;
+extern const int gdiExtraStatusIconsItemsCount;
#include "proto.h"
-#include "MraConstans.h"
#include "MraSendCommand.h"
#include "MraMRIMProxy.h"
#include "MraSendQueue.h"
@@ -154,26 +162,17 @@ struct SERVICE_ITEM
#include "MraChat.h"
-
#ifdef MRA_EXPORTS
#define MRA_API __declspec(dllexport)
#else
#define MRA_API
// __declspec(dllimport)
- #pragma comment(lib,"MRALib.lib")
+ #pragma comment(lib, "MRALib.lib")
#endif
-
-
-
-
/////////////////////////////////////////////////////////////////////////////////////////
// plugin options
-
-#define MAIN_MENU_ITEMS_COUNT 15
-#define CONTACT_MENU_ITEMS_COUNT 10
-
typedef struct
{
HANDLE hHeap;
@@ -182,73 +181,11 @@ typedef struct
HANDLE lpfnCompress2;
HANDLE lpfnUncompress;
HMODULE hDLLXStatusIcons;
- char szModuleName[MAXMODULELABELLENGTH];
- WCHAR wszModuleName[MAXMODULELABELLENGTH];
- SIZE_T dwModuleNameLen;
- char szDisplayModuleName[MAX_PATH];
- WCHAR wszDisplayModuleName[MAX_PATH];
- SIZE_T dwDisplayModuleNameLen;
DWORD dwGlobalPluginRunning;
- BOOL bLoggedIn;
BOOL bChatExist;
- DWORD dwStatusMode;
- DWORD dwXStatusMode;
- DWORD dwDesiredStatusMode;
-
- HWND hWndEMailPopupStatus;
- DWORD dwEmailMessagesTotal;
- DWORD dwEmailMessagesUnRead;
-
- BOOL bHideXStatusUI;
- HANDLE hXStatusMenuItems[MRA_XSTATUS_COUNT+4];
- HANDLE hXStatusAdvancedStatusIcons[MRA_XSTATUS_COUNT+4];
- HANDLE hXStatusAdvancedStatusItems[MRA_XSTATUS_COUNT+4];
- HANDLE hExtraXstatusIcon;
-
- HANDLE hMainMenuIcons[MAIN_MENU_ITEMS_COUNT+4];
- HANDLE hMainMenuItems[MAIN_MENU_ITEMS_COUNT+4];
-
- HANDLE hContactMenuIcons[CONTACT_MENU_ITEMS_COUNT+4];
- HANDLE hContactMenuItems[CONTACT_MENU_ITEMS_COUNT+4];
-
- HANDLE hAdvancedStatusIcons[ADV_ICON_MAX+4];
- HANDLE hAdvancedStatusItems[ADV_ICON_MAX+4];
- HANDLE hExtraInfo;
-
- HANDLE hThreadAPC; // APC thread, for queue tasks
- HANDLE hWaitEventThreadAPCHandle;
- DWORD dwAPCThreadRunning;
- FIFO_MT ffmtAPCQueue;
- HANDLE hMPopSessionQueue;
- HANDLE hSendQueueHandle;
- HANDLE hFilesQueueHandle;
- HANDLE hAvatarsQueueHandle;
-
- HANDLE hNetlibUser;
- HANDLE hThreadWorker;
- HANDLE hConnection;
- DWORD dwThreadWorkerLastPingTime;
- DWORD dwThreadWorkerRunning;
- DWORD dwCMDNum;
- CRITICAL_SECTION csCriticalSectionSend;
-
- HANDLE hHookModulesLoaded;
- HANDLE hHookPreShutdown;
- HANDLE hHookOptInitialize;
- HANDLE hHookContactDeleted;
- HANDLE hHookSettingChanged;
- HANDLE hHookRebuildCMenu;
- HANDLE hHookExtraIconsApply;
- HANDLE hHookExtraIconsRebuild;
- HANDLE hHookIconsChanged;
- HANDLE heNudgeReceived;
- HANDLE hHookRebuildStatusMenu;
- HANDLE hWATrack;
-
- char szNewMailSound[MAX_PATH];
-
- SIZE_T dwMirWorkDirPathLen;
+
+ size_t dwMirWorkDirPathLen;
WCHAR szMirWorkDirPath[MAX_FILEPATH];
} MRA_SETTINGS;
@@ -256,187 +193,84 @@ typedef struct
/////////////////////////////////////////////////////////////////////////////////////////
// External variables
extern MRA_SETTINGS masMraSettings;
+extern LIST<CMraProto> g_Instances;
+INT_PTR LoadModules();
+void UnloadModules();
+void InitExtraIcons();
-INT_PTR LoadServices ();
-INT_PTR LoadModules ();
-void UnloadModules ();
-void UnloadServices ();
-void InitExtraIcons ();
-void SetExtraIcons (HANDLE hContact);
-DWORD MraSetXStatusInternal (DWORD dwXStatus);
-DWORD MraGetXStatusInternal ();
-
-int OptInit (WPARAM wParam,LPARAM lParam);
-
-
-INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM lParam);
-DWORD AdvancedSearchFromDlg(HWND hWndDlg);
-
+DWORD MraGetSelfVersionString(LPSTR lpszSelfVersion, size_t dwSelfVersionSize, size_t *pdwSelfVersionSizeRet);
-DWORD MraRecvCommand_Message (DWORD dwTime,DWORD dwFlags,MRA_LPS *plpsFrom,MRA_LPS *plpsText,MRA_LPS *plpsRFTText,MRA_LPS *plpsMultiChatData);
+#define GetContactNameA(Contact) (LPSTR)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)Contact, 0)
+#define GetContactNameW(Contact) (LPWSTR)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)Contact, GCDNF_UNICODE)
+#define GetStatusModeDescriptionA(Status) (LPSTR)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)Status, 0)
+#define GetStatusModeDescriptionW(Status) (LPWSTR)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)Status, GSMDF_UNICODE)
-DWORD MraGetSelfVersionString (LPSTR lpszSelfVersion,SIZE_T dwSelfVersionSize,SIZE_T *pdwSelfVersionSizeRet);
+#define SetBit(bytes, bitpos) bytes |= (1<<bitpos)
+#define GetBit(bytes, bitpos) ((bytes&(1<<bitpos))? TRUE:FALSE)
-DWORD MraAddrListGetFromBuff (LPSTR lpszAddreses,SIZE_T dwAddresesSize,MRA_ADDR_LIST *pmalAddrList);
-DWORD MraAddrListGetToBuff (MRA_ADDR_LIST *pmalAddrList,LPSTR lpszBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSizeRet);
-void MraAddrListStoreToContact (HANDLE hContact,MRA_ADDR_LIST *pmalAddrList);
-void MraAddrListFree (MRA_ADDR_LIST *pmalAddrList);
-
-
-
-#define GetContactNameA(Contact) (LPSTR)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)Contact,0)
-#define GetContactNameW(Contact) (LPWSTR)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)Contact,GCDNF_UNICODE)
+#define IsXStatusValid(XStatus) (((XStatus) && (XStatus)<MRA_XSTATUS_COUNT))
-#define GetStatusModeDescriptionA(Status) (LPSTR)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,(WPARAM)Status,0)
-#define GetStatusModeDescriptionW(Status) (LPWSTR)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,(WPARAM)Status,GSMDF_UNICODE)
+#define SEND_DLG_ITEM_MESSAGEW(hDlg, nIDDlgItem, Msg, wParam, lParam) SendMessageW(GetDlgItem(hDlg, nIDDlgItem), Msg, wParam, lParam)
+#define SEND_DLG_ITEM_MESSAGEA(hDlg, nIDDlgItem, Msg, wParam, lParam) SendMessageA(GetDlgItem(hDlg, nIDDlgItem), Msg, wParam, lParam)
+#define SEND_DLG_ITEM_MESSAGE(hDlg, nIDDlgItem, Msg, wParam, lParam) SendMessage(GetDlgItem(hDlg, nIDDlgItem), Msg, wParam, lParam)
-#define DB_Mra_DeleteValue(Contact,valueName) DBDeleteContactSetting(Contact,PROTOCOL_NAMEA,valueName)
+#define IS_DLG_BUTTON_CHECKED(hDlg, nIDDlgItem) SEND_DLG_ITEM_MESSAGE(hDlg, nIDDlgItem, BM_GETCHECK, NULL, NULL)
+#define CHECK_DLG_BUTTON(hDlg, nIDDlgItem, uCheck) SEND_DLG_ITEM_MESSAGE(hDlg, nIDDlgItem, BM_SETCHECK, (WPARAM)uCheck, NULL)
-#define DB_Mra_GetDword(Contact,valueName,parDefltValue) DBGetContactSettingDword(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
-#define DB_Mra_SetDword(Contact,valueName,parValue) DBWriteContactSettingDword(Contact,PROTOCOL_NAMEA,valueName,parValue)
+#define SET_DLG_ITEM_TEXTW(hDlg, nIDDlgItem, lpString) SEND_DLG_ITEM_MESSAGEW(hDlg, nIDDlgItem, WM_SETTEXT, 0, (LPARAM)lpString)
+#define SET_DLG_ITEM_TEXTA(hDlg, nIDDlgItem, lpString) SEND_DLG_ITEM_MESSAGEA(hDlg, nIDDlgItem, WM_SETTEXT, 0, (LPARAM)lpString)
+#define SET_DLG_ITEM_TEXT(hDlg, nIDDlgItem, lpString) SEND_DLG_ITEM_MESSAGE(hDlg, nIDDlgItem, WM_SETTEXT, 0, (LPARAM)lpString)
-#define DB_Mra_GetWord(Contact,valueName,parDefltValue) DBGetContactSettingWord(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
-#define DB_Mra_SetWord(Contact,valueName,parValue) DBWriteContactSettingWord(Contact,PROTOCOL_NAMEA,valueName,parValue)
+#define GET_DLG_ITEM_TEXTW(hDlg, nIDDlgItem, lpString, nMaxCount) SEND_DLG_ITEM_MESSAGEW(hDlg, nIDDlgItem, WM_GETTEXT, (WPARAM)nMaxCount, (LPARAM)lpString)
+#define GET_DLG_ITEM_TEXTA(hDlg, nIDDlgItem, lpString, nMaxCount) SEND_DLG_ITEM_MESSAGEA(hDlg, nIDDlgItem, WM_GETTEXT, (WPARAM)nMaxCount, (LPARAM)lpString)
+#define GET_DLG_ITEM_TEXT(hDlg, nIDDlgItem, lpString, nMaxCount) SEND_DLG_ITEM_MESSAGE(hDlg, nIDDlgItem, WM_GETTEXT, (WPARAM)nMaxCount, (LPARAM)lpString)
-#define DB_Mra_GetByte(Contact,valueName,parDefltValue) DBGetContactSettingByte(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
-#define DB_Mra_SetByte(Contact,valueName,parValue) DBWriteContactSettingByte(Contact,PROTOCOL_NAMEA,valueName,parValue)
+#define GET_DLG_ITEM_TEXT_LENGTH(hDlg, nIDDlgItem) SEND_DLG_ITEM_MESSAGE(hDlg, nIDDlgItem, WM_GETTEXTLENGTH, NULL, NULL)
+#define GET_WINDOW_TEXT_LENGTH(hDlg) SendMessage(hDlg, WM_GETTEXTLENGTH, NULL, NULL)
-void DB_Mra_CreateResidentSetting(LPSTR lpszValueName);
+#define GET_CURRENT_COMBO_DATA(hWndDlg, ControlID) SEND_DLG_ITEM_MESSAGE(hWndDlg, ControlID, CB_GETITEMDATA, SEND_DLG_ITEM_MESSAGE(hWndDlg, ControlID, CB_GETCURSEL, 0, 0), 0)
-BOOL DB_GetStaticStringA(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPSTR lpszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize);
-BOOL DB_GetStaticStringW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize);
-#define DB_Mra_GetStaticStringA(Contact,ValueName,Ret,RetBuffSize,pRetBuffSize) DB_GetStaticStringA(Contact,PROTOCOL_NAMEA,ValueName,Ret,RetBuffSize,pRetBuffSize)
-#define DB_Mra_GetStaticStringW(Contact,ValueName,Ret,RetBuffSize,pRetBuffSize) DB_GetStaticStringW(Contact,PROTOCOL_NAMEA,ValueName,Ret,RetBuffSize,pRetBuffSize)
-BOOL DB_SetStringExA(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPSTR lpszValue,SIZE_T dwValueSize);
-BOOL DB_SetStringExW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpwszValue,SIZE_T dwValueSize);
-#define DB_SetStringA(Contact,Module,valueName,parValue) DB_SetStringExA(Contact,Module,valueName,parValue,lstrlenA(parValue))
-#define DB_SetStringW(Contact,Module,valueName,parValue) DBWriteContactSettingWString(Contact,Module,valueName,parValue)
-#define DB_SetLPSStringA(Contact,Module,valueName,parValue) if ((parValue)) DB_SetStringExA(Contact,Module,valueName,(parValue)->lpszData,(parValue)->dwSize)
-#define DB_SetLPSStringW(Contact,Module,valueName,parValue) if ((parValue)) DB_SetStringExW(Contact,Module,valueName,(parValue)->lpwszData,((parValue)->dwSize/sizeof(WCHAR)))
-#define DB_Mra_SetStringA(Contact,valueName,parValue) DB_SetStringExA(Contact,PROTOCOL_NAMEA,valueName,parValue,lstrlenA(parValue))
-#define DB_Mra_SetStringW(Contact,valueName,parValue) DBWriteContactSettingWString(Contact,PROTOCOL_NAMEA,valueName,parValue)
-#define DB_Mra_SetLPSStringA(Contact,valueName,parValue) DB_SetLPSStringA(Contact,PROTOCOL_NAMEA,valueName,parValue)
-#define DB_Mra_SetLPSStringW(Contact,valueName,parValue) DB_SetLPSStringW(Contact,PROTOCOL_NAMEA,valueName,parValue)
-#define DB_Mra_SetStringExA(Contact,valueName,parValue,parValueSize) DB_SetStringExA(Contact,PROTOCOL_NAMEA,valueName,parValue,parValueSize)
-#define DB_Mra_SetStringExW(Contact,valueName,parValue,parValueSize) DB_SetStringExW(Contact,PROTOCOL_NAMEA,valueName,parValue,parValueSize)
+#define IsFileExist(FileName) (GetFileAttributes(FileName) != INVALID_FILE_ATTRIBUTES)
+#define IsFileExistA(FileName) (GetFileAttributesA(FileName) != INVALID_FILE_ATTRIBUTES)
+#define IsFileExistW(FileName) (GetFileAttributesW(FileName) != INVALID_FILE_ATTRIBUTES)
-int DB_WriteContactSettingBlob(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPVOID lpValue,SIZE_T dwValueSize);
-#define DB_Mra_WriteContactSettingBlob(hContact,lpszValueName,lpbValue,dwValueSize) DB_WriteContactSettingBlob(hContact,PROTOCOL_NAMEA,lpszValueName,lpbValue,dwValueSize)
-BOOL DB_GetContactSettingBlob(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPVOID lpRet,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize);
-#define DB_Mra_GetContactSettingBlob(hContact,lpszValueName,lpbRet,dwRetBuffSize,pdwRetBuffSize) DB_GetContactSettingBlob(hContact,PROTOCOL_NAMEA,lpszValueName,lpbRet,dwRetBuffSize,pdwRetBuffSize)
-#define MEMALLOC(Size) HeapAlloc(masMraSettings.hHeap,HEAP_ZERO_MEMORY,((Size)+sizeof(void*)))
-#define MEMREALLOC(Mem,Size) HeapReAlloc(masMraSettings.hHeap,(HEAP_ZERO_MEMORY),(void*)(Mem),((Size)+sizeof(void*)))
-#define MEMFREE(Mem) if ((Mem)) {HeapFree(masMraSettings.hHeap,0,(void*)(Mem));(Mem)=NULL;}
+#define IsThreadAlive(hThread) (GetThreadPriority(hThread) != THREAD_PRIORITY_ERROR_RETURN)
-#define SetBit(bytes,bitpos) bytes|=(1<<bitpos)
-#define GetBit(bytes,bitpos) ((bytes&(1<<bitpos))? TRUE:FALSE)
+void MraAddrListFree(MRA_ADDR_LIST *pmalAddrList);
+DWORD MraAddrListGetFromBuff(LPSTR lpszAddreses, size_t dwAddresesSize, MRA_ADDR_LIST *pmalAddrList);
+DWORD MraAddrListGetToBuff(MRA_ADDR_LIST *pmalAddrList, LPSTR lpszBuff, size_t dwBuffSize, size_t *pdwBuffSizeRet);
+DWORD MraGetVersionStringFromFormatted (LPSTR lpszUserAgentFormated, size_t dwUserAgentFormatedSize, LPSTR lpszVersion, size_t dwVersionSize, size_t *pdwVersionSizeRet);
+BOOL IsUnicodeEnv ();
+BOOL IsHTTPSProxyUsed (HANDLE hNetlibUser);
+BOOL IsContactMraProto (HANDLE hContact);
+BOOL IsEMailMR (LPSTR lpszEMail, size_t dwEMailSize);
+BOOL GetEMailFromString (LPSTR lpszBuff, size_t dwBuffSize, LPSTR *plpszEMail, size_t *pdwEMailSize);
+DWORD ProtoBroadcastAckAsynchEx (const char *szModule, HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam, size_t dwLparamSize);
-#define IsXStatusValid(XStatus) (((XStatus) && (XStatus)<MRA_XSTATUS_COUNT))
+DWORD CreateBlobFromContact (HANDLE hContact, LPWSTR lpwszRequestReason, size_t dwRequestReasonSize, LPBYTE lpbBuff, size_t dwBuffSize, size_t *pdwBuffSizeRet);
+int ExtraSetIcon (HANDLE hExtraIcon, HANDLE hContact, HANDLE hImage, int iColumnType);
+size_t CopyNumber (LPCVOID lpcOutBuff, LPCVOID lpcBuff, size_t dwLen);
+BOOL IsPhone (LPSTR lpszString, size_t dwStringSize);
+BOOL IsContactPhone (HANDLE hContact, LPSTR lpszPhone, size_t dwPhoneSize);
+HANDLE MraHContactFromPhone (LPSTR lpszPhone, size_t dwPhoneSize, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded);
+void EnableControlsArray (HWND hWndDlg, WORD *pwControlsList, size_t dwControlsListCount, BOOL bEnabled);
+BOOL MraRequestXStatusDetails (DWORD dwXStatus);
+BOOL MraSendReplyBlogStatus (HANDLE hContact);
+DWORD GetYears (CONST PSYSTEMTIME pcstSystemTime);
+DWORD FindFile (LPWSTR lpszFolder, DWORD dwFolderLen, LPWSTR lpszFileName, DWORD dwFileNameLen, LPWSTR lpszRetFilePathName, DWORD dwRetFilePathLen, DWORD *pdwRetFilePathLen);
+DWORD MemFillRandom (LPVOID lpBuff, size_t dwBuffSize);
+DWORD DecodeXML (LPTSTR lptszMessage, size_t dwMessageSize, LPTSTR lptszMessageConverted, size_t dwMessageConvertedBuffSize, size_t *pdwMessageConvertedSize);
+DWORD EncodeXML (LPTSTR lptszMessage, size_t dwMessageSize, LPTSTR lptszMessageConverted, size_t dwMessageConvertedBuffSize, size_t *pdwMessageConvertedSize);
+DWORD GetMraStatusFromMiradaStatus (DWORD dwMirandaStatus, DWORD dwXStatusMir, DWORD *pdwXStatusMra);
+DWORD GetMiradaStatusFromMraStatus (DWORD dwMraStatus, DWORD dwXStatusMra, DWORD *pdwXStatusMir);
+DWORD GetMraXStatusIDFromMraUriStatus (LPSTR lpszStatusUri, size_t dwStatusUriSize);
-#define SEND_DLG_ITEM_MESSAGEW(hDlg,nIDDlgItem,Msg,wParam,lParam) SendMessageW(GetDlgItem(hDlg,nIDDlgItem),Msg,wParam,lParam)
-#define SEND_DLG_ITEM_MESSAGEA(hDlg,nIDDlgItem,Msg,wParam,lParam) SendMessageA(GetDlgItem(hDlg,nIDDlgItem),Msg,wParam,lParam)
-#define SEND_DLG_ITEM_MESSAGE(hDlg,nIDDlgItem,Msg,wParam,lParam) SendMessage(GetDlgItem(hDlg,nIDDlgItem),Msg,wParam,lParam)
-
-#define IS_DLG_BUTTON_CHECKED(hDlg,nIDDlgItem) SEND_DLG_ITEM_MESSAGE(hDlg,nIDDlgItem,BM_GETCHECK,NULL,NULL)
-#define CHECK_DLG_BUTTON(hDlg,nIDDlgItem,uCheck) SEND_DLG_ITEM_MESSAGE(hDlg,nIDDlgItem,BM_SETCHECK,(WPARAM)uCheck,NULL)
-
-#define SET_DLG_ITEM_TEXTW(hDlg,nIDDlgItem,lpString) SEND_DLG_ITEM_MESSAGEW(hDlg,nIDDlgItem,WM_SETTEXT,0,(LPARAM)lpString)
-#define SET_DLG_ITEM_TEXTA(hDlg,nIDDlgItem,lpString) SEND_DLG_ITEM_MESSAGEA(hDlg,nIDDlgItem,WM_SETTEXT,0,(LPARAM)lpString)
-#define SET_DLG_ITEM_TEXT(hDlg,nIDDlgItem,lpString) SEND_DLG_ITEM_MESSAGE(hDlg,nIDDlgItem,WM_SETTEXT,0,(LPARAM)lpString)
-
-#define GET_DLG_ITEM_TEXTW(hDlg,nIDDlgItem,lpString,nMaxCount) SEND_DLG_ITEM_MESSAGEW(hDlg,nIDDlgItem,WM_GETTEXT,(WPARAM)nMaxCount,(LPARAM)lpString)
-#define GET_DLG_ITEM_TEXTA(hDlg,nIDDlgItem,lpString,nMaxCount) SEND_DLG_ITEM_MESSAGEA(hDlg,nIDDlgItem,WM_GETTEXT,(WPARAM)nMaxCount,(LPARAM)lpString)
-#define GET_DLG_ITEM_TEXT(hDlg,nIDDlgItem,lpString,nMaxCount) SEND_DLG_ITEM_MESSAGE(hDlg,nIDDlgItem,WM_GETTEXT,(WPARAM)nMaxCount,(LPARAM)lpString)
-
-#define GET_DLG_ITEM_TEXT_LENGTH(hDlg,nIDDlgItem) SEND_DLG_ITEM_MESSAGE(hDlg,nIDDlgItem,WM_GETTEXTLENGTH,NULL,NULL)
-#define GET_WINDOW_TEXT_LENGTH(hDlg) SendMessage(hDlg,WM_GETTEXTLENGTH,NULL,NULL)
-
-#define GET_CURRENT_COMBO_DATA(hWndDlg,ControlID) SEND_DLG_ITEM_MESSAGE(hWndDlg,ControlID,CB_GETITEMDATA,SEND_DLG_ITEM_MESSAGE(hWndDlg,ControlID,CB_GETCURSEL,0,0),0)
-
-
-#define IsFileExist(FileName) (GetFileAttributes(FileName)!=INVALID_FILE_ATTRIBUTES)
-#define IsFileExistA(FileName) (GetFileAttributesA(FileName)!=INVALID_FILE_ATTRIBUTES)
-#define IsFileExistW(FileName) (GetFileAttributesW(FileName)!=INVALID_FILE_ATTRIBUTES)
-
-
-#define IsThreadAlive(hThread) (GetThreadPriority(hThread)!=THREAD_PRIORITY_ERROR_RETURN)
-
-
-
-DWORD MraGetVersionStringFromFormated (LPSTR lpszUserAgentFormated,SIZE_T dwUserAgentFormatedSize,LPSTR lpszVersion,SIZE_T dwVersionSize,SIZE_T *pdwVersionSizeRet);
-HANDLE MraHContactFromEmail (LPSTR lpszEMail,SIZE_T dwEMailSize,BOOL bAddIfNeeded,BOOL bTemporary,BOOL *pbAdded);
-BOOL MraUpdateContactInfo (HANDLE hContact);
-DWORD MraContactCapabilitiesGet (HANDLE hContact);
-void MraContactCapabilitiesSet (HANDLE hContact,DWORD dwFutureFlags);
-DWORD MraGetContactStatus (HANDLE hContact);
-DWORD MraSetContactStatus (HANDLE hContact,DWORD dwNewStatus);
-void MraUpdateEmailStatus (LPSTR lpszFrom,SIZE_T dwFromSize,LPSTR lpszSubject,SIZE_T dwSubjectSize,DWORD dwDate,DWORD dwUIDL);
-BOOL IsUnicodeEnv ();
-BOOL IsHTTPSProxyUsed (HANDLE hNetlibUser);
-BOOL IsContactMra (HANDLE hContact);
-BOOL IsContactMraProto (HANDLE hContact);
-BOOL IsEMailMy (LPSTR lpszEMail,SIZE_T dwEMailSize);
-BOOL IsEMailChatAgent (LPSTR lpszEMail,SIZE_T dwEMailSize);
-BOOL IsContactChatAgent (HANDLE hContact);
-BOOL IsEMailMR (LPSTR lpszEMail,SIZE_T dwEMailSize);
-BOOL GetEMailFromString (LPSTR lpszBuff,SIZE_T dwBuffSize,LPSTR *plpszEMail,SIZE_T *pdwEMailSize);
-DWORD GetContactEMailCount (HANDLE hContact,BOOL bMRAOnly);
-BOOL GetContactFirstEMail (HANDLE hContact,BOOL bMRAOnly,LPSTR lpszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize);
-DWORD MraAPCQueueAdd (PAPCFUNC pfnAPC,PFIFO_MT pffmtAPCQueue,ULONG_PTR dwData);
-void MraAPCQueueDestroy (PFIFO_MT pffmtAPCQueue);
-void ShowFormatedErrorMessage (LPWSTR lpwszErrText,DWORD dwErrorCode);
-DWORD ProtoBroadcastAckAsynchEx (const char *szModule,HANDLE hContact,int type,int result,HANDLE hProcess,LPARAM lParam,SIZE_T dwLparamSize);
-void MraUserAPCThreadProc (LPVOID lpParameter);
-
-DWORD CreateBlobFromContact (HANDLE hContact,LPWSTR lpwszRequestReason,SIZE_T dwRequestReasonSize,LPBYTE lpbBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSizeRet);
-void CListCreateMenu (LONG lPosition,LONG lPopupPosition,HICON hMainIcon,LPSTR pszContactOwner,BOOL bIsStatus,const GUI_DISPLAY_ITEM *pgdiItems,HANDLE *hIcoLibIcons,SIZE_T dwCount,HANDLE *hResult);
-void CListDestroyMenu (const GUI_DISPLAY_ITEM *pgdiItems,SIZE_T dwCount);
-void CListShowMenuItem (HANDLE hMenuItem,BOOL bShow);
-int ExtraSetIcon (HANDLE hExtraIcon,HANDLE hContact,HANDLE hImage,int iColumnType);
-SIZE_T CopyNumber (LPCVOID lpcOutBuff,LPCVOID lpcBuff,SIZE_T dwLen);
-BOOL IsPhone (LPSTR lpszString,SIZE_T dwStringSize);
-BOOL IsContactPhone (HANDLE hContact,LPSTR lpszPhone,SIZE_T dwPhoneSize);
-HANDLE MraHContactFromPhone (LPSTR lpszPhone,SIZE_T dwPhoneSize,BOOL bAddIfNeeded,BOOL bTemporary,BOOL *pbAdded);
-void EnableControlsArray (HWND hWndDlg,WORD *pwControlsList,SIZE_T dwControlsListCount,BOOL bEnabled);
-BOOL MraRequestXStatusDetails (DWORD dwXStatus);
-BOOL MraSendReplyBlogStatus (HANDLE hContact);
-DWORD GetYears (CONST PSYSTEMTIME pcstSystemTime);
-DWORD FindFile (LPWSTR lpszFolder,DWORD dwFolderLen,LPWSTR lpszFileName,DWORD dwFileNameLen,LPWSTR lpszRetFilePathName,DWORD dwRetFilePathLen,DWORD *pdwRetFilePathLen);
-DWORD MemFillRandom (LPVOID lpBuff,SIZE_T dwBuffSize);
-BOOL SetPassDB (LPSTR lpszBuff,SIZE_T dwBuffSize);
-BOOL GetPassDB (LPSTR lpszBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSize);
-DWORD DecodeXML (LPTSTR lptszMessage,SIZE_T dwMessageSize,LPTSTR lptszMessageConverted,SIZE_T dwMessageConvertedBuffSize,SIZE_T *pdwMessageConvertedSize);
-DWORD EncodeXML (LPTSTR lptszMessage,SIZE_T dwMessageSize,LPTSTR lptszMessageConverted,SIZE_T dwMessageConvertedBuffSize,SIZE_T *pdwMessageConvertedSize);
-
-
-DWORD StartConnect ();
-void MraThreadClean ();
-
-DWORD GetMraStatusFromMiradaStatus (DWORD dwMirandaStatus,DWORD dwXStatusMir,DWORD *pdwXStatusMra);
-DWORD GetMiradaStatusFromMraStatus (DWORD dwMraStatus,DWORD dwXStatusMra,DWORD *pdwXStatusMir);
-DWORD GetMraXStatusIDFromMraUriStatus (LPSTR lpszStatusUri,SIZE_T dwStatusUriSize);
-
-DWORD GetContactFlags (HANDLE hContact);
-DWORD SetContactFlags (HANDLE hContact,DWORD dwContactFlag);
-
-DWORD GetContactBasicInfoW (HANDLE hContact,DWORD *pdwID,DWORD *pdwGroupID,DWORD *pdwContactFlag,DWORD *pdwContactSeverFlags,DWORD *pdwStatus,LPSTR lpszEMail,SIZE_T dwEMailSize,SIZE_T *pdwEMailSize,LPWSTR lpwszNick,SIZE_T dwNickSize,SIZE_T *pdwNickSize,LPSTR lpszPhones,SIZE_T dwPhonesSize,SIZE_T *pdwPhonesSize);
-
-#define SCBIFSI_LOCK_CHANGES_EVENTS 1
-#define SCBIF_ID 1
-#define SCBIF_GROUP_ID 2
-#define SCBIF_FLAG 4
-#define SCBIF_SERVER_FLAG 8
-#define SCBIF_STATUS 16
-#define SCBIF_EMAIL 32
-#define SCBIF_NICK 64
-#define SCBIF_PHONES 128
-DWORD SetContactBasicInfoW (HANDLE hContact,DWORD dwSetInfoFlags,DWORD dwFlags,DWORD dwID,DWORD dwGroupID,DWORD dwContactFlag,DWORD dwContactSeverFlags,DWORD dwStatus,LPSTR lpszEMail,SIZE_T dwEMailSize,LPWSTR lpwszNick,SIZE_T dwNickSize,LPSTR lpszPhones,SIZE_T dwPhonesSize);
diff --git a/protocols/MRA/Mra.vcxproj b/protocols/MRA/Mra.vcxproj
index eaac5f94e7..9c3c242bba 100644
--- a/protocols/MRA/Mra.vcxproj
+++ b/protocols/MRA/Mra.vcxproj
@@ -187,6 +187,7 @@
<ClCompile Include="Mra.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
+ <ClCompile Include="MraProto.cpp" />
<ClCompile Include="Mra_functions.cpp" />
<ClCompile Include="Mra_options.cpp" />
<ClCompile Include="Mra_proto.cpp" />
@@ -207,24 +208,6 @@
<ClCompile Include="MraSendQueue.cpp" />
</ItemGroup>
<ItemGroup>
- <None Include="Icons\Alarm.ico" />
- <None Include="Icons\answers.ico" />
- <None Include="Icons\AuthGrant.ico" />
- <None Include="Icons\AuthReguest.ico" />
- <None Include="Icons\Bagz.ico" />
- <None Include="Icons\Blogs.ico" />
- <None Include="Icons\BlogStatus.ico" />
- <None Include="Icons\Chat.ico" />
- <None Include="Icons\Info.ico" />
- <None Include="Icons\Magent.ico" />
- <None Include="Icons\Mail.ico" />
- <None Include="Icons\MailNotify.ico" />
- <None Include="Icons\my world.ico" />
- <None Include="Icons\Phone.ico" />
- <None Include="Icons\Photo.ico" />
- <None Include="Icons\PostCards.ico" />
- <None Include="Icons\video.ico" />
- <None Include="Icons\WebSearch.ico" />
<None Include="langpack_MRA_russian.txt" />
<None Include="Readme_MRA.txt" />
<None Include="TODO.txt" />
@@ -242,15 +225,18 @@
<ClInclude Include="MraOfflineMsg.h" />
<ClInclude Include="MraPlaces.h" />
<ClInclude Include="MraPopUp.h" />
+ <ClInclude Include="MraProto.h" />
<ClInclude Include="MraRTFMsg.h" />
<ClInclude Include="MraSelectEMail.h" />
<ClInclude Include="MraSendCommand.h" />
<ClInclude Include="MraSendQueue.h" />
<ClInclude Include="proto.h" />
<ClInclude Include="resource.h" />
+ <ClInclude Include="version.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="resource.rc" />
+ <ResourceCompile Include="version.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
diff --git a/protocols/MRA/Mra.vcxproj.filters b/protocols/MRA/Mra.vcxproj.filters
index dbad64b8c4..fd647eb504 100644
--- a/protocols/MRA/Mra.vcxproj.filters
+++ b/protocols/MRA/Mra.vcxproj.filters
@@ -72,62 +72,11 @@
<ClCompile Include="MraSendQueue.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="MraProto.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
- <None Include="Icons\Alarm.ico">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="Icons\answers.ico">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="Icons\AuthGrant.ico">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="Icons\AuthReguest.ico">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="Icons\Bagz.ico">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="Icons\Blogs.ico">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="Icons\BlogStatus.ico">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="Icons\Chat.ico">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="Icons\Info.ico">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="Icons\Magent.ico">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="Icons\Mail.ico">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="Icons\MailNotify.ico">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="Icons\my world.ico">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="Icons\Phone.ico">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="Icons\Photo.ico">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="Icons\PostCards.ico">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="Icons\video.ico">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="Icons\WebSearch.ico">
- <Filter>Resource Files</Filter>
- </None>
<None Include="langpack_MRA_russian.txt" />
<None Include="Readme_MRA.txt" />
<None Include="TODO.txt" />
@@ -187,10 +136,19 @@
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="MraProto.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="version.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="resource.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
+ <ResourceCompile Include="version.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/protocols/MRA/MraAdvancedSearch.cpp b/protocols/MRA/MraAdvancedSearch.cpp
index c97ae8aba2..8ffe222cab 100644
--- a/protocols/MRA/MraAdvancedSearch.cpp
+++ b/protocols/MRA/MraAdvancedSearch.cpp
@@ -12,45 +12,45 @@ struct FieldNames
-static const FieldNames GenderField[]=
+static const FieldNames GenderField[] =
{
- {1, L"Male"},
- {2, L"Female"},
- {-1, NULL}
+ {1, L"Male"},
+ {2, L"Female"},
+ {-1, NULL}
};
-static const FieldNames MonthField[]=
+static const FieldNames MonthField[] =
{
- {1, L"January"},
- {2, L"February"},
- {3, L"March"},
- {4, L"April"},
- {5, L"May"},
- {6, L"June"},
- {7, L"July"},
- {8, L"August"},
- {9, L"September"},
- {10, L"October"},
- {11, L"November"},
- {12, L"December"},
- {-1, NULL}
+ {1, L"January"},
+ {2, L"February"},
+ {3, L"March"},
+ {4, L"April"},
+ {5, L"May"},
+ {6, L"June"},
+ {7, L"July"},
+ {8, L"August"},
+ {9, L"September"},
+ {10, L"October"},
+ {11, L"November"},
+ {12, L"December"},
+ {-1, NULL}
};
-static const FieldNames ZodiakField[]=
+static const FieldNames ZodiakField[] =
{
- {1, L"Aries"},
- {2, L"Taurus"},
- {3, L"Gemini"},
- {4, L"Cancer"},
- {5, L"Leo"},
- {6, L"Virgo"},
- {7, L"Libra"},
- {8, L"Scorpio"},
- {9, L"Sagitarius"},
- {10, L"Capricorn"},
- {11, L"Aquarius"},
- {12, L"Pisces"},
- {-1, NULL}
+ {1, L"Aries"},
+ {2, L"Taurus"},
+ {3, L"Gemini"},
+ {4, L"Cancer"},
+ {5, L"Leo"},
+ {6, L"Virgo"},
+ {7, L"Libra"},
+ {8, L"Scorpio"},
+ {9, L"Sagitarius"},
+ {10, L"Capricorn"},
+ {11, L"Aquarius"},
+ {12, L"Pisces"},
+ {-1, NULL}
};
@@ -62,46 +62,48 @@ void ResetComboBox(HWND hWndCombo)
{
DWORD dwItem;
- SendMessage(hWndCombo,CB_RESETCONTENT,0,0);
- dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)L"");
- SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,0);
- SendMessage(hWndCombo,CB_SETCURSEL,dwItem,0);
+ SendMessage(hWndCombo, CB_RESETCONTENT, 0, 0);
+ dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)L"");
+ SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, 0);
+ SendMessage(hWndCombo, CB_SETCURSEL, dwItem, 0);
}
-void InitComboBox(HWND hWndCombo,FieldNames *lpNames)
+void InitComboBox(HWND hWndCombo, FieldNames *lpNames)
{
DWORD dwItem;
ResetComboBox(hWndCombo);
- for (SIZE_T i=0;lpNames[i].lpszText;i++)
+ for (size_t i = 0;lpNames[i].lpszText;i++)
{
- dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)TranslateW(lpNames[i].lpszText));
- SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,lpNames[i].dwCode);
+ dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)TranslateW(lpNames[i].lpszText));
+ SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, lpNames[i].dwCode);
}
}
-void InitComboBoxNumders(HWND hWndCombo,DWORD dwStart,DWORD dwEnd)
+void InitComboBoxNumders(HWND hWndCombo, DWORD dwStart, DWORD dwEnd)
{
DWORD dwItem;
WCHAR szBuff[MAX_PATH];
ResetComboBox(hWndCombo);
- for (DWORD i=dwStart;i<=dwEnd;i++)
+ for (DWORD i = dwStart;i <= dwEnd;i++)
{
- mir_sntprintf(szBuff,SIZEOF(szBuff),L"%lu",i);
- dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)szBuff);
- SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,i);
+ mir_sntprintf(szBuff, SIZEOF(szBuff), L"%lu", i);
+ dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)szBuff);
+ SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, i);
}
}
-INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
- switch(message){
+ CMraProto *ppro = (CMraProto*)GetWindowLongPtr(hWndDlg, GWLP_USERDATA);
+
+ switch (message) {
case WM_INITDIALOG:
{
HWND hWndCombo;
@@ -110,183 +112,175 @@ INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,L
SYSTEMTIME stTime;
GetLocalTime(&stTime);
- //InitComboBox(GetDlgItem(hWndDlg,IDC_EMAIL_DOMAIN),(FieldNames*)DomainField);
+ SetWindowLongPtr(hWndDlg, GWLP_USERDATA, lParam);
+ ppro = (CMraProto*)lParam;
+ //InitComboBox(GetDlgItem(hWndDlg, IDC_EMAIL_DOMAIN), (FieldNames*)DomainField);
{
- hWndCombo=GetDlgItem(hWndDlg,IDC_EMAIL_DOMAIN);
+ hWndCombo = GetDlgItem(hWndDlg, IDC_EMAIL_DOMAIN);
ResetComboBox(hWndCombo);
- for (SIZE_T i=0;lpcszMailRuDomains[i];i++)
+ for (size_t i = 0;lpcszMailRuDomains[i];i++)
{
- MultiByteToWideChar(MRA_CODE_PAGE,0,lpcszMailRuDomains[i],-1,wszBuff,SIZEOF(wszBuff));
- SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)wszBuff);
+ MultiByteToWideChar(MRA_CODE_PAGE, 0, lpcszMailRuDomains[i], -1, wszBuff, SIZEOF(wszBuff));
+ SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)wszBuff);
}
}
- InitComboBox(GetDlgItem(hWndDlg,IDC_GENDER),(FieldNames*)GenderField);
- InitComboBoxNumders(GetDlgItem(hWndDlg,IDC_AGERANGE_FROM),1,100);
- InitComboBoxNumders(GetDlgItem(hWndDlg,IDC_AGERANGE_TO),1,100);
- InitComboBoxNumders(GetDlgItem(hWndDlg,IDC_BIRTHDAY_DAY),1,31);
- InitComboBox(GetDlgItem(hWndDlg,IDC_BIRTHDAY_MONTH),(FieldNames*)MonthField);
- InitComboBoxNumders(GetDlgItem(hWndDlg,IDC_BIRTHDAY_YEAR),1900,(DWORD)stTime.wYear);
- InitComboBox(GetDlgItem(hWndDlg,IDC_ZODIAK),(FieldNames*)ZodiakField);
-
- hWndCombo=GetDlgItem(hWndDlg,IDC_COUNTRY);
+ InitComboBox(GetDlgItem(hWndDlg, IDC_GENDER), (FieldNames*)GenderField);
+ InitComboBoxNumders(GetDlgItem(hWndDlg, IDC_AGERANGE_FROM), 1, 100);
+ InitComboBoxNumders(GetDlgItem(hWndDlg, IDC_AGERANGE_TO), 1, 100);
+ InitComboBoxNumders(GetDlgItem(hWndDlg, IDC_BIRTHDAY_DAY), 1, 31);
+ InitComboBox(GetDlgItem(hWndDlg, IDC_BIRTHDAY_MONTH), (FieldNames*)MonthField);
+ InitComboBoxNumders(GetDlgItem(hWndDlg, IDC_BIRTHDAY_YEAR), 1900, (DWORD)stTime.wYear);
+ InitComboBox(GetDlgItem(hWndDlg, IDC_ZODIAK), (FieldNames*)ZodiakField);
+
+ hWndCombo = GetDlgItem(hWndDlg, IDC_COUNTRY);
ResetComboBox(hWndCombo);
- for(SIZE_T i=0;mrapPlaces[i].lpszData;i++)
+ for (size_t i = 0;mrapPlaces[i].lpszData;i++)
{
- if (mrapPlaces[i].dwCityID==0 && mrapPlaces[i].dwPlaceID==0)
+ if (mrapPlaces[i].dwCityID == 0 && mrapPlaces[i].dwPlaceID == 0)
{
- dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)mrapPlaces[i].lpszData);
- SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,mrapPlaces[i].dwCountryID);
+ dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)mrapPlaces[i].lpszData);
+ SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, mrapPlaces[i].dwCountryID);
}
}
- ResetComboBox(GetDlgItem(hWndDlg,IDC_CITY));
+ ResetComboBox(GetDlgItem(hWndDlg, IDC_CITY));
- if (DB_Mra_GetByte(NULL,"AdvancedSearchRemember",MRA_DEFAULT_SEARCH_REMEMBER))
- {
- SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_GENDER,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchGender",0),0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_AGERANGE_FROM,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchAgeFrom",0),0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_AGERANGE_TO,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchAgeTo",0),0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BIRTHDAY_MONTH,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchBirthDayMonth",0),0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BIRTHDAY_DAY,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchBirthDayDay",0),0);
+ if ( ppro->mraGetByte(NULL, "AdvancedSearchRemember", MRA_DEFAULT_SEARCH_REMEMBER)) {
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_GENDER, CB_SETCURSEL, ppro->mraGetWord(NULL, "AdvancedSearchGender", 0), 0);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_AGERANGE_FROM, CB_SETCURSEL, ppro->mraGetWord(NULL, "AdvancedSearchAgeFrom", 0), 0);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_AGERANGE_TO, CB_SETCURSEL, ppro->mraGetWord(NULL, "AdvancedSearchAgeTo", 0), 0);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BIRTHDAY_MONTH, CB_SETCURSEL, ppro->mraGetWord(NULL, "AdvancedSearchBirthDayMonth", 0), 0);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BIRTHDAY_DAY, CB_SETCURSEL, ppro->mraGetWord(NULL, "AdvancedSearchBirthDayDay", 0), 0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_ZODIAK,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchZodiakID",0),0);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_ZODIAK, CB_SETCURSEL, ppro->mraGetWord(NULL, "AdvancedSearchZodiakID", 0), 0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_COUNTRY,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchCountryID",0),0);
- SendMessageW(hWndDlg,WM_COMMAND,(WPARAM)MAKELONG(IDC_COUNTRY,CBN_SELCHANGE),(LPARAM)GetDlgItem(hWndDlg,IDC_COUNTRY));
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_COUNTRY, CB_SETCURSEL, ppro->mraGetWord(NULL, "AdvancedSearchCountryID", 0), 0);
+ SendMessageW(hWndDlg, WM_COMMAND, (WPARAM)MAKELONG(IDC_COUNTRY, CBN_SELCHANGE), (LPARAM)GetDlgItem(hWndDlg, IDC_COUNTRY));
- SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_STATE,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchStateID",0),0);
- SendMessageW(hWndDlg,WM_COMMAND,(WPARAM)MAKELONG(IDC_STATE,CBN_SELCHANGE),(LPARAM)GetDlgItem(hWndDlg,IDC_STATE));
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_STATE, CB_SETCURSEL, ppro->mraGetWord(NULL, "AdvancedSearchStateID", 0), 0);
+ SendMessageW(hWndDlg, WM_COMMAND, (WPARAM)MAKELONG(IDC_STATE, CBN_SELCHANGE), (LPARAM)GetDlgItem(hWndDlg, IDC_STATE));
- SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_CITY,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchCityID",0),0);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_CITY, CB_SETCURSEL, ppro->mraGetWord(NULL, "AdvancedSearchCityID", 0), 0);
- CHECK_DLG_BUTTON(hWndDlg,IDC_ONLINEONLY,DB_Mra_GetByte(NULL,"AdvancedSearchOnlineOnly",FALSE));
- CHECK_DLG_BUTTON(hWndDlg,IDC_CHK_REMEMBER,TRUE);
+ CHECK_DLG_BUTTON(hWndDlg, IDC_ONLINEONLY, ppro->mraGetByte(NULL, "AdvancedSearchOnlineOnly", FALSE));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_CHK_REMEMBER, TRUE);
}
TranslateDialogDefault(hWndDlg);
}
- return(TRUE);
- case WM_DESTROY:
- {
- /*dwUserSize=GET_DLG_ITEM_TEXTA(hWndDlg,IDC_EMAIL_USER,szUser,SIZEOF(szUser));
- dwDomainSize=GET_DLG_ITEM_TEXTA(hWndDlg,IDC_EMAIL_DOMAIN,szDomain,SIZEOF(szDomain));
-
- dwNickNameSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_NICK,wszNickName,SIZEOF(wszNickName));
+ return TRUE;
- dwFirstNameSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_FIRSTNAME,wszFirstName,SIZEOF(wszFirstName));
-
- dwLastNameSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_LASTNAME,wszLastName,SIZEOF(wszLastName));*/
-
- DB_Mra_SetWord(NULL,"AdvancedSearchGender",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_GENDER,CB_GETCURSEL,0,0));
- DB_Mra_SetWord(NULL,"AdvancedSearchAgeFrom",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_AGERANGE_FROM,CB_GETCURSEL,0,0));
- DB_Mra_SetWord(NULL,"AdvancedSearchAgeTo",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_AGERANGE_TO,CB_GETCURSEL,0,0));
- DB_Mra_SetWord(NULL,"AdvancedSearchBirthDayMonth",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BIRTHDAY_MONTH,CB_GETCURSEL,0,0));
- DB_Mra_SetWord(NULL,"AdvancedSearchBirthDayDay",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BIRTHDAY_DAY,CB_GETCURSEL,0,0));
+ case WM_DESTROY:
+ ppro->mraSetWord(NULL, "AdvancedSearchGender", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_GENDER, CB_GETCURSEL, 0, 0));
+ ppro->mraSetWord(NULL, "AdvancedSearchAgeFrom", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_AGERANGE_FROM, CB_GETCURSEL, 0, 0));
+ ppro->mraSetWord(NULL, "AdvancedSearchAgeTo", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_AGERANGE_TO, CB_GETCURSEL, 0, 0));
+ ppro->mraSetWord(NULL, "AdvancedSearchBirthDayMonth", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BIRTHDAY_MONTH, CB_GETCURSEL, 0, 0));
+ ppro->mraSetWord(NULL, "AdvancedSearchBirthDayDay", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BIRTHDAY_DAY, CB_GETCURSEL, 0, 0));
- DB_Mra_SetWord(NULL,"AdvancedSearchZodiakID",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_ZODIAK,CB_GETCURSEL,0,0));
+ ppro->mraSetWord(NULL, "AdvancedSearchZodiakID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_ZODIAK, CB_GETCURSEL, 0, 0));
- DB_Mra_SetWord(NULL,"AdvancedSearchCityID",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_CITY,CB_GETCURSEL,0,0));
- DB_Mra_SetWord(NULL,"AdvancedSearchStateID",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_STATE,CB_GETCURSEL,0,0));
- DB_Mra_SetWord(NULL,"AdvancedSearchCountryID",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_COUNTRY,CB_GETCURSEL,0,0));
+ ppro->mraSetWord(NULL, "AdvancedSearchCityID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_CITY, CB_GETCURSEL, 0, 0));
+ ppro->mraSetWord(NULL, "AdvancedSearchStateID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_STATE, CB_GETCURSEL, 0, 0));
+ ppro->mraSetWord(NULL, "AdvancedSearchCountryID", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_COUNTRY, CB_GETCURSEL, 0, 0));
- DB_Mra_SetByte(NULL,"AdvancedSearchOnlineOnly",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_ONLINEONLY));
- DB_Mra_SetByte(NULL,"AdvancedSearchRemember",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_CHK_REMEMBER));
- }
+ ppro->mraSetByte(NULL, "AdvancedSearchOnlineOnly", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ONLINEONLY));
+ ppro->mraSetByte(NULL, "AdvancedSearchRemember", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_REMEMBER));
break;
+
case WM_COMMAND:
- switch(LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
case IDOK:
- SendMessage(GetParent(hWndDlg),WM_COMMAND,MAKEWPARAM(IDOK,BN_CLICKED),(LPARAM)GetDlgItem(GetParent(hWndDlg),IDOK));
+ SendMessage(GetParent(hWndDlg), WM_COMMAND, MAKEWPARAM(IDOK, BN_CLICKED), (LPARAM)GetDlgItem(GetParent(hWndDlg), IDOK));
break;
case IDC_AGERANGE_FROM:
case IDC_AGERANGE_TO:
- if (HIWORD(wParam)==CBN_SELCHANGE)
+ if (HIWORD(wParam) == CBN_SELCHANGE)
{
- if (LOWORD(wParam)==IDC_AGERANGE_FROM)
+ if (LOWORD(wParam) == IDC_AGERANGE_FROM)
{
- DWORD dwAgeFrom,dwAgeTo;
+ DWORD dwAgeFrom, dwAgeTo;
- dwAgeFrom=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_AGERANGE_FROM);
- dwAgeTo=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_AGERANGE_TO);
- if (dwAgeFrom==0) dwAgeFrom++;
- InitComboBoxNumders(GetDlgItem(hWndDlg,IDC_AGERANGE_TO),dwAgeFrom,100);
- SendMessage(GetDlgItem(hWndDlg,IDC_AGERANGE_TO),CB_SETCURSEL,((dwAgeTo-dwAgeFrom)+1),0);
+ dwAgeFrom = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_AGERANGE_FROM);
+ dwAgeTo = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_AGERANGE_TO);
+ if (dwAgeFrom == 0) dwAgeFrom++;
+ InitComboBoxNumders(GetDlgItem(hWndDlg, IDC_AGERANGE_TO), dwAgeFrom, 100);
+ SendMessage(GetDlgItem(hWndDlg, IDC_AGERANGE_TO), CB_SETCURSEL, ((dwAgeTo-dwAgeFrom)+1), 0);
}
- SendMessage(GetDlgItem(hWndDlg,IDC_BIRTHDAY_YEAR),CB_SETCURSEL,0,0);
+ SendMessage(GetDlgItem(hWndDlg, IDC_BIRTHDAY_YEAR), CB_SETCURSEL, 0, 0);
}
break;
case IDC_BIRTHDAY_DAY:
case IDC_BIRTHDAY_MONTH:
case IDC_BIRTHDAY_YEAR:
- if (HIWORD(wParam)==CBN_SELCHANGE)
+ if (HIWORD(wParam) == CBN_SELCHANGE)
{
DWORD dwAge;
- SYSTEMTIME stTime={0};
+ SYSTEMTIME stTime = {0};
- stTime.wYear=(WORD)GET_CURRENT_COMBO_DATA(hWndDlg,IDC_BIRTHDAY_YEAR);
- stTime.wMonth=(WORD)GET_CURRENT_COMBO_DATA(hWndDlg,IDC_BIRTHDAY_MONTH);
- stTime.wDay=(WORD)GET_CURRENT_COMBO_DATA(hWndDlg,IDC_BIRTHDAY_DAY);
+ stTime.wYear = (WORD)GET_CURRENT_COMBO_DATA(hWndDlg, IDC_BIRTHDAY_YEAR);
+ stTime.wMonth = (WORD)GET_CURRENT_COMBO_DATA(hWndDlg, IDC_BIRTHDAY_MONTH);
+ stTime.wDay = (WORD)GET_CURRENT_COMBO_DATA(hWndDlg, IDC_BIRTHDAY_DAY);
- dwAge=GetYears(&stTime);
- SendMessage(GetDlgItem(hWndDlg,IDC_AGERANGE_FROM),CB_SETCURSEL,dwAge,0);
- SendMessage(GetDlgItem(hWndDlg,IDC_AGERANGE_TO),CB_SETCURSEL,dwAge,0);
- SendMessage(GetDlgItem(hWndDlg,IDC_ZODIAK),CB_SETCURSEL,0,0);
+ dwAge = GetYears(&stTime);
+ SendMessage(GetDlgItem(hWndDlg, IDC_AGERANGE_FROM), CB_SETCURSEL, dwAge, 0);
+ SendMessage(GetDlgItem(hWndDlg, IDC_AGERANGE_TO), CB_SETCURSEL, dwAge, 0);
+ SendMessage(GetDlgItem(hWndDlg, IDC_ZODIAK), CB_SETCURSEL, 0, 0);
}
break;
case IDC_ZODIAK:
- if (HIWORD(wParam)==CBN_SELCHANGE)
+ if (HIWORD(wParam) == CBN_SELCHANGE)
{
- SendMessage(GetDlgItem(hWndDlg,IDC_BIRTHDAY_DAY),CB_SETCURSEL,0,0);
- SendMessage(GetDlgItem(hWndDlg,IDC_BIRTHDAY_MONTH),CB_SETCURSEL,0,0);
- //SendMessage(GetDlgItem(hWndDlg,IDC_BIRTHDAY_YEAR),CB_SETCURSEL,0,0);
+ SendMessage(GetDlgItem(hWndDlg, IDC_BIRTHDAY_DAY), CB_SETCURSEL, 0, 0);
+ SendMessage(GetDlgItem(hWndDlg, IDC_BIRTHDAY_MONTH), CB_SETCURSEL, 0, 0);
+ //SendMessage(GetDlgItem(hWndDlg, IDC_BIRTHDAY_YEAR), CB_SETCURSEL, 0, 0);
}
break;
case IDC_COUNTRY:
- if (HIWORD(wParam)==CBN_SELCHANGE)
+ if (HIWORD(wParam) == CBN_SELCHANGE)
{
HWND hWndCombo;
- DWORD dwItem,dwCountryID;
+ DWORD dwItem, dwCountryID;
- dwCountryID=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_COUNTRY);
- hWndCombo=GetDlgItem(hWndDlg,IDC_STATE);
- SendMessage(hWndCombo,CB_RESETCONTENT,0,0);
- ResetComboBox(GetDlgItem(hWndDlg,IDC_CITY));
- dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)L"");
- SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,0);
- SendMessage(hWndCombo,CB_SETCURSEL,dwItem,0);
+ dwCountryID = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_COUNTRY);
+ hWndCombo = GetDlgItem(hWndDlg, IDC_STATE);
+ SendMessage(hWndCombo, CB_RESETCONTENT, 0, 0);
+ ResetComboBox(GetDlgItem(hWndDlg, IDC_CITY));
+ dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)L"");
+ SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, 0);
+ SendMessage(hWndCombo, CB_SETCURSEL, dwItem, 0);
- for(SIZE_T i=0;mrapPlaces[i].lpszData;i++)
+ for (size_t i = 0;mrapPlaces[i].lpszData;i++)
{
- if (mrapPlaces[i].dwCountryID==dwCountryID && mrapPlaces[i].dwCityID && mrapPlaces[i].dwPlaceID==0)
+ if (mrapPlaces[i].dwCountryID == dwCountryID && mrapPlaces[i].dwCityID && mrapPlaces[i].dwPlaceID == 0)
{
- dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)mrapPlaces[i].lpszData);
- SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,mrapPlaces[i].dwCityID);
+ dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)mrapPlaces[i].lpszData);
+ SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, mrapPlaces[i].dwCityID);
}
}
}
break;
case IDC_STATE:
- if (HIWORD(wParam)==CBN_SELCHANGE)
+ if (HIWORD(wParam) == CBN_SELCHANGE)
{
HWND hWndCombo;
- DWORD dwItem,dwCountryID,dwStateID;
+ DWORD dwItem, dwCountryID, dwStateID;
- dwCountryID=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_COUNTRY);
- dwStateID=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_STATE);
- hWndCombo=GetDlgItem(hWndDlg,IDC_CITY);
- SendMessage(hWndCombo,CB_RESETCONTENT,0,0);
- dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)L"");
- SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,0);
- SendMessage(hWndCombo,CB_SETCURSEL,dwItem,0);
+ dwCountryID = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_COUNTRY);
+ dwStateID = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_STATE);
+ hWndCombo = GetDlgItem(hWndDlg, IDC_CITY);
+ SendMessage(hWndCombo, CB_RESETCONTENT, 0, 0);
+ dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)L"");
+ SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, 0);
+ SendMessage(hWndCombo, CB_SETCURSEL, dwItem, 0);
- for(SIZE_T i=0;mrapPlaces[i].lpszData;i++)
+ for (size_t i = 0;mrapPlaces[i].lpszData;i++)
{
- if (mrapPlaces[i].dwCountryID==dwCountryID && mrapPlaces[i].dwCityID==dwStateID && mrapPlaces[i].dwPlaceID)
+ if (mrapPlaces[i].dwCountryID == dwCountryID && mrapPlaces[i].dwCityID == dwStateID && mrapPlaces[i].dwPlaceID)
{
- dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)mrapPlaces[i].lpszData);
- SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,mrapPlaces[i].dwPlaceID);
+ dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)mrapPlaces[i].lpszData);
+ SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, mrapPlaces[i].dwPlaceID);
}
}
}
@@ -298,64 +292,70 @@ INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,L
default:
break;
}
-return(FALSE);
+return FALSE;
}
-
-DWORD AdvancedSearchFromDlg(HWND hWndDlg)
+HWND CMraProto::SearchAdvanced(HWND hWndDlg)
{
- DWORD dwRequestFlags=0;
- CHAR szUser[MAX_PATH],szDomain[MAX_PATH];
- WCHAR wszNickName[MAX_PATH],wszFirstName[MAX_PATH],wszLastName[MAX_PATH];
- SIZE_T dwUserSize,dwDomainSize,dwNickNameSize,dwFirstNameSize,dwLastNameSize;
- DWORD dwSex,dwDate1,dwDate2,dwCityID,dwZodiak,dwBirthdayMonth,dwBirthdayDay,dwCountryID,dwOnline;
-
-
- dwUserSize=GET_DLG_ITEM_TEXTA(hWndDlg,IDC_EMAIL_USER,szUser,SIZEOF(szUser));
- dwDomainSize=GET_DLG_ITEM_TEXTA(hWndDlg,IDC_EMAIL_DOMAIN,szDomain,SIZEOF(szDomain));
+ DWORD dwRequestFlags = 0;
+ CHAR szUser[MAX_PATH], szDomain[MAX_PATH];
+ WCHAR wszNickName[MAX_PATH], wszFirstName[MAX_PATH], wszLastName[MAX_PATH];
+ size_t dwUserSize, dwDomainSize, dwNickNameSize, dwFirstNameSize, dwLastNameSize;
+ DWORD dwSex, dwDate1, dwDate2, dwCityID, dwZodiak, dwBirthdayMonth, dwBirthdayDay, dwCountryID, dwOnline;
+
+ dwUserSize = GET_DLG_ITEM_TEXTA(hWndDlg, IDC_EMAIL_USER, szUser, SIZEOF(szUser));
+ dwDomainSize = GET_DLG_ITEM_TEXTA(hWndDlg, IDC_EMAIL_DOMAIN, szDomain, SIZEOF(szDomain));
if (dwUserSize && dwDomainSize)
{
- SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_USER);
- SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_DOMAIN);
+ SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_USER);
+ SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_DOMAIN);
}
- dwNickNameSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_NICK,wszNickName,SIZEOF(wszNickName));
- if (dwNickNameSize) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_NICKNAME);
+ dwNickNameSize = GET_DLG_ITEM_TEXT(hWndDlg, IDC_NICK, wszNickName, SIZEOF(wszNickName));
+ if (dwNickNameSize) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_NICKNAME);
- dwFirstNameSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_FIRSTNAME,wszFirstName,SIZEOF(wszFirstName));
- if (dwFirstNameSize) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME);
+ dwFirstNameSize = GET_DLG_ITEM_TEXT(hWndDlg, IDC_FIRSTNAME, wszFirstName, SIZEOF(wszFirstName));
+ if (dwFirstNameSize) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME);
- dwLastNameSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_LASTNAME,wszLastName,SIZEOF(wszLastName));
- if (dwLastNameSize) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_LASTNAME);
+ dwLastNameSize = GET_DLG_ITEM_TEXT(hWndDlg, IDC_LASTNAME, wszLastName, SIZEOF(wszLastName));
+ if (dwLastNameSize) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_LASTNAME);
- dwSex=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_GENDER);
- if (dwSex) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_SEX);
+ dwSex = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_GENDER);
+ if (dwSex) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_SEX);
- dwDate1=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_AGERANGE_FROM);
- if (dwDate1) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_DATE1);
+ dwDate1 = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_AGERANGE_FROM);
+ if (dwDate1) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_DATE1);
- dwDate2=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_AGERANGE_TO);
- if (dwDate2) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_DATE2);
+ dwDate2 = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_AGERANGE_TO);
+ if (dwDate2) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_DATE2);
- dwCityID=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_CITY);
- if (dwCityID==0) dwCityID=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_STATE);
- if (dwCityID) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_CITY_ID);
+ dwCityID = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_CITY);
+ if (dwCityID == 0) dwCityID = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_STATE);
+ if (dwCityID) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_CITY_ID);
- dwZodiak=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_ZODIAK);
- if (dwZodiak) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_ZODIAC);
+ dwZodiak = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_ZODIAK);
+ if (dwZodiak) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_ZODIAC);
- dwBirthdayMonth=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_BIRTHDAY_MONTH);
- if (dwBirthdayMonth) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH);
+ dwBirthdayMonth = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_BIRTHDAY_MONTH);
+ if (dwBirthdayMonth) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH);
- dwBirthdayDay=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_BIRTHDAY_DAY);
- if (dwBirthdayMonth) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY);
+ dwBirthdayDay = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_BIRTHDAY_DAY);
+ if (dwBirthdayMonth) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY);
- dwCountryID=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_COUNTRY);
- if (dwCountryID) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID);
+ dwCountryID = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_COUNTRY);
+ if (dwCountryID) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID);
- dwOnline=IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_ONLINEONLY);
- if (dwOnline) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_ONLINE);
+ dwOnline = IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ONLINEONLY);
+ if (dwOnline) SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_ONLINE);
-return(MraSendCommand_WPRequestW(NULL,ACKTYPE_SEARCH,dwRequestFlags,szUser,dwUserSize,szDomain,dwDomainSize,wszNickName,dwNickNameSize,wszFirstName,dwFirstNameSize,wszLastName,dwLastNameSize,dwSex,dwDate1,dwDate2,dwCityID,dwZodiak,dwBirthdayMonth,dwBirthdayDay,dwCountryID,dwOnline));
-} \ No newline at end of file
+ return (HWND)MraWPRequestW(NULL, ACKTYPE_SEARCH, dwRequestFlags, szUser, dwUserSize, szDomain, dwDomainSize, wszNickName, dwNickNameSize, wszFirstName, dwFirstNameSize, wszLastName, dwLastNameSize, dwSex, dwDate1, dwDate2, dwCityID, dwZodiak, dwBirthdayMonth, dwBirthdayDay, dwCountryID, dwOnline);
+}
+
+HWND CMraProto::CreateExtendedSearchUI(HWND owner)
+{
+ if (masMraSettings.hInstance && owner)
+ return CreateDialogParam(masMraSettings.hInstance, MAKEINTRESOURCE(IDD_MRAADVANCEDSEARCH), owner, AdvancedSearchDlgProc, (LPARAM)this);
+
+ return NULL;
+}
diff --git a/protocols/MRA/MraAntiSpam.cpp b/protocols/MRA/MraAntiSpam.cpp
index 002aa3cd08..70e1cb3a57 100644
--- a/protocols/MRA/MraAntiSpam.cpp
+++ b/protocols/MRA/MraAntiSpam.cpp
@@ -4,537 +4,441 @@
#include "MraAntiSpam.h"
#include "MraRTFMsg.h"
-
typedef struct
{
LPWSTR lpwszBadWord;
DWORD dwBadWordLen;
} MRA_ANTISPAM_BAD_WORD;
-static MRA_ANTISPAM_BAD_WORD *pmabwBadWords=NULL;
-static SIZE_T dwBadWordsCount=0;
-
-
+static MRA_ANTISPAM_BAD_WORD *pmabwBadWords = NULL;
+static size_t dwBadWordsCount = 0;
#define MRA_ANTISPAM_PREALLOC_COUNT 256
-SIZE_T MraAntiSpamLoadBadWordsW()
-{
- SIZE_T dwRet=0;
+size_t MraAntiSpamLoadBadWordsW()
+{
char szSettingName[MAX_PATH];
- SIZE_T i=0,dwValueSize,dwAllocatedItemsCount=MRA_ANTISPAM_PREALLOC_COUNT;
- DBVARIANT dbv={0};
- DBCONTACTGETSETTING sVal={0};
-
- dbv.type=DBVT_WCHAR;
- sVal.pValue=&dbv;
- sVal.szModule=PROTOCOL_NAMEA;
- sVal.szSetting=szSettingName;
+ size_t i = 0, dwValueSize, dwAllocatedItemsCount = MRA_ANTISPAM_PREALLOC_COUNT;
+ DBVARIANT dbv = {0};
+ DBCONTACTGETSETTING sVal = {0};
+ dbv.type = DBVT_WCHAR;
+ sVal.pValue = &dbv;
+ sVal.szModule = "MRA";
+ sVal.szSetting = szSettingName;
- if (pmabwBadWords || dwBadWordsCount) MraAntiSpamFreeBadWords();
+ if (pmabwBadWords || dwBadWordsCount)
+ MraAntiSpamFreeBadWords();
- pmabwBadWords=(MRA_ANTISPAM_BAD_WORD*)MEMALLOC((sizeof(MRA_ANTISPAM_BAD_WORD)*dwAllocatedItemsCount));
+ pmabwBadWords = (MRA_ANTISPAM_BAD_WORD*)mir_calloc((sizeof(MRA_ANTISPAM_BAD_WORD)*dwAllocatedItemsCount));
- for(i=0;TRUE;i++)
- {
- mir_snprintf(szSettingName,SIZEOF(szSettingName),"AntiSpamBadWord %lu",i);
- dbv.type=DBVT_WCHAR;
- if (CallService(MS_DB_CONTACT_GETSETTING_STR,NULL,(LPARAM)&sVal))
- {
+ for (i = 0;TRUE;i++) {
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "AntiSpamBadWord %lu", i);
+ dbv.type = DBVT_WCHAR;
+ if (CallService(MS_DB_CONTACT_GETSETTING_STR, NULL, (LPARAM)&sVal))
break;
- }else{
- if (dwAllocatedItemsCount==i)
- {
- dwAllocatedItemsCount+=MRA_ANTISPAM_PREALLOC_COUNT;
- pmabwBadWords=(MRA_ANTISPAM_BAD_WORD*)MEMREALLOC(pmabwBadWords,(sizeof(MRA_ANTISPAM_BAD_WORD)*dwAllocatedItemsCount));
- if (pmabwBadWords==NULL) break;
- }
-
- dwValueSize=lstrlenW(dbv.pwszVal);
- pmabwBadWords[i].lpwszBadWord=(LPWSTR)MEMALLOC((dwValueSize*sizeof(WCHAR)));
- if (pmabwBadWords[i].lpwszBadWord)
- {//BuffToLowerCase(szValue,dbv.pszVal,dwValueSize);
- memmove(pmabwBadWords[i].lpwszBadWord,dbv.pwszVal,(dwValueSize*sizeof(WCHAR)));
- CharLowerBuffW(pmabwBadWords[i].lpwszBadWord,dwValueSize);
- pmabwBadWords[i].dwBadWordLen=dwValueSize;
- }
- DBFreeVariant(&dbv);
+
+ if (dwAllocatedItemsCount == i) {
+ dwAllocatedItemsCount += MRA_ANTISPAM_PREALLOC_COUNT;
+ pmabwBadWords = (MRA_ANTISPAM_BAD_WORD*)mir_realloc(pmabwBadWords, (sizeof(MRA_ANTISPAM_BAD_WORD)*dwAllocatedItemsCount));
+ if (pmabwBadWords == NULL)
+ break;
+ }
- if (pmabwBadWords[i].lpwszBadWord==NULL) break;
+ dwValueSize = lstrlenW(dbv.pwszVal);
+ pmabwBadWords[i].lpwszBadWord = (LPWSTR)mir_calloc((dwValueSize*sizeof(WCHAR)));
+ if (pmabwBadWords[i].lpwszBadWord) {
+ memmove(pmabwBadWords[i].lpwszBadWord, dbv.pwszVal, (dwValueSize*sizeof(WCHAR)));
+ CharLowerBuffW(pmabwBadWords[i].lpwszBadWord, dwValueSize);
+ pmabwBadWords[i].dwBadWordLen = dwValueSize;
}
+ DBFreeVariant(&dbv);
+
+ if (pmabwBadWords[i].lpwszBadWord == NULL)
+ break;
}
- dwBadWordsCount=i;
+ dwBadWordsCount = i;
-return(dwRet);
+ return 0;
}
void MraAntiSpamFreeBadWords()
{
- SIZE_T i;
-
- for(i=0;i<dwBadWordsCount;i++)
- {
- if (pmabwBadWords[i].lpwszBadWord) MEMFREE(pmabwBadWords[i].lpwszBadWord);
- }
+ for (size_t i = 0; i < dwBadWordsCount; i++)
+ mir_free(pmabwBadWords[i].lpwszBadWord);
- MEMFREE(pmabwBadWords);
- dwBadWordsCount=0;
+ mir_free(pmabwBadWords);
+ dwBadWordsCount = 0;
}
+static WORD wMraAntiSpamControlsList[] = {
+ IDC_CHK_TEMP_CONTACTS, IDC_CLN_NON_ALPHNUM, IDC_MAX_LANG_CHANGES, IDC_SHOWPOPUP, IDC_WRITETOSYSTEMHISTORY, IDC_SEND_SPAM_REPORT_TO_SERVER,
+ IDC_BAD_WORDS_LIST, IDC_EDIT_BAD_WORD, IDC_BUTTON_ADD, IDC_BUTTONREMOVE, IDC_BUTTON_DEFAULT };
-
-
-void MraAntiSpamEnableControls(HWND hWndDlg,BOOL bEnabled)
+void MraAntiSpamEnableControls(HWND hWndDlg, BOOL bEnabled)
{
- WORD wMraAntiSpamControlsList[]={
- IDC_CHK_TEMP_CONTACTS,
- IDC_CLN_NON_ALPHNUM,
- IDC_MAX_LANG_CHANGES,
- IDC_SHOWPOPUP,
- IDC_WRITETOSYSTEMHISTORY,
- IDC_SEND_SPAM_REPORT_TO_SERVER,
- IDC_BAD_WORDS_LIST,
- IDC_EDIT_BAD_WORD,
- IDC_BUTTON_ADD,
- IDC_BUTTONREMOVE,
- IDC_BUTTON_DEFAULT
- };
-
- EnableControlsArray(hWndDlg,(WORD*)&wMraAntiSpamControlsList,SIZEOF(wMraAntiSpamControlsList),bEnabled);
- EnableWindow(GetDlgItem(hWndDlg,IDC_DELETE_SPAMBOT_CONTACT),(bEnabled && IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_CHK_TEMP_CONTACTS)));
+ EnableControlsArray(hWndDlg, (WORD*)&wMraAntiSpamControlsList, SIZEOF(wMraAntiSpamControlsList), bEnabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_DELETE_SPAMBOT_CONTACT), (bEnabled && IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_TEMP_CONTACTS)));
}
-INT_PTR CALLBACK MraAntiSpamDlgProcOpts(HWND hWndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK MraAntiSpamDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg){
+ CMraProto *ppro = (CMraProto*)GetWindowLongPtr(hWndDlg, GWLP_USERDATA);
+
+ switch (msg) {
case WM_INITDIALOG:
+ TranslateDialogDefault(hWndDlg);
+ SetWindowLongPtr(hWndDlg, GWLP_USERDATA, lParam);
+ ppro = (CMraProto*)lParam;
+
+ CHECK_DLG_BUTTON(hWndDlg, IDC_ENABLE, ppro->mraGetByte(NULL, "AntiSpamEnable", MRA_ANTISPAM_DEFAULT_ENABLE));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_CHK_TEMP_CONTACTS, ppro->mraGetByte(NULL, "AntiSpamCheckTempContacts", MRA_ANTISPAM_DEFAULT_CHK_TEMP_CONTACTS));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_DELETE_SPAMBOT_CONTACT, ppro->mraGetByte(NULL, "AntiSpamDeteleSpamBotContacts", MRA_ANTISPAM_DEFAULT_DELETE_SPAMBOT_CONTACT));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_CLN_NON_ALPHNUM, ppro->mraGetByte(NULL, "AntiSpamCleanNonAlphaNumeric", MRA_ANTISPAM_DEFAULT_CLN_NON_ALPHNUM));
+ SetDlgItemInt(hWndDlg, IDC_MAX_LANG_CHANGES, ppro->mraGetDword(NULL, "AntiSpamMaxLangChanges", MRA_ANTISPAM_DEFAULT_MAX_LNG_CHANGES), FALSE);
+ CHECK_DLG_BUTTON(hWndDlg, IDC_SHOWPOPUP, ppro->mraGetByte(NULL, "AntiSpamShowPopUp", MRA_ANTISPAM_DEFAULT_SHOWPOP));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_WRITETOSYSTEMHISTORY, ppro->mraGetByte(NULL, "AntiSpamWriteToSystemHistory", MRA_ANTISPAM_DEFAULT_WRITETOSYSTEMHISTORY));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_SEND_SPAM_REPORT_TO_SERVER, ppro->mraGetByte(NULL, "AntiSpamSendSpamReportToSrv", MRA_ANTISPAM_DEFAULT_SEND_SPAM_REPORT_TO_SERVER));
{
- TranslateDialogDefault(hWndDlg);
-
- CHECK_DLG_BUTTON(hWndDlg,IDC_ENABLE,DB_Mra_GetByte(NULL,"AntiSpamEnable",MRA_ANTISPAM_DEFAULT_ENABLE));
- CHECK_DLG_BUTTON(hWndDlg,IDC_CHK_TEMP_CONTACTS,DB_Mra_GetByte(NULL,"AntiSpamCheckTempContacts",MRA_ANTISPAM_DEFAULT_CHK_TEMP_CONTACTS));
- CHECK_DLG_BUTTON(hWndDlg,IDC_DELETE_SPAMBOT_CONTACT,DB_Mra_GetByte(NULL,"AntiSpamDeteleSpamBotContacts",MRA_ANTISPAM_DEFAULT_DELETE_SPAMBOT_CONTACT));
- CHECK_DLG_BUTTON(hWndDlg,IDC_CLN_NON_ALPHNUM,DB_Mra_GetByte(NULL,"AntiSpamCleanNonAlphaNumeric",MRA_ANTISPAM_DEFAULT_CLN_NON_ALPHNUM));
- SetDlgItemInt(hWndDlg,IDC_MAX_LANG_CHANGES,DB_Mra_GetDword(NULL,"AntiSpamMaxLangChanges",MRA_ANTISPAM_DEFAULT_MAX_LNG_CHANGES),FALSE);
- CHECK_DLG_BUTTON(hWndDlg,IDC_SHOWPOPUP,DB_Mra_GetByte(NULL,"AntiSpamShowPopUp",MRA_ANTISPAM_DEFAULT_SHOWPOP));
- CHECK_DLG_BUTTON(hWndDlg,IDC_WRITETOSYSTEMHISTORY,DB_Mra_GetByte(NULL,"AntiSpamWriteToSystemHistory",MRA_ANTISPAM_DEFAULT_WRITETOSYSTEMHISTORY));
- CHECK_DLG_BUTTON(hWndDlg,IDC_SEND_SPAM_REPORT_TO_SERVER,DB_Mra_GetByte(NULL,"AntiSpamSendSpamReportToSrv",MRA_ANTISPAM_DEFAULT_SEND_SPAM_REPORT_TO_SERVER));
-
-
- {// fill list
- char szSettingName[MAX_PATH];
- WCHAR wszBuff[MAX_PATH];
-
- SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_RESETCONTENT,0,0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_INITSTORAGE,(WPARAM)1024,(LPARAM)32768);
- for(SIZE_T i=0;TRUE;i++)
- {
- mir_snprintf(szSettingName,SIZEOF(szSettingName),"AntiSpamBadWord %lu",i);
- if (DB_Mra_GetStaticStringW(NULL,szSettingName,wszBuff,SIZEOF(wszBuff),NULL))
- {
- if (SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_FINDSTRING,-1,(LPARAM)wszBuff)==LB_ERR) SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_ADDSTRING,0,(LPARAM)wszBuff);
- }else{
- break;
- }
+ // fill list
+ char szSettingName[MAX_PATH];
+ WCHAR wszBuff[MAX_PATH];
+
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BAD_WORDS_LIST, LB_RESETCONTENT, 0, 0);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BAD_WORDS_LIST, LB_INITSTORAGE, (WPARAM)1024, (LPARAM)32768);
+ for (size_t i = 0; TRUE; i++) {
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "AntiSpamBadWord %lu", i);
+ if (ppro->mraGetStaticStringW(NULL, szSettingName, wszBuff, SIZEOF(wszBuff), NULL)) {
+ if (SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BAD_WORDS_LIST, LB_FINDSTRING, -1, (LPARAM)wszBuff) == LB_ERR)
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BAD_WORDS_LIST, LB_ADDSTRING, 0, (LPARAM)wszBuff);
}
+ else break;
}
- //SET_DLG_ITEM_TEXTW(hWndDlg,IDC_EDIT_BAD_WORD,L"");
-
- MraAntiSpamEnableControls(hWndDlg,IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_ENABLE));
}
- return(TRUE);
+
+ MraAntiSpamEnableControls(hWndDlg, IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ENABLE));
+ return TRUE;
+
case WM_COMMAND:
- if (LOWORD(wParam)==IDC_ENABLE)
- {
- MraAntiSpamEnableControls(hWndDlg,IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_ENABLE));
- }
+ if (LOWORD(wParam) == IDC_ENABLE)
+ MraAntiSpamEnableControls(hWndDlg, IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ENABLE));
- if (LOWORD(wParam)==IDC_CHK_TEMP_CONTACTS)
- {
- EnableWindow(GetDlgItem(hWndDlg,IDC_DELETE_SPAMBOT_CONTACT),IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_CHK_TEMP_CONTACTS));
- }
+ if (LOWORD(wParam) == IDC_CHK_TEMP_CONTACTS)
+ EnableWindow(GetDlgItem(hWndDlg, IDC_DELETE_SPAMBOT_CONTACT), IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_TEMP_CONTACTS));
- if (LOWORD(wParam)==IDC_BUTTON_ADD)
- {
+ if (LOWORD(wParam) == IDC_BUTTON_ADD) {
WCHAR szBadWord[MAX_PATH];
- if (GET_DLG_ITEM_TEXT(hWndDlg,IDC_EDIT_BAD_WORD,szBadWord,SIZEOF(szBadWord)))
- {
- SET_DLG_ITEM_TEXTW(hWndDlg,IDC_EDIT_BAD_WORD,L"");
- if (SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_FINDSTRING,-1,(LPARAM)szBadWord)==LB_ERR) SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_ADDSTRING,0,(LPARAM)szBadWord);
+ if (GET_DLG_ITEM_TEXT(hWndDlg, IDC_EDIT_BAD_WORD, szBadWord, SIZEOF(szBadWord))) {
+ SET_DLG_ITEM_TEXTW(hWndDlg, IDC_EDIT_BAD_WORD, L"");
+ if (SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BAD_WORDS_LIST, LB_FINDSTRING, -1, (LPARAM)szBadWord) == LB_ERR) SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BAD_WORDS_LIST, LB_ADDSTRING, 0, (LPARAM)szBadWord);
}
}
- if (LOWORD(wParam)==IDC_BUTTONREMOVE)
- {
- SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_DELETESTRING,SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_GETCURSEL,0,0),0);
- }
+ if (LOWORD(wParam) == IDC_BUTTONREMOVE)
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BAD_WORDS_LIST, LB_DELETESTRING, SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BAD_WORDS_LIST, LB_GETCURSEL, 0, 0), 0);
- if (LOWORD(wParam)==IDC_BUTTON_DEFAULT)
- {
+ if (LOWORD(wParam) == IDC_BUTTON_DEFAULT) {
MraAntiSpamResetBadWordsList();
- {// fill list
- char szSettingName[MAX_PATH];
- WCHAR wszBuff[MAX_PATH];
-
- SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_RESETCONTENT,0,0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_INITSTORAGE,(WPARAM)1024,(LPARAM)32768);
- for(SIZE_T i=0;TRUE;i++)
- {
- mir_snprintf(szSettingName,SIZEOF(szSettingName),"AntiSpamBadWord %lu",i);
- if (DB_Mra_GetStaticStringW(NULL,szSettingName,wszBuff,SIZEOF(wszBuff),NULL))
- {
- if (SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_FINDSTRING,-1,(LPARAM)wszBuff)==LB_ERR) SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_ADDSTRING,0,(LPARAM)wszBuff);
- }else{
- break;
- }
+
+ char szSettingName[MAX_PATH];
+ WCHAR wszBuff[MAX_PATH];
+
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BAD_WORDS_LIST, LB_RESETCONTENT, 0, 0);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BAD_WORDS_LIST, LB_INITSTORAGE, (WPARAM)1024, (LPARAM)32768);
+ for (size_t i = 0;TRUE;i++) {
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "AntiSpamBadWord %lu", i);
+ if (ppro->mraGetStaticStringW(NULL, szSettingName, wszBuff, SIZEOF(wszBuff), NULL)) {
+ if (SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BAD_WORDS_LIST, LB_FINDSTRING, -1, (LPARAM)wszBuff) == LB_ERR)
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BAD_WORDS_LIST, LB_ADDSTRING, 0, (LPARAM)wszBuff);
}
+ else break;
}
MraAntiSpamLoadBadWordsW();
}
- if ((LOWORD(wParam)==IDC_EDIT_BAD_WORD) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return(0);
- SendMessage(GetParent(hWndDlg),PSM_CHANGED,0,0);
+ if ((LOWORD(wParam) == IDC_EDIT_BAD_WORD) && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) return 0;
+ SendMessage(GetParent(hWndDlg), PSM_CHANGED, 0, 0);
break;
+
case WM_NOTIFY:
- switch (((LPNMHDR)lParam)->code){
+ switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
{
char szSettingName[MAX_PATH];
WCHAR szBadWord[MAX_PATH];
- SIZE_T i,dwCount;
-
- DBWriteContactSettingByte(NULL,PROTOCOL_NAMEA,"AntiSpamEnable",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_ENABLE));
- DBWriteContactSettingByte(NULL,PROTOCOL_NAMEA,"AntiSpamCheckTempContacts",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_CHK_TEMP_CONTACTS));
- DBWriteContactSettingByte(NULL,PROTOCOL_NAMEA,"AntiSpamDeteleSpamBotContacts",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_DELETE_SPAMBOT_CONTACT));
- DBWriteContactSettingByte(NULL,PROTOCOL_NAMEA,"AntiSpamCleanNonAlphaNumeric",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_CLN_NON_ALPHNUM));
- DB_Mra_SetDword(NULL,"AntiSpamMaxLangChanges",(DWORD)GetDlgItemInt(hWndDlg,IDC_MAX_LANG_CHANGES,NULL,FALSE));
- DBWriteContactSettingByte(NULL,PROTOCOL_NAMEA,"AntiSpamShowPopUp",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_SHOWPOPUP));
- DBWriteContactSettingByte(NULL,PROTOCOL_NAMEA,"AntiSpamWriteToSystemHistory",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_WRITETOSYSTEMHISTORY));
- DBWriteContactSettingByte(NULL,PROTOCOL_NAMEA,"AntiSpamSendSpamReportToSrv",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_SEND_SPAM_REPORT_TO_SERVER));
-
- dwCount=SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_GETCOUNT,0,0);
- for(i=0;i<dwCount;i++)
- {
- mir_snprintf(szSettingName,SIZEOF(szSettingName),"AntiSpamBadWord %lu",i);
- SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_GETTEXT,i,(LPARAM)szBadWord);
- DB_Mra_SetStringW(NULL,szSettingName,szBadWord);
+ size_t i, dwCount;
+
+ ppro->mraSetByte(NULL, "AntiSpamEnable", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ENABLE));
+ ppro->mraSetByte(NULL, "AntiSpamCheckTempContacts", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_TEMP_CONTACTS));
+ ppro->mraSetByte(NULL, "AntiSpamDeteleSpamBotContacts", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_DELETE_SPAMBOT_CONTACT));
+ ppro->mraSetByte(NULL, "AntiSpamCleanNonAlphaNumeric", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CLN_NON_ALPHNUM));
+ ppro->mraSetDword(NULL, "AntiSpamMaxLangChanges", (DWORD)GetDlgItemInt(hWndDlg, IDC_MAX_LANG_CHANGES, NULL, FALSE));
+ ppro->mraSetByte(NULL, "AntiSpamShowPopUp", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_SHOWPOPUP));
+ ppro->mraSetByte(NULL, "AntiSpamWriteToSystemHistory", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_WRITETOSYSTEMHISTORY));
+ ppro->mraSetByte(NULL, "AntiSpamSendSpamReportToSrv", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_SEND_SPAM_REPORT_TO_SERVER));
+
+ dwCount = SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BAD_WORDS_LIST, LB_GETCOUNT, 0, 0);
+ for (i = 0; i < dwCount; i++) {
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "AntiSpamBadWord %lu", i);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_BAD_WORDS_LIST, LB_GETTEXT, i, (LPARAM)szBadWord);
+ ppro->mraSetStringW(NULL, szSettingName, szBadWord);
}
- dwCount=((i*2)+1024);
- for (;i<dwCount;i++)
- {
- mir_snprintf(szSettingName,SIZEOF(szSettingName),"AntiSpamBadWord %lu",i);
- DB_Mra_DeleteValue(NULL,szSettingName);
+ dwCount = ((i*2)+1024);
+ for (; i < dwCount; i++) {
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "AntiSpamBadWord %lu", i);
+ ppro->mraDelValue(NULL, szSettingName);
}
MraAntiSpamLoadBadWordsW();
}
- return(TRUE);
+ return TRUE;
}
break;
}
-return(FALSE);
+ return FALSE;
}
+///////////////////////////////////////////////////////////////////////////////
-void MraAntiSpamResetBadWordsList()
+static LPWSTR lpwszBadWords[] =
{
- char szSettingName[MAX_PATH];
- SIZE_T i,dwMax;
- LPWSTR lpwszBadWords[]=
- {
- // web words
- L"@",L"http://",L"ftp://",L"www",L"wap.",L".com",L".org",L".info",L".net",L".ua",L".uz",L".to",L".biz",L".vu",L".ru",L"mailto:",L"ICQ",L"SKYPE",
+ // web words
+ L"@", L"http://", L"ftp://", L"www", L"wap.", L".com", L".org", L".info", L".net", L".ua", L".uz", L".to", L".biz", L".vu", L".ru", L"mailto:", L"ICQ", L"SKYPE",
- // spam words
- L"sex",L"seks",L"sekc",L"xxx",L"phorno",L"video",L"photo",L"SMS",L"WMZ",L"WMR",L"narod",L"ucoz",L"ref",L"Agent",L"+7",L"495",L"$",L"spam",L"URL",L"%2E",
+ // spam words
+ L"sex", L"seks", L"sekc", L"xxx", L"phorno", L"video", L"photo", L"SMS", L"WMZ", L"WMR", L"narod", L"ucoz", L"ref", L"Agent", L"+7", L"495", L"$", L"spam", L"URL", L"%2E",
- // spam words rus
- L"прода",L"цена",L"деньги",L"денег",L"секс",L"лесби",L"лезби",L"анал",L"порн",L"эротич",L"видео",L"фильм",L"кино",L"муз",L"фотки",L"фото",L"СМС",L"аськ",L"база",L"сайт",L"проект",L"рассылк",L"обьявлен",L"реклам",L"услуг",L"оплат",L"заказ",L"пиши",L"звони",L"работ",L"зараб",L"зайди",L"загляни",L"посети",L"посмотр",L"погляд",L"точка",L"тчк",L"спам",L"ссылк",L"майл",L"агент",L"супер",L"лох",L"регистрац",L"троян",L"вирус",L"взлом",
+ // spam words rus
+ L"прода", L"цена", L"деньги", L"денег", L"секс", L"лесби", L"лезби", L"анал", L"порн", L"эротич", L"видео", L"фильм", L"кино", L"муз", L"фотки", L"фото", L"СМС", L"аськ", L"база", L"сайт", L"проект", L"рассылк", L"обьявлен", L"реклам", L"услуг", L"оплат", L"заказ", L"пиши", L"звони", L"работ", L"зараб", L"зайди", L"загляни", L"посети", L"посмотр", L"погляд", L"точка", L"тчк", L"спам", L"ссылк", L"майл", L"агент", L"супер", L"лох", L"регистрац", L"троян", L"вирус", L"взлом",
- // executable
- L".ade",L".adp",L".bas",L".bat",L".chm",L".cmd",L".com",L".cpl",L".crt",L".exe",L".hlp",L".hta",L".inf",L".ins",L".isp",L".js",L".jse",L".lnk",L".mdb",L".mde",L".msc",L".msi",L".msp",L".mst",L".pcd",L".pif",L".reg",L".scr",L".sct",L".shs",L".shb",L".url",L".vb",L".vbe",L".vbs",L".wsc",L".wsf",L".wsh",
+ // executable
+ L".ade", L".adp", L".bas", L".bat", L".chm", L".cmd", L".com", L".cpl", L".crt", L".exe", L".hlp", L".hta", L".inf", L".ins", L".isp", L".js", L".jse", L".lnk", L".mdb", L".mde", L".msc", L".msi", L".msp", L".mst", L".pcd", L".pif", L".reg", L".scr", L".sct", L".shs", L".shb", L".url", L".vb", L".vbe", L".vbs", L".wsc", L".wsf", L".wsh",
- // archives
- L".zip",L".rar",L".cab",L".arj",L".tar",L".gz",L".zoo",L".lzh",L".jar",L".ace",L".z",L".iso",L".bz2",L".uue",L".gzip",
+ // archives
+ L".zip", L".rar", L".cab", L".arj", L".tar", L".gz", L".zoo", L".lzh", L".jar", L".ace", L".z", L".iso", L".bz2", L".uue", L".gzip",
- NULL
- };
+ NULL
+};
- for(i=0;lpwszBadWords[i];i++)
- {
- mir_snprintf(szSettingName,SIZEOF(szSettingName),"AntiSpamBadWord %lu",i);
- DB_Mra_SetStringW(NULL,szSettingName,lpwszBadWords[i]);
+void MraAntiSpamResetBadWordsList()
+{
+ char szSettingName[MAX_PATH];
+ size_t i, dwMax;
+
+ for (i = 0; lpwszBadWords[i]; i++) {
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "AntiSpamBadWord %lu", i);
+ db_set_ws(NULL, "MRA", szSettingName, lpwszBadWords[i]);
}
- dwMax=(i+1024);
- for (;i<dwMax;i++)
- {
- mir_snprintf(szSettingName,SIZEOF(szSettingName),"AntiSpamBadWord %lu",i);
- DB_Mra_DeleteValue(NULL,szSettingName);
+ dwMax = (i+1024);
+ for (; i < dwMax; i++) {
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "AntiSpamBadWord %lu", i);
+ db_unset(NULL, "MRA", szSettingName);
}
}
+///////////////////////////////////////////////////////////////////////////////
+
+static WCHAR lpwszExceptedChars[] = L"\r\n .,<>//?;:'\"\\][}{`-=~!@#$%^&*()_+№1234567890";
BOOL MraAntiSpamIsCharExcepted(WCHAR wcTestChar)
{
- BOOL bRet=FALSE;
- SIZE_T i;
- LPWSTR lpwszExceptedChars=L"\r\n .,<>//?;:'\"\\][}{`-=~!@#$%^&*()_+№1234567890";
-
- //lstrlenW(lpwszExceptedChars)=46
- for(i=0;i<46;i++)
- {
- if (lpwszExceptedChars[i]==wcTestChar)
- {
- bRet=TRUE;
- break;
- }
- }
-return(bRet);
-}
+ for (size_t i = 0; i < SIZEOF(lpwszExceptedChars); i++)
+ if (lpwszExceptedChars[i] == wcTestChar)
+ return TRUE;
+ return FALSE;
+}
-SIZE_T MraAntiSpamCalcLangChanges(LPWSTR lpwszMessage,SIZE_T dwMessageSize)
+size_t MraAntiSpamCalcLangChanges(LPWSTR lpwszMessage, size_t dwMessageSize)
{
- SIZE_T dwRet=0;
+ size_t dwRet = 0;
- if (lpwszMessage && dwMessageSize)
- {
- WCHAR wcPrevChar=0;
- SIZE_T i;
-
- for(i=1;i<dwMessageSize;i++)
- {
- if (MraAntiSpamIsCharExcepted(lpwszMessage[i])==FALSE)
- {
+ if (lpwszMessage && dwMessageSize) {
+ WCHAR wcPrevChar = 0;
+ for (size_t i = 1; i < dwMessageSize; i++) {
+ if (MraAntiSpamIsCharExcepted(lpwszMessage[i]) == FALSE) {
if (wcPrevChar)
- if ( (max(wcPrevChar,lpwszMessage[i])-min(wcPrevChar,lpwszMessage[i])) > 255)
- {
- dwRet++;
- }
- wcPrevChar=lpwszMessage[i];
+ if ( (max(wcPrevChar, lpwszMessage[i])-min(wcPrevChar, lpwszMessage[i])) > 255)
+ dwRet++;
+
+ wcPrevChar = lpwszMessage[i];
}
}
}
-return(dwRet);
-}
+ return dwRet;
+}
-SIZE_T MraAntiSpamCleanNonAlphaNumeric(LPWSTR lpwszMessage,SIZE_T dwMessageSize)
+size_t MraAntiSpamCleanNonAlphaNumeric(LPWSTR lpwszMessage, size_t dwMessageSize)
{
- SIZE_T dwRet=0;
-
- if (lpwszMessage && dwMessageSize)
- {
- LPWSTR lpwszCurWritePos=lpwszMessage;
- SIZE_T i;
+ size_t dwRet = 0;
- for(i=0;i<dwMessageSize;i++)
- {
- if (IsCharAlphaNumeric(lpwszMessage[i])) (*lpwszCurWritePos++)=lpwszMessage[i];
- }
+ if (lpwszMessage && dwMessageSize) {
+ LPWSTR lpwszCurWritePos = lpwszMessage;
+ for (size_t i = 0;i<dwMessageSize;i++)
+ if (IsCharAlphaNumeric(lpwszMessage[i]))
+ *lpwszCurWritePos++ = lpwszMessage[i];
- (*lpwszCurWritePos)=0;
- dwRet=(lpwszCurWritePos-lpwszMessage);
+ *lpwszCurWritePos = 0;
+ dwRet = lpwszCurWritePos - lpwszMessage;
}
-return(dwRet);
+ return dwRet;
}
-BOOL MraAntiSpamTestMessageForBadWordsW(LPWSTR lpwszMessage,SIZE_T dwMessageSize)
+BOOL MraAntiSpamTestMessageForBadWordsW(LPWSTR lpwszMessage, size_t dwMessageSize)
{
- BOOL bRet=FALSE;
-
if (lpwszMessage && dwMessageSize)
- {
- for(SIZE_T i=0;i<dwBadWordsCount;i++)
- {
- if (MemoryFind(0,lpwszMessage,(dwMessageSize*sizeof(WCHAR)),pmabwBadWords[i].lpwszBadWord,(pmabwBadWords[i].dwBadWordLen*sizeof(WCHAR))))
- {
- bRet=TRUE;
- break;
- }
- }
- }
-return(bRet);
-}
-
+ for (size_t i = 0; i < dwBadWordsCount; i++)
+ if (MemoryFind(0, lpwszMessage, (dwMessageSize*sizeof(WCHAR)), pmabwBadWords[i].lpwszBadWord, (pmabwBadWords[i].dwBadWordLen*sizeof(WCHAR))))
+ return TRUE;
+ return FALSE;
+}
-BOOL MraAntiSpamHasMessageBadWordsW(LPWSTR lpwszMessage,SIZE_T dwMessageSize)
+BOOL CMraProto::MraAntiSpamHasMessageBadWordsW(LPWSTR lpwszMessage, size_t dwMessageSize)
{
- BOOL bRet=FALSE;
-
- if (lpwszMessage && dwMessageSize)
- {
- LPWSTR lpwszMessageConverted;
-
- lpwszMessageConverted=(LPWSTR)MEMALLOC((dwMessageSize*sizeof(WCHAR)));
- if (lpwszMessageConverted)
- {
- SIZE_T dwtm;
+ BOOL bRet = FALSE;
- /*{
- HANDLE hFile=CreateFile(L"C:\\Documents and Settings\\Rozhuk_IM\\Рабочий стол\\spam_raw.txt",GENERIC_WRITE,FILE_SHARE_READ,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
-
- if (hFile!=INVALID_HANDLE_VALUE)
- {
- WriteFile(hFile,lpwszMessageConverted,(dwMessageSize*sizeof(WCHAR)),&i,NULL);
- CloseHandle(hFile);
- }
- }//*/
+ if (lpwszMessage && dwMessageSize) {
+ LPWSTR lpwszMessageConverted = (LPWSTR)mir_calloc((dwMessageSize*sizeof(WCHAR)));
+ if (lpwszMessageConverted) {
+ size_t dwtm;
// в нижний регистр всё сообщение
- {//BuffToLowerCase(lpszMessageConverted,lpszMessage,dwMessageSize);
- memmove(lpwszMessageConverted,lpwszMessage,(dwMessageSize*sizeof(WCHAR)));
- CharLowerBuffW(lpwszMessageConverted,dwMessageSize);
- }
+ memmove(lpwszMessageConverted, lpwszMessage, (dwMessageSize*sizeof(WCHAR)));
+ CharLowerBuffW(lpwszMessageConverted, dwMessageSize);
// 1 проход: считаем колличество переключений языка
- dwtm=DB_Mra_GetDword(NULL,"AntiSpamMaxLangChanges",MRA_ANTISPAM_DEFAULT_MAX_LNG_CHANGES);
+ dwtm = mraGetDword(NULL, "AntiSpamMaxLangChanges", MRA_ANTISPAM_DEFAULT_MAX_LNG_CHANGES);
if (dwtm)
- {
- if (dwtm<=MraAntiSpamCalcLangChanges(lpwszMessageConverted,dwMessageSize)) bRet=TRUE;
- }
+ if (dwtm <= MraAntiSpamCalcLangChanges(lpwszMessageConverted, dwMessageSize))
+ bRet = TRUE;
// 2 проход: ищем плохие слова
- if (bRet==FALSE) bRet=MraAntiSpamTestMessageForBadWordsW(lpwszMessageConverted,dwMessageSize);
+ if (bRet == FALSE)
+ bRet = MraAntiSpamTestMessageForBadWordsW(lpwszMessageConverted, dwMessageSize);
// 3 проход: оставляем только буквы + цифры и снова ищем плохие слова
- if (bRet==FALSE)
- if (DB_Mra_GetByte(NULL,"AntiSpamCleanNonAlphaNumeric",MRA_ANTISPAM_DEFAULT_ENABLE))
- {
- dwMessageSize=MraAntiSpamCleanNonAlphaNumeric(lpwszMessageConverted,dwMessageSize);
- bRet=MraAntiSpamTestMessageForBadWordsW(lpwszMessageConverted,dwMessageSize);
+ if (bRet == FALSE)
+ if (mraGetByte(NULL, "AntiSpamCleanNonAlphaNumeric", MRA_ANTISPAM_DEFAULT_ENABLE)) {
+ dwMessageSize = MraAntiSpamCleanNonAlphaNumeric(lpwszMessageConverted, dwMessageSize);
+ bRet = MraAntiSpamTestMessageForBadWordsW(lpwszMessageConverted, dwMessageSize);
}
-
- MEMFREE(lpwszMessageConverted);
+ mir_free(lpwszMessageConverted);
}
}
-return(bRet);
+ return bRet;
}
-
-DWORD MraAntiSpamReceivedMessageW(LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwMessageFlags,LPWSTR lpwszMessage,SIZE_T dwMessageSize)
+DWORD CMraProto::MraAntiSpamReceivedMessageW(LPSTR lpszEMail, size_t dwEMailSize, DWORD dwMessageFlags, LPWSTR lpwszMessage, size_t dwMessageSize)
{
- DWORD dwRet=MESSAGE_NOT_SPAM;;
-
- if ((dwMessageFlags&(MESSAGE_FLAG_SYSTEM|MESSAGE_FLAG_CONTACT|MESSAGE_FLAG_NOTIFY|MESSAGE_FLAG_SMS|MESSAGE_SMS_DELIVERY_REPORT|MESSAGE_FLAG_ALARM|MESSAGE_FLAG_MULTICHAT))==0)
- if (DB_Mra_GetByte(NULL,"AntiSpamEnable",MRA_ANTISPAM_DEFAULT_ENABLE))
- if (IsEMailChatAgent(lpszEMail,dwEMailSize)==FALSE)
- {// enabled, message mast be cheked
- BOOL bCheckMessage=TRUE;
- HANDLE hContact;
-
- dwRet=MESSAGE_SPAM;
- hContact=MraHContactFromEmail(lpszEMail,dwEMailSize,FALSE,TRUE,NULL);
- if (hContact)
- {
- DWORD dwID,dwGroupID,dwContactFlag,dwContactSeverFlags;
-
- GetContactBasicInfoW(hContact,&dwID,&dwGroupID,&dwContactFlag,&dwContactSeverFlags,NULL,NULL,0,NULL,NULL,0,NULL,NULL,0,NULL);
- if ((dwID!=-1 && DBGetContactSettingByte(hContact,"CList","NotOnList",0)==0) || dwGroupID==-2)
- {// not temp contact, OK
- bCheckMessage=FALSE;
- dwRet=MESSAGE_NOT_SPAM;
- }else{// temp contact
- if (DB_Mra_GetByte(NULL,"AntiSpamCheckTempContacts",MRA_ANTISPAM_DEFAULT_CHK_TEMP_CONTACTS)==FALSE ||
- (((dwMessageFlags&MESSAGE_FLAG_AUTHORIZE) && DB_Mra_GetByte(NULL,"AutoAuthGrandNewUsers",MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS) && DB_Mra_GetByte(NULL,"AutoAuthGrandNewUsersDisableSPAMCheck",MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK))))
+ DWORD dwRet = MESSAGE_NOT_SPAM;;
+
+ if ((dwMessageFlags&(MESSAGE_FLAG_SYSTEM|MESSAGE_FLAG_CONTACT|MESSAGE_FLAG_NOTIFY|MESSAGE_FLAG_SMS|MESSAGE_SMS_DELIVERY_REPORT|MESSAGE_FLAG_ALARM|MESSAGE_FLAG_MULTICHAT)) == 0)
+ if (mraGetByte(NULL, "AntiSpamEnable", MRA_ANTISPAM_DEFAULT_ENABLE))
+ if (IsEMailChatAgent(lpszEMail, dwEMailSize) == FALSE) { // enabled, message must be checked
+ BOOL bCheckMessage = TRUE;
+ dwRet = MESSAGE_SPAM;
+ HANDLE hContact = MraHContactFromEmail(lpszEMail, dwEMailSize, FALSE, TRUE, NULL);
+ if (hContact) {
+ DWORD dwID, dwGroupID, dwContactFlag, dwContactSeverFlags;
+ GetContactBasicInfoW(hContact, &dwID, &dwGroupID, &dwContactFlag, &dwContactSeverFlags, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, 0, NULL);
+
+ // not temp contact, OK
+ if ((dwID != -1 && db_get_b(hContact, "CList", "NotOnList", 0) == 0) || dwGroupID == -2) {
+ bCheckMessage = FALSE;
+ dwRet = MESSAGE_NOT_SPAM;
+ }
+ else { // temp contact
+ if (mraGetByte(NULL, "AntiSpamCheckTempContacts", MRA_ANTISPAM_DEFAULT_CHK_TEMP_CONTACTS) == FALSE ||
+ (((dwMessageFlags&MESSAGE_FLAG_AUTHORIZE) && mraGetByte(NULL, "AutoAuthGrandNewUsers", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS) && mraGetByte(NULL, "AutoAuthGrandNewUsersDisableSPAMCheck", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK))))
{// проверка временного контакта
- bCheckMessage=FALSE;
- dwRet=MESSAGE_NOT_SPAM;
+ bCheckMessage = FALSE;
+ dwRet = MESSAGE_NOT_SPAM;
}
}
}
if (bCheckMessage)
- {
- if (MraAntiSpamHasMessageBadWordsW(lpwszMessage,dwMessageSize)==FALSE)
- {// в простом тексте нет спама
- dwRet=MESSAGE_NOT_SPAM;
- }
- }
+ if (MraAntiSpamHasMessageBadWordsW(lpwszMessage, dwMessageSize) == FALSE)
+ dwRet = MESSAGE_NOT_SPAM;
- if (dwRet==MESSAGE_SPAM)
- {
- BOOL bAntiSpamShowPopUp,bAntiSpamWriteToSystemHistory,bAntiSpamDeteleSpamBotContacts;
+ if (dwRet == MESSAGE_SPAM) {
+ BOOL bAntiSpamShowPopUp, bAntiSpamWriteToSystemHistory, bAntiSpamDeteleSpamBotContacts;
- bAntiSpamShowPopUp=(BOOL)DB_Mra_GetByte(NULL,"AntiSpamShowPopUp",MRA_ANTISPAM_DEFAULT_SHOWPOP);
- bAntiSpamWriteToSystemHistory=(BOOL)DB_Mra_GetByte(NULL,"AntiSpamWriteToSystemHistory",MRA_ANTISPAM_DEFAULT_WRITETOSYSTEMHISTORY);
- bAntiSpamDeteleSpamBotContacts=(BOOL)DB_Mra_GetByte(NULL,"AntiSpamDeteleSpamBotContacts",MRA_ANTISPAM_DEFAULT_DELETE_SPAMBOT_CONTACT);
+ bAntiSpamShowPopUp = (BOOL)mraGetByte(NULL, "AntiSpamShowPopUp", MRA_ANTISPAM_DEFAULT_SHOWPOP);
+ bAntiSpamWriteToSystemHistory = (BOOL)mraGetByte(NULL, "AntiSpamWriteToSystemHistory", MRA_ANTISPAM_DEFAULT_WRITETOSYSTEMHISTORY);
+ bAntiSpamDeteleSpamBotContacts = (BOOL)mraGetByte(NULL, "AntiSpamDeteleSpamBotContacts", MRA_ANTISPAM_DEFAULT_DELETE_SPAMBOT_CONTACT);
- if (bAntiSpamShowPopUp || bAntiSpamWriteToSystemHistory)
- {
+ if (bAntiSpamShowPopUp || bAntiSpamWriteToSystemHistory) {
char szEMail[MAX_EMAIL_LEN];
WCHAR wszBuff[MRA_MAXLENOFMESSAGE*2];
- SIZE_T dwDBMessageSize;
+ size_t dwDBMessageSize;
- memmove(szEMail,lpszEMail,dwEMailSize);
- (*((WORD*)(szEMail+dwEMailSize)))=0;
+ memmove(szEMail, lpszEMail, dwEMailSize);
+ (*((WORD*)(szEMail+dwEMailSize))) = 0;
- dwDBMessageSize=mir_sntprintf(wszBuff,SIZEOF(wszBuff),L"%s: %S\r\n",TranslateW(L"Spam bot blocked"),szEMail);
- if (dwMessageSize>(SIZEOF(wszBuff)-(dwDBMessageSize+sizeof(DWORD)))) dwMessageSize=(SIZEOF(wszBuff)-(dwDBMessageSize+sizeof(DWORD)));
- memmove((wszBuff+dwDBMessageSize),lpwszMessage,(dwMessageSize*sizeof(WCHAR)));
- dwDBMessageSize+=dwMessageSize;
- (*((DWORD*)(wszBuff+dwDBMessageSize)))=0;
- dwDBMessageSize+=sizeof(DWORD);
+ dwDBMessageSize = mir_sntprintf(wszBuff, SIZEOF(wszBuff), L"%s: %S\r\n", TranslateW(L"Spam bot blocked"), szEMail);
+ if (dwMessageSize>(SIZEOF(wszBuff)-(dwDBMessageSize+sizeof(DWORD)))) dwMessageSize = (SIZEOF(wszBuff)-(dwDBMessageSize+sizeof(DWORD)));
+ memmove((wszBuff+dwDBMessageSize), lpwszMessage, (dwMessageSize*sizeof(WCHAR)));
+ dwDBMessageSize += dwMessageSize;
+ (*((DWORD*)(wszBuff+dwDBMessageSize))) = 0;
+ dwDBMessageSize += sizeof(DWORD);
- if (bAntiSpamShowPopUp) MraPopupShowFromAgentW(MRA_POPUP_TYPE_INFORMATION,0,wszBuff);
+ if (bAntiSpamShowPopUp)
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_INFORMATION, 0, wszBuff);
- if (bAntiSpamWriteToSystemHistory)
- {
+ if (bAntiSpamWriteToSystemHistory) {
CHAR szBuff[MRA_MAXLENOFMESSAGE*2];
- DBEVENTINFO dbei={0};
-
- WideCharToMultiByte(CP_UTF8,0,wszBuff,dwDBMessageSize,szBuff,SIZEOF(szBuff),NULL,NULL);
-
- dbei.cbSize=sizeof(dbei);
- dbei.szModule=PROTOCOL_NAMEA;
- dbei.timestamp=_time32(NULL);
- dbei.flags=(DBEF_READ|DBEF_UTF);
- dbei.eventType=EVENTTYPE_MESSAGE;
- dbei.cbBlob=(dwDBMessageSize*sizeof(WCHAR));
- dbei.pBlob=(PBYTE)szBuff;
-
- CallService(MS_DB_EVENT_ADD,0,(LPARAM)&dbei);
+ WideCharToMultiByte(CP_UTF8, 0, wszBuff, dwDBMessageSize, szBuff, SIZEOF(szBuff), NULL, NULL);
+
+ DBEVENTINFO dbei = {0};
+ dbei.cbSize = sizeof(dbei);
+ dbei.szModule = m_szModuleName;
+ dbei.timestamp = _time32(NULL);
+ dbei.flags = (DBEF_READ|DBEF_UTF);
+ dbei.eventType = EVENTTYPE_MESSAGE;
+ dbei.cbBlob = (dwDBMessageSize*sizeof(WCHAR));
+ dbei.pBlob = (PBYTE)szBuff;
+
+ CallService(MS_DB_EVENT_ADD, 0, (LPARAM)&dbei);
}
- if (hContact && bAntiSpamDeteleSpamBotContacts)
- {
- dwDBMessageSize=mir_sntprintf(wszBuff,SIZEOF(wszBuff),L"%s: %S",TranslateW(L"Spam bot contact deleted"),szEMail);
+ if (hContact && bAntiSpamDeteleSpamBotContacts) {
+ dwDBMessageSize = mir_sntprintf(wszBuff, SIZEOF(wszBuff), L"%s: %S", TranslateW(L"Spam bot contact deleted"), szEMail);
- if (bAntiSpamShowPopUp) MraPopupShowFromAgentW(MRA_POPUP_TYPE_INFORMATION,0,wszBuff);
-
- if (bAntiSpamWriteToSystemHistory)
- {
- CHAR szBuff[MRA_MAXLENOFMESSAGE*2];
- DBEVENTINFO dbei={0};
+ if (bAntiSpamShowPopUp)
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_INFORMATION, 0, wszBuff);
- (*((DWORD*)(wszBuff+dwDBMessageSize)))=0;
- dwDBMessageSize+=sizeof(DWORD);
+ if (bAntiSpamWriteToSystemHistory) {
+ (*((DWORD*)(wszBuff+dwDBMessageSize))) = 0;
+ dwDBMessageSize += sizeof(DWORD);
- WideCharToMultiByte(CP_UTF8,0,wszBuff,dwDBMessageSize,szBuff,SIZEOF(szBuff),NULL,NULL);
-
- dbei.cbSize=sizeof(dbei);
- dbei.szModule=PROTOCOL_NAMEA;
- dbei.timestamp=_time32(NULL);
- dbei.flags=(DBEF_READ|DBEF_UTF);
- dbei.eventType=EVENTTYPE_MESSAGE;
- dbei.cbBlob=(dwDBMessageSize*sizeof(WCHAR));
- dbei.pBlob=(PBYTE)szBuff;
-
- CallService(MS_DB_EVENT_ADD,0,(LPARAM)&dbei);
+ CHAR szBuff[MRA_MAXLENOFMESSAGE*2];
+ WideCharToMultiByte(CP_UTF8, 0, wszBuff, dwDBMessageSize, szBuff, SIZEOF(szBuff), NULL, NULL);
+
+ DBEVENTINFO dbei = {0};
+ dbei.cbSize = sizeof(dbei);
+ dbei.szModule = m_szModuleName;
+ dbei.timestamp = _time32(NULL);
+ dbei.flags = (DBEF_READ|DBEF_UTF);
+ dbei.eventType = EVENTTYPE_MESSAGE;
+ dbei.cbBlob = (dwDBMessageSize*sizeof(WCHAR));
+ dbei.pBlob = (PBYTE)szBuff;
+ CallService(MS_DB_EVENT_ADD, 0, (LPARAM)&dbei);
}
}
}
- if (hContact && bAntiSpamDeteleSpamBotContacts) CallService(MS_DB_CONTACT_DELETE,(WPARAM)hContact,0);
+ if (hContact && bAntiSpamDeteleSpamBotContacts)
+ CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
}
}
-return(dwRet);
+ return dwRet;
}
diff --git a/protocols/MRA/MraAntiSpam.h b/protocols/MRA/MraAntiSpam.h
index 697daf654b..7549e308c3 100644
--- a/protocols/MRA/MraAntiSpam.h
+++ b/protocols/MRA/MraAntiSpam.h
@@ -6,19 +6,11 @@
#pragma once
#endif // _MSC_VER > 1000
-
-
-
-SIZE_T MraAntiSpamLoadBadWordsW();
+size_t MraAntiSpamLoadBadWordsW();
void MraAntiSpamFreeBadWords();
-INT_PTR CALLBACK MraAntiSpamDlgProcOpts(HWND hWndDlg,UINT msg,WPARAM wParam,LPARAM lParam);
+INT_PTR CALLBACK MraAntiSpamDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
void MraAntiSpamResetBadWordsList();
-#define MESSAGE_NOT_SPAM 1
-#define MESSAGE_SPAM 2
-DWORD MraAntiSpamReceivedMessageW(LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwMessageFlags,LPWSTR lpwszMessage,SIZE_T dwMessageSize);
-
-
#endif // !defined(AFX_MRA_ANTISPAM_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraAvatars.cpp b/protocols/MRA/MraAvatars.cpp
index 786e930392..67c89f0328 100644
--- a/protocols/MRA/MraAvatars.cpp
+++ b/protocols/MRA/MraAvatars.cpp
@@ -1,63 +1,50 @@
#include "Mra.h"
#include "MraAvatars.h"
-
-
-
#define PA_FORMAT_MAX 7
-const LPTSTR lpcszExtensions[9]=
+const LPTSTR lpcszExtensions[9] =
{
- _T(".dat"),// PA_FORMAT_UNKNOWN
- _T(".png"),// PA_FORMAT_PNG
- _T(".jpg"),// PA_FORMAT_JPEG
- _T(".ico"),// PA_FORMAT_ICON
- _T(".bmp"),// PA_FORMAT_BMP
- _T(".gif"),// PA_FORMAT_GIF
- _T(".swf"),// PA_FORMAT_SWF
- _T(".xml"),// PA_FORMAT_XML
+ _T(".dat"), // PA_FORMAT_UNKNOWN
+ _T(".png"), // PA_FORMAT_PNG
+ _T(".jpg"), // PA_FORMAT_JPEG
+ _T(".ico"), // PA_FORMAT_ICON
+ _T(".bmp"), // PA_FORMAT_BMP
+ _T(".gif"), // PA_FORMAT_GIF
+ _T(".swf"), // PA_FORMAT_SWF
+ _T(".xml"), // PA_FORMAT_XML
NULL
};
-
-const LPSTR lpcszContentType[9]=
+const LPSTR lpcszContentType[9] =
{
- "", // PA_FORMAT_UNKNOWN
- "image/png", // PA_FORMAT_PNG
- "image/jpeg", // PA_FORMAT_JPEG
- "image/icon", // PA_FORMAT_ICON
- "image/x-xbitmap", // PA_FORMAT_BMP
- "image/gif", // PA_FORMAT_GIF
- "", // PA_FORMAT_SWF
- "", // PA_FORMAT_XML
+ "", // PA_FORMAT_UNKNOWN
+ "image/png", // PA_FORMAT_PNG
+ "image/jpeg", // PA_FORMAT_JPEG
+ "image/icon", // PA_FORMAT_ICON
+ "image/x-xbitmap", // PA_FORMAT_BMP
+ "image/gif", // PA_FORMAT_GIF
+ "", // PA_FORMAT_SWF
+ "", // PA_FORMAT_XML
NULL
};
-
-
-typedef struct
-{
- FIFO_MT ffmtQueueToQuery;
- BOOL bIsRunning;
- HANDLE hNetlibUser;
- HANDLE hThreadEvent;
- DWORD dwThreadsCount;
- HANDLE hThread[MAXIMUM_WAIT_OBJECTS];
- LONG lThreadsRunningCount;
- HANDLE hAvatarsPath;
-} MRA_AVATARS_QUEUE;
-
-
-typedef struct
+struct MRA_AVATARS_QUEUE : public FIFO_MT
{
- // internal
- FIFO_MT_ITEM ffmtiFifoItem;
- // external
- DWORD dwAvatarsQueueID;
- DWORD dwFlags;
- HANDLE hContact;
-} MRA_AVATARS_QUEUE_ITEM;
-
+ BOOL bIsRunning;
+ HANDLE hNetlibUser;
+ HANDLE hThreadEvent;
+ DWORD dwThreadsCount;
+ HANDLE hThread[MAXIMUM_WAIT_OBJECTS];
+ LONG lThreadsRunningCount;
+ HANDLE hAvatarsPath;
+};
+struct MRA_AVATARS_QUEUE_ITEM : public FIFO_MT_ITEM
+{
+ DWORD dwAvatarsQueueID;
+ DWORD dwFlags;
+ HANDLE hContact;
+};
#define FILETIME_SECOND ((DWORDLONG)10000000)
#define FILETIME_MINUTE ((DWORDLONG)FILETIME_SECOND*60)
@@ -70,46 +57,38 @@ char szAvtSectName[MAX_PATH];
static bool bFoldersPresent = false;
-//#define MEMALLOC(Size) HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,(Size+sizeof(SIZE_T)))
-//#define MEMREALLOC(Mem,Size) HeapReAlloc(GetProcessHeap(),(HEAP_ZERO_MEMORY),(LPVOID)Mem,(Size+sizeof(SIZE_T)))
-//#define MEMFREE(Mem) if (Mem) {HeapFree(GetProcessHeap(),0,(LPVOID)Mem);Mem=NULL;}
-
-#define NETLIB_CLOSEHANDLE(hConnection) {Netlib_CloseHandle(hConnection);hConnection=NULL;}
-
-void MraAvatarsQueueClear(HANDLE hAvatarsQueueHandle);
-DWORD MraAvatarsQueueAdd(HANDLE hAvatarsQueueHandle,DWORD dwFlags,HANDLE hContact,DWORD *pdwAvatarsQueueID);
-void MraAvatarsThreadProc(LPVOID lpParameter);
-HANDLE MraAvatarsHttpConnect(HANDLE hNetlibUser,LPSTR lpszHost,DWORD dwPort);
+//#define mir_calloc(Size) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (Size+sizeof(size_t)))
+//#define mir_realloc(Mem, Size) HeapReAlloc(GetProcessHeap(), (HEAP_ZERO_MEMORY), (LPVOID)Mem, (Size+sizeof(size_t)))
+//#define mir_free(Mem) if (Mem) {HeapFree(GetProcessHeap(), 0, (LPVOID)Mem);Mem = NULL;}
+#define NETLIB_CLOSEHANDLE(hConnection) {Netlib_CloseHandle(hConnection);hConnection = NULL;}
+HANDLE MraAvatarsHttpConnect(HANDLE hNetlibUser, LPSTR lpszHost, DWORD dwPort);
#define MAHTRO_AVT 0
#define MAHTRO_AVTMRIM 1
#define MAHTRO_AVTSMALL 2
#define MAHTRO_AVTSMALLMRIM 3
-DWORD MraAvatarsHttpTransaction (HANDLE hConnection,DWORD dwRequestType,LPSTR lpszUser,LPSTR lpszDomain,LPSTR lpszHost,DWORD dwReqObj,BOOL bUseKeepAliveConn,DWORD *pdwResultCode,BOOL *pbKeepAlive,DWORD *pdwFormat,SIZE_T *pdwAvatarSize,INTERNET_TIME *pitLastModifiedTime);
-BOOL MraAvatarsGetContactTime (HANDLE hContact,LPSTR lpszValueName,SYSTEMTIME *pstTime);
-void MraAvatarsSetContactTime (HANDLE hContact,LPSTR lpszValueName,SYSTEMTIME *pstTime);
-DWORD MraAvatarsGetFileFormat (LPTSTR lpszPath,SIZE_T dwPathSize);
+DWORD MraAvatarsHttpTransaction (HANDLE hConnection, DWORD dwRequestType, LPSTR lpszUser, LPSTR lpszDomain, LPSTR lpszHost, DWORD dwReqObj, BOOL bUseKeepAliveConn, DWORD *pdwResultCode, BOOL *pbKeepAlive, DWORD *pdwFormat, size_t *pdwAvatarSize, INTERNET_TIME *pitLastModifiedTime);
+DWORD MraAvatarsGetFileFormat (LPTSTR lpszPath, size_t dwPathSize);
-
-DWORD MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle)
+DWORD CMraProto::MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle)
{
bFoldersPresent = ServiceExists( MS_FOLDERS_REGISTER_PATH ) != 0;
- mir_snprintf(szAvtSectName,SIZEOF(szAvtSectName),"%s Avatars",PROTOCOL_NAMEA);
+ mir_snprintf(szAvtSectName, SIZEOF(szAvtSectName), "%s Avatars", m_szModuleName);
if (phAvatarsQueueHandle == NULL)
return ERROR_INVALID_HANDLE;
- MRA_AVATARS_QUEUE *pmraaqAvatarsQueue = (MRA_AVATARS_QUEUE*)MEMALLOC(sizeof(MRA_AVATARS_QUEUE));
+ MRA_AVATARS_QUEUE *pmraaqAvatarsQueue = (MRA_AVATARS_QUEUE*)mir_calloc(sizeof(MRA_AVATARS_QUEUE));
if (pmraaqAvatarsQueue == NULL)
return GetLastError();
- DWORD dwRetErrorCode = FifoMTInitialize(&pmraaqAvatarsQueue->ffmtQueueToQuery,0);
+ DWORD dwRetErrorCode = FifoMTInitialize(pmraaqAvatarsQueue, 0);
if (dwRetErrorCode == NO_ERROR) {
CHAR szBuffer[MAX_PATH];
- mir_snprintf(szBuffer,SIZEOF(szBuffer),"%s %s %s",PROTOCOL_NAMEA,Translate("Avatars"),Translate("plugin connections"));
+ mir_snprintf(szBuffer, SIZEOF(szBuffer), "%s %s %s", m_szModuleName, Translate("Avatars"), Translate("plugin connections"));
NETLIBUSER nlu = {0};
nlu.cbSize = sizeof(nlu);
@@ -120,20 +99,20 @@ DWORD MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle)
if (pmraaqAvatarsQueue->hNetlibUser) {
if (bFoldersPresent) {
TCHAR tszPath[ MAX_PATH ];
- mir_sntprintf( tszPath, SIZEOF(tszPath), _T("%%miranda_avatarcache%%\\%s"), PROTOCOL_NAMEW);
+ mir_sntprintf( tszPath, SIZEOF(tszPath), _T("%%miranda_avatarcache%%\\%s"), m_tszUserName);
pmraaqAvatarsQueue->hAvatarsPath = FoldersRegisterCustomPathT(MRA_AVT_SECT_NAME, "AvatarsPath", tszPath);
}
else pmraaqAvatarsQueue->hAvatarsPath = NULL;
- InterlockedExchange((volatile LONG*)&pmraaqAvatarsQueue->bIsRunning,TRUE);
- pmraaqAvatarsQueue->hThreadEvent = CreateEvent(NULL,FALSE,FALSE,NULL);
- pmraaqAvatarsQueue->dwThreadsCount = DBGetContactSettingDword(NULL,MRA_AVT_SECT_NAME,"WorkThreadsCount",MRA_AVT_DEFAULT_WRK_THREAD_COUNTS);
- if (pmraaqAvatarsQueue->dwThreadsCount==0)
+ InterlockedExchange((volatile LONG*)&pmraaqAvatarsQueue->bIsRunning, TRUE);
+ pmraaqAvatarsQueue->hThreadEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ pmraaqAvatarsQueue->dwThreadsCount = DBGetContactSettingDword(NULL, MRA_AVT_SECT_NAME, "WorkThreadsCount", MRA_AVT_DEFAULT_WRK_THREAD_COUNTS);
+ if (pmraaqAvatarsQueue->dwThreadsCount == 0)
pmraaqAvatarsQueue->dwThreadsCount = 1;
if (pmraaqAvatarsQueue->dwThreadsCount > MAXIMUM_WAIT_OBJECTS)
pmraaqAvatarsQueue->dwThreadsCount = MAXIMUM_WAIT_OBJECTS;
- for (DWORD i=0; i < pmraaqAvatarsQueue->dwThreadsCount; i++)
- pmraaqAvatarsQueue->hThread[i]=(HANDLE)mir_forkthread((pThreadFunc)MraAvatarsThreadProc,pmraaqAvatarsQueue);
+ for (DWORD i = 0; i < pmraaqAvatarsQueue->dwThreadsCount; i++)
+ pmraaqAvatarsQueue->hThread[i] = ForkThreadEx(&CMraProto::MraAvatarsThreadProc, pmraaqAvatarsQueue);
*phAvatarsQueueHandle = (HANDLE)pmraaqAvatarsQueue;
}
@@ -142,46 +121,44 @@ DWORD MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle)
return dwRetErrorCode;
}
-
-void MraAvatarsQueueClear(HANDLE hAvatarsQueueHandle)
+void CMraProto::MraAvatarsQueueClear(HANDLE hAvatarsQueueHandle)
{
if (hAvatarsQueueHandle)
{
- MRA_AVATARS_QUEUE *pmraaqAvatarsQueue=(MRA_AVATARS_QUEUE*)hAvatarsQueueHandle;
+ MRA_AVATARS_QUEUE *pmraaqAvatarsQueue = (MRA_AVATARS_QUEUE*)hAvatarsQueueHandle;
MRA_AVATARS_QUEUE_ITEM *pmraaqiAvatarsQueueItem;
- PROTO_AVATAR_INFORMATIONT pai={0};
+ PROTO_AVATAR_INFORMATIONT pai = {0};
- pai.cbSize=sizeof(pai);
- //pai.hContact=pmraaqiAvatarsQueueItem->hContact;
- pai.format=PA_FORMAT_UNKNOWN;
- //pai.filename[0]=0;
+ pai.cbSize = sizeof(pai);
+ //pai.hContact = pmraaqiAvatarsQueueItem->hContact;
+ pai.format = PA_FORMAT_UNKNOWN;
+ //pai.filename[0] = 0;
- while(FifoMTItemPop(&pmraaqAvatarsQueue->ffmtQueueToQuery,NULL,(LPVOID*)&pmraaqiAvatarsQueueItem)==NO_ERROR)
+ while(FifoMTItemPop(pmraaqAvatarsQueue, NULL, (LPVOID*)&pmraaqiAvatarsQueueItem) == NO_ERROR)
{
- pai.hContact=pmraaqiAvatarsQueueItem->hContact;
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmraaqiAvatarsQueueItem->hContact,ACKTYPE_AVATAR,ACKRESULT_FAILED,(HANDLE)&pai,0);
- MEMFREE(pmraaqiAvatarsQueueItem);
+ pai.hContact = pmraaqiAvatarsQueueItem->hContact;
+ ProtoBroadcastAck(m_szModuleName, pmraaqiAvatarsQueueItem->hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&pai, 0);
+ mir_free(pmraaqiAvatarsQueueItem);
}
}
}
-
-void MraAvatarsQueueDestroy(HANDLE hAvatarsQueueHandle)
+void CMraProto::MraAvatarsQueueDestroy(HANDLE hAvatarsQueueHandle)
{
if (hAvatarsQueueHandle)
{
- MRA_AVATARS_QUEUE *pmraaqAvatarsQueue=(MRA_AVATARS_QUEUE*)hAvatarsQueueHandle;
+ MRA_AVATARS_QUEUE *pmraaqAvatarsQueue = (MRA_AVATARS_QUEUE*)hAvatarsQueueHandle;
- InterlockedExchange((volatile LONG*)&pmraaqAvatarsQueue->bIsRunning,FALSE);
+ InterlockedExchange((volatile LONG*)&pmraaqAvatarsQueue->bIsRunning, FALSE);
SetEvent(pmraaqAvatarsQueue->hThreadEvent);
- WaitForMultipleObjects(pmraaqAvatarsQueue->dwThreadsCount,(HANDLE*)&pmraaqAvatarsQueue->hThread[0],TRUE,(WAIT_FOR_THREAD_TIMEOUT*1000));
+ WaitForMultipleObjects(pmraaqAvatarsQueue->dwThreadsCount, (HANDLE*)&pmraaqAvatarsQueue->hThread[0], TRUE, (WAIT_FOR_THREAD_TIMEOUT*1000));
- if (InterlockedExchangeAdd((volatile LONG*)&pmraaqAvatarsQueue->lThreadsRunningCount,0))
+ if (InterlockedExchangeAdd((volatile LONG*)&pmraaqAvatarsQueue->lThreadsRunningCount, 0))
{// Иногда они не завершаются, хотя уведомление говорит об обратном %)
- while(InterlockedExchangeAdd((volatile LONG*)&pmraaqAvatarsQueue->lThreadsRunningCount,0))
+ while(InterlockedExchangeAdd((volatile LONG*)&pmraaqAvatarsQueue->lThreadsRunningCount, 0))
{// ждём пока точно все завершатся
- SleepEx(100,TRUE);
+ SleepEx(100, TRUE);
}
}
@@ -189,209 +166,207 @@ void MraAvatarsQueueDestroy(HANDLE hAvatarsQueueHandle)
MraAvatarsQueueClear(hAvatarsQueueHandle);
- FifoMTDestroy(&pmraaqAvatarsQueue->ffmtQueueToQuery);
+ FifoMTDestroy(pmraaqAvatarsQueue);
Netlib_CloseHandle(pmraaqAvatarsQueue->hNetlibUser);
- MEMFREE(pmraaqAvatarsQueue);
+ mir_free(pmraaqAvatarsQueue);
}
}
-
-DWORD MraAvatarsQueueAdd(HANDLE hAvatarsQueueHandle,DWORD dwFlags,HANDLE hContact,DWORD *pdwAvatarsQueueID)
+DWORD CMraProto::MraAvatarsQueueAdd(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD *pdwAvatarsQueueID)
{
DWORD dwRetErrorCode;
if (hAvatarsQueueHandle)
{
- MRA_AVATARS_QUEUE *pmraaqAvatarsQueue=(MRA_AVATARS_QUEUE*)hAvatarsQueueHandle;
+ MRA_AVATARS_QUEUE *pmraaqAvatarsQueue = (MRA_AVATARS_QUEUE*)hAvatarsQueueHandle;
MRA_AVATARS_QUEUE_ITEM *pmraaqiAvatarsQueueItem;
- pmraaqiAvatarsQueueItem=(MRA_AVATARS_QUEUE_ITEM*)MEMALLOC(sizeof(MRA_AVATARS_QUEUE_ITEM));
+ pmraaqiAvatarsQueueItem = (MRA_AVATARS_QUEUE_ITEM*)mir_calloc(sizeof(MRA_AVATARS_QUEUE_ITEM));
if (pmraaqiAvatarsQueueItem)
{
//pmraaqiAvatarsQueueItem->ffmtiFifoItem;
- pmraaqiAvatarsQueueItem->dwAvatarsQueueID=GetTickCount();
- pmraaqiAvatarsQueueItem->dwFlags=dwFlags;
- pmraaqiAvatarsQueueItem->hContact=hContact;
+ pmraaqiAvatarsQueueItem->dwAvatarsQueueID = GetTickCount();
+ pmraaqiAvatarsQueueItem->dwFlags = dwFlags;
+ pmraaqiAvatarsQueueItem->hContact = hContact;
- FifoMTItemPush(&pmraaqAvatarsQueue->ffmtQueueToQuery,&pmraaqiAvatarsQueueItem->ffmtiFifoItem,(LPVOID)pmraaqiAvatarsQueueItem);
- if (pdwAvatarsQueueID) (*pdwAvatarsQueueID)=pmraaqiAvatarsQueueItem->dwAvatarsQueueID;
+ FifoMTItemPush(pmraaqAvatarsQueue, pmraaqiAvatarsQueueItem, (LPVOID)pmraaqiAvatarsQueueItem);
+ if (pdwAvatarsQueueID) (*pdwAvatarsQueueID) = pmraaqiAvatarsQueueItem->dwAvatarsQueueID;
SetEvent(pmraaqAvatarsQueue->hThreadEvent);
- dwRetErrorCode=NO_ERROR;
- }else{
- dwRetErrorCode=GetLastError();
- ShowFormatedErrorMessage(L"Avatars: can't add request to queue, error",dwRetErrorCode);
+ dwRetErrorCode = NO_ERROR;
+ }else {
+ dwRetErrorCode = GetLastError();
+ ShowFormattedErrorMessage(L"Avatars: can't add request to queue, error", dwRetErrorCode);
}
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }else {
+ dwRetErrorCode = ERROR_INVALID_HANDLE;
}
-return(dwRetErrorCode);
+ return dwRetErrorCode;
}
-
-void MraAvatarsThreadProc(LPVOID lpParameter)
+void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter)
{
- MRA_AVATARS_QUEUE *pmraaqAvatarsQueue=(MRA_AVATARS_QUEUE*)lpParameter;
+ MRA_AVATARS_QUEUE *pmraaqAvatarsQueue = (MRA_AVATARS_QUEUE*)lpParameter;
MRA_AVATARS_QUEUE_ITEM *pmraaqiAvatarsQueueItem;
-
- char szEMail[MAX_EMAIL_LEN],szServer[MAX_PATH];
- WCHAR wszFileName[MAX_FILEPATH],szErrorText[2048];
- BOOL bContinue,bKeepAlive,bUseKeepAliveConn,bFailed,bDownloadNew,bDefaultAvt;
+
+ char szEMail[MAX_EMAIL_LEN], szServer[MAX_PATH];
+ WCHAR wszFileName[MAX_FILEPATH], szErrorText[2048];
+ BOOL bContinue, bKeepAlive, bUseKeepAliveConn, bFailed, bDownloadNew, bDefaultAvt;
BYTE btBuff[BUFF_SIZE_RCV];
- DWORD dwResultCode,dwAvatarFormat,dwReceived,dwWritten,dwServerPort,dwErrorCode;
- LPSTR lpszUser,lpszDomain;
- SIZE_T dwEMailSize,dwAvatarSizeServer,dwFileNameSize;
- FILETIME ftLastModifiedTimeServer,ftLastModifiedTimeLocal;
+ DWORD dwResultCode, dwAvatarFormat, dwReceived, dwWritten, dwServerPort, dwErrorCode;
+ LPSTR lpszUser, lpszDomain;
+ size_t dwEMailSize, dwAvatarSizeServer, dwFileNameSize;
+ FILETIME ftLastModifiedTimeServer, ftLastModifiedTimeLocal;
SYSTEMTIME stAvatarLastModifiedTimeLocal;
- HANDLE hConnection=NULL,hFile;
- NETLIBSELECT nls={0};
+ HANDLE hConnection = NULL, hFile;
+ NETLIBSELECT nls = {0};
INTERNET_TIME itAvatarLastModifiedTimeServer;
PROTO_AVATAR_INFORMATIONT pai;
- nls.cbSize=sizeof(nls);
- pai.cbSize=sizeof(pai);
+ nls.cbSize = sizeof(nls);
+ pai.cbSize = sizeof(pai);
InterlockedIncrement((volatile LONG*)&pmraaqAvatarsQueue->lThreadsRunningCount);
- while(InterlockedExchangeAdd((volatile LONG*)&pmraaqAvatarsQueue->bIsRunning,0))
+ while(InterlockedExchangeAdd((volatile LONG*)&pmraaqAvatarsQueue->bIsRunning, 0))
{
- if (FifoMTItemPop(&pmraaqAvatarsQueue->ffmtQueueToQuery,NULL,(LPVOID*)&pmraaqiAvatarsQueueItem)==NO_ERROR)
+ if (FifoMTItemPop(pmraaqAvatarsQueue, NULL, (LPVOID*)&pmraaqiAvatarsQueueItem) == NO_ERROR)
{
bFailed = TRUE;
bDownloadNew = FALSE;
bDefaultAvt = FALSE;
- if (DB_GetStaticStringA(NULL,MRA_AVT_SECT_NAME,"Server",szServer,SIZEOF(szServer),NULL)==FALSE) memmove(szServer,MRA_AVT_DEFAULT_SERVER,sizeof(MRA_AVT_DEFAULT_SERVER));
- dwServerPort=DBGetContactSettingDword(NULL,MRA_AVT_SECT_NAME,"ServerPort",MRA_AVT_DEFAULT_SERVER_PORT);
- bUseKeepAliveConn=DBGetContactSettingByte(NULL,MRA_AVT_SECT_NAME,"UseKeepAliveConn",MRA_AVT_DEFAULT_USE_KEEPALIVE_CONN);
-
- if (DB_Mra_GetStaticStringA(pmraaqiAvatarsQueueItem->hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize)) {
- BuffToLowerCase(szEMail,szEMail,dwEMailSize);
- if (lpszDomain=(LPSTR)MemoryFindByte(0,szEMail,dwEMailSize,'@'))
- if (lpszUser=(LPSTR)MemoryFindByte((lpszDomain-szEMail),szEMail,dwEMailSize,'.')) {
- *lpszUser = 0;
- lpszUser = szEMail;
- *lpszDomain = 0;
- lpszDomain++;
-
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmraaqiAvatarsQueueItem->hContact,ACKTYPE_AVATAR,ACKRESULT_CONNECTING,NULL,0);
- if (hConnection == NULL) hConnection = MraAvatarsHttpConnect(pmraaqAvatarsQueue->hNetlibUser,szServer,dwServerPort);
- if (hConnection) {
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmraaqiAvatarsQueueItem->hContact,ACKTYPE_AVATAR,ACKRESULT_CONNECTED,NULL,0);
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmraaqiAvatarsQueueItem->hContact,ACKTYPE_AVATAR,ACKRESULT_SENTREQUEST,NULL,0);
- if (MraAvatarsHttpTransaction(hConnection,REQUEST_HEAD,lpszUser,lpszDomain,szServer,MAHTRO_AVTMRIM,bUseKeepAliveConn,&dwResultCode,&bKeepAlive,&dwAvatarFormat,&dwAvatarSizeServer,&itAvatarLastModifiedTimeServer)==NO_ERROR)
- {
- switch(dwResultCode) {
- case 200:
- if (MraAvatarsGetContactTime(pmraaqiAvatarsQueueItem->hContact,"AvatarLastModifiedTime",&stAvatarLastModifiedTimeLocal)) {
- SystemTimeToFileTime(&itAvatarLastModifiedTimeServer.stTime,&ftLastModifiedTimeServer);
- SystemTimeToFileTime(&stAvatarLastModifiedTimeLocal,&ftLastModifiedTimeLocal);
-
- if ((*((DWORDLONG*)&ftLastModifiedTimeServer))!=(*((DWORDLONG*)&ftLastModifiedTimeLocal)))
- {// need check for update
- bDownloadNew=TRUE;
- //ProtoBroadcastAck(PROTOCOL_NAMEA,pmraaqiAvatarsQueueItem->hContact,ACKTYPE_AVATAR,ACKRESULT_STATUS,0,0);
- }
- else {// avatar is valid
- if (MraAvatarsGetFileName(pmraaqAvatarsQueue, pmraaqiAvatarsQueueItem->hContact, dwAvatarFormat, wszFileName, SIZEOF(wszFileName), NULL) == NO_ERROR) {
- if ( IsFileExist( wszFileName ))
- bFailed = FALSE;
- else
- bDownloadNew = TRUE;
+ if (DB_GetStaticStringA(NULL, MRA_AVT_SECT_NAME, "Server", szServer, SIZEOF(szServer), NULL) == FALSE) memmove(szServer, MRA_AVT_DEFAULT_SERVER, sizeof(MRA_AVT_DEFAULT_SERVER));
+ dwServerPort = DBGetContactSettingDword(NULL, MRA_AVT_SECT_NAME, "ServerPort", MRA_AVT_DEFAULT_SERVER_PORT);
+ bUseKeepAliveConn = db_get_b(NULL, MRA_AVT_SECT_NAME, "UseKeepAliveConn", MRA_AVT_DEFAULT_USE_KEEPALIVE_CONN);
+
+ if (mraGetStaticStringA(pmraaqiAvatarsQueueItem->hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize)) {
+ BuffToLowerCase(szEMail, szEMail, dwEMailSize);
+ if (lpszDomain = (LPSTR)MemoryFindByte(0, szEMail, dwEMailSize, '@'))
+ if (lpszUser = (LPSTR)MemoryFindByte((lpszDomain-szEMail), szEMail, dwEMailSize, '.')) {
+ *lpszUser = 0;
+ lpszUser = szEMail;
+ *lpszDomain = 0;
+ lpszDomain++;
+
+ ProtoBroadcastAck(m_szModuleName, pmraaqiAvatarsQueueItem->hContact, ACKTYPE_AVATAR, ACKRESULT_CONNECTING, NULL, 0);
+ if (hConnection == NULL) hConnection = MraAvatarsHttpConnect(pmraaqAvatarsQueue->hNetlibUser, szServer, dwServerPort);
+ if (hConnection) {
+ ProtoBroadcastAck(m_szModuleName, pmraaqiAvatarsQueueItem->hContact, ACKTYPE_AVATAR, ACKRESULT_CONNECTED, NULL, 0);
+ ProtoBroadcastAck(m_szModuleName, pmraaqiAvatarsQueueItem->hContact, ACKTYPE_AVATAR, ACKRESULT_SENTREQUEST, NULL, 0);
+ if (MraAvatarsHttpTransaction(hConnection, REQUEST_HEAD, lpszUser, lpszDomain, szServer, MAHTRO_AVTMRIM, bUseKeepAliveConn, &dwResultCode, &bKeepAlive, &dwAvatarFormat, &dwAvatarSizeServer, &itAvatarLastModifiedTimeServer) == NO_ERROR)
+ {
+ switch (dwResultCode) {
+ case 200:
+ if (MraAvatarsGetContactTime(pmraaqiAvatarsQueueItem->hContact, "AvatarLastModifiedTime", &stAvatarLastModifiedTimeLocal)) {
+ SystemTimeToFileTime(&itAvatarLastModifiedTimeServer.stTime, &ftLastModifiedTimeServer);
+ SystemTimeToFileTime(&stAvatarLastModifiedTimeLocal, &ftLastModifiedTimeLocal);
+
+ if ((*((DWORDLONG*)&ftLastModifiedTimeServer)) != (*((DWORDLONG*)&ftLastModifiedTimeLocal)))
+ {// need check for update
+ bDownloadNew = TRUE;
+ //ProtoBroadcastAck(m_szModuleName, pmraaqiAvatarsQueueItem->hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, 0, 0);
+ }
+ else {// avatar is valid
+ if (MraAvatarsGetFileName(pmraaqAvatarsQueue, pmraaqiAvatarsQueueItem->hContact, dwAvatarFormat, wszFileName, SIZEOF(wszFileName), NULL) == NO_ERROR) {
+ if ( IsFileExist( wszFileName ))
+ bFailed = FALSE;
+ else
+ bDownloadNew = TRUE;
+ }
}
}
- }
- else // need update
- bDownloadNew=TRUE;
-
- break;
- case 404:// return def avatar
- if (MraAvatarsGetFileName((HANDLE)pmraaqAvatarsQueue, NULL, PA_FORMAT_DEFAULT, wszFileName, SIZEOF(wszFileName), &dwFileNameSize) == NO_ERROR) {
- if ( IsFileExist( wszFileName )) {
- dwAvatarFormat = MraAvatarsGetFileFormat(wszFileName, dwFileNameSize);
- bFailed = FALSE;
+ else // need update
+ bDownloadNew = TRUE;
+
+ break;
+ case 404:// return def avatar
+ if (MraAvatarsGetFileName((HANDLE)pmraaqAvatarsQueue, NULL, PA_FORMAT_DEFAULT, wszFileName, SIZEOF(wszFileName), &dwFileNameSize) == NO_ERROR) {
+ if ( IsFileExist( wszFileName )) {
+ dwAvatarFormat = MraAvatarsGetFileFormat(wszFileName, dwFileNameSize);
+ bFailed = FALSE;
+ }
+ else//loading default avatar
+ bDownloadNew = TRUE;
+
+ bDefaultAvt = TRUE;
}
- else//loading default avatar
- bDownloadNew=TRUE;
+ break;
- bDefaultAvt=TRUE;
+ default:
+ mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateW(L"Avatars: server return HTTP code: %lu"), dwResultCode);
+ ShowFormattedErrorMessage(szErrorText, NO_ERROR);
+ break;
}
- break;
-
- default:
- mir_sntprintf(szErrorText,SIZEOF(szErrorText),TranslateW(L"Avatars: server return HTTP code: %lu"),dwResultCode);
- ShowFormatedErrorMessage(szErrorText,NO_ERROR);
- break;
}
+ if (bUseKeepAliveConn == FALSE || bKeepAlive == FALSE) NETLIB_CLOSEHANDLE(hConnection);
}
- if (bUseKeepAliveConn==FALSE || bKeepAlive==FALSE) NETLIB_CLOSEHANDLE(hConnection);
- }
- if (bDownloadNew)
- {
- if (hConnection==NULL) hConnection=MraAvatarsHttpConnect(pmraaqAvatarsQueue->hNetlibUser,szServer,dwServerPort);
- if (hConnection)
+ if (bDownloadNew)
{
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmraaqiAvatarsQueueItem->hContact,ACKTYPE_AVATAR,ACKRESULT_DATA,NULL,0);
- if (MraAvatarsHttpTransaction(hConnection,REQUEST_GET,lpszUser,lpszDomain,szServer,MAHTRO_AVT,bUseKeepAliveConn,&dwResultCode,&bKeepAlive,&dwAvatarFormat,&dwAvatarSizeServer,&itAvatarLastModifiedTimeServer)==NO_ERROR && dwResultCode==200)
+ if (hConnection == NULL) hConnection = MraAvatarsHttpConnect(pmraaqAvatarsQueue->hNetlibUser, szServer, dwServerPort);
+ if (hConnection)
{
- if (bDefaultAvt) dwAvatarFormat=PA_FORMAT_DEFAULT;
- if (MraAvatarsGetFileName(pmraaqAvatarsQueue, pmraaqiAvatarsQueueItem->hContact, dwAvatarFormat, wszFileName, SIZEOF(wszFileName), NULL) == NO_ERROR)
+ ProtoBroadcastAck(m_szModuleName, pmraaqiAvatarsQueueItem->hContact, ACKTYPE_AVATAR, ACKRESULT_DATA, NULL, 0);
+ if (MraAvatarsHttpTransaction(hConnection, REQUEST_GET, lpszUser, lpszDomain, szServer, MAHTRO_AVT, bUseKeepAliveConn, &dwResultCode, &bKeepAlive, &dwAvatarFormat, &dwAvatarSizeServer, &itAvatarLastModifiedTimeServer) == NO_ERROR && dwResultCode == 200)
{
- hFile = CreateFile(wszFileName,GENERIC_WRITE,FILE_SHARE_READ,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
- if (hFile != INVALID_HANDLE_VALUE) {
- dwWritten = 0;
- bContinue = TRUE;
- nls.dwTimeout = (1000*DBGetContactSettingDword(NULL,MRA_AVT_SECT_NAME,"TimeOutReceive",MRA_AVT_DEFAULT_TIMEOUT_RECV));
- nls.hReadConns[0] = hConnection;
-
- while ( bContinue ) {
- switch(CallService(MS_NETLIB_SELECT,0,(LPARAM)&nls)) {
- case SOCKET_ERROR:
- case 0:// Time out
- dwErrorCode=GetLastError();
- ShowFormatedErrorMessage(L"Avatars: error on receive file data",dwErrorCode);
- bContinue=FALSE;
- break;
- case 1:
- dwReceived=Netlib_Recv(hConnection,(LPSTR)&btBuff,SIZEOF(btBuff),0);
- if (dwReceived==0 || dwReceived==SOCKET_ERROR) {
- dwErrorCode=GetLastError();
- ShowFormatedErrorMessage(L"Avatars: error on receive file data",dwErrorCode);
- bContinue=FALSE;
- }
- else {
- if ( WriteFile( hFile, (LPVOID)&btBuff, dwReceived, &dwReceived, NULL)) {
- dwWritten += dwReceived;
- if (dwWritten >= dwAvatarSizeServer)
- bContinue=FALSE;
- }
- else {
+ if (bDefaultAvt) dwAvatarFormat = PA_FORMAT_DEFAULT;
+ if (MraAvatarsGetFileName(pmraaqAvatarsQueue, pmraaqiAvatarsQueueItem->hContact, dwAvatarFormat, wszFileName, SIZEOF(wszFileName), NULL) == NO_ERROR)
+ {
+ hFile = CreateFile(wszFileName, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (hFile != INVALID_HANDLE_VALUE) {
+ dwWritten = 0;
+ bContinue = TRUE;
+ nls.dwTimeout = (1000*DBGetContactSettingDword(NULL, MRA_AVT_SECT_NAME, "TimeOutReceive", MRA_AVT_DEFAULT_TIMEOUT_RECV));
+ nls.hReadConns[0] = hConnection;
+
+ while ( bContinue ) {
+ switch (CallService(MS_NETLIB_SELECT, 0, (LPARAM)&nls)) {
+ case SOCKET_ERROR:
+ case 0:// Time out
+ dwErrorCode = GetLastError();
+ ShowFormattedErrorMessage(L"Avatars: error on receive file data", dwErrorCode);
+ bContinue = FALSE;
+ break;
+ case 1:
+ dwReceived = Netlib_Recv(hConnection, (LPSTR)&btBuff, SIZEOF(btBuff), 0);
+ if (dwReceived == 0 || dwReceived == SOCKET_ERROR) {
dwErrorCode = GetLastError();
- ShowFormatedErrorMessage(L"Avatars: cant write file data, error",dwErrorCode);
+ ShowFormattedErrorMessage(L"Avatars: error on receive file data", dwErrorCode);
bContinue = FALSE;
}
+ else {
+ if ( WriteFile( hFile, (LPVOID)&btBuff, dwReceived, &dwReceived, NULL)) {
+ dwWritten += dwReceived;
+ if (dwWritten >= dwAvatarSizeServer)
+ bContinue = FALSE;
+ }
+ else {
+ dwErrorCode = GetLastError();
+ ShowFormattedErrorMessage(L"Avatars: cant write file data, error", dwErrorCode);
+ bContinue = FALSE;
+ }
+ }
+ break;
}
- break;
}
+ CloseHandle(hFile);
+ bFailed = FALSE;
+ }
+ else {
+ dwErrorCode = GetLastError();
+ mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateW(L"Avatars: cant open file %s, error"), wszFileName);
+ ShowFormattedErrorMessage(szErrorText, dwErrorCode);
}
- CloseHandle(hFile);
- bFailed = FALSE;
- }
- else {
- dwErrorCode = GetLastError();
- mir_sntprintf(szErrorText,SIZEOF(szErrorText),TranslateW(L"Avatars: cant open file %s, error"),wszFileName);
- ShowFormatedErrorMessage(szErrorText,dwErrorCode);
}
}
+ else DebugBreak();
+
+ if (bUseKeepAliveConn == FALSE || bKeepAlive == FALSE) NETLIB_CLOSEHANDLE(hConnection);
}
- else DebugBreak();
-
- if (bUseKeepAliveConn==FALSE || bKeepAlive==FALSE) NETLIB_CLOSEHANDLE(hConnection);
}
}
- }
}
if (bFailed) {
@@ -399,30 +374,30 @@ void MraAvatarsThreadProc(LPVOID lpParameter)
pai.hContact = pmraaqiAvatarsQueueItem->hContact;
pai.format = PA_FORMAT_UNKNOWN;
pai.filename[0] = 0;
- ProtoBroadcastAck(PROTOCOL_NAMEA, pmraaqiAvatarsQueueItem->hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&pai, 0);
+ ProtoBroadcastAck(m_szModuleName, pmraaqiAvatarsQueueItem->hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&pai, 0);
}
else {
pai.hContact = pmraaqiAvatarsQueueItem->hContact;
pai.format = dwAvatarFormat;
- if ( DBGetContactSettingByte(NULL, MRA_AVT_SECT_NAME, "ReturnAbsolutePath", MRA_AVT_DEFAULT_RET_ABC_PATH))
+ if ( db_get_b(NULL, MRA_AVT_SECT_NAME, "ReturnAbsolutePath", MRA_AVT_DEFAULT_RET_ABC_PATH))
lstrcpyn(pai.filename, wszFileName, SIZEOF(pai.filename));
else
CallService(MS_UTILS_PATHTORELATIVET, (WPARAM)wszFileName, (LPARAM)pai.filename );
-
+
if (bDefaultAvt) dwAvatarFormat = PA_FORMAT_DEFAULT;
SetContactAvatarFormat(pmraaqiAvatarsQueueItem->hContact, dwAvatarFormat);
- MraAvatarsSetContactTime(pmraaqiAvatarsQueueItem->hContact,"AvatarLastModifiedTime",&itAvatarLastModifiedTimeServer.stTime);
+ MraAvatarsSetContactTime(pmraaqiAvatarsQueueItem->hContact, "AvatarLastModifiedTime", &itAvatarLastModifiedTimeServer.stTime);
// write owner avatar file name to DB
if ( pmraaqiAvatarsQueueItem->hContact == NULL) // proto avatar
- CallService(MS_AV_REPORTMYAVATARCHANGED, (WPARAM)PROTOCOL_NAMEA, 0);
-
- ProtoBroadcastAck(PROTOCOL_NAMEA, pmraaqiAvatarsQueueItem->hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&pai, 0);
+ CallService(MS_AV_REPORTMYAVATARCHANGED, (WPARAM)m_szModuleName, 0);
+
+ ProtoBroadcastAck(m_szModuleName, pmraaqiAvatarsQueueItem->hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&pai, 0);
}
- MEMFREE(pmraaqiAvatarsQueueItem);
+ mir_free(pmraaqiAvatarsQueueItem);
}
- else{ // waiting until service stop or new task
+ else { // waiting until service stop or new task
NETLIB_CLOSEHANDLE(hConnection);
- WaitForSingleObjectEx(pmraaqAvatarsQueue->hThreadEvent,MRA_AVT_DEFAULT_QE_CHK_INTERVAL,FALSE);
+ WaitForSingleObjectEx(pmraaqAvatarsQueue->hThreadEvent, MRA_AVT_DEFAULT_QE_CHK_INTERVAL, FALSE);
}
}
@@ -430,198 +405,192 @@ void MraAvatarsThreadProc(LPVOID lpParameter)
}
-HANDLE MraAvatarsHttpConnect(HANDLE hNetlibUser,LPSTR lpszHost,DWORD dwPort)
+HANDLE MraAvatarsHttpConnect(HANDLE hNetlibUser, LPSTR lpszHost, DWORD dwPort)
{
HANDLE hConnection;
- DWORD dwConnectReTryCount,dwCurConnectReTryCount;
- NETLIBOPENCONNECTION nloc={0};
+ DWORD dwConnectReTryCount, dwCurConnectReTryCount;
+ NETLIBOPENCONNECTION nloc = {0};
- dwConnectReTryCount=DBGetContactSettingDword(NULL,MRA_AVT_SECT_NAME,"ConnectReTryCount",MRA_AVT_DEFAULT_CONN_RETRY_COUNT);
+ dwConnectReTryCount = DBGetContactSettingDword(NULL, MRA_AVT_SECT_NAME, "ConnectReTryCount", MRA_AVT_DEFAULT_CONN_RETRY_COUNT);
- nloc.cbSize=sizeof(nloc);
- nloc.flags=(NLOCF_HTTP|NLOCF_V2);
- nloc.szHost=lpszHost;
+ nloc.cbSize = sizeof(nloc);
+ nloc.flags = (NLOCF_HTTP|NLOCF_V2);
+ nloc.szHost = lpszHost;
if (IsHTTPSProxyUsed(hNetlibUser))
{// через https прокси только 443 порт
- nloc.wPort=MRA_SERVER_PORT_HTTPS;
- }else{
- nloc.wPort=(WORD)dwPort;
+ nloc.wPort = MRA_SERVER_PORT_HTTPS;
+ }else {
+ nloc.wPort = (WORD)dwPort;
}
- nloc.timeout=DBGetContactSettingDword(NULL,MRA_AVT_SECT_NAME,"TimeOutConnect",MRA_AVT_DEFAULT_TIMEOUT_CONN);
- if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout=MRA_TIMEOUT_CONN_MIN;
- if (nloc.timeout>MRA_TIMEOUT_CONN_МАХ) nloc.timeout=MRA_TIMEOUT_CONN_МАХ;
+ nloc.timeout = DBGetContactSettingDword(NULL, MRA_AVT_SECT_NAME, "TimeOutConnect", MRA_AVT_DEFAULT_TIMEOUT_CONN);
+ if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout = MRA_TIMEOUT_CONN_MIN;
+ if (nloc.timeout>MRA_TIMEOUT_CONN_МАХ) nloc.timeout = MRA_TIMEOUT_CONN_МАХ;
- dwCurConnectReTryCount=dwConnectReTryCount;
- do{
- hConnection=(HANDLE)CallService(MS_NETLIB_OPENCONNECTION,(WPARAM)hNetlibUser,(LPARAM)&nloc);
- }while(--dwCurConnectReTryCount && hConnection==NULL);
-
- if (hConnection==NULL)
- {
- ShowFormatedErrorMessage(L"Avatars: can't connect to server, error",GetLastError());
+ dwCurConnectReTryCount = dwConnectReTryCount;
+ do {
+ hConnection = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)hNetlibUser, (LPARAM)&nloc);
}
-return(hConnection);
+ while(--dwCurConnectReTryCount && hConnection == NULL);
+
+ return(hConnection);
}
-DWORD MraAvatarsHttpTransaction(HANDLE hConnection,DWORD dwRequestType,LPSTR lpszUser,LPSTR lpszDomain,LPSTR lpszHost,DWORD dwReqObj,BOOL bUseKeepAliveConn,DWORD *pdwResultCode,BOOL *pbKeepAlive,DWORD *pdwFormat,SIZE_T *pdwAvatarSize,INTERNET_TIME *pitLastModifiedTime)
+DWORD MraAvatarsHttpTransaction(HANDLE hConnection, DWORD dwRequestType, LPSTR lpszUser, LPSTR lpszDomain, LPSTR lpszHost, DWORD dwReqObj, BOOL bUseKeepAliveConn, DWORD *pdwResultCode, BOOL *pbKeepAlive, DWORD *pdwFormat, size_t *pdwAvatarSize, INTERNET_TIME *pitLastModifiedTime)
{
DWORD dwRetErrorCode;
- if (pdwResultCode) (*pdwResultCode)=0;
- if (pbKeepAlive) (*pbKeepAlive)=FALSE;
- if (pdwFormat) (*pdwFormat)=PA_FORMAT_UNKNOWN;
- if (pdwAvatarSize) (*pdwAvatarSize)=0;
- if (pitLastModifiedTime)bzero(pitLastModifiedTime,sizeof(INTERNET_TIME));
+ if (pdwResultCode) (*pdwResultCode) = 0;
+ if (pbKeepAlive) (*pbKeepAlive) = FALSE;
+ if (pdwFormat) (*pdwFormat) = PA_FORMAT_UNKNOWN;
+ if (pdwAvatarSize) (*pdwAvatarSize) = 0;
+ if (pitLastModifiedTime)bzero(pitLastModifiedTime, sizeof(INTERNET_TIME));
if (hConnection)
{
- char szBuff[4096],szSelfVersionString[MAX_PATH];
- DWORD dwSended,dwBuffSize;
+ char szBuff[4096], szSelfVersionString[MAX_PATH];
+ DWORD dwSended, dwBuffSize;
LPSTR lpszReqObj;
- NETLIBHTTPHEADER nlbhHeaders[8]={0};
- NETLIBHTTPREQUEST *pnlhr,nlhr={0};
-
- switch(dwReqObj){
- case MAHTRO_AVT: lpszReqObj="_avatar"; break;
- case MAHTRO_AVTMRIM: lpszReqObj="_mrimavatar"; break;
- case MAHTRO_AVTSMALL: lpszReqObj="_avatarsmall"; break;
- case MAHTRO_AVTSMALLMRIM: lpszReqObj="_mrimavatarsmall"; break;
- default: lpszReqObj=""; break;
+ NETLIBHTTPHEADER nlbhHeaders[8] = {0};
+ NETLIBHTTPREQUEST *pnlhr, nlhr = {0};
+
+ switch (dwReqObj) {
+ case MAHTRO_AVT: lpszReqObj = "_avatar"; break;
+ case MAHTRO_AVTMRIM: lpszReqObj = "_mrimavatar"; break;
+ case MAHTRO_AVTSMALL: lpszReqObj = "_avatarsmall"; break;
+ case MAHTRO_AVTSMALLMRIM: lpszReqObj = "_mrimavatarsmall"; break;
+ default: lpszReqObj = ""; break;
}
- dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"http://%s/%s/%s/%s",lpszHost,lpszDomain,lpszUser,lpszReqObj);
-
- MraGetSelfVersionString(szSelfVersionString,SIZEOF(szSelfVersionString),NULL);
-
- nlbhHeaders[0].szName="User-Agent"; nlbhHeaders[0].szValue=szSelfVersionString;
- nlbhHeaders[1].szName="Accept-Encoding";nlbhHeaders[1].szValue="deflate";
- nlbhHeaders[2].szName="Pragma"; nlbhHeaders[2].szValue="no-cache";
- nlbhHeaders[3].szName="Connection"; nlbhHeaders[3].szValue=(bUseKeepAliveConn)? "keep-alive":"close";
- //nlbhHeaders[4].szName="If-Modified-Since";nlbhHeaders[4].szValue="Thu, 03 Aug 2006 19:54:33 GMT";
-
- nlhr.cbSize=sizeof(nlhr);
- nlhr.requestType=dwRequestType;
- nlhr.flags=(NLHRF_GENERATEHOST|NLHRF_SMARTREMOVEHOST|NLHRF_SMARTAUTHHEADER);
- nlhr.szUrl=szBuff;
- nlhr.headers=(NETLIBHTTPHEADER*)&nlbhHeaders;
- nlhr.headersCount=4;
- //nlhr.pData=NULL;
- //nlhr.dataLength=0;
- //nlhr.resultCode=0;
- //nlhr.szResultDescr=NULL;
- //nlhr.nlc=NULL;
+ dwBuffSize = mir_snprintf(szBuff, SIZEOF(szBuff), "http://%s/%s/%s/%s", lpszHost, lpszDomain, lpszUser, lpszReqObj);
+
+ MraGetSelfVersionString(szSelfVersionString, SIZEOF(szSelfVersionString), NULL);
+
+ nlbhHeaders[0].szName = "User-Agent"; nlbhHeaders[0].szValue = szSelfVersionString;
+ nlbhHeaders[1].szName = "Accept-Encoding";nlbhHeaders[1].szValue = "deflate";
+ nlbhHeaders[2].szName = "Pragma"; nlbhHeaders[2].szValue = "no-cache";
+ nlbhHeaders[3].szName = "Connection"; nlbhHeaders[3].szValue = (bUseKeepAliveConn)? "keep-alive":"close";
+ //nlbhHeaders[4].szName = "If-Modified-Since";nlbhHeaders[4].szValue = "Thu, 03 Aug 2006 19:54:33 GMT";
+
+ nlhr.cbSize = sizeof(nlhr);
+ nlhr.requestType = dwRequestType;
+ nlhr.flags = (NLHRF_GENERATEHOST|NLHRF_SMARTREMOVEHOST|NLHRF_SMARTAUTHHEADER);
+ nlhr.szUrl = szBuff;
+ nlhr.headers = (NETLIBHTTPHEADER*)&nlbhHeaders;
+ nlhr.headersCount = 4;
+ //nlhr.pData = NULL;
+ //nlhr.dataLength = 0;
+ //nlhr.resultCode = 0;
+ //nlhr.szResultDescr = NULL;
+ //nlhr.nlc = NULL;
- dwSended=CallService(MS_NETLIB_SENDHTTPREQUEST,(WPARAM)hConnection,(LPARAM)&nlhr);
- if (dwSended!=SOCKET_ERROR && dwSended)
+ dwSended = CallService(MS_NETLIB_SENDHTTPREQUEST, (WPARAM)hConnection, (LPARAM)&nlhr);
+ if (dwSended != SOCKET_ERROR && dwSended)
{
- pnlhr=(NETLIBHTTPREQUEST*)CallService(MS_NETLIB_RECVHTTPHEADERS,(WPARAM)hConnection,(LPARAM)0);
+ pnlhr = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_RECVHTTPHEADERS, (WPARAM)hConnection, (LPARAM)0);
if (pnlhr)
{
- for(SIZE_T i=0;i<(SIZE_T)pnlhr->headersCount;i++)
+ for (size_t i = 0;i<(size_t)pnlhr->headersCount;i++)
{
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pnlhr->headers[i].szName,-1,"Connection",10)==CSTR_EQUAL)
+ if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, pnlhr->headers[i].szName, -1, "Connection", 10) == CSTR_EQUAL)
{
- if (pbKeepAlive) (*pbKeepAlive)=(CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pnlhr->headers[i].szValue,-1,"keep-alive",10)==CSTR_EQUAL);
+ if (pbKeepAlive) (*pbKeepAlive) = (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, pnlhr->headers[i].szValue, -1, "keep-alive", 10) == CSTR_EQUAL);
}else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pnlhr->headers[i].szName,-1,"Content-Type",12)==CSTR_EQUAL)
+ if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, pnlhr->headers[i].szName, -1, "Content-Type", 12) == CSTR_EQUAL)
{
if (pdwFormat)
{
- for (SIZE_T j=0;j<PA_FORMAT_MAX;j++)
+ for (size_t j = 0;j<PA_FORMAT_MAX;j++)
{
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pnlhr->headers[i].szValue,-1,lpcszContentType[j],-1)==CSTR_EQUAL)
+ if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, pnlhr->headers[i].szValue, -1, lpcszContentType[j], -1) == CSTR_EQUAL)
{
- (*pdwFormat)=j;
+ (*pdwFormat) = j;
break;
}
}
}
}else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pnlhr->headers[i].szName,-1,"Content-Length",14)==CSTR_EQUAL)
+ if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, pnlhr->headers[i].szName, -1, "Content-Length", 14) == CSTR_EQUAL)
{
- if (pdwAvatarSize) (*pdwAvatarSize)=StrToUNum(pnlhr->headers[i].szValue,lstrlenA(pnlhr->headers[i].szValue));
+ if (pdwAvatarSize) (*pdwAvatarSize) = StrToUNum(pnlhr->headers[i].szValue, lstrlenA(pnlhr->headers[i].szValue));
}else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pnlhr->headers[i].szName,-1,"Last-Modified",13)==CSTR_EQUAL)
+ if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, pnlhr->headers[i].szName, -1, "Last-Modified", 13) == CSTR_EQUAL)
{
- if (pitLastModifiedTime) InternetTimeGetTime(pnlhr->headers[i].szValue,lstrlenA(pnlhr->headers[i].szValue),pitLastModifiedTime);
+ if (pitLastModifiedTime) InternetTimeGetTime(pnlhr->headers[i].szValue, lstrlenA(pnlhr->headers[i].szValue), pitLastModifiedTime);
}
}// end for
- if (pdwResultCode) (*pdwResultCode)=pnlhr->resultCode;
- CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT,(WPARAM)0,(LPARAM)pnlhr);
- dwRetErrorCode=NO_ERROR;
- }else{// err on receive
- dwRetErrorCode=GetLastError();
- ShowFormatedErrorMessage(L"Avatars: error on receive HTTP answer",dwRetErrorCode);
+ if (pdwResultCode) (*pdwResultCode) = pnlhr->resultCode;
+ CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, (WPARAM)0, (LPARAM)pnlhr);
+ dwRetErrorCode = NO_ERROR;
+ }else {// err on receive
+ dwRetErrorCode = GetLastError();
}
- }else{// err on send http request
- dwRetErrorCode=GetLastError();
- ShowFormatedErrorMessage(L"Avatars: error on send HTTP request",dwRetErrorCode);
+ }else {// err on send http request
+ dwRetErrorCode = GetLastError();
}
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }else {
+ dwRetErrorCode = ERROR_INVALID_HANDLE;
}
return(dwRetErrorCode);
}
-
-BOOL MraAvatarsGetContactTime(HANDLE hContact,LPSTR lpszValueName,SYSTEMTIME *pstTime)
+BOOL CMraProto::MraAvatarsGetContactTime(HANDLE hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime)
{
- BOOL bRet=FALSE;
+ BOOL bRet = FALSE;
if (lpszValueName && pstTime)
{
char szBuff[MAX_PATH];
- SIZE_T dwBuffSize;
+ size_t dwBuffSize;
INTERNET_TIME itAvatarLastModifiedTimeLocal;
- if (DB_Mra_GetStaticStringA(hContact,lpszValueName,(LPSTR)szBuff,SIZEOF(szBuff),&dwBuffSize))
- if (InternetTimeGetTime(szBuff,dwBuffSize,&itAvatarLastModifiedTimeLocal)==NO_ERROR)
+ if (mraGetStaticStringA(hContact, lpszValueName, (LPSTR)szBuff, SIZEOF(szBuff), &dwBuffSize))
+ if (InternetTimeGetTime(szBuff, dwBuffSize, &itAvatarLastModifiedTimeLocal) == NO_ERROR)
{
- memmove(pstTime,&itAvatarLastModifiedTimeLocal.stTime,sizeof(SYSTEMTIME));
- bRet=TRUE;
+ memmove(pstTime, &itAvatarLastModifiedTimeLocal.stTime, sizeof(SYSTEMTIME));
+ bRet = TRUE;
}
}
return(bRet);
}
-void MraAvatarsSetContactTime(HANDLE hContact,LPSTR lpszValueName,SYSTEMTIME *pstTime)
+void CMraProto::MraAvatarsSetContactTime(HANDLE hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime)
{
if (lpszValueName)
{
char szBuff[MAX_PATH];
- SIZE_T dwBuffUsedSize;
+ size_t dwBuffUsedSize;
INTERNET_TIME itTime;
if (pstTime)
{
- itTime.lTimeZone=0;
- memmove(&itTime.stTime,pstTime,sizeof(SYSTEMTIME));
- }else{
+ itTime.lTimeZone = 0;
+ memmove(&itTime.stTime, pstTime, sizeof(SYSTEMTIME));
+ }else {
InternetTimeGetCurrentTime(&itTime);
}
if (itTime.stTime.wYear)
{
- InternetTimeGetString(&itTime,(LPSTR)szBuff,SIZEOF(szBuff),&dwBuffUsedSize);
- DB_Mra_SetStringExA(hContact,lpszValueName,(LPSTR)szBuff,dwBuffUsedSize);
- }else{
- DB_Mra_DeleteValue(hContact,lpszValueName);
+ InternetTimeGetString(&itTime, (LPSTR)szBuff, SIZEOF(szBuff), &dwBuffUsedSize);
+ mraSetStringExA(hContact, lpszValueName, (LPSTR)szBuff, dwBuffUsedSize);
+ }else {
+ mraDelValue(hContact, lpszValueName);
}
}
}
-DWORD MraAvatarsGetFileFormat(LPTSTR lpszPath,SIZE_T dwPathSize)
+DWORD MraAvatarsGetFileFormat(LPTSTR lpszPath, size_t dwPathSize)
{
DWORD dwRet = -1;
TCHAR dwExt[ 5 ];
BuffToLowerCase(&dwExt, lpszPath+(dwPathSize-4), 4);
- for ( DWORD i=0; i < PA_FORMAT_MAX; i++ ) {
+ for ( DWORD i = 0; i < PA_FORMAT_MAX; i++ ) {
if ( !_tcscmp( dwExt, lpcszExtensions[i])) {
dwRet = i;
break;
@@ -631,7 +600,7 @@ DWORD MraAvatarsGetFileFormat(LPTSTR lpszPath,SIZE_T dwPathSize)
}
-DWORD MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HANDLE hContact, DWORD dwFormat, LPTSTR lpszPath, SIZE_T dwPathSize, SIZE_T *pdwPathSizeRet)
+DWORD CMraProto::MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HANDLE hContact, DWORD dwFormat, LPTSTR lpszPath, size_t dwPathSize, size_t *pdwPathSizeRet)
{
if (hAvatarsQueueHandle == NULL)
return ERROR_INVALID_HANDLE;
@@ -640,14 +609,14 @@ DWORD MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HANDLE hContact, DWORD d
return ERROR_NOT_SUPPORTED;
LPTSTR lpszCurPath = lpszPath;
- SIZE_T dwEMailSize;
- MRA_AVATARS_QUEUE *pmraaqAvatarsQueue=(MRA_AVATARS_QUEUE*)hAvatarsQueueHandle;
+ size_t dwEMailSize;
+ MRA_AVATARS_QUEUE *pmraaqAvatarsQueue = (MRA_AVATARS_QUEUE*)hAvatarsQueueHandle;
DWORD dwRetErrorCode = ERROR_INSUFFICIENT_BUFFER;
if ( !bFoldersPresent ) {
// default path
LPTSTR lpszPathToAvatarsCache = Utils_ReplaceVarsT( _T("%miranda_avatarcache%"));
- dwEMailSize = mir_sntprintf(lpszPath, dwPathSize, _T("%s\\%s\\"), lpszPathToAvatarsCache, PROTOCOL_NAMEW);
+ dwEMailSize = mir_sntprintf(lpszPath, dwPathSize, _T("%s\\%s\\"), lpszPathToAvatarsCache, m_tszUserName);
mir_free(lpszPathToAvatarsCache);
}
else {
@@ -663,7 +632,7 @@ DWORD MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HANDLE hContact, DWORD d
CallService(MS_UTILS_CREATEDIRTREET, 0, (LPARAM)lpszPath);
if (dwFormat != PA_FORMAT_DEFAULT) {
- if ( DB_Mra_GetStaticStringW(hContact, "e-mail", lpszCurPath, (dwPathSize-5), &dwEMailSize)) {
+ if ( mraGetStaticStringW(hContact, "e-mail", lpszCurPath, (dwPathSize-5), &dwEMailSize)) {
BuffToLowerCase(lpszCurPath, lpszCurPath, dwEMailSize);
lpszCurPath += dwEMailSize;
_tcscpy( lpszCurPath, lpcszExtensions[dwFormat] );
@@ -690,170 +659,163 @@ DWORD MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HANDLE hContact, DWORD d
return dwRetErrorCode;
}
-DWORD MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle,DWORD dwFlags,HANDLE hContact,DWORD *pdwAvatarsQueueID,DWORD *pdwFormat,LPTSTR lpszPath)
+DWORD CMraProto::MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD *pdwAvatarsQueueID, DWORD *pdwFormat, LPTSTR lpszPath)
{
- DWORD dwRetCode=GAIR_NOAVATAR;
+ DWORD dwRetCode = GAIR_NOAVATAR;
if (hAvatarsQueueHandle)
- if (DBGetContactSettingByte(NULL,MRA_AVT_SECT_NAME,"Enable",MRA_AVT_DEFAULT_ENABLE))
- if (IsContactChatAgent(hContact)==FALSE)
+ if (db_get_b(NULL, MRA_AVT_SECT_NAME, "Enable", MRA_AVT_DEFAULT_ENABLE))
+ if (IsContactChatAgent(hContact) == FALSE)
{// not @chat.agent conference
- BOOL bQueueAdd=TRUE;// check for updates
- MRA_AVATARS_QUEUE *pmraaqAvatarsQueue=(MRA_AVATARS_QUEUE*)hAvatarsQueueHandle;
+ BOOL bQueueAdd = TRUE;// check for updates
+ MRA_AVATARS_QUEUE *pmraaqAvatarsQueue = (MRA_AVATARS_QUEUE*)hAvatarsQueueHandle;
SYSTEMTIME stAvatarLastCheckTime;
- if ((dwFlags&GAIF_FORCE)==0)// если флаг принудит. обновления, то даже не проверяем времени последнего обновления
- if (MraAvatarsGetContactTime(hContact,"AvatarLastCheckTime",&stAvatarLastCheckTime))
+ if ((dwFlags&GAIF_FORCE) == 0)// если флаг принудит. обновления, то даже не проверяем времени последнего обновления
+ if (MraAvatarsGetContactTime(hContact, "AvatarLastCheckTime", &stAvatarLastCheckTime))
{
TCHAR wszFileName[MAX_FILEPATH];
- SIZE_T dwPathSize;
- FILETIME ftCurrentTime,ftExpireTime;
+ size_t dwPathSize;
+ FILETIME ftCurrentTime, ftExpireTime;
GetSystemTimeAsFileTime(&ftCurrentTime);
- SystemTimeToFileTime(&stAvatarLastCheckTime,&ftExpireTime);
- (*((DWORDLONG*)&ftExpireTime))+=(FILETIME_MINUTE*(DWORDLONG)DBGetContactSettingDword(NULL,MRA_AVT_SECT_NAME,"CheckInterval",MRA_AVT_DEFAULT_CHK_INTERVAL));
+ SystemTimeToFileTime(&stAvatarLastCheckTime, &ftExpireTime);
+ (*((DWORDLONG*)&ftExpireTime)) += (FILETIME_MINUTE*(DWORDLONG)DBGetContactSettingDword(NULL, MRA_AVT_SECT_NAME, "CheckInterval", MRA_AVT_DEFAULT_CHK_INTERVAL));
if ((*((DWORDLONG*)&ftExpireTime))>(*((DWORDLONG*)&ftCurrentTime)))
- if ( MraAvatarsGetFileName(hAvatarsQueueHandle, hContact, GetContactAvatarFormat(hContact,PA_FORMAT_DEFAULT), wszFileName, SIZEOF(wszFileName), &dwPathSize) == NO_ERROR)
+ if ( MraAvatarsGetFileName(hAvatarsQueueHandle, hContact, GetContactAvatarFormat(hContact, PA_FORMAT_DEFAULT), wszFileName, SIZEOF(wszFileName), &dwPathSize) == NO_ERROR)
if ( IsFileExist( wszFileName )) {
// файл с аватаром существует и не устарел/не было комманды обновлять(просто запрос имени)
if (lpszPath) {
- if (DBGetContactSettingByte(NULL,MRA_AVT_SECT_NAME,"ReturnAbsolutePath",MRA_AVT_DEFAULT_RET_ABC_PATH))
+ if (db_get_b(NULL, MRA_AVT_SECT_NAME, "ReturnAbsolutePath", MRA_AVT_DEFAULT_RET_ABC_PATH))
lstrcpyn(lpszPath, wszFileName, MAX_PATH);
else
CallService( MS_UTILS_PATHTORELATIVET, (WPARAM)wszFileName, (LPARAM)lpszPath );
}
- if (pdwFormat) (*pdwFormat)=GetContactAvatarFormat(hContact,PA_FORMAT_DEFAULT);
- dwRetCode=GAIR_SUCCESS;
- bQueueAdd=FALSE;
+ if (pdwFormat) (*pdwFormat) = GetContactAvatarFormat(hContact, PA_FORMAT_DEFAULT);
+ dwRetCode = GAIR_SUCCESS;
+ bQueueAdd = FALSE;
}
}
if (bQueueAdd || (dwFlags&GAIF_FORCE))
- if (MraAvatarsQueueAdd(hAvatarsQueueHandle,dwFlags,hContact,pdwAvatarsQueueID)==NO_ERROR)
+ if (MraAvatarsQueueAdd(hAvatarsQueueHandle, dwFlags, hContact, pdwAvatarsQueueID) == NO_ERROR)
{
- MraAvatarsSetContactTime(hContact,"AvatarLastCheckTime",NULL);
- dwRetCode=GAIR_WAITFOR;
+ MraAvatarsSetContactTime(hContact, "AvatarLastCheckTime", NULL);
+ dwRetCode = GAIR_WAITFOR;
}
}
return(dwRetCode);
}
-DWORD MraAvatarsQueueGetAvatarSimple(HANDLE hAvatarsQueueHandle,DWORD dwFlags,HANDLE hContact,DWORD dwSourceID)
+DWORD CMraProto::MraAvatarsQueueGetAvatarSimple(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD dwSourceID)
{//***deb dwSourceID - for filtering cals from different places
- DWORD dwRetCode=GAIR_NOAVATAR;
+ DWORD dwRetCode = GAIR_NOAVATAR;
- PROTO_AVATAR_INFORMATIONT pai={0};
+ PROTO_AVATAR_INFORMATIONT pai = {0};
pai.cbSize = sizeof(pai);
pai.hContact = hContact;
- if ((dwRetCode = MraAvatarsQueueGetAvatar(hAvatarsQueueHandle, dwFlags, hContact,NULL, (DWORD*)&pai.format, pai.filename )) == GAIR_SUCCESS ) {
+ if ((dwRetCode = MraAvatarsQueueGetAvatar(hAvatarsQueueHandle, dwFlags, hContact, NULL, (DWORD*)&pai.format, pai.filename )) == GAIR_SUCCESS ) {
// write owner avatar file name to DB
if (hContact == NULL)
- CallService(MS_AV_REPORTMYAVATARCHANGED, (WPARAM)PROTOCOL_NAMEA, 0);
+ CallService(MS_AV_REPORTMYAVATARCHANGED, (WPARAM)m_szModuleName, 0);
- ProtoBroadcastAck(PROTOCOL_NAMEA, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&pai, 0);
+ ProtoBroadcastAck(m_szModuleName, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&pai, 0);
}
return(dwRetCode);
}
-WORD wMraAvatarsControlsList[]={
- IDC_SERVER,
- IDC_SERVERPORT,
- IDC_BUTTON_DEFAULT,
- IDC_USE_KEEPALIVE_CONN,
- IDC_UPD_CHECK_INTERVAL,
- IDC_RETURN_ABC_PATH,
+WORD wMraAvatarsControlsList[] = {
+ IDC_SERVER,
+ IDC_SERVERPORT,
+ IDC_BUTTON_DEFAULT,
+ IDC_USE_KEEPALIVE_CONN,
+ IDC_UPD_CHECK_INTERVAL,
+ IDC_RETURN_ABC_PATH,
IDC_DELETE_AVT_ON_CONTACT_DELETE
};
-INT_PTR CALLBACK MraAvatarsQueueDlgProcOpts(HWND hWndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK MraAvatarsQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg){
+ CMraProto *ppro = (CMraProto*)GetWindowLongPtr(hWndDlg, GWLP_USERDATA);
+
+ switch (msg) {
case WM_INITDIALOG:
+ TranslateDialogDefault(hWndDlg);
+ SetWindowLongPtr(hWndDlg, GWLP_USERDATA, lParam);
+ ppro = (CMraProto*)lParam;
{
WCHAR szServer[MAX_PATH];
- TranslateDialogDefault(hWndDlg);
+ CHECK_DLG_BUTTON(hWndDlg, IDC_ENABLE, db_get_b(NULL, MRA_AVT_SECT_NAME, "Enable", MRA_AVT_DEFAULT_ENABLE));
- CHECK_DLG_BUTTON(hWndDlg,IDC_ENABLE,DBGetContactSettingByte(NULL,MRA_AVT_SECT_NAME,"Enable",MRA_AVT_DEFAULT_ENABLE));
+ if (DB_GetStaticStringW(NULL, MRA_AVT_SECT_NAME, "Server", szServer, MAX_PATH, NULL))
+ SET_DLG_ITEM_TEXT(hWndDlg, IDC_SERVER, szServer);
+ else
+ SET_DLG_ITEM_TEXTA(hWndDlg, IDC_SERVER, MRA_AVT_DEFAULT_SERVER);
- if (DB_GetStaticStringW(NULL,MRA_AVT_SECT_NAME,"Server",szServer,MAX_PATH,NULL))
- {
- SET_DLG_ITEM_TEXT(hWndDlg,IDC_SERVER,szServer);
- }else{
- SET_DLG_ITEM_TEXTA(hWndDlg,IDC_SERVER,MRA_AVT_DEFAULT_SERVER);
- }
-
- SetDlgItemInt(hWndDlg,IDC_SERVERPORT,DBGetContactSettingDword(NULL,MRA_AVT_SECT_NAME,"ServerPort",MRA_AVT_DEFAULT_SERVER_PORT),FALSE);
- CHECK_DLG_BUTTON(hWndDlg,IDC_USE_KEEPALIVE_CONN,DBGetContactSettingByte(NULL,MRA_AVT_SECT_NAME,"UseKeepAliveConn",MRA_AVT_DEFAULT_USE_KEEPALIVE_CONN));
- SetDlgItemInt(hWndDlg,IDC_UPD_CHECK_INTERVAL,DBGetContactSettingDword(NULL,MRA_AVT_SECT_NAME,"CheckInterval",MRA_AVT_DEFAULT_CHK_INTERVAL),FALSE);
- CHECK_DLG_BUTTON(hWndDlg,IDC_RETURN_ABC_PATH,DBGetContactSettingByte(NULL,MRA_AVT_SECT_NAME,"ReturnAbsolutePath",MRA_AVT_DEFAULT_RET_ABC_PATH));
- CHECK_DLG_BUTTON(hWndDlg,IDC_DELETE_AVT_ON_CONTACT_DELETE,DBGetContactSettingByte(NULL,MRA_AVT_SECT_NAME,"DeleteAvtOnContactDelete",MRA_DELETE_AVT_ON_CONTACT_DELETE));
+ SetDlgItemInt(hWndDlg, IDC_SERVERPORT, DBGetContactSettingDword(NULL, MRA_AVT_SECT_NAME, "ServerPort", MRA_AVT_DEFAULT_SERVER_PORT), FALSE);
+ CHECK_DLG_BUTTON(hWndDlg, IDC_USE_KEEPALIVE_CONN, db_get_b(NULL, MRA_AVT_SECT_NAME, "UseKeepAliveConn", MRA_AVT_DEFAULT_USE_KEEPALIVE_CONN));
+ SetDlgItemInt(hWndDlg, IDC_UPD_CHECK_INTERVAL, DBGetContactSettingDword(NULL, MRA_AVT_SECT_NAME, "CheckInterval", MRA_AVT_DEFAULT_CHK_INTERVAL), FALSE);
+ CHECK_DLG_BUTTON(hWndDlg, IDC_RETURN_ABC_PATH, db_get_b(NULL, MRA_AVT_SECT_NAME, "ReturnAbsolutePath", MRA_AVT_DEFAULT_RET_ABC_PATH));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_DELETE_AVT_ON_CONTACT_DELETE, db_get_b(NULL, MRA_AVT_SECT_NAME, "DeleteAvtOnContactDelete", MRA_DELETE_AVT_ON_CONTACT_DELETE));
- EnableControlsArray(hWndDlg,(WORD*)&wMraAvatarsControlsList,SIZEOF(wMraAvatarsControlsList),IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_ENABLE));
+ EnableControlsArray(hWndDlg, (WORD*)&wMraAvatarsControlsList, SIZEOF(wMraAvatarsControlsList), IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ENABLE));
}
- return(TRUE);
+ return TRUE;
+
case WM_COMMAND:
- if (LOWORD(wParam)==IDC_ENABLE)
- {
- EnableControlsArray(hWndDlg,(WORD*)&wMraAvatarsControlsList,SIZEOF(wMraAvatarsControlsList),IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_ENABLE));
- }
+ if (LOWORD(wParam) == IDC_ENABLE)
+ EnableControlsArray(hWndDlg, (WORD*)&wMraAvatarsControlsList, SIZEOF(wMraAvatarsControlsList), IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ENABLE));
- if (LOWORD(wParam)==IDC_BUTTON_DEFAULT)
- {
- SET_DLG_ITEM_TEXTA(hWndDlg,IDC_SERVER,MRA_AVT_DEFAULT_SERVER);
- SetDlgItemInt(hWndDlg,IDC_SERVERPORT,MRA_AVT_DEFAULT_SERVER_PORT,FALSE);
+ if (LOWORD(wParam) == IDC_BUTTON_DEFAULT) {
+ SET_DLG_ITEM_TEXTA(hWndDlg, IDC_SERVER, MRA_AVT_DEFAULT_SERVER);
+ SetDlgItemInt(hWndDlg, IDC_SERVERPORT, MRA_AVT_DEFAULT_SERVER_PORT, FALSE);
}
- if ((LOWORD(wParam)==IDC_SERVER || LOWORD(wParam)==IDC_SERVERPORT || LOWORD(wParam)==IDC_UPD_CHECK_INTERVAL) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return(FALSE);
- SendMessage(GetParent(hWndDlg),PSM_CHANGED,0,0);
+ if ((LOWORD(wParam) == IDC_SERVER || LOWORD(wParam) == IDC_SERVERPORT || LOWORD(wParam) == IDC_UPD_CHECK_INTERVAL) && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) return FALSE;
+ SendMessage(GetParent(hWndDlg), PSM_CHANGED, 0, 0);
break;
+
case WM_NOTIFY:
- switch (((LPNMHDR)lParam)->code){
+ switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
{
WCHAR szServer[MAX_PATH];
- DBWriteContactSettingByte(NULL,MRA_AVT_SECT_NAME,"Enable",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_ENABLE));
- DBWriteContactSettingByte(NULL,MRA_AVT_SECT_NAME,"DeleteAvtOnContactDelete",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_DELETE_AVT_ON_CONTACT_DELETE));
- DBWriteContactSettingByte(NULL,MRA_AVT_SECT_NAME,"ReturnAbsolutePath",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_RETURN_ABC_PATH));
- DBWriteContactSettingDword(NULL,MRA_AVT_SECT_NAME,"CheckInterval",GetDlgItemInt(hWndDlg,IDC_UPD_CHECK_INTERVAL,NULL,FALSE));
- DBWriteContactSettingByte(NULL,MRA_AVT_SECT_NAME,"UseKeepAliveConn",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_USE_KEEPALIVE_CONN));
- DBWriteContactSettingDword(NULL,MRA_AVT_SECT_NAME,"ServerPort",GetDlgItemInt(hWndDlg,IDC_SERVERPORT,NULL,FALSE));
- GET_DLG_ITEM_TEXT(hWndDlg,IDC_SERVER,szServer,SIZEOF(szServer));DB_SetStringW(NULL,MRA_AVT_SECT_NAME,"Server",szServer);
+ DBWriteContactSettingByte(NULL, MRA_AVT_SECT_NAME, "Enable", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_ENABLE));
+ DBWriteContactSettingByte(NULL, MRA_AVT_SECT_NAME, "DeleteAvtOnContactDelete", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_DELETE_AVT_ON_CONTACT_DELETE));
+ DBWriteContactSettingByte(NULL, MRA_AVT_SECT_NAME, "ReturnAbsolutePath", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_RETURN_ABC_PATH));
+ DBWriteContactSettingDword(NULL, MRA_AVT_SECT_NAME, "CheckInterval", GetDlgItemInt(hWndDlg, IDC_UPD_CHECK_INTERVAL, NULL, FALSE));
+ DBWriteContactSettingByte(NULL, MRA_AVT_SECT_NAME, "UseKeepAliveConn", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_USE_KEEPALIVE_CONN));
+ DBWriteContactSettingDword(NULL, MRA_AVT_SECT_NAME, "ServerPort", GetDlgItemInt(hWndDlg, IDC_SERVERPORT, NULL, FALSE));
+
+ GET_DLG_ITEM_TEXT(hWndDlg, IDC_SERVER, szServer, SIZEOF(szServer));
+ db_set_ws(NULL, MRA_AVT_SECT_NAME, "Server", szServer);
}
- return(TRUE);
+ return TRUE;
}
break;
}
-return(FALSE);
+ return FALSE;
}
-DWORD MraAvatarsDeleteContactAvatarFile(HANDLE hAvatarsQueueHandle,HANDLE hContact)
+DWORD CMraProto::MraAvatarsDeleteContactAvatarFile(HANDLE hAvatarsQueueHandle, HANDLE hContact)
{
- DWORD dwRetErrorCode,dwAvatarFormat;
- TCHAR szFileName[MAX_FILEPATH];
-
- if (hAvatarsQueueHandle) {
- MRA_AVATARS_QUEUE *pmraaqAvatarsQueue=(MRA_AVATARS_QUEUE*)hAvatarsQueueHandle;
-
- dwAvatarFormat=GetContactAvatarFormat(hContact,PA_FORMAT_UNKNOWN);
- if (DBGetContactSettingByte(NULL,MRA_AVT_SECT_NAME,"DeleteAvtOnContactDelete",MRA_DELETE_AVT_ON_CONTACT_DELETE) && dwAvatarFormat != PA_FORMAT_DEFAULT) {
- dwRetErrorCode = MraAvatarsGetFileName(hAvatarsQueueHandle, hContact, dwAvatarFormat, szFileName, SIZEOF(szFileName), NULL);
- if ( dwRetErrorCode == NO_ERROR) {
- if ( DeleteFile( szFileName ))
- dwRetErrorCode = NO_ERROR;
- else
- dwRetErrorCode = GetLastError();
- }
- }
- else dwRetErrorCode = NO_ERROR;
+ if (hAvatarsQueueHandle == NULL)
+ return ERROR_INVALID_HANDLE;
+
+ MRA_AVATARS_QUEUE *pmraaqAvatarsQueue = (MRA_AVATARS_QUEUE*)hAvatarsQueueHandle;
+
+ DWORD dwAvatarFormat = GetContactAvatarFormat(hContact, PA_FORMAT_UNKNOWN);
+ if ( db_get_b(NULL, MRA_AVT_SECT_NAME, "DeleteAvtOnContactDelete", MRA_DELETE_AVT_ON_CONTACT_DELETE) && dwAvatarFormat != PA_FORMAT_DEFAULT) {
+ TCHAR szFileName[MAX_FILEPATH];
+ if ( !MraAvatarsGetFileName(hAvatarsQueueHandle, hContact, dwAvatarFormat, szFileName, SIZEOF(szFileName), NULL))
+ return DeleteFile(szFileName);
}
- else dwRetErrorCode = ERROR_INVALID_HANDLE;
-
- return dwRetErrorCode;
+ return NO_ERROR;
}
diff --git a/protocols/MRA/MraAvatars.h b/protocols/MRA/MraAvatars.h
index 994f9cbd67..67c0eff121 100644
--- a/protocols/MRA/MraAvatars.h
+++ b/protocols/MRA/MraAvatars.h
@@ -6,25 +6,10 @@
#pragma once
#endif // _MSC_VER > 1000
-
-
-
-
-DWORD MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle);
-void MraAvatarsQueueDestroy(HANDLE hAvatarsQueueHandle);
-
-
#define PA_FORMAT_DEFAULT 255 // return file name of def avatar
-#define GetContactAvatarFormat(hContact,dwDefaultFormat) DB_Mra_GetByte(hContact,"AvatarType",dwDefaultFormat)
-#define SetContactAvatarFormat(hContact,dwFormat) DB_Mra_SetByte(hContact,"AvatarType",(BYTE)dwFormat)
-
-DWORD MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HANDLE hContact, DWORD dwFormat, LPTSTR lpszPath, SIZE_T dwPathSize, SIZE_T *pdwPathSizeRet);
+#define GetContactAvatarFormat(hContact, dwDefaultFormat) mraGetByte(hContact, "AvatarType", dwDefaultFormat)
+#define SetContactAvatarFormat(hContact, dwFormat) mraSetByte(hContact, "AvatarType", (BYTE)dwFormat)
-// mir flag: GAIF_FORCE
-DWORD MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD *pdwAvatarsQueueID, DWORD *pdwFormat, LPTSTR lpszPath);
-DWORD MraAvatarsQueueGetAvatarSimple(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD dwSourceID);
-DWORD MraAvatarsDeleteContactAvatarFile(HANDLE hAvatarsQueueHandle, HANDLE hContact);
-
INT_PTR CALLBACK MraAvatarsQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/protocols/MRA/MraChat.cpp b/protocols/MRA/MraChat.cpp
index c0e0484c9e..4c2140347a 100644
--- a/protocols/MRA/MraChat.cpp
+++ b/protocols/MRA/MraChat.cpp
@@ -4,8 +4,8 @@
-//static COLORREF crCols[16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
-static LPWSTR lpwszStatuses[]={ L"Owners",L"Inviter",L"Visitors" };
+//static COLORREF crCols[16] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
+static LPWSTR lpwszStatuses[] = { L"Owners", L"Inviter", L"Visitors" };
#define MRA_CHAT_STATUS_OWNER 0
#define MRA_CHAT_STATUS_INVITER 1
#define MRA_CHAT_STATUS_VISITOR 2
@@ -13,315 +13,294 @@ static LPWSTR lpwszStatuses[]={ L"Owners",L"Inviter",L"Visitors" };
-int MraChatGcEventHook (WPARAM, LPARAM lParam);
void MraChatSendPrivateMessage (LPWSTR lpwszEMail);
-void MraChatDllError()
+void CMraProto::MraChatDllError()
{
- MessageBoxW(NULL,TranslateW(L"CHAT plugin is required for conferences. Install it before chatting"),PROTOCOL_DISPLAY_NAMEW,(MB_OK|MB_ICONWARNING));
+ MessageBoxW(NULL, TranslateW(L"CHAT plugin is required for conferences. Install it before chatting"), m_tszUserName, (MB_OK|MB_ICONWARNING));
}
-
-
-BOOL MraChatRegister()
+BOOL CMraProto::MraChatRegister()
{
- BOOL bRet=FALSE;
-
- if (ServiceExists(MS_GC_REGISTER))
- {
- GCREGISTER gcr={0};
- gcr.cbSize=sizeof(GCREGISTER);
- gcr.dwFlags=GC_UNICODE;
- gcr.iMaxText=MRA_MAXLENOFMESSAGE;
- gcr.nColors=0;
- //gcr.pColors=&crCols[0];
- gcr.pszModuleDispName=PROTOCOL_DISPLAY_NAMEA;
- gcr.pszModule=PROTOCOL_NAMEA;
- CallServiceSync(MS_GC_REGISTER,NULL,(LPARAM)&gcr);
-
- HookEvent(ME_GC_EVENT,&MraChatGcEventHook);
- //HookEvent(ME_GC_BUILDMENU, &CJabberProto::JabberGcMenuHook );
-
- bRet=TRUE;
- }else{
- MraChatDllError();
- }
-return(bRet);
+ if ( !ServiceExists(MS_GC_REGISTER))
+ return FALSE;
+
+ GCREGISTER gcr = {0};
+ gcr.cbSize = sizeof(GCREGISTER);
+ gcr.dwFlags = GC_UNICODE;
+ gcr.iMaxText = MRA_MAXLENOFMESSAGE;
+ gcr.nColors = 0;
+ gcr.ptszModuleDispName = m_tszUserName;
+ gcr.pszModule = m_szModuleName;
+ CallServiceSync(MS_GC_REGISTER, NULL, (LPARAM)&gcr);
+
+ HookEvent(ME_GC_EVENT, &CMraProto::MraChatGcEventHook);
+ return TRUE;
}
-INT_PTR MraChatSessionNew(HANDLE hContact)
+INT_PTR CMraProto::MraChatSessionNew(HANDLE hContact)
{
- INT_PTR iRet=1;
+ INT_PTR iRet = 1;
- if (masMraSettings.bChatExist)
+ if (bChatExists)
if (hContact)
{
- GCSESSION gcw={0};
- WCHAR wszEMail[MAX_EMAIL_LEN]={0};
-
- gcw.cbSize=sizeof(GCSESSION);
- gcw.iType=GCW_CHATROOM;
- gcw.pszModule=PROTOCOL_NAMEA;
- gcw.ptszName=GetContactNameW(hContact);
- gcw.ptszID=(LPWSTR)wszEMail;
- gcw.ptszStatusbarText=L"status bar";
- gcw.dwFlags=GC_UNICODE;
- gcw.dwItemData=(DWORD)hContact;
- DB_Mra_GetStaticStringW(hContact,"e-mail",wszEMail,SIZEOF(wszEMail),NULL);
- iRet=CallServiceSync(MS_GC_NEWSESSION,NULL,(LPARAM)&gcw);
-
- if (iRet==0)
+ GCSESSION gcw = {0};
+ WCHAR wszEMail[MAX_EMAIL_LEN] = {0};
+
+ gcw.cbSize = sizeof(GCSESSION);
+ gcw.iType = GCW_CHATROOM;
+ gcw.pszModule = m_szModuleName;
+ gcw.ptszName = GetContactNameW(hContact);
+ gcw.ptszID = (LPWSTR)wszEMail;
+ gcw.ptszStatusbarText = L"status bar";
+ gcw.dwFlags = GC_UNICODE;
+ gcw.dwItemData = (DWORD)hContact;
+ mraGetStaticStringW(hContact, "e-mail", wszEMail, SIZEOF(wszEMail), NULL);
+ iRet = CallServiceSync(MS_GC_NEWSESSION, NULL, (LPARAM)&gcw);
+
+ if (iRet == 0)
{
- CHAR szEMail[MAX_EMAIL_LEN]={0};
- SIZE_T dwEMailSize;
- GCDEST gcd={0};
- GCEVENT gce={0};
-
- gcd.pszModule=PROTOCOL_NAMEA;
- gcd.ptszID=(LPWSTR)wszEMail;
- gcd.iType=GC_EVENT_ADDGROUP;
-
- gce.cbSize=sizeof(GCEVENT);
- gce.pDest=&gcd;
- gce.dwFlags=GC_UNICODE;
- for (SIZE_T i=0;i<SIZEOF(lpwszStatuses);i++)
+ CHAR szEMail[MAX_EMAIL_LEN] = {0};
+ size_t dwEMailSize;
+ GCDEST gcd = {0};
+ GCEVENT gce = {0};
+
+ gcd.pszModule = m_szModuleName;
+ gcd.ptszID = (LPWSTR)wszEMail;
+ gcd.iType = GC_EVENT_ADDGROUP;
+
+ gce.cbSize = sizeof(GCEVENT);
+ gce.pDest = &gcd;
+ gce.dwFlags = GC_UNICODE;
+ for (size_t i = 0;i<SIZEOF(lpwszStatuses);i++)
{
- gce.ptszStatus=TranslateW(lpwszStatuses[i]);
- CallServiceSync(MS_GC_EVENT,NULL,(LPARAM)&gce);
+ gce.ptszStatus = TranslateW(lpwszStatuses[i]);
+ CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
}
- gce.cbSize=sizeof(GCEVENT);
- gce.pDest=&gcd;
- gcd.iType=GC_EVENT_CONTROL;
+ gce.cbSize = sizeof(GCEVENT);
+ gce.pDest = &gcd;
+ gcd.iType = GC_EVENT_CONTROL;
- CallServiceSync(MS_GC_EVENT,SESSION_INITDONE,(LPARAM)&gce);
- CallServiceSync(MS_GC_EVENT,SESSION_ONLINE,(LPARAM)&gce);
+ CallServiceSync(MS_GC_EVENT, SESSION_INITDONE, (LPARAM)&gce);
+ CallServiceSync(MS_GC_EVENT, SESSION_ONLINE, (LPARAM)&gce);
- //MraChatSessionJoinUser(hContact,NULL,0,0);
- (*(DWORD*)wszEMail)=MULTICHAT_GET_MEMBERS;
- DB_Mra_GetStaticStringA(hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize);
- MraSendCommand_MessageW(FALSE,NULL,0,MESSAGE_FLAG_MULTICHAT,szEMail,dwEMailSize,NULL,0,(LPBYTE)wszEMail,4);
+ //MraChatSessionJoinUser(hContact, NULL, 0, 0);
+ (*(DWORD*)wszEMail) = MULTICHAT_GET_MEMBERS;
+ mraGetStaticStringA(hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize);
+ MraMessageW(FALSE, NULL, 0, MESSAGE_FLAG_MULTICHAT, szEMail, dwEMailSize, NULL, 0, (LPBYTE)wszEMail, 4);
}
}
-return(iRet);
+ return(iRet);
}
-void MraChatSessionDestroy(HANDLE hContact)
+void CMraProto::MraChatSessionDestroy(HANDLE hContact)
{
- if (masMraSettings.bChatExist)
+ if (bChatExists)
{
- GCDEST gcd={0};
- GCEVENT gce={0};
- WCHAR wszEMail[MAX_EMAIL_LEN]={0};
+ GCDEST gcd = {0};
+ GCEVENT gce = {0};
+ WCHAR wszEMail[MAX_EMAIL_LEN] = {0};
- gcd.pszModule=PROTOCOL_NAMEA;
- gcd.iType=GC_EVENT_CONTROL;
+ gcd.pszModule = m_szModuleName;
+ gcd.iType = GC_EVENT_CONTROL;
if (hContact)
{
- gcd.ptszID=(LPWSTR)wszEMail;
- DB_Mra_GetStaticStringW(hContact,"e-mail",wszEMail,SIZEOF(wszEMail),NULL);
+ gcd.ptszID = (LPWSTR)wszEMail;
+ mraGetStaticStringW(hContact, "e-mail", wszEMail, SIZEOF(wszEMail), NULL);
}
- gce.cbSize=sizeof(GCEVENT);
- gce.pDest=&gcd;
- gce.dwFlags=GC_UNICODE;
+ gce.cbSize = sizeof(GCEVENT);
+ gce.pDest = &gcd;
+ gce.dwFlags = GC_UNICODE;
- CallServiceSync(MS_GC_EVENT,SESSION_TERMINATE,(LPARAM)&gce);
- CallServiceSync(MS_GC_EVENT,WINDOW_CLEARLOG,(LPARAM)&gce);
+ CallServiceSync(MS_GC_EVENT, SESSION_TERMINATE, (LPARAM)&gce);
+ CallServiceSync(MS_GC_EVENT, WINDOW_CLEARLOG, (LPARAM)&gce);
}
}
-
-
-
-INT_PTR MraChatSessionEventSendByHandle(HANDLE hContactChatSession,DWORD dwType,DWORD dwFlags,LPSTR lpszUID,SIZE_T dwUIDSize,LPWSTR lpwszStatus,LPWSTR lpwszMessage,DWORD_PTR dwItemData,DWORD dwTime)
+INT_PTR CMraProto::MraChatSessionEventSendByHandle(HANDLE hContactChatSession, DWORD dwType, DWORD dwFlags, LPSTR lpszUID, size_t dwUIDSize, LPWSTR lpwszStatus, LPWSTR lpwszMessage, DWORD_PTR dwItemData, DWORD dwTime)
{
- INT_PTR iRet=1;
+ INT_PTR iRet = 1;
- if (masMraSettings.bChatExist)
+ if (bChatExists)
{
- GCDEST gcd={0};
- GCEVENT gce={0};
- WCHAR wszID[MAX_EMAIL_LEN]={0},wszUID[MAX_EMAIL_LEN]={0},wszNick[MAX_EMAIL_LEN]={0};
+ GCDEST gcd = {0};
+ GCEVENT gce = {0};
+ WCHAR wszID[MAX_EMAIL_LEN] = {0}, wszUID[MAX_EMAIL_LEN] = {0}, wszNick[MAX_EMAIL_LEN] = {0};
- gcd.pszModule=PROTOCOL_NAMEA;
+ gcd.pszModule = m_szModuleName;
if (hContactChatSession)
{
- gcd.ptszID=(LPWSTR)wszID;
- DB_Mra_GetStaticStringW(hContactChatSession,"e-mail",wszID,SIZEOF(wszID),NULL);
+ gcd.ptszID = (LPWSTR)wszID;
+ mraGetStaticStringW(hContactChatSession, "e-mail", wszID, SIZEOF(wszID), NULL);
}
- gcd.iType=dwType;
+ gcd.iType = dwType;
- gce.cbSize=sizeof(GCEVENT);
- gce.pDest=&gcd;
- gce.dwFlags=GC_UNICODE|dwFlags;
- gce.ptszUID=wszUID;
- gce.ptszStatus=lpwszStatus;
- gce.ptszText=lpwszMessage;
- gce.dwItemData=dwItemData;
- gce.time=dwTime;
+ gce.cbSize = sizeof(GCEVENT);
+ gce.pDest = &gcd;
+ gce.dwFlags = GC_UNICODE|dwFlags;
+ gce.ptszUID = wszUID;
+ gce.ptszStatus = lpwszStatus;
+ gce.ptszText = lpwszMessage;
+ gce.dwItemData = dwItemData;
+ gce.time = dwTime;
if (lpszUID && dwUIDSize)
{
- gce.bIsMe=IsEMailMy(lpszUID,dwUIDSize);
- }else{
- gce.bIsMe=TRUE;
+ gce.bIsMe = IsEMailMy(lpszUID, dwUIDSize);
+ }else {
+ gce.bIsMe = TRUE;
}
if (gce.bIsMe)
{
- DB_Mra_GetStaticStringW(NULL,"e-mail",wszUID,SIZEOF(wszUID),NULL);
- DB_Mra_GetStaticStringW(NULL,"Nick",wszNick,SIZEOF(wszNick),NULL);
- gce.ptszNick=wszNick;
- }else{
+ mraGetStaticStringW(NULL, "e-mail", wszUID, SIZEOF(wszUID), NULL);
+ mraGetStaticStringW(NULL, "Nick", wszNick, SIZEOF(wszNick), NULL);
+ gce.ptszNick = wszNick;
+ }else {
HANDLE hContactSender;
- hContactSender=MraHContactFromEmail(lpszUID,dwUIDSize,FALSE,TRUE,NULL);
- MultiByteToWideChar(MRA_CODE_PAGE,0,lpszUID,dwUIDSize,wszUID,SIZEOF(wszUID));
+ hContactSender = MraHContactFromEmail(lpszUID, dwUIDSize, FALSE, TRUE, NULL);
+ MultiByteToWideChar(MRA_CODE_PAGE, 0, lpszUID, dwUIDSize, wszUID, SIZEOF(wszUID));
if (hContactSender)
{
- gce.ptszNick=GetContactNameW(hContactSender);
- }else{
- gce.ptszNick=wszUID;
+ gce.ptszNick = GetContactNameW(hContactSender);
+ }else {
+ gce.ptszNick = wszUID;
}
}
- iRet=CallServiceSync(MS_GC_EVENT,NULL,(LPARAM)&gce);
+ iRet = CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
}
return(iRet);
}
-
-
-
-
-INT_PTR MraChatSessionInvite(HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize,DWORD dwTime)
+INT_PTR CMraProto::MraChatSessionInvite(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize, DWORD dwTime)
{
- INT_PTR iRet=1;
+ INT_PTR iRet = 1;
if (hContactChatSession)
{
- WCHAR wszEMailInMultiChat[MAX_EMAIL_LEN]={0},wszBuff[((MAX_EMAIL_LEN*2)+MAX_PATH)];
+ WCHAR wszEMailInMultiChat[MAX_EMAIL_LEN] = {0}, wszBuff[((MAX_EMAIL_LEN*2)+MAX_PATH)];
- MultiByteToWideChar(MRA_CODE_PAGE,0,lpszEMailInMultiChat,dwEMailInMultiChatSize,wszEMailInMultiChat,SIZEOF(wszEMailInMultiChat));
- mir_sntprintf(wszBuff,SIZEOF(wszBuff),L"[%s]: %s",wszEMailInMultiChat,TranslateW(L"invite sender"));
+ MultiByteToWideChar(MRA_CODE_PAGE, 0, lpszEMailInMultiChat, dwEMailInMultiChatSize, wszEMailInMultiChat, SIZEOF(wszEMailInMultiChat));
+ mir_sntprintf(wszBuff, SIZEOF(wszBuff), L"[%s]: %s", wszEMailInMultiChat, TranslateW(L"invite sender"));
- iRet=MraChatSessionEventSendByHandle(hContactChatSession,GC_EVENT_ACTION,GCEF_ADDTOLOG,lpszEMailInMultiChat,dwEMailInMultiChatSize,NULL,wszBuff,0,dwTime);
+ iRet = MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ACTION, GCEF_ADDTOLOG, lpszEMailInMultiChat, dwEMailInMultiChatSize, NULL, wszBuff, 0, dwTime);
}
return(iRet);
}
-INT_PTR MraChatSessionMembersAdd(HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize,DWORD dwTime)
+INT_PTR CMraProto::MraChatSessionMembersAdd(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize, DWORD dwTime)
{
- INT_PTR iRet=1;
+ INT_PTR iRet = 1;
if (hContactChatSession)
{
- WCHAR wszEMailInMultiChat[MAX_EMAIL_LEN]={0},wszBuff[((MAX_EMAIL_LEN*2)+MAX_PATH)];
+ WCHAR wszEMailInMultiChat[MAX_EMAIL_LEN] = {0}, wszBuff[((MAX_EMAIL_LEN*2)+MAX_PATH)];
- MultiByteToWideChar(MRA_CODE_PAGE,0,lpszEMailInMultiChat,dwEMailInMultiChatSize,wszEMailInMultiChat,SIZEOF(wszEMailInMultiChat));
- mir_sntprintf(wszBuff,SIZEOF(wszBuff),L"[%s]: %s",wszEMailInMultiChat,TranslateW(L"invite new members"));
+ MultiByteToWideChar(MRA_CODE_PAGE, 0, lpszEMailInMultiChat, dwEMailInMultiChatSize, wszEMailInMultiChat, SIZEOF(wszEMailInMultiChat));
+ mir_sntprintf(wszBuff, SIZEOF(wszBuff), L"[%s]: %s", wszEMailInMultiChat, TranslateW(L"invite new members"));
- iRet=MraChatSessionEventSendByHandle(hContactChatSession,GC_EVENT_ACTION,GCEF_ADDTOLOG,lpszEMailInMultiChat,dwEMailInMultiChatSize,NULL,wszBuff,0,dwTime);
+ iRet = MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ACTION, GCEF_ADDTOLOG, lpszEMailInMultiChat, dwEMailInMultiChatSize, NULL, wszBuff, 0, dwTime);
}
return(iRet);
}
-INT_PTR MraChatSessionJoinUser(HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize,DWORD dwTime)
+INT_PTR CMraProto::MraChatSessionJoinUser(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize, DWORD dwTime)
{
- INT_PTR iRet=1;
+ INT_PTR iRet = 1;
if (hContactChatSession)
{
- iRet=MraChatSessionEventSendByHandle(hContactChatSession,GC_EVENT_JOIN,GCEF_ADDTOLOG,lpszEMailInMultiChat,dwEMailInMultiChatSize,lpwszStatuses[MRA_CHAT_STATUS_VISITOR],L"",0,dwTime);
+ iRet = MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_JOIN, GCEF_ADDTOLOG, lpszEMailInMultiChat, dwEMailInMultiChatSize, lpwszStatuses[MRA_CHAT_STATUS_VISITOR], L"", 0, dwTime);
}
return(iRet);
}
-INT_PTR MraChatSessionLeftUser(HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize,DWORD dwTime)
+INT_PTR CMraProto::MraChatSessionLeftUser(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize, DWORD dwTime)
{
- INT_PTR iRet=1;
+ INT_PTR iRet = 1;
if (hContactChatSession)
{
- iRet=MraChatSessionEventSendByHandle(hContactChatSession,GC_EVENT_PART,GCEF_ADDTOLOG,lpszEMailInMultiChat,dwEMailInMultiChatSize,NULL,NULL,0,dwTime);
+ iRet = MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_PART, GCEF_ADDTOLOG, lpszEMailInMultiChat, dwEMailInMultiChatSize, NULL, NULL, 0, dwTime);
}
return(iRet);
}
-INT_PTR MraChatSessionSetIviter(HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize)
+INT_PTR CMraProto::MraChatSessionSetIviter(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize)
{
- INT_PTR iRet=1;
+ INT_PTR iRet = 1;
if (hContactChatSession && lpszEMailInMultiChat && dwEMailInMultiChatSize)
{
- //iRet=MraChatSessionEventSendByHandle(hContactChatSession,GC_EVENT_REMOVESTATUS,0,lpszEMailInMultiChat,dwEMailInMultiChatSize,lpwszStatuses[MRA_CHAT_STATUS_VISITOR],NULL,0,0);
- iRet=MraChatSessionEventSendByHandle(hContactChatSession,GC_EVENT_ADDSTATUS,0,lpszEMailInMultiChat,dwEMailInMultiChatSize,lpwszStatuses[MRA_CHAT_STATUS_INVITER],NULL,0,0);
+ //iRet = MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_REMOVESTATUS, 0, lpszEMailInMultiChat, dwEMailInMultiChatSize, lpwszStatuses[MRA_CHAT_STATUS_VISITOR], NULL, 0, 0);
+ iRet = MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ADDSTATUS, 0, lpszEMailInMultiChat, dwEMailInMultiChatSize, lpwszStatuses[MRA_CHAT_STATUS_INVITER], NULL, 0, 0);
}
return(iRet);
}
-INT_PTR MraChatSessionSetOwner(HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize)
+INT_PTR CMraProto::MraChatSessionSetOwner(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize)
{
- INT_PTR iRet=1;
+ INT_PTR iRet = 1;
if (hContactChatSession && lpszEMailInMultiChat && dwEMailInMultiChatSize)
{
- iRet=MraChatSessionEventSendByHandle(hContactChatSession,GC_EVENT_ADDSTATUS,0,lpszEMailInMultiChat,dwEMailInMultiChatSize,lpwszStatuses[MRA_CHAT_STATUS_OWNER],NULL,0,0);
+ iRet = MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_ADDSTATUS, 0, lpszEMailInMultiChat, dwEMailInMultiChatSize, lpwszStatuses[MRA_CHAT_STATUS_OWNER], NULL, 0, 0);
}
return(iRet);
}
-INT_PTR MraChatSessionMessageAdd(HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize,LPWSTR lpwszMessage,SIZE_T dwMessageSize,DWORD dwTime)
+INT_PTR CMraProto::MraChatSessionMessageAdd(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize, LPWSTR lpwszMessage, size_t dwMessageSize, DWORD dwTime)
{
- INT_PTR iRet=1;
+ INT_PTR iRet = 1;
if (hContactChatSession)
{
LPWSTR lpwszMessageLocal;
- lpwszMessageLocal=(LPWSTR)MEMALLOC((dwMessageSize*sizeof(WCHAR)));
+ lpwszMessageLocal = (LPWSTR)mir_calloc((dwMessageSize*sizeof(WCHAR)));
if (lpwszMessageLocal)
{// we need zeros after text allways
- memmove((LPVOID)lpwszMessageLocal,lpwszMessage,(dwMessageSize*sizeof(WCHAR)));//gce.ptszText=lpwszMessage;
+ memmove((LPVOID)lpwszMessageLocal, lpwszMessage, (dwMessageSize*sizeof(WCHAR)));//gce.ptszText = lpwszMessage;
- iRet=MraChatSessionEventSendByHandle(hContactChatSession,GC_EVENT_MESSAGE,GCEF_ADDTOLOG,lpszEMailInMultiChat,dwEMailInMultiChatSize,NULL,lpwszMessageLocal,0,dwTime);
+ iRet = MraChatSessionEventSendByHandle(hContactChatSession, GC_EVENT_MESSAGE, GCEF_ADDTOLOG, lpszEMailInMultiChat, dwEMailInMultiChatSize, NULL, lpwszMessageLocal, 0, dwTime);
- MEMFREE(lpwszMessageLocal);
+ mir_free(lpwszMessageLocal);
}
}
return(iRet);
}
-
-
-int MraChatGcEventHook(WPARAM, LPARAM lParam)
+int CMraProto::MraChatGcEventHook(WPARAM, LPARAM lParam)
{
- int iRet=0;
+ int iRet = 0;
if (lParam)
- if (masMraSettings.bChatExist)
+ if (bChatExists)
{
- GCHOOK* gch=(GCHOOK*)lParam;
+ GCHOOK* gch = (GCHOOK*)lParam;
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,gch->pDest->pszModule,-1,PROTOCOL_NAMEA,PROTOCOL_NAME_LEN)==CSTR_EQUAL)
- {
- switch(gch->pDest->iType){
+ if ( !_stricmp(gch->pDest->pszModule, m_szModuleName)) {
+ switch (gch->pDest->iType) {
case GC_USER_MESSAGE:
if (gch->ptszText && lstrlen(gch->ptszText))
{
BOOL bSlowSend;
- CHAR szEMail[MAX_EMAIL_LEN]={0};
- DWORD dwFlags=0;
- SIZE_T dwEMailSize,dwMessageSize;
+ CHAR szEMail[MAX_EMAIL_LEN] = {0};
+ DWORD dwFlags = 0;
+ size_t dwEMailSize, dwMessageSize;
INT_PTR iSendRet;
HANDLE hContact;
@@ -329,23 +308,23 @@ int MraChatGcEventHook(WPARAM, LPARAM lParam)
//TCHAR* buf = NEWTSTR_ALLOCA(gch->ptszText);
//UnEscapeChatTags( buf );
- dwMessageSize=lstrlenW(gch->ptszText);
- dwEMailSize=(WideCharToMultiByte(MRA_CODE_PAGE,0,gch->pDest->ptszID,-1,szEMail,SIZEOF(szEMail),NULL,NULL)-1);
- hContact=MraHContactFromEmail(szEMail,dwEMailSize,FALSE,TRUE,NULL);
- bSlowSend=DB_Mra_GetByte(NULL,"SlowSend",MRA_DEFAULT_SLOW_SEND);
+ dwMessageSize = lstrlenW(gch->ptszText);
+ dwEMailSize = (WideCharToMultiByte(MRA_CODE_PAGE, 0, gch->pDest->ptszID, -1, szEMail, SIZEOF(szEMail), NULL, NULL)-1);
+ hContact = MraHContactFromEmail(szEMail, dwEMailSize, FALSE, TRUE, NULL);
+ bSlowSend = mraGetByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND);
- if (DB_Mra_GetByte(NULL,"RTFSendEnable",MRA_DEFAULT_RTF_SEND_ENABLE) && (MraContactCapabilitiesGet(hContact)&FEATURE_FLAG_RTF_MESSAGE))
+ if (mraGetByte(NULL, "RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE) && (MraContactCapabilitiesGet(hContact)&FEATURE_FLAG_RTF_MESSAGE))
{
- dwFlags|=MESSAGE_FLAG_RTF;
+ dwFlags |= MESSAGE_FLAG_RTF;
}
- iSendRet=MraSendCommand_MessageW(bSlowSend,hContact,ACKTYPE_MESSAGE,dwFlags,szEMail,dwEMailSize,gch->ptszText,dwMessageSize,NULL,0);
- if (bSlowSend==FALSE)
+ iSendRet = MraMessageW(bSlowSend, hContact, ACKTYPE_MESSAGE, dwFlags, szEMail, dwEMailSize, gch->ptszText, dwMessageSize, NULL, 0);
+ if (bSlowSend == FALSE)
{
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,ACKTYPE_MESSAGE,ACKRESULT_SUCCESS,(HANDLE)iSendRet,(LPARAM)NULL,0);
+ ProtoBroadcastAckAsynchEx(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)iSendRet, (LPARAM)NULL, 0);
}
- MraChatSessionEventSendByHandle(hContact,GC_EVENT_MESSAGE,GCEF_ADDTOLOG,NULL,0,NULL,gch->ptszText,0,(DWORD)_time32(NULL));
+ MraChatSessionEventSendByHandle(hContact, GC_EVENT_MESSAGE, GCEF_ADDTOLOG, NULL, 0, NULL, gch->ptszText, 0, (DWORD)_time32(NULL));
}
break;
case GC_USER_PRIVMESS:
@@ -365,23 +344,22 @@ int MraChatGcEventHook(WPARAM, LPARAM lParam)
}
}
}
-return(iRet);
+ return(iRet);
}
-
-void MraChatSendPrivateMessage(LPWSTR lpwszEMail)
+void CMraProto::MraChatSendPrivateMessage(LPWSTR lpwszEMail)
{
BOOL bAdded;
HANDLE hContact;
- CHAR szEMail[MAX_EMAIL_LEN]={0};
- SIZE_T dwEMailSize;
+ CHAR szEMail[MAX_EMAIL_LEN] = {0};
+ size_t dwEMailSize;
- dwEMailSize=(WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszEMail,-1,szEMail,SIZEOF(szEMail),NULL,NULL)-1);
- hContact=MraHContactFromEmail(szEMail,dwEMailSize,TRUE,TRUE,&bAdded);
+ dwEMailSize = (WideCharToMultiByte(MRA_CODE_PAGE, 0, lpwszEMail, -1, szEMail, SIZEOF(szEMail), NULL, NULL)-1);
+ hContact = MraHContactFromEmail(szEMail, dwEMailSize, TRUE, TRUE, &bAdded);
- if (bAdded) DBWriteContactSettingByte(hContact,"CList","Hidden",1);
- CallService(MS_IGNORE_UNIGNORE,(WPARAM)hContact,IGNOREEVENT_ALL);
- CallService(MS_MSG_SENDMESSAGE,(WPARAM)hContact,0);
+ if (bAdded) DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
+ CallService(MS_IGNORE_UNIGNORE, (WPARAM)hContact, IGNOREEVENT_ALL);
+ CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0);
}
diff --git a/protocols/MRA/MraChat.h b/protocols/MRA/MraChat.h
index 540ceeceaa..790c16584a 100644
--- a/protocols/MRA/MraChat.h
+++ b/protocols/MRA/MraChat.h
@@ -6,25 +6,4 @@
#pragma once
#endif // _MSC_VER > 1000
-
-
-void MraChatDllError ();
-BOOL MraChatRegister ();
-INT_PTR MraChatSessionNew (HANDLE hContactChatSession);
-void MraChatSessionDestroy (HANDLE hContactChatSession);
-INT_PTR MraChatSessionEventSendByHandle (HANDLE hContactChatSession,DWORD dwType,DWORD dwFlags,LPSTR lpszUID,SIZE_T dwUIDSize,LPWSTR lpwszStatus,LPWSTR lpwszMessage,DWORD_PTR dwItemData,DWORD dwTime);
-INT_PTR MraChatSessionInvite (HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize,DWORD dwTime);
-INT_PTR MraChatSessionMembersAdd (HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize,DWORD dwTime);
-INT_PTR MraChatSessionJoinUser (HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize,DWORD dwTime);
-INT_PTR MraChatSessionLeftUser (HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize,DWORD dwTime);
-INT_PTR MraChatSessionSetIviter (HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize);
-INT_PTR MraChatSessionSetOwner (HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize);
-INT_PTR MraChatSessionMessageAdd (HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize,LPWSTR lpwszMessage,SIZE_T dwMessageSize,DWORD dwTime);
-
-
-
-
-
-
-
#endif // !defined(AFX_MRA_CHAT_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraConstans.h b/protocols/MRA/MraConstans.h
index 59fd2382a5..17b73e5642 100644
--- a/protocols/MRA/MraConstans.h
+++ b/protocols/MRA/MraConstans.h
@@ -1,294 +1,246 @@
#if !defined(AFX_MRA_CONSTANS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
#define AFX_MRA_CONSTANS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
-
#include "proto.h"
-
-
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
+#define PROTOCOL_DISPLAY_NAME_ORIGA "Mail.ru Agent"
-#define MIN_MIR_VER_VERSION_DWORD PLUGIN_MAKE_VERSION(0,9,0,0)
-
-
-#define PLUGIN_VERSION_DWORD PLUGIN_MAKE_VERSION(PROTO_VERSION_MAJOR,PROTO_VERSION_MINOR,0,1)
-#define PROTOCOL_DISPLAY_NAME_ORIGA "Mail.ru Agent"
-
-#define MIRVER_UNKNOWN ("Mail.ru Agent unknown client")
-
+#define MIRVER_UNKNOWN ("Mail.ru Agent unknown client")
-#define PROTOCOL_NAMEA masMraSettings.szModuleName
-#define PROTOCOL_NAMEW masMraSettings.wszModuleName
-#define PROTOCOL_NAME_LEN masMraSettings.dwModuleNameLen
-#define PROTOCOL_NAME_SIZE (PROTOCOL_NAME_LEN+1)
-#define PROTOCOL_DISPLAY_NAMEA masMraSettings.szDisplayModuleName
-#define PROTOCOL_DISPLAY_NAMEW masMraSettings.wszDisplayModuleName
-
-
-#define MRA_PLUGIN_UPDATER_ID 2544 //появляется после первого выкладывания на сайт
-#define MRA_SERVER_PORT_STANDART_NLB 2042
-#define MRA_SERVER_PORT_STANDART 2041
-#define MRA_SERVER_PORT_HTTPS 443
-static const LPSTR lpcszMailRuDomains[]=
+#define MRA_PLUGIN_UPDATER_ID 2544 //появляется после первого выкладывания на сайт
+#define MRA_SERVER_PORT_STANDART_NLB 2042
+#define MRA_SERVER_PORT_STANDART 2041
+#define MRA_SERVER_PORT_HTTPS 443
+static const LPSTR lpcszMailRuDomains[] =
{
- ("mail.ru"),
- ("list.ru"),
- ("bk.ru"),
- ("inbox.ru"),
- ("corp.mail.ru"),
- NULL
+ ("mail.ru"),
+ ("list.ru"),
+ ("bk.ru"),
+ ("inbox.ru"),
+ ("corp.mail.ru"),
+ NULL
};
-#define MAILRU_CHAT_CONF_DOMAIN "chat.agent"
-
-
-#define MAX_EMAIL_LEN 1024
-#define MAX_FILEPATH 32768 //internal
-#define BUFF_SIZE_RCV 65535 //internal
-#define BUFF_SIZE_RCV_MIN_FREE 16384 //internal
-#define BUFF_SIZE_BLOB 16384 //internal
-#define BUFF_SIZE_URL 4096 //internal
-#define NETLIB_SELECT_TIMEOUT 250 //internal // время ожидания событий на сокете
-#define WAIT_FOR_THREAD_TIMEOUT 15 //internal // время ожидания завершения потока
-#define THREAD_SLEEP_TIME 100 //internal
-#define THREAD_MAX_PING_TIME 20 // sec, internal
-#define THREAD_MAX_PING_FAIL_COUNT 3 // internal
-#define SEND_QUEUE_TIMEOUT 600 //internal // время удаления недоставленных сообщений из очереди отправки
-#define ALLOCATED_COUNT 32 //internal // колличество элементов
-#define EMAILS_MIN_COUNT 16 //internal // колличество элементов обязательно проверяемых при извлечении email адреса из инфы юзера
-#define PHONES_MIN_COUNT 4 //internal // колличество элементов обязательно проверяемых при извлечении email адреса из инфы юзера
-
-
-
-#define MRA_ALARM_MESSAGE L"Your contact wakes you"
-
-#define MRA_GOTO_INBOX "/GotoInbox"
-#define MRA_GOTO_INBOX_STR L"Display &Inbox"
-#define MRA_SHOW_INBOX_STATUS "/ShowInboxStatus"
-#define MRA_SHOW_INBOX_STATUS_STR L"Display &Inbox status"
-#define MRA_EDIT_PROFILE "/EditProfile"
-#define MRA_EDIT_PROFILE_STR L"Edit &Profile"
-#define MRA_MY_ALBUM "/MyAlbum"
-#define MRA_MY_ALBUM_STR L"My Album"
-#define MRA_MY_BLOG "/MyBlog"
-#define MRA_MY_BLOG_STR L"My Blog"
-#define MRA_MY_BLOGSTATUS "/MyBlogStatus"
-#define MRA_MY_BLOGSTATUS_STR L"My Blog Status"
-#define MRA_MY_VIDEO "/MyVideo"
-#define MRA_MY_VIDEO_STR L"My Video"
-#define MRA_MY_ANSWERS "/MyAnswers"
-#define MRA_MY_ANSWERS_STR L"My Answers"
-#define MRA_MY_WORLD "/MyWorld"
-#define MRA_MY_WORLD_STR L"My World"
-#define MRA_ZHUKI "/Zhuki"
-#define MRA_ZHUKI_STR L"Zhuki"
-#define MRA_CHAT "/Chat"
-#define MRA_CHAT_STR L"Chat"
-#define MRA_WEB_SEARCH "/WebSearch"
-#define MRA_WEB_SEARCH_STR L"Web search"
-#define MRA_UPD_ALL_USERS_INFO "/UpdateAllUsersInfo"
-#define MRA_UPD_ALL_USERS_INFO_STR L"Update all users info"
-#define MRA_CHK_UPDATES_USERS_AVATARS "/CheckUpdatesUsersAvatars"
-#define MRA_CHK_UPDATES_USERS_AVATARS_STR L"Check updates users avatars"
-#define MRA_REQ_AUTH_FOR_ALL "/ReqAuthForAll"
-#define MRA_REQ_AUTH_FOR_ALL_STR L"Request authorization for all"
-
-
-#define MRA_MPOP_AUTH_URL "http://swa.mail.ru/cgi-bin/auth?Login=%s&agent=%s&page=%s"
-
-#define MRA_WIN_INBOX_URL "http://win.mail.ru/cgi-bin/start"
-#define MRA_PDA_INBOX_URL "http://pda.mail.ru/cgi-bin/start"
-#define MRA_EDIT_PROFILE_URL "http://win.mail.ru/cgi-bin/userinfo?mra=1"
-#define MRA_CHAT_URL "http://chat.mail.ru"
-#define MRA_ZHUKI_URL "http://zhuki.mail.ru"
-#define MRA_SEARCH_URL "http://go.mail.ru"
+#define MAILRU_CHAT_CONF_DOMAIN "chat.agent"
+
+
+#define MAX_EMAIL_LEN 1024
+#define MAX_FILEPATH 32768 //internal
+#define BUFF_SIZE_RCV 65535 //internal
+#define BUFF_SIZE_RCV_MIN_FREE 16384 //internal
+#define BUFF_SIZE_BLOB 16384 //internal
+#define BUFF_SIZE_URL 4096 //internal
+#define NETLIB_SELECT_TIMEOUT 250 //internal // время ожидания событий на сокете
+#define WAIT_FOR_THREAD_TIMEOUT 15 //internal // время ожидания завершения потока
+#define THREAD_SLEEP_TIME 100 //internal
+#define THREAD_MAX_PING_TIME 20 // sec, internal
+#define THREAD_MAX_PING_FAIL_COUNT 3 // internal
+#define SEND_QUEUE_TIMEOUT 600 //internal // время удаления недоставленных сообщений из очереди отправки
+#define ALLOCATED_COUNT 32 //internal // колличество элементов
+#define EMAILS_MIN_COUNT 16 //internal // колличество элементов обязательно проверяемых при извлечении email адреса из инфы юзера
+#define PHONES_MIN_COUNT 4 //internal // колличество элементов обязательно проверяемых при извлечении email адреса из инфы юзера
+
+#define MRA_ALARM_MESSAGE L"Your contact wakes you"
+
+#define MRA_GOTO_INBOX "/GotoInbox"
+#define MRA_GOTO_INBOX_STR L"Display &Inbox"
+#define MRA_SHOW_INBOX_STATUS "/ShowInboxStatus"
+#define MRA_SHOW_INBOX_STATUS_STR L"Display &Inbox status"
+#define MRA_EDIT_PROFILE "/EditProfile"
+#define MRA_EDIT_PROFILE_STR L"Edit &Profile"
+#define MRA_MY_ALBUM "/MyAlbum"
+#define MRA_MY_ALBUM_STR L"My Album"
+#define MRA_MY_BLOG "/MyBlog"
+#define MRA_MY_BLOG_STR L"My Blog"
+#define MRA_MY_BLOGSTATUS "/MyBlogStatus"
+#define MRA_MY_BLOGSTATUS_STR L"My Blog Status"
+#define MRA_MY_VIDEO "/MyVideo"
+#define MRA_MY_VIDEO_STR L"My Video"
+#define MRA_MY_ANSWERS "/MyAnswers"
+#define MRA_MY_ANSWERS_STR L"My Answers"
+#define MRA_MY_WORLD "/MyWorld"
+#define MRA_MY_WORLD_STR L"My World"
+#define MRA_ZHUKI "/Zhuki"
+#define MRA_ZHUKI_STR L"Zhuki"
+#define MRA_CHAT "/Chat"
+#define MRA_CHAT_STR L"Chat"
+#define MRA_WEB_SEARCH "/WebSearch"
+#define MRA_WEB_SEARCH_STR L"Web search"
+#define MRA_UPD_ALL_USERS_INFO "/UpdateAllUsersInfo"
+#define MRA_UPD_ALL_USERS_INFO_STR L"Update all users info"
+#define MRA_CHK_USERS_AVATARS "/CheckUpdatesUsersAvatars"
+#define MRA_CHK_USERS_AVATARS_STR L"Check updates users avatars"
+#define MRA_REQ_AUTH_FOR_ALL "/ReqAuthForAll"
+#define MRA_REQ_AUTH_FOR_ALL_STR L"Request authorization for all"
+
+#define MRA_MPOP_AUTH_URL "http://swa.mail.ru/cgi-bin/auth?Login = %s&agent = %s&page = %s"
+
+#define MRA_WIN_INBOX_URL "http://win.mail.ru/cgi-bin/start"
+#define MRA_PDA_INBOX_URL "http://pda.mail.ru/cgi-bin/start"
+#define MRA_EDIT_PROFILE_URL "http://win.mail.ru/cgi-bin/userinfo?mra = 1"
+#define MRA_CHAT_URL "http://chat.mail.ru"
+#define MRA_ZHUKI_URL "http://zhuki.mail.ru"
+#define MRA_SEARCH_URL "http://go.mail.ru"
// used spesialy! added: /domain/user
-#define MRA_BLOGS_URL "http://blogs.mail.ru"
-#define MRA_FOTO_URL "http://foto.mail.ru"
-#define MRA_VIDEO_URL "http://video.mail.ru"
-#define MRA_ANSWERS_URL "http://otvet.mail.ru"
-#define MRA_WORLD_URL "http://my.mail.ru"
-
+#define MRA_BLOGS_URL "http://blogs.mail.ru"
+#define MRA_FOTO_URL "http://foto.mail.ru"
+#define MRA_VIDEO_URL "http://video.mail.ru"
+#define MRA_ANSWERS_URL "http://otvet.mail.ru"
+#define MRA_WORLD_URL "http://my.mail.ru"
// without auth
-#define MRA_REGISTER_URL "http://win.mail.ru/cgi-bin/signup"
-#define MRA_FORGOT_PASSWORD_URL "http://win.mail.ru/cgi-bin/passremind"
-
-
-// wParam=(WPARAM)hContact
-#define MRA_REQ_AUTH "/ReqAuth"
-#define MRA_REQ_AUTH_STR L"Request authorization"
-#define MRA_GRANT_AUTH "/GrantAuth"
-#define MRA_GRANT_AUTH_STR L"Grant authorization"
-#define MRA_SEND_POSTCARD "/SendPostcard"
-#define MRA_SEND_POSTCARD_STR L"&Send postcard"
-#define MRA_VIEW_ALBUM "/ViewAlbum"
-#define MRA_VIEW_ALBUM_STR L"&View Album"
-#define MRA_READ_BLOG "/ReadBlog"
-#define MRA_READ_BLOG_STR L"&Read Blog"
-#define MRA_REPLY_BLOG_STATUS "/ReplyBlogStatus"
-#define MRA_REPLY_BLOG_STATUS_STR L"Reply Blog Status"
-#define MRA_VIEW_VIDEO "/ViewVideo"
-#define MRA_VIEW_VIDEO_STR L"View Video"
-#define MRA_ANSWERS "/Answers"
-#define MRA_ANSWERS_STR L"Answers"
-#define MRA_WORLD "/World"
-#define MRA_WORLD_STR L"World"
-#define MRA_SEND_NUDGE "/SendNudge"
-#define MS_NUDGE "/Nudge"
-#define MRA_SENDNUDGE_STR L"Send &Nudge"
-
-
-#define ADV_ICON_DELETED 0
-#define ADV_ICON_DELETED_ID "ADV_ICON_DELETED"
-#define ADV_ICON_DELETED_STR L"Mail box deleted"
-#define ADV_ICON_NOT_ON_SERVER 1
-#define ADV_ICON_NOT_ON_SERVER_ID "ADV_ICON_NOT_ON_SERVER"
-#define ADV_ICON_NOT_ON_SERVER_STR L"Contact not on server"
-#define ADV_ICON_NOT_AUTHORIZED 2
-#define ADV_ICON_NOT_AUTHORIZED_ID "ADV_ICON_NOT_AUTHORIZED"
-#define ADV_ICON_NOT_AUTHORIZED_STR L"Not authorized"
-#define ADV_ICON_PHONE 3
-#define ADV_ICON_PHONE_ID "ADV_ICON_PHONE"
-#define ADV_ICON_PHONE_STR L"Phone/SMS only contact"
-#define ADV_ICON_BLOGSTATUS 4
-#define ADV_ICON_BLOGSTATUS_ID "ADV_ICON_BLOGSTATUS"
-#define ADV_ICON_BLOGSTATUS_STR L"Blog status message"
-#define ADV_ICON_MAX 5
-
-static const GUI_DISPLAY_ITEM gdiExtraStatusIconsItems[] =
-{
- { ADV_ICON_DELETED_ID, ADV_ICON_DELETED_STR, (INT_PTR)IDI_ERROR, NULL },
- { ADV_ICON_NOT_ON_SERVER_ID, ADV_ICON_NOT_ON_SERVER_STR, IDI_AUTHGRANT, NULL },
- { ADV_ICON_NOT_AUTHORIZED_ID, ADV_ICON_NOT_AUTHORIZED_STR, IDI_AUTHRUGUEST, NULL },
- { ADV_ICON_PHONE_ID, ADV_ICON_PHONE_STR, IDI_MRA_PHONE, NULL },
- { ADV_ICON_BLOGSTATUS_ID, ADV_ICON_BLOGSTATUS_STR, IDI_BLOGSTATUS, NULL },
-};
-
-
-
-
-#define MRA_SOUND_NEW_EMAIL "New E-mail available in Inbox"
-
-
-#define MAILRU_SERVER_TIME_ZONE -180 //internal // +0300
-#define MAILRU_CONTACTISTYPING_TIMEOUT 10 //internal
-#define MRA_DEFAULT_SERVER "mrim.mail.ru"
-#define MRA_DEFAULT_SERVER_PORT MRA_SERVER_PORT_STANDART_NLB
-#define MRA_MAX_MRIM_SERVER 46
-#define MRA_DEFAULT_TIMEOUT_CONN_MRIM 20
-#define MRA_DEFAULT_CONN_RETRY_COUNT_MRIM 2
-#define MRA_DEFAULT_TIMEOUT_CONN_NLB 20
-#define MRA_DEFAULT_CONN_RETRY_COUNT_NLB 3
-#define MRA_DEFAULT_TIMEOUT_RECV_NLB 20
-#define MRA_DEFAULT_CONN_RETRY_COUNT_FILES 2
-#define MRA_DEFAULT_CONN_RETRY_COUNT_MRIMPROXY 3
-#define MRA_TIMEOUT_DIRECT_CONN 30 //internal; время после которого клиент считает что к нему подключится не удалось
-#define MRA_TIMEOUT_CONN_MIN 2 //internal; минимальное время ожидания пока устанавливается исходящее подключение
-#define MRA_TIMEOUT_CONN_МАХ 16 //internal; максимальное время ожидания пока устанавливается исходящее подключение
-#define MRA_MAXLENOFMESSAGE 32768 //internal
-#define MRA_MAXCONTACTSPERPACKET 256 //internal
-#define MRA_CODE_PAGE 1251 //internal
-#define MRA_FEATURE_FLAGS (FEATURE_FLAG_BASE_SMILES|FEATURE_FLAG_ADVANCED_SMILES|FEATURE_FLAG_CONTACTS_EXCH|FEATURE_FLAG_WAKEUP|FEATURE_FLAG_MULTS|FEATURE_FLAG_FILE_TRANSFER|FEATURE_FLAG_GAMES)
-
-
-
-#define MRA_DEFAULT_POPUPS_ENABLED TRUE
-#define MRA_DEFAULT_POPUPS_EVENT_FILTER -1
-#define MRA_DEFAULT_POPUP_TIMEOUT 8
-#define MRA_DEFAULT_POPUP_USE_WIN_COLORS TRUE
-#define MRA_DEFAULT_POPUP_COLOR_BACK RGB(191,0,0) //Red
-#define MRA_DEFAULT_POPUP_COLOR_TEXT RGB(255,245,225) //Yellow
-
-
-
-#define MRA_DEFAULT_NLB_FAIL_DIRECT_CONNECT FALSE // hidden option
-#define MRA_DEFAULT_AUTO_ADD_CONTACTS_TO_SERVER TRUE
-#define MRA_DEFAULT_AUTO_AUTH_REQ_ON_LOGON FALSE
-#define MRA_DEFAULT_AUTO_AUTH_GRAND_IN_CLIST FALSE
-#define MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS FALSE
+#define MRA_REGISTER_URL "http://win.mail.ru/cgi-bin/signup"
+#define MRA_FORGOT_PASSWORD_URL "http://win.mail.ru/cgi-bin/passremind"
+
+
+// wParam = (WPARAM)hContact
+#define MRA_REQ_AUTH "/ReqAuth"
+#define MRA_REQ_AUTH_STR L"Request authorization"
+#define MRA_GRANT_AUTH "/GrantAuth"
+#define MRA_GRANT_AUTH_STR L"Grant authorization"
+#define MRA_SEND_POSTCARD "/SendPostcard"
+#define MRA_SEND_POSTCARD_STR L"&Send postcard"
+#define MRA_VIEW_ALBUM "/ViewAlbum"
+#define MRA_VIEW_ALBUM_STR L"&View Album"
+#define MRA_READ_BLOG "/ReadBlog"
+#define MRA_READ_BLOG_STR L"&Read Blog"
+#define MRA_REPLY_BLOG_STATUS "/ReplyBlogStatus"
+#define MRA_REPLY_BLOG_STATUS_STR L"Reply Blog Status"
+#define MRA_VIEW_VIDEO "/ViewVideo"
+#define MRA_VIEW_VIDEO_STR L"View Video"
+#define MRA_ANSWERS "/Answers"
+#define MRA_ANSWERS_STR L"Answers"
+#define MRA_WORLD "/World"
+#define MRA_WORLD_STR L"World"
+#define MRA_SEND_NUDGE "/SendNudge"
+#define MS_NUDGE "/Nudge"
+#define MRA_SENDNUDGE_STR L"Send &Nudge"
+
+
+#define ADV_ICON_DELETED 0
+#define ADV_ICON_DELETED_ID "ADV_ICON_DELETED"
+#define ADV_ICON_DELETED_STR L"Mail box deleted"
+#define ADV_ICON_NOT_ON_SERVER 1
+#define ADV_ICON_NOT_ON_SERVER_ID "ADV_ICON_NOT_ON_SERVER"
+#define ADV_ICON_NOT_ON_SERVER_STR L"Contact not on server"
+#define ADV_ICON_NOT_AUTHORIZED 2
+#define ADV_ICON_NOT_AUTHORIZED_ID "ADV_ICON_NOT_AUTHORIZED"
+#define ADV_ICON_NOT_AUTHORIZED_STR L"Not authorized"
+#define ADV_ICON_PHONE 3
+#define ADV_ICON_PHONE_ID "ADV_ICON_PHONE"
+#define ADV_ICON_PHONE_STR L"Phone/SMS only contact"
+#define ADV_ICON_BLOGSTATUS 4
+#define ADV_ICON_BLOGSTATUS_ID "ADV_ICON_BLOGSTATUS"
+#define ADV_ICON_BLOGSTATUS_STR L"Blog status message"
+
+#define MRA_SOUND_NEW_EMAIL "New E-mail available in Inbox"
+
+#define MAILRU_SERVER_TIME_ZONE -180 //internal // +0300
+#define MAILRU_CONTACTISTYPING_TIMEOUT 10 //internal
+#define MRA_DEFAULT_SERVER "mrim.mail.ru"
+#define MRA_DEFAULT_SERVER_PORT MRA_SERVER_PORT_STANDART_NLB
+#define MRA_MAX_MRIM_SERVER 46
+#define MRA_DEFAULT_TIMEOUT_CONN_MRIM 20
+#define MRA_DEFAULT_CONN_RETRY_COUNT_MRIM 2
+#define MRA_DEFAULT_TIMEOUT_CONN_NLB 20
+#define MRA_DEFAULT_CONN_RETRY_COUNT_NLB 3
+#define MRA_DEFAULT_TIMEOUT_RECV_NLB 20
+#define MRA_DEFAULT_CONN_RETRY_COUNT_FILES 2
+#define MRA_DEFAULT_CONN_RETRY_COUNT_MRIMPROXY 3
+#define MRA_TIMEOUT_DIRECT_CONN 30 //internal; время после которого клиент считает что к нему подключится не удалось
+#define MRA_TIMEOUT_CONN_MIN 2 //internal; минимальное время ожидания пока устанавливается исходящее подключение
+#define MRA_TIMEOUT_CONN_МАХ 16 //internal; максимальное время ожидания пока устанавливается исходящее подключение
+#define MRA_MAXLENOFMESSAGE 32768 //internal
+#define MRA_MAXCONTACTSPERPACKET 256 //internal
+#define MRA_CODE_PAGE 1251 //internal
+#define MRA_FEATURE_FLAGS (FEATURE_FLAG_BASE_SMILES|FEATURE_FLAG_ADVANCED_SMILES|FEATURE_FLAG_CONTACTS_EXCH|FEATURE_FLAG_WAKEUP|FEATURE_FLAG_MULTS|FEATURE_FLAG_FILE_TRANSFER|FEATURE_FLAG_GAMES)
+
+#define MRA_DEFAULT_POPUPS_ENABLED TRUE
+#define MRA_DEFAULT_POPUPS_EVENT_FILTER -1
+#define MRA_DEFAULT_POPUP_TIMEOUT 8
+#define MRA_DEFAULT_POPUP_USE_WIN_COLORS TRUE
+#define MRA_DEFAULT_POPUP_COLOR_BACK RGB(191, 0, 0) //Red
+#define MRA_DEFAULT_POPUP_COLOR_TEXT RGB(255, 245, 225) //Yellow
+
+#define MRA_DEFAULT_NLB_FAIL_DIRECT_CONNECT FALSE // hidden option
+#define MRA_DEFAULT_AUTO_ADD_CONTACTS_TO_SERVER TRUE
+#define MRA_DEFAULT_AUTO_AUTH_REQ_ON_LOGON FALSE
+#define MRA_DEFAULT_AUTO_AUTH_GRAND_IN_CLIST FALSE
+#define MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS FALSE
#define MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK FALSE
-#define MRA_DEFAULT_SLOW_SEND TRUE
-#define MRA_DEFAULT_CVT_SMILES_TO_TAGS TRUE
-#define MRA_DEFAULT_MIRVER_RAW FALSE // hidden option
-#define MRA_DEFAULT_AUTH_MESSAGE L"Please authorize me"
-
-#define MRA_DEFAULT_RTF_RECEIVE_ENABLE FALSE
-#define MRA_DEFAULT_RTF_SEND_ENABLE TRUE
-#define MRA_DEFAULT_RTF_SEND_SMART TRUE
-#define MRA_DEFAULT_RTF_BACKGROUND_COLOUR RGB(255,255,255)
-#define MRA_DEFAULT_RTF_FONT_COLOUR RGB(255,0,0)
-#define MRA_DEFAULT_RTF_FONT_SIZE 12
-#define MRA_DEFAULT_RTF_FONT_CHARSET RUSSIAN_CHARSET
-#define MRA_DEFAULT_RTF_FONT_NAME L"Tahoma"
-
-#define MRA_DEFAULT_SEARCH_REMEMBER TRUE
-#define MRA_DEFAULT_LAST_SEARCH_COUTRY 0
-
-
-#define MRA_DEFAULT_FILE_SEND_BLOCK_SIZE 8192 //hidden, размер блока при отправке файла
-
-#define MRA_DEFAULT_HIDE_MENU_ITEMS_FOR_NON_MRA FALSE
-
-#define MRA_DEFAULT_INC_NEW_MAIL_NOTIFY FALSE
-#define MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY FALSE
-#define MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX FALSE
-
-
-
-#define MRA_ANTISPAM_DEFAULT_ENABLE TRUE
-#define MRA_ANTISPAM_DEFAULT_CHK_TEMP_CONTACTS TRUE
-#define MRA_ANTISPAM_DEFAULT_DELETE_SPAMBOT_CONTACT FALSE
-#define MRA_ANTISPAM_DEFAULT_CLN_NON_ALPHNUM TRUE
-#define MRA_ANTISPAM_DEFAULT_MAX_LNG_CHANGES 5
-#define MRA_ANTISPAM_DEFAULT_SHOWPOP TRUE
-#define MRA_ANTISPAM_DEFAULT_WRITETOSYSTEMHISTORY TRUE
-#define MRA_ANTISPAM_DEFAULT_SEND_SPAM_REPORT_TO_SERVER TRUE
-
-
-#define MRA_AVT_DEFAULT_ENABLE TRUE
-#define MRA_AVT_DEFAULT_WRK_THREAD_COUNTS 4 // hidden
-#define MRA_AVT_DEFAULT_SERVER "obraz.foto.mail.ru"
-#define MRA_AVT_DEFAULT_SERVER_PORT 80
-#define MRA_AVT_DEFAULT_TIMEOUT_CONN 10
-#define MRA_AVT_DEFAULT_CONN_RETRY_COUNT 3
-#define MRA_AVT_DEFAULT_TIMEOUT_RECV 30
-#define MRA_AVT_DEFAULT_USE_KEEPALIVE_CONN TRUE
-#define MRA_AVT_DEFAULT_CHK_INTERVAL 60
-#define MRA_AVT_DEFAULT_AVT_FILENAME _T("_default.jpg")
-#define MRA_AVT_DEFAULT_RET_ABC_PATH TRUE
-#define MRA_DELETE_AVT_ON_CONTACT_DELETE TRUE
-#define MRA_AVT_DEFAULT_QE_CHK_INTERVAL 1000 //internal
-
-
-#define MRA_FILES_QUEUE_PROGRESS_INTERVAL 250 //internal
-#define MRA_FILES_NULL_ADDRR "192.168.0.1:26666;"
-#define MRA_DEF_FS_TIMEOUT_RECV 600
-#define MRA_DEF_FS_ENABLE_DIRECT_CONN TRUE
-#define MRA_DEF_FS_NO_OUT_CONN_ON_RCV FALSE
-#define MRA_DEF_FS_NO_OUT_CONN_ON_SEND FALSE
-#define MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS FALSE
-#define MRA_DEF_FS_HIDE_MY_ADDRESSES FALSE
-#define MRA_DEF_FS_ADD_EXTRA_ADDRESSES FALSE
-#define MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS TRUE
-
-
+#define MRA_DEFAULT_SLOW_SEND TRUE
+#define MRA_DEFAULT_CVT_SMILES_TO_TAGS TRUE
+#define MRA_DEFAULT_MIRVER_RAW FALSE // hidden option
+#define MRA_DEFAULT_AUTH_MESSAGE L"Please authorize me"
+
+#define MRA_DEFAULT_RTF_RECEIVE_ENABLE FALSE
+#define MRA_DEFAULT_RTF_SEND_ENABLE TRUE
+#define MRA_DEFAULT_RTF_SEND_SMART TRUE
+#define MRA_DEFAULT_RTF_BACKGROUND_COLOUR RGB(255, 255, 255)
+#define MRA_DEFAULT_RTF_FONT_COLOUR RGB(255, 0, 0)
+#define MRA_DEFAULT_RTF_FONT_SIZE 12
+#define MRA_DEFAULT_RTF_FONT_CHARSET RUSSIAN_CHARSET
+#define MRA_DEFAULT_RTF_FONT_NAME L"Tahoma"
+
+#define MRA_DEFAULT_SEARCH_REMEMBER TRUE
+#define MRA_DEFAULT_LAST_SEARCH_COUTRY 0
+
+
+#define MRA_DEFAULT_FILE_SEND_BLOCK_SIZE 8192 //hidden, размер блока при отправке файла
+
+#define MRA_DEFAULT_HIDE_MENU_ITEMS_FOR_NON_MRA FALSE
+
+#define MRA_DEFAULT_INC_NEW_MAIL_NOTIFY FALSE
+#define MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY FALSE
+#define MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX FALSE
+
+#define MRA_ANTISPAM_DEFAULT_ENABLE TRUE
+#define MRA_ANTISPAM_DEFAULT_CHK_TEMP_CONTACTS TRUE
+#define MRA_ANTISPAM_DEFAULT_DELETE_SPAMBOT_CONTACT FALSE
+#define MRA_ANTISPAM_DEFAULT_CLN_NON_ALPHNUM TRUE
+#define MRA_ANTISPAM_DEFAULT_MAX_LNG_CHANGES 5
+#define MRA_ANTISPAM_DEFAULT_SHOWPOP TRUE
+#define MRA_ANTISPAM_DEFAULT_WRITETOSYSTEMHISTORY TRUE
+#define MRA_ANTISPAM_DEFAULT_SEND_SPAM_REPORT_TO_SERVER TRUE
+
+#define MRA_AVT_DEFAULT_ENABLE TRUE
+#define MRA_AVT_DEFAULT_WRK_THREAD_COUNTS 4 // hidden
+#define MRA_AVT_DEFAULT_SERVER "obraz.foto.mail.ru"
+#define MRA_AVT_DEFAULT_SERVER_PORT 80
+#define MRA_AVT_DEFAULT_TIMEOUT_CONN 10
+#define MRA_AVT_DEFAULT_CONN_RETRY_COUNT 3
+#define MRA_AVT_DEFAULT_TIMEOUT_RECV 30
+#define MRA_AVT_DEFAULT_USE_KEEPALIVE_CONN TRUE
+#define MRA_AVT_DEFAULT_CHK_INTERVAL 60
+#define MRA_AVT_DEFAULT_AVT_FILENAME _T("_default.jpg")
+#define MRA_AVT_DEFAULT_RET_ABC_PATH TRUE
+#define MRA_DELETE_AVT_ON_CONTACT_DELETE TRUE
+#define MRA_AVT_DEFAULT_QE_CHK_INTERVAL 1000 //internal
+
+#define MRA_FILES_QUEUE_PROGRESS_INTERVAL 250 //internal
+#define MRA_FILES_NULL_ADDRR "192.168.0.1:26666;"
+#define MRA_DEF_FS_TIMEOUT_RECV 600
+#define MRA_DEF_FS_ENABLE_DIRECT_CONN TRUE
+#define MRA_DEF_FS_NO_OUT_CONN_ON_RCV FALSE
+#define MRA_DEF_FS_NO_OUT_CONN_ON_SEND FALSE
+#define MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS FALSE
+#define MRA_DEF_FS_HIDE_MY_ADDRESSES FALSE
+#define MRA_DEF_FS_ADD_EXTRA_ADDRESSES FALSE
+#define MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS TRUE
#define PS_GETMYAVATAR "/GetMyAvatar"
-//wParam=(char *)Buffer to file name
-//lParam=(int)Buffer size
-//return=0 for sucess
-
-
+//wParam = (char *)Buffer to file name
+//lParam = (int)Buffer size
+//return = 0 for sucess
#define ICQACKTYPE_SMS 1001
#define ICQEVENTTYPE_SMS 2001 //database event type
#define MS_ICQ_SENDSMS "/SendSMS"
-
// Database setting names
#define DBSETTING_CAPABILITIES "caps"
#define DBSETTING_XSTATUSID "XStatusId"
@@ -299,13 +251,6 @@ static const GUI_DISPLAY_ITEM gdiExtraStatusIconsItems[] =
#define DBSETTING_BLOGSTATUS "BlogStatus"
#define DBSETTING_BLOGSTATUSMUSIC "ListeningTo"
-#define PS_ICQ_SETCUSTOMSTATUS "/SetXStatus"
-#define PS_ICQ_SETCUSTOMSTATUSEX "/SetXStatusEx"
-#define PS_ICQ_GETCUSTOMSTATUS "/GetXStatus"
-#define PS_ICQ_GETCUSTOMSTATUSEX "/GetXStatusEx"
-#define PS_ICQ_GETCUSTOMSTATUSICON "/GetXStatusIcon"
-
-
#define CSSF_MASK_STATUS 0x0001 // status member valid for set/get
#define CSSF_MASK_NAME 0x0002 // pszName member valid for set/get
#define CSSF_MASK_MESSAGE 0x0004 // pszMessage member valid for set/get
@@ -315,352 +260,22 @@ static const GUI_DISPLAY_ITEM gdiExtraStatusIconsItems[] =
#define CSSF_STR_SIZES 0x0200 // returns sizes of custom status name & message (wParam & lParam members) in chars
#define CSSF_UNICODE 0x1000 // strings are in UCS-2
+extern const LPSTR lpcszStatusUri[];
+extern const LPWSTR lpcszXStatusNameDef[];
+#define MRA_XSTATUS_MENU "/menuXStatus"
+#define MRA_XSTATUS_COUNT 50
+#define MRA_MIR_XSTATUS_NONE 0
+#define MRA_MIR_XSTATUS_UNKNOWN MRA_XSTATUS_COUNT
-typedef struct {
- int cbSize; // size of the structure
- int flags; // combination of CSSF_*
- int *status; // custom status id
- union {
- char *pszName; // buffer for custom status name
- TCHAR *ptszName;
- WCHAR *pwszName;
- };
- union {
- char *pszMessage; // buffer for custom status message
- TCHAR *ptszMessage;
- WCHAR *pwszMessage;
- };
- WPARAM *wParam; // extra params, see flags
- LPARAM *lParam;
-} ICQ_CUSTOM_STATUS;
-
-
-
-
-
-
-
-
-
-
-
-INT_PTR MraGetCaps (WPARAM wParam,LPARAM lParam);
-INT_PTR MraGetName (WPARAM wParam,LPARAM lParam);
-INT_PTR MraLoadIcon (WPARAM wParam,LPARAM lParam);
-INT_PTR MraSetStatus (WPARAM wParam,LPARAM lParam);
-INT_PTR MraGetStatus (WPARAM wParam,LPARAM lParam);
-
-INT_PTR MraSetXStatus (WPARAM wParam,LPARAM lParam);
-INT_PTR MraSetXStatusEx (WPARAM wParam,LPARAM lParam);
-INT_PTR MraGetXStatus (WPARAM wParam,LPARAM lParam);
-INT_PTR MraGetXStatusEx (WPARAM wParam,LPARAM lParam);
-INT_PTR MraGetXStatusIcon (WPARAM wParam,LPARAM lParam);
-
-INT_PTR MraSetListeningTo (WPARAM wParam,LPARAM lParam);
-
-INT_PTR MraSetAwayMsgA (WPARAM wParam,LPARAM lParam);
-INT_PTR MraSetAwayMsg (WPARAM wParam,LPARAM lParam);
-INT_PTR MraGetAwayMsg (WPARAM wParam,LPARAM lParam);
-
-INT_PTR MraAuthAllow (WPARAM wParam,LPARAM lParam);
-INT_PTR MraAuthDeny (WPARAM wParam,LPARAM lParam);
-INT_PTR MraAddToList (WPARAM wParam,LPARAM lParam);
-INT_PTR MraAddToListByEvent (WPARAM wParam,LPARAM lParam);
-
-INT_PTR MraRecvMessage (WPARAM wParam,LPARAM lParam);
-INT_PTR MraRecvContacts (WPARAM wParam,LPARAM lParam);
-INT_PTR MraRecvFile (WPARAM wParam,LPARAM lParam);
-INT_PTR MraRecvAuth (WPARAM wParam,LPARAM lParam);
-
-INT_PTR MraSendAuthRequest (WPARAM wParam,LPARAM lParam);
-INT_PTR MraSendMessage (WPARAM wParam,LPARAM lParam);
-INT_PTR MraSendContacts (WPARAM wParam,LPARAM lParam);
-INT_PTR MraSendUserIsTyping (WPARAM wParam,LPARAM lParam);
-INT_PTR MraSendNudge (WPARAM wParam,LPARAM lParam);
-INT_PTR MraSetApparentMode (WPARAM wParam,LPARAM lParam);
-INT_PTR MraGetInfo (WPARAM wParam,LPARAM lParam);
-
-INT_PTR MraBasicSearch (WPARAM wParam,LPARAM lParam);
-INT_PTR MraSearchByEmail (WPARAM wParam,LPARAM lParam);
-INT_PTR MraSearchByName (WPARAM wParam,LPARAM lParam);
-INT_PTR MraCreateAdvSearchUI (WPARAM wParam,LPARAM lParam);
-INT_PTR MraSearchByAdvanced (WPARAM wParam,LPARAM lParam);
-
-INT_PTR MraGetAvatarCaps (WPARAM wParam,LPARAM lParam);
-INT_PTR MraGetAvatarInfo (WPARAM wParam,LPARAM lParam);
-INT_PTR MraGetMyAvatar (WPARAM wParam,LPARAM lParam);
-
-INT_PTR MraFileResume (WPARAM wParam,LPARAM lParam);
-INT_PTR MraFileAllow (WPARAM wParam,LPARAM lParam);
-INT_PTR MraFileDenyCancel (WPARAM wParam,LPARAM lParam);
-INT_PTR MraFileSend (WPARAM wParam,LPARAM lParam);
-
-
-INT_PTR MraSendSMS (WPARAM wParam,LPARAM lParam);
-
-
-static const SERVICE_ITEM siPluginServices[] =
-{
- { PS_GETCAPS, MraGetCaps },
- { PS_GETNAME, MraGetName },
- { PS_LOADICON, MraLoadIcon },
- { PS_SETSTATUS, MraSetStatus },
- { PS_GETSTATUS, MraGetStatus },
-
- { PS_ICQ_SETCUSTOMSTATUS, MraSetXStatus },
- { PS_ICQ_SETCUSTOMSTATUSEX, MraSetXStatusEx },
- { PS_ICQ_GETCUSTOMSTATUS, MraGetXStatus },
- { PS_ICQ_GETCUSTOMSTATUSEX, MraGetXStatusEx },
- { PS_ICQ_GETCUSTOMSTATUSICON, MraGetXStatusIcon },
-
- { PS_SET_LISTENINGTO, MraSetListeningTo },
-
- { PS_SETAWAYMSG, MraSetAwayMsgA },
- { PS_SETAWAYMSGW, MraSetAwayMsg },
- { PSS_GETAWAYMSG, MraGetAwayMsg },
-
- { PS_AUTHALLOW, MraAuthAllow },
- { PS_AUTHDENYW, MraAuthDeny },
-
- { PS_ADDTOLIST, MraAddToList },
- { PS_ADDTOLISTBYEVENT, MraAddToListByEvent },
-
- { PSR_MESSAGE, MraRecvMessage },
- { PSR_CONTACTS, MraRecvContacts },
- { PSR_FILE, MraRecvFile },
- { PSR_AUTH, MraRecvAuth },
-
- { PSS_AUTHREQUESTW, MraSendAuthRequest },
- { PSS_MESSAGE, MraSendMessage },
- { PSS_CONTACTS, MraSendContacts },
- { PSS_USERISTYPING, MraSendUserIsTyping },
- { PSS_SETAPPARENTMODE, MraSetApparentMode },
- { PSS_GETINFO, MraGetInfo },
-
- { PS_GETAVATARCAPS, MraGetAvatarCaps },
- { PS_GETAVATARINFOT, MraGetAvatarInfo },
- { PS_GETMYAVATART, MraGetMyAvatar },
-
- { PS_BASICSEARCHW, MraBasicSearch },
- { PS_SEARCHBYEMAILW, MraSearchByEmail },
- { PS_SEARCHBYNAMEW, MraSearchByName },
- { PS_CREATEADVSEARCHUI, MraCreateAdvSearchUI },
- { PS_SEARCHBYADVANCED, MraSearchByAdvanced },
-
- { PS_FILERESUMEW, MraFileResume },
- { PSS_FILEALLOWW, MraFileAllow },
- { PSS_FILEDENYW, MraFileDenyCancel },
- { PSS_FILECANCEL, MraFileDenyCancel },
- { PSS_FILEW, MraFileSend },
-
- { MS_ICQ_SENDSMS, MraSendSMS },
- { MRA_SEND_NUDGE, MraSendNudge },
-};
-
-
-
-
-INT_PTR MraGotoInbox(WPARAM wParam,LPARAM lParam);
-INT_PTR MraShowInboxStatus(WPARAM wParam,LPARAM lParam);
-INT_PTR MraEditProfile(WPARAM wParam,LPARAM lParam);
-INT_PTR MyAlbum(WPARAM wParam,LPARAM lParam);
-INT_PTR MyBlog(WPARAM wParam,LPARAM lParam);
-INT_PTR MyBlogStatus(WPARAM wParam,LPARAM lParam);
-INT_PTR MyVideo(WPARAM wParam,LPARAM lParam);
-INT_PTR MyAnswers(WPARAM wParam,LPARAM lParam);
-INT_PTR MyWorld(WPARAM wParam,LPARAM lParam);
-INT_PTR MraZhuki(WPARAM wParam,LPARAM lParam);
-INT_PTR MraChat(WPARAM wParam,LPARAM lParam);
-INT_PTR MraWebSearch(WPARAM wParam,LPARAM lParam);
-INT_PTR MraUpdateAllUsersInfo(WPARAM wParam,LPARAM lParam);
-INT_PTR MraCheckUpdatesUsersAvt(WPARAM wParam,LPARAM lParam);
-INT_PTR MraRequestAuthForAll(WPARAM wParam,LPARAM lParam);
-
-static const GUI_DISPLAY_ITEM gdiMenuItems[] =
-{
- { MRA_GOTO_INBOX, MRA_GOTO_INBOX_STR, IDI_INBOX, MraGotoInbox },
- { MRA_SHOW_INBOX_STATUS, MRA_SHOW_INBOX_STATUS_STR, IDI_MAIL_NOTIFY, MraShowInboxStatus },
- { MRA_EDIT_PROFILE, MRA_EDIT_PROFILE_STR, IDI_PROFILE, MraEditProfile },
- { MRA_MY_ALBUM, MRA_MY_ALBUM_STR, IDI_MRA_PHOTO, MyAlbum },
- { MRA_MY_BLOG, MRA_MY_BLOG_STR, IDI_MRA_BLOGS, MyBlog },
- { MRA_MY_BLOGSTATUS, MRA_MY_BLOGSTATUS_STR, IDI_BLOGSTATUS, MyBlogStatus },
- { MRA_MY_VIDEO, MRA_MY_VIDEO_STR, IDI_MRA_VIDEO, MyVideo },
- { MRA_MY_ANSWERS, MRA_MY_ANSWERS_STR, IDI_MRA_ANSWERS, MyAnswers },
- { MRA_MY_WORLD, MRA_MY_WORLD_STR, IDI_MRA_WORLD, MyWorld },
- { MRA_ZHUKI, MRA_ZHUKI_STR, IDI_MRA_ZHUKI, MraZhuki },
- { MRA_CHAT, MRA_CHAT_STR, IDI_MRA_CHAT, MraChat },
- { MRA_WEB_SEARCH, MRA_WEB_SEARCH_STR, IDI_MRA_WEB_SEARCH, MraWebSearch },
- { MRA_UPD_ALL_USERS_INFO, MRA_UPD_ALL_USERS_INFO_STR, IDI_PROFILE, MraUpdateAllUsersInfo },
- { MRA_CHK_UPDATES_USERS_AVATARS, MRA_CHK_UPDATES_USERS_AVATARS_STR, IDI_PROFILE, MraCheckUpdatesUsersAvt },
- { MRA_REQ_AUTH_FOR_ALL, MRA_REQ_AUTH_FOR_ALL_STR, IDI_AUTHRUGUEST, MraRequestAuthForAll }
-};
-
-
-
-INT_PTR MraRequestAuthorization(WPARAM wParam,LPARAM lParam);
-INT_PTR MraGrantAuthorization(WPARAM wParam,LPARAM lParam);
-INT_PTR MraSendPostcard(WPARAM wParam,LPARAM lParam);
-INT_PTR MraViewAlbum(WPARAM wParam,LPARAM lParam);
-INT_PTR MraReadBlog(WPARAM wParam,LPARAM lParam);
-INT_PTR MraReplyBlogStatus(WPARAM wParam,LPARAM lParam);
-INT_PTR MraViewVideo(WPARAM wParam,LPARAM lParam);
-INT_PTR MraAnswers(WPARAM wParam,LPARAM lParam);
-INT_PTR MraWorld(WPARAM wParam,LPARAM lParam);
-
-static const GUI_DISPLAY_ITEM gdiContactMenuItems[] =
-{
- { MRA_REQ_AUTH, MRA_REQ_AUTH_STR, IDI_AUTHRUGUEST, MraRequestAuthorization },
- { MRA_GRANT_AUTH, MRA_GRANT_AUTH_STR, IDI_AUTHGRANT, MraGrantAuthorization },
- { MRA_SEND_POSTCARD, MRA_SEND_POSTCARD_STR, IDI_MRA_POSTCARD, MraSendPostcard },
- { MRA_VIEW_ALBUM, MRA_VIEW_ALBUM_STR, IDI_MRA_PHOTO, MraViewAlbum },
- { MRA_READ_BLOG, MRA_READ_BLOG_STR, IDI_MRA_BLOGS, MraReadBlog },
- { MRA_REPLY_BLOG_STATUS,MRA_REPLY_BLOG_STATUS_STR,IDI_BLOGSTATUS, MraReplyBlogStatus },
- { MRA_VIEW_VIDEO, MRA_VIEW_VIDEO_STR, IDI_MRA_VIDEO, MraViewVideo },
- { MRA_ANSWERS, MRA_ANSWERS_STR, IDI_MRA_ANSWERS, MraAnswers },
- { MRA_WORLD, MRA_WORLD_STR, IDI_MRA_WORLD, MraWorld },
- { MRA_SEND_NUDGE, MRA_SENDNUDGE_STR, IDI_MRA_ALARM, NULL }
-};
-
-
-
-
-
-
-
-static const LPSTR lpcszStatusUri[]=
-{
- "",// offline // "status_0",
- "STATUS_ONLINE",// "status_1",
- "STATUS_AWAY", // "status_2",
- "STATUS_INVISIBLE",// "status_3",
- "status_dnd",
- "status_chat",
- "status_4",
- "status_5",
- "status_6",
- "status_7",
- "status_8",
- "status_9",
- "status_10",
- "status_11",
- "status_12",
- "status_13",
- "status_14",
- "status_15",
- "status_16",
- "status_17",
- "status_18",
- "status_19",
- "status_20",
- "status_21",
- "status_22",
- "status_23",
- "status_24",
- //"status_25", // chat/dnd
- "status_26",
- "status_27",
- "status_28",
- "status_29",
- "status_30",
- //"status_31", // chat/dnd
- "status_32",
- "status_33",
- "status_34",
- "status_35",
- "status_36",
- "status_37",
- "status_38",
- "status_39",
- "status_40",
- "status_41",
- "status_42",
- "status_43",
- "status_44",
- "status_45",
- "status_46",
- "status_47",
- "status_48",
- "status_49",
- "status_50",
- "status_51",
- "status_52",
- "status_53",
- "status_dating",
- //"status_127",145,154
- NULL
-};
-
-static const LPWSTR lpcszXStatusNameDef[]=
-{
- L"None",
- L"Sick",
- L"Home",
- L"Eating",
- L"Compass",
- L"On WC",
- L"Cooking",
- L"Walking",
- L"Alien",
- L"Shrimp",
- L"Got lost",
- L"Crazy",
- L"Duck",
- L"Playing",
- L"Smoking",
- L"Office",
- L"Meeting",
- L"Beer",
- L"Coffee",
- L"Working",
- L"Relaxing",
- L"On the phone",
- L"In institute",
- L"At school",
- L"Wrong number",
- L"Laughing",
- L"Malicious",
- L"Imp",
- L"Blind",
- L"Disappointed",
- L"Almost crying",
- L"Fearful",
- L"Angry",
- L"Vampire",
- L"Ass",
- L"Love",
- L"Sleeping",
- L"Cool!",
- L"Peace!",
- L"Cock a snook",
- L"Get out",
- L"Death",
- L"Rocket",
- L"Devil-fish",
- L"Heavy metal",
- L"Things look bad",
- L"Squirrel",
- L"Star",
- L"Music",
- L"Dating",
- NULL
-};
-
-#define MRA_XSTATUS_MENU "/menuXStatus"
-#define MRA_XSTATUS_COUNT 50
-#define MRA_MIR_XSTATUS_NONE 0
-#define MRA_MIR_XSTATUS_UNKNOWN MRA_XSTATUS_COUNT
-
-#define MRA_XSTATUS_OFFLINE 0
-#define MRA_XSTATUS_ONLINE 1
-#define MRA_XSTATUS_AWAY 2
-#define MRA_XSTATUS_INVISIBLE 3
-#define MRA_XSTATUS_DND 4
-#define MRA_XSTATUS_CHAT 5
-#define MRA_XSTATUS_UNKNOWN 55
+#define MRA_XSTATUS_OFFLINE 0
+#define MRA_XSTATUS_ONLINE 1
+#define MRA_XSTATUS_AWAY 2
+#define MRA_XSTATUS_INVISIBLE 3
+#define MRA_XSTATUS_DND 4
+#define MRA_XSTATUS_CHAT 5
+#define MRA_XSTATUS_UNKNOWN 55
#define MRA_XSTATUS_INDEX_OFFSET 6
-
-
#endif // !defined(AFX_MRA_CONSTANS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraFilesQueue.cpp b/protocols/MRA/MraFilesQueue.cpp
index 75b25a4f78..5e12fee80f 100644
--- a/protocols/MRA/MraFilesQueue.cpp
+++ b/protocols/MRA/MraFilesQueue.cpp
@@ -2,169 +2,144 @@
#include "MraFilesQueue.h"
#include "proto.h"
-
-
-
#define MRA_FT_HELLO "MRA_FT_HELLO"
#define MRA_FT_GET_FILE "MRA_FT_GET_FILE"
-
-
-typedef struct
+struct MRA_FILES_QUEUE : public LIST_MT
{
- LIST_MT lmtListMT;
DWORD dwSendTimeOutInterval;
-} MRA_FILES_QUEUE;
-
-
+};
struct MRA_FILES_QUEUE_FILE
{
LPWSTR lpwszName;
- SIZE_T dwNameLen;
+ size_t dwNameLen;
DWORDLONG dwSize;
};
-
-
-
-typedef struct
+struct MRA_FILES_QUEUE_ITEM : public LIST_MT_ITEM
{
// internal
- LIST_MT_ITEM lmtListMTItem;
- BOOL bIsWorking;
- DWORD dwSendTime;
- // external
- DWORD dwIDRequest;
- DWORD dwFlags;
- HANDLE hContact;
- DWORDLONG dwFilesCount;
- DWORDLONG dwFilesTotalSize;
- MRA_FILES_QUEUE_FILE *pmfqfFiles;
- LPWSTR pwszFilesList;
- LPWSTR pwszDescription;
- MRA_ADDR_LIST malAddrList;
- LPWSTR lpwszPath;
- SIZE_T dwPathSize;
- BOOL bSending;
- HANDLE hConnection;
- HANDLE hListen;
- HANDLE hThread;
- HANDLE hWaitHandle;
- HANDLE hMraMrimProxyData;
-
-} MRA_FILES_QUEUE_ITEM;
-
+ BOOL bIsWorking;
+ DWORD dwSendTime;
+ // external
+ CMraProto *ppro;
+ DWORD dwIDRequest;
+ DWORD dwFlags;
+ HANDLE hContact;
+ DWORDLONG dwFilesCount;
+ DWORDLONG dwFilesTotalSize;
+ MRA_FILES_QUEUE_FILE *pmfqfFiles;
+ LPWSTR pwszFilesList;
+ LPWSTR pwszDescription;
+ MRA_ADDR_LIST malAddrList;
+ LPWSTR lpwszPath;
+ size_t dwPathSize;
+ BOOL bSending;
+ HANDLE hConnection;
+ HANDLE hListen;
+ HANDLE hThread;
+ HANDLE hWaitHandle;
+ HANDLE hMraMrimProxyData;
+};
struct MRA_FILES_THREADPROC_PARAMS
{
HANDLE hFilesQueueHandle;
- MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+ MRA_FILES_QUEUE_ITEM *dat;
};
-//#define MEMALLOC(Size) HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,(Size+sizeof(SIZE_T)))
-//#define MEMREALLOC(Mem,Size) HeapReAlloc(GetProcessHeap(),(HEAP_ZERO_MEMORY),(LPVOID)Mem,(Size+sizeof(SIZE_T)))
-//#define MEMFREE(Mem) if (Mem) {HeapFree(GetProcessHeap(),0,(LPVOID)Mem);Mem=NULL;}
+//#define mir_calloc(Size) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (Size+sizeof(size_t)))
+//#define mir_realloc(Mem, Size) HeapReAlloc(GetProcessHeap(), (HEAP_ZERO_MEMORY), (LPVOID)Mem, (Size+sizeof(size_t)))
+//#define mir_free(Mem) if (Mem) {HeapFree(GetProcessHeap(), 0, (LPVOID)Mem);Mem = NULL;}
-DWORD MraFilesQueueItemFindByID (HANDLE hFilesQueueHandle,DWORD dwIDRequest,MRA_FILES_QUEUE_ITEM **ppmrafqFilesQueueItem);
-//DWORD MraFilesQueueItemFindByEMail (HANDLE hFilesQueueHandle,LPSTR lpszEMail,SIZE_T dwEMailSize,MRA_FILES_QUEUE_ITEM **ppmrafqFilesQueueItem);
-void MraFilesQueueItemFree (MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem);
-SIZE_T MraFilesQueueGetLocalAddressesList (LPSTR lpszBuff,SIZE_T dwBuffSize,DWORD dwPort);
+DWORD MraFilesQueueItemFindByID(HANDLE hFilesQueueHandle, DWORD dwIDRequest, MRA_FILES_QUEUE_ITEM **ppmrafqFilesQueueItem);
+void MraFilesQueueItemFree(MRA_FILES_QUEUE_ITEM *dat);
-BOOL MraFilesQueueHandCheck (HANDLE hConnection,MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem);
-void MraFilesQueueConnectionReceived (HANDLE hNewConnection,DWORD dwRemoteIP,void *pExtra);
-
-void MraFilesQueueRecvThreadProc (LPVOID lpParameter);
-void MraFilesQueueSendThreadProc (LPVOID lpParameter);
-
-
-
-void MraFilesQueueDlgEnableDirectConsControls(HWND hWndDlg,BOOL bEnabled)
+void MraFilesQueueDlgEnableDirectConsControls(HWND hWndDlg, BOOL bEnabled)
{
- WORD wMraFilesControlsList[]={
- IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE,
- IDC_FILE_SEND_NOOUTCONNECTIONONSEND,
- IDC_FILE_SEND_IGNORYADDITIONALPORTS,
- IDC_FILE_SEND_HIDE_MY_ADDRESSES,
- IDC_FILE_SEND_ADD_EXTRA_ADDRESS,
+ WORD wMraFilesControlsList[] = {
+ IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE,
+ IDC_FILE_SEND_NOOUTCONNECTIONONSEND,
+ IDC_FILE_SEND_IGNORYADDITIONALPORTS,
+ IDC_FILE_SEND_HIDE_MY_ADDRESSES,
+ IDC_FILE_SEND_ADD_EXTRA_ADDRESS,
IDC_FILE_SEND_EXTRA_ADDRESS
};
- EnableControlsArray(hWndDlg,(WORD*)&wMraFilesControlsList,SIZEOF(wMraFilesControlsList),bEnabled);
- EnableWindow(GetDlgItem(hWndDlg,IDC_FILE_SEND_EXTRA_ADDRESS),(bEnabled && IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_ADD_EXTRA_ADDRESS)));
+ EnableControlsArray(hWndDlg, (WORD*)&wMraFilesControlsList, SIZEOF(wMraFilesControlsList), bEnabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_FILE_SEND_EXTRA_ADDRESS), (bEnabled && IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ADD_EXTRA_ADDRESS)));
}
INT_PTR CALLBACK MraFilesQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg){
+ CMraProto *ppro = (CMraProto*)GetWindowLongPtr(hWndDlg, GWLP_USERDATA);
+
+ switch (msg) {
case WM_INITDIALOG:
+ TranslateDialogDefault(hWndDlg);
+ SetWindowLongPtr(hWndDlg, GWLP_USERDATA, lParam);
{
WCHAR szBuff[MAX_PATH];
+ CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_ENABLE_DIRECT_CONN, ppro->mraGetByte(NULL, "FileSendEnableDirectConn", MRA_DEF_FS_ENABLE_DIRECT_CONN));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE, ppro->mraGetByte(NULL, "FileSendNoOutConnOnRcv", MRA_DEF_FS_NO_OUT_CONN_ON_RCV));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONSEND, ppro->mraGetByte(NULL, "FileSendNoOutConnOnSend", MRA_DEF_FS_NO_OUT_CONN_ON_SEND));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_IGNORYADDITIONALPORTS, ppro->mraGetByte(NULL, "FileSendIgnoryAdditionalPorts", MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_HIDE_MY_ADDRESSES, ppro->mraGetByte(NULL, "FileSendHideMyAddresses", MRA_DEF_FS_HIDE_MY_ADDRESSES));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_ADD_EXTRA_ADDRESS, ppro->mraGetByte(NULL, "FileSendAddExtraAddresses", MRA_DEF_FS_ADD_EXTRA_ADDRESSES));
- TranslateDialogDefault(hWndDlg);
-
- CHECK_DLG_BUTTON(hWndDlg,IDC_FILE_SEND_ENABLE_DIRECT_CONN,DB_Mra_GetByte(NULL,"FileSendEnableDirectConn",MRA_DEF_FS_ENABLE_DIRECT_CONN));
- CHECK_DLG_BUTTON(hWndDlg,IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE,DB_Mra_GetByte(NULL,"FileSendNoOutConnOnRcv",MRA_DEF_FS_NO_OUT_CONN_ON_RCV));
- CHECK_DLG_BUTTON(hWndDlg,IDC_FILE_SEND_NOOUTCONNECTIONONSEND,DB_Mra_GetByte(NULL,"FileSendNoOutConnOnSend",MRA_DEF_FS_NO_OUT_CONN_ON_SEND));
- CHECK_DLG_BUTTON(hWndDlg,IDC_FILE_SEND_IGNORYADDITIONALPORTS,DB_Mra_GetByte(NULL,"FileSendIgnoryAdditionalPorts",MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS));
- CHECK_DLG_BUTTON(hWndDlg,IDC_FILE_SEND_HIDE_MY_ADDRESSES,DB_Mra_GetByte(NULL,"FileSendHideMyAddresses",MRA_DEF_FS_HIDE_MY_ADDRESSES));
- CHECK_DLG_BUTTON(hWndDlg,IDC_FILE_SEND_ADD_EXTRA_ADDRESS,DB_Mra_GetByte(NULL,"FileSendAddExtraAddresses",MRA_DEF_FS_ADD_EXTRA_ADDRESSES));
- if (DB_Mra_GetStaticStringW(NULL,"FileSendExtraAddresses",szBuff,SIZEOF(szBuff),NULL))
- {
- SET_DLG_ITEM_TEXT(hWndDlg,IDC_FILE_SEND_EXTRA_ADDRESS,szBuff);
- }
+ if (ppro->mraGetStaticStringW(NULL, "FileSendExtraAddresses", szBuff, SIZEOF(szBuff), NULL))
+ SET_DLG_ITEM_TEXT(hWndDlg, IDC_FILE_SEND_EXTRA_ADDRESS, szBuff);
- CHECK_DLG_BUTTON(hWndDlg,IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS,DB_Mra_GetByte(NULL,"FileSendEnableMRIMProxyCons",MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS, ppro->mraGetByte(NULL, "FileSendEnableMRIMProxyCons", MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS));
- SetDlgItemInt(hWndDlg,IDC_FILE_SEND_BLOCK_SIZE,DB_Mra_GetDword(NULL,"FileSendBlockSize",MRA_DEFAULT_FILE_SEND_BLOCK_SIZE),FALSE);
+ SetDlgItemInt(hWndDlg, IDC_FILE_SEND_BLOCK_SIZE, ppro->mraGetDword(NULL, "FileSendBlockSize", MRA_DEFAULT_FILE_SEND_BLOCK_SIZE), FALSE);
- MraFilesQueueDlgEnableDirectConsControls(hWndDlg,IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_ENABLE_DIRECT_CONN));
+ MraFilesQueueDlgEnableDirectConsControls(hWndDlg, IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ENABLE_DIRECT_CONN));
}
- return(TRUE);
+ return TRUE;
+
case WM_COMMAND:
- if (LOWORD(wParam)==IDC_FILE_SEND_ENABLE_DIRECT_CONN)
- {
- MraFilesQueueDlgEnableDirectConsControls(hWndDlg,IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_ENABLE_DIRECT_CONN));
- }
+ if (LOWORD(wParam) == IDC_FILE_SEND_ENABLE_DIRECT_CONN)
+ MraFilesQueueDlgEnableDirectConsControls(hWndDlg, IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ENABLE_DIRECT_CONN));
- if (LOWORD(wParam)==IDC_FILE_SEND_ADD_EXTRA_ADDRESS)
- {
- EnableWindow(GetDlgItem(hWndDlg,IDC_FILE_SEND_EXTRA_ADDRESS),IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_ADD_EXTRA_ADDRESS));
- }
+ if (LOWORD(wParam) == IDC_FILE_SEND_ADD_EXTRA_ADDRESS)
+ EnableWindow(GetDlgItem(hWndDlg, IDC_FILE_SEND_EXTRA_ADDRESS), IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ADD_EXTRA_ADDRESS));
- if ((LOWORD(wParam)==IDC_FILE_SEND_EXTRA_ADDRESS || LOWORD(wParam)==IDC_FILE_SEND_BLOCK_SIZE) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return(FALSE);
- SendMessage(GetParent(hWndDlg),PSM_CHANGED,0,0);
+ if ((LOWORD(wParam) == IDC_FILE_SEND_EXTRA_ADDRESS || LOWORD(wParam) == IDC_FILE_SEND_BLOCK_SIZE) && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) return FALSE;
+ SendMessage(GetParent(hWndDlg), PSM_CHANGED, 0, 0);
break;
+
case WM_NOTIFY:
- switch (((LPNMHDR)lParam)->code){
+ switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
{
WCHAR szBuff[MAX_PATH];
- DB_Mra_SetByte(NULL,"FileSendEnableDirectConn",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_ENABLE_DIRECT_CONN));
- DB_Mra_SetByte(NULL,"FileSendNoOutConnOnRcv",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE));
- DB_Mra_SetByte(NULL,"FileSendNoOutConnOnSend",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_NOOUTCONNECTIONONSEND));
- DB_Mra_SetByte(NULL,"FileSendIgnoryAdditionalPorts",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_IGNORYADDITIONALPORTS));
- DB_Mra_SetByte(NULL,"FileSendHideMyAddresses",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_HIDE_MY_ADDRESSES));
- DB_Mra_SetByte(NULL,"FileSendAddExtraAddresses",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_ADD_EXTRA_ADDRESS));
- GET_DLG_ITEM_TEXT(hWndDlg,IDC_FILE_SEND_EXTRA_ADDRESS,szBuff,SIZEOF(szBuff));
- DB_Mra_SetStringW(NULL,"FileSendExtraAddresses",szBuff);
- DB_Mra_SetDword(NULL,"FileSendBlockSize",(DWORD)GetDlgItemInt(hWndDlg,IDC_FILE_SEND_BLOCK_SIZE,NULL,FALSE));
- DB_Mra_SetByte(NULL,"FileSendEnableMRIMProxyCons",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS));
+ ppro->mraSetByte(NULL, "FileSendEnableDirectConn", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ENABLE_DIRECT_CONN));
+ ppro->mraSetByte(NULL, "FileSendNoOutConnOnRcv", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE));
+ ppro->mraSetByte(NULL, "FileSendNoOutConnOnSend", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_NOOUTCONNECTIONONSEND));
+ ppro->mraSetByte(NULL, "FileSendIgnoryAdditionalPorts", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_IGNORYADDITIONALPORTS));
+ ppro->mraSetByte(NULL, "FileSendHideMyAddresses", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_HIDE_MY_ADDRESSES));
+ ppro->mraSetByte(NULL, "FileSendAddExtraAddresses", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ADD_EXTRA_ADDRESS));
+ GET_DLG_ITEM_TEXT(hWndDlg, IDC_FILE_SEND_EXTRA_ADDRESS, szBuff, SIZEOF(szBuff));
+ ppro->mraSetStringW(NULL, "FileSendExtraAddresses", szBuff);
+ ppro->mraSetDword(NULL, "FileSendBlockSize", (DWORD)GetDlgItemInt(hWndDlg, IDC_FILE_SEND_BLOCK_SIZE, NULL, FALSE));
+ ppro->mraSetByte(NULL, "FileSendEnableMRIMProxyCons", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS));
}
- return(TRUE);
+ return TRUE;
}
break;
}
-return(FALSE);
+return FALSE;
}
-DWORD MraFilesQueueInitialize(DWORD dwSendTimeOutInterval,HANDLE *phFilesQueueHandle)
+DWORD MraFilesQueueInitialize(DWORD dwSendTimeOutInterval, HANDLE *phFilesQueueHandle)
{
DWORD dwRetErrorCode;
@@ -172,22 +147,22 @@ DWORD MraFilesQueueInitialize(DWORD dwSendTimeOutInterval,HANDLE *phFilesQueueHa
{
MRA_FILES_QUEUE *pmrafqFilesQueue;
- pmrafqFilesQueue=(MRA_FILES_QUEUE*)MEMALLOC(sizeof(MRA_FILES_QUEUE));
+ pmrafqFilesQueue = (MRA_FILES_QUEUE*)mir_calloc(sizeof(MRA_FILES_QUEUE));
if (pmrafqFilesQueue)
{
- dwRetErrorCode=ListMTInitialize(&pmrafqFilesQueue->lmtListMT,0);
- if (dwRetErrorCode==NO_ERROR)
+ dwRetErrorCode = ListMTInitialize(pmrafqFilesQueue, 0);
+ if (dwRetErrorCode == NO_ERROR)
{
- pmrafqFilesQueue->dwSendTimeOutInterval=dwSendTimeOutInterval;
- (*phFilesQueueHandle)=(HANDLE)pmrafqFilesQueue;
- }else{
- MEMFREE(pmrafqFilesQueue);
+ pmrafqFilesQueue->dwSendTimeOutInterval = dwSendTimeOutInterval;
+ (*phFilesQueueHandle) = (HANDLE)pmrafqFilesQueue;
+ }else {
+ mir_free(pmrafqFilesQueue);
}
- }else{
- dwRetErrorCode=GetLastError();
+ }else {
+ dwRetErrorCode = GetLastError();
}
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }else {
+ dwRetErrorCode = ERROR_INVALID_HANDLE;
}
return(dwRetErrorCode);
}
@@ -197,164 +172,123 @@ void MraFilesQueueDestroy(HANDLE hFilesQueueHandle)
{
if (hFilesQueueHandle)
{
- MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
- MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+ MRA_FILES_QUEUE *pmrafqFilesQueue = (MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *dat;
- ListMTLock(&pmrafqFilesQueue->lmtListMT);
- while(ListMTItemGetFirst(&pmrafqFilesQueue->lmtListMT,NULL,(LPVOID*)&pmrafqFilesQueueItem)==NO_ERROR)
+ ListMTLock(pmrafqFilesQueue);
+ while( ListMTItemGetFirst(pmrafqFilesQueue, NULL, (LPVOID*)&dat) == NO_ERROR)
{
- MraFilesQueueItemFree(pmrafqFilesQueueItem);
+ MraFilesQueueItemFree(dat);
}
- ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ ListMTUnLock(pmrafqFilesQueue);
- ListMTDestroy(&pmrafqFilesQueue->lmtListMT);
- MEMFREE(pmrafqFilesQueue);
+ ListMTDestroy(pmrafqFilesQueue);
+ mir_free(pmrafqFilesQueue);
}
}
-DWORD MraFilesQueueItemFindByID(HANDLE hFilesQueueHandle,DWORD dwIDRequest,MRA_FILES_QUEUE_ITEM **ppmrafqFilesQueueItem)
+DWORD MraFilesQueueItemFindByID(HANDLE hFilesQueueHandle, DWORD dwIDRequest, MRA_FILES_QUEUE_ITEM **ppmrafqFilesQueueItem)
{
DWORD dwRetErrorCode;
if (hFilesQueueHandle)
{
- MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
- MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+ MRA_FILES_QUEUE *pmrafqFilesQueue = (MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *dat;
LIST_MT_ITERATOR lmtiIterator;
- dwRetErrorCode=ERROR_NOT_FOUND;
- ListMTLock(&pmrafqFilesQueue->lmtListMT);
- ListMTIteratorMoveFirst(&pmrafqFilesQueue->lmtListMT,&lmtiIterator);
+ dwRetErrorCode = ERROR_NOT_FOUND;
+ ListMTLock(pmrafqFilesQueue);
+ ListMTIteratorMoveFirst(pmrafqFilesQueue, &lmtiIterator);
do
{// цикл
- if (ListMTIteratorGet(&lmtiIterator,NULL,(LPVOID*)&pmrafqFilesQueueItem)==NO_ERROR)
- if (pmrafqFilesQueueItem->dwIDRequest==dwIDRequest)
+ if (ListMTIteratorGet(&lmtiIterator, NULL, (LPVOID*)&dat) == NO_ERROR)
+ if (dat->dwIDRequest == dwIDRequest)
{
- if (ppmrafqFilesQueueItem) (*ppmrafqFilesQueueItem)=pmrafqFilesQueueItem;
- dwRetErrorCode=NO_ERROR;
+ if (ppmrafqFilesQueueItem) (*ppmrafqFilesQueueItem) = dat;
+ dwRetErrorCode = NO_ERROR;
break;
}
}while(ListMTIteratorMoveNext(&lmtiIterator));
- ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ ListMTUnLock(pmrafqFilesQueue);
+ }else {
+ dwRetErrorCode = ERROR_INVALID_HANDLE;
}
return(dwRetErrorCode);
}
-HANDLE MraFilesQueueItemProxyByID(HANDLE hFilesQueueHandle,DWORD dwIDRequest)
+HANDLE MraFilesQueueItemProxyByID(HANDLE hFilesQueueHandle, DWORD dwIDRequest)
{
- HANDLE hRet=NULL;
- MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+ HANDLE hRet = NULL;
+ MRA_FILES_QUEUE_ITEM *dat;
- if (MraFilesQueueItemFindByID(hFilesQueueHandle,dwIDRequest,&pmrafqFilesQueueItem)==NO_ERROR)
+ if (MraFilesQueueItemFindByID(hFilesQueueHandle, dwIDRequest, &dat) == NO_ERROR)
{
- hRet=pmrafqFilesQueueItem->hMraMrimProxyData;
+ hRet = dat->hMraMrimProxyData;
}
return(hRet);
}
-
-/*DWORD MraFilesQueueItemFindByEMail(HANDLE hFilesQueueHandle,LPSTR lpszEMail,SIZE_T dwEMailSize,MRA_FILES_QUEUE_ITEM **ppmrafqFilesQueueItem)
+void MraFilesQueueItemFree(MRA_FILES_QUEUE_ITEM *dat)
{
- DWORD dwRetErrorCode;
-
- if (hFilesQueueHandle)
- {
- CHAR szEMailLocal[MAX_EMAIL_LEN];
- SIZE_T dwEMailLocalSize;
- MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
- MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
- LIST_MT_ITERATOR lmtiIterator;
-
- dwRetErrorCode=ERROR_NOT_FOUND;
- ListMTLock(&pmrafqFilesQueue->lmtListMT);
- ListMTIteratorMoveFirst(&pmrafqFilesQueue->lmtListMT,&lmtiIterator);
- do
- {// цикл
- if (ListMTIteratorGet(&lmtiIterator,NULL,(LPVOID*)&pmrafqFilesQueueItem)==NO_ERROR)
- if (DB_Mra_GetStaticStringA(pmrafqFilesQueueItem->hContact,"e-mail",szEMailLocal,SIZEOF(szEMailLocal),&dwEMailLocalSize))
- if (dwEMailSize==dwEMailLocalSize)
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszEMail,dwEMailSize,szEMailLocal,dwEMailLocalSize)==CSTR_EQUAL)
- {
- if (ppmrafqFilesQueueItem) (*ppmrafqFilesQueueItem)=pmrafqFilesQueueItem;
- dwRetErrorCode=NO_ERROR;
- break;
- }
- }while(ListMTIteratorMoveNext(&lmtiIterator));
- ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
- }
-return(dwRetErrorCode);
-}*/
-
+ LIST_MT *plmtListMT = (LIST_MT*)dat->lpListMT;
-void MraFilesQueueItemFree(MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem)
-{
- LIST_MT *plmtListMT=(LIST_MT*)pmrafqFilesQueueItem->lmtListMTItem.lpListMT;
+ for (size_t i = 0;i<dat->dwFilesCount;i++)
+ mir_free(dat->pmfqfFiles[i].lpwszName);
- for(SIZE_T i=0;i<pmrafqFilesQueueItem->dwFilesCount;i++)
- {
- MEMFREE(pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName);
- }
- MEMFREE(pmrafqFilesQueueItem->pmfqfFiles);
- MEMFREE(pmrafqFilesQueueItem->pwszFilesList);
- MEMFREE(pmrafqFilesQueueItem->pwszDescription);
- MraAddrListFree(&pmrafqFilesQueueItem->malAddrList);
- MraMrimProxyFree(pmrafqFilesQueueItem->hMraMrimProxyData);
- MEMFREE(pmrafqFilesQueueItem->lpwszPath);
+ mir_free(dat->pmfqfFiles);
+ mir_free(dat->pwszFilesList);
+ mir_free(dat->pwszDescription);
+ MraAddrListFree(&dat->malAddrList);
+ MraMrimProxyFree(dat->hMraMrimProxyData);
+ mir_free(dat->lpwszPath);
ListMTLock(plmtListMT);
- ListMTItemDelete(plmtListMT,&pmrafqFilesQueueItem->lmtListMTItem);
+ ListMTItemDelete(plmtListMT, dat);
ListMTUnLock(plmtListMT);
- MEMFREE(pmrafqFilesQueueItem);
+ mir_free(dat);
}
-
-
-
-
-SIZE_T MraFilesQueueGetLocalAddressesList(LPSTR lpszBuff,SIZE_T dwBuffSize,DWORD dwPort)
+size_t CMraProto::MraFilesQueueGetLocalAddressesList(LPSTR lpszBuff, size_t dwBuffSize, DWORD dwPort)
{
- CHAR szHostName[MAX_PATH]={0};
- LPSTR lpszCurPos=lpszBuff;
+ CHAR szHostName[MAX_PATH] = {0};
+ LPSTR lpszCurPos = lpszBuff;
- if (DB_Mra_GetByte(NULL,"FileSendHideMyAddresses",MRA_DEF_FS_HIDE_MY_ADDRESSES))
+ if (mraGetByte(NULL, "FileSendHideMyAddresses", MRA_DEF_FS_HIDE_MY_ADDRESSES))
{// не выдаём врагу наш IP адрес!!! :)
- if (DB_Mra_GetByte(NULL,"FileSendAddExtraAddresses",MRA_DEF_FS_ADD_EXTRA_ADDRESSES)==FALSE)
+ if (mraGetByte(NULL, "FileSendAddExtraAddresses", MRA_DEF_FS_ADD_EXTRA_ADDRESSES) == FALSE)
{// только если не добавляем адрес роутера
- lpszCurPos+=mir_snprintf(lpszCurPos,(dwBuffSize-((SIZE_T)lpszCurPos-(SIZE_T)lpszBuff)),MRA_FILES_NULL_ADDRR);
+ lpszCurPos += mir_snprintf(lpszCurPos, (dwBuffSize-((size_t)lpszCurPos-(size_t)lpszBuff)), MRA_FILES_NULL_ADDRR);
}
- }else{// создаём список наших IP адресов
+ }else {// создаём список наших IP адресов
BYTE btAddress[32];
DWORD dwSelfExternalIP;
- SIZE_T dwAdapter=0;
+ size_t dwAdapter = 0;
hostent *sh;
- dwSelfExternalIP=NTOHL(DB_Mra_GetDword(NULL,"IP",0));
+ dwSelfExternalIP = NTOHL(mraGetDword(NULL, "IP", 0));
if (dwSelfExternalIP)
{
- memmove(&btAddress,&dwSelfExternalIP,sizeof(DWORD));
- lpszCurPos+=mir_snprintf(lpszCurPos,(dwBuffSize-((SIZE_T)lpszCurPos-(SIZE_T)lpszBuff)),"%lu.%lu.%lu.%lu:%lu;",btAddress[0],btAddress[1],btAddress[2],btAddress[3],dwPort);
+ memmove(&btAddress, &dwSelfExternalIP, sizeof(DWORD));
+ lpszCurPos += mir_snprintf(lpszCurPos, (dwBuffSize-((size_t)lpszCurPos-(size_t)lpszBuff)), "%lu.%lu.%lu.%lu:%lu;", btAddress[0], btAddress[1], btAddress[2], btAddress[3], dwPort);
}
- if (gethostname(szHostName,SIZEOF(szHostName))==0)
- if ((sh=gethostbyname((LPSTR)&szHostName)))
+ if (gethostname(szHostName, SIZEOF(szHostName)) == 0)
+ if ((sh = gethostbyname((LPSTR)&szHostName)))
{
while(sh->h_addr_list[dwAdapter])
{
- lpszCurPos+=mir_snprintf(lpszCurPos,(dwBuffSize-((SIZE_T)lpszCurPos-(SIZE_T)lpszBuff)),"%s:%lu;",inet_ntoa(*((struct in_addr*)sh->h_addr_list[dwAdapter])),dwPort);
+ lpszCurPos += mir_snprintf(lpszCurPos, (dwBuffSize-((size_t)lpszCurPos-(size_t)lpszBuff)), "%s:%lu;", inet_ntoa(*((struct in_addr*)sh->h_addr_list[dwAdapter])), dwPort);
dwAdapter++;
}
}
}
- if (DB_Mra_GetByte(NULL,"FileSendAddExtraAddresses",MRA_DEF_FS_ADD_EXTRA_ADDRESSES))// добавляем произвольный адрес
- if (DB_Mra_GetStaticStringA(NULL,"FileSendExtraAddresses",szHostName,SIZEOF(szHostName),NULL))
+ if (mraGetByte(NULL, "FileSendAddExtraAddresses", MRA_DEF_FS_ADD_EXTRA_ADDRESSES))// добавляем произвольный адрес
+ if (mraGetStaticStringA(NULL, "FileSendExtraAddresses", szHostName, SIZEOF(szHostName), NULL))
{
- lpszCurPos+=mir_snprintf(lpszCurPos,(dwBuffSize-((SIZE_T)lpszCurPos-(SIZE_T)lpszBuff)),"%s:%lu;",szHostName,dwPort);
+ lpszCurPos += mir_snprintf(lpszCurPos, (dwBuffSize-((size_t)lpszCurPos-(size_t)lpszBuff)), "%s:%lu;", szHostName, dwPort);
}
return((lpszCurPos-lpszBuff));
}
@@ -362,416 +296,413 @@ return((lpszCurPos-lpszBuff));
-DWORD MraFilesQueueAddReceive(HANDLE hFilesQueueHandle,DWORD dwFlags,HANDLE hContact,DWORD dwIDRequest,LPWSTR lpwszFiles,SIZE_T dwFilesSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize)
+DWORD CMraProto::MraFilesQueueAddReceive(HANDLE hFilesQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD dwIDRequest, LPWSTR lpwszFiles, size_t dwFilesSize, LPSTR lpszAddreses, size_t dwAddresesSize)
{
DWORD dwRetErrorCode;
if (hFilesQueueHandle && dwIDRequest)
{
- MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
- MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+ MRA_FILES_QUEUE *pmrafqFilesQueue = (MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *dat;
- pmrafqFilesQueueItem=(MRA_FILES_QUEUE_ITEM*)MEMALLOC(sizeof(MRA_FILES_QUEUE_ITEM)+sizeof(LPSTR)+64);
- if (pmrafqFilesQueueItem)
+ dat = (MRA_FILES_QUEUE_ITEM*)mir_calloc(sizeof(MRA_FILES_QUEUE_ITEM)+sizeof(LPSTR)+64);
+ if (dat)
{
WCHAR szBuff[MAX_PATH];
- LPWSTR lpwszCurrentItem,lpwszDelimiter,lpwszEndItem;
- SIZE_T dwMemSize,dwAllocatedCount,dwFileNameTotalSize;
+ LPWSTR lpwszCurrentItem, lpwszDelimiter, lpwszEndItem;
+ size_t dwMemSize, dwAllocatedCount, dwFileNameTotalSize;
CCSDATA ccs;
PROTORECVFILET prf;
- //pmrafqFilesQueueItem->lmtListMTItem;
- pmrafqFilesQueueItem->bIsWorking=TRUE;
- pmrafqFilesQueueItem->dwSendTime=GetTickCount();
- pmrafqFilesQueueItem->dwIDRequest=dwIDRequest;
- pmrafqFilesQueueItem->dwFlags=dwFlags;
- pmrafqFilesQueueItem->hContact=hContact;
- if (DB_Mra_GetByte(NULL,"FileSendEnableMRIMProxyCons",MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS)) pmrafqFilesQueueItem->hMraMrimProxyData=MraMrimProxyCreate();
-
-
- dwFileNameTotalSize=0;
- dwAllocatedCount=ALLOCATED_COUNT;
- pmrafqFilesQueueItem->dwFilesCount=0;
- pmrafqFilesQueueItem->dwFilesTotalSize=0;
- pmrafqFilesQueueItem->pmfqfFiles=(MRA_FILES_QUEUE_FILE*)MEMALLOC((sizeof(MRA_FILES_QUEUE_FILE)*dwAllocatedCount));
- lpwszCurrentItem=lpwszFiles;
+ //dat->lmtListMTItem;
+ dat->ppro = this;
+ dat->bIsWorking = TRUE;
+ dat->dwSendTime = GetTickCount();
+ dat->dwIDRequest = dwIDRequest;
+ dat->dwFlags = dwFlags;
+ dat->hContact = hContact;
+ if (mraGetByte(NULL, "FileSendEnableMRIMProxyCons", MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS))
+ dat->hMraMrimProxyData = MraMrimProxyCreate();
+
+ dwFileNameTotalSize = 0;
+ dwAllocatedCount = ALLOCATED_COUNT;
+ dat->dwFilesCount = 0;
+ dat->dwFilesTotalSize = 0;
+ dat->pmfqfFiles = (MRA_FILES_QUEUE_FILE*)mir_calloc((sizeof(MRA_FILES_QUEUE_FILE)*dwAllocatedCount));
+ lpwszCurrentItem = lpwszFiles;
while(TRUE)
{
- lpwszDelimiter=(LPWSTR)MemoryFind(((SIZE_T)lpwszCurrentItem-(SIZE_T)lpwszFiles),lpwszFiles,(dwFilesSize*sizeof(WCHAR)),";",2);
+ lpwszDelimiter = (LPWSTR)MemoryFind(((size_t)lpwszCurrentItem-(size_t)lpwszFiles), lpwszFiles, (dwFilesSize*sizeof(WCHAR)), ";", 2);
if (lpwszDelimiter)
{
- lpwszEndItem=(LPWSTR)MemoryFind((((SIZE_T)lpwszDelimiter+2)-(SIZE_T)lpwszFiles),lpwszFiles,(dwFilesSize*sizeof(WCHAR)),";",2);
+ lpwszEndItem = (LPWSTR)MemoryFind((((size_t)lpwszDelimiter+2)-(size_t)lpwszFiles), lpwszFiles, (dwFilesSize*sizeof(WCHAR)), ";", 2);
if (lpwszEndItem)
{
- if (pmrafqFilesQueueItem->dwFilesCount==dwAllocatedCount)
+ if (dat->dwFilesCount == dwAllocatedCount)
{
- dwAllocatedCount*=2;
- pmrafqFilesQueueItem->pmfqfFiles=(MRA_FILES_QUEUE_FILE*)MEMREALLOC(pmrafqFilesQueueItem->pmfqfFiles,(sizeof(MRA_FILES_QUEUE_FILE)*dwAllocatedCount));
+ dwAllocatedCount *= 2;
+ dat->pmfqfFiles = (MRA_FILES_QUEUE_FILE*)mir_realloc(dat->pmfqfFiles, (sizeof(MRA_FILES_QUEUE_FILE)*dwAllocatedCount));
}
- dwMemSize=((SIZE_T)lpwszDelimiter-(SIZE_T)lpwszCurrentItem);
- pmrafqFilesQueueItem->pmfqfFiles[pmrafqFilesQueueItem->dwFilesCount].lpwszName=(LPWSTR)MEMALLOC(dwMemSize);
- memmove(pmrafqFilesQueueItem->pmfqfFiles[pmrafqFilesQueueItem->dwFilesCount].lpwszName,lpwszCurrentItem,dwMemSize);
- pmrafqFilesQueueItem->pmfqfFiles[pmrafqFilesQueueItem->dwFilesCount].dwSize=StrToUNum64((LPSTR)((SIZE_T)lpwszDelimiter+1),((SIZE_T)lpwszEndItem-((SIZE_T)lpwszDelimiter+1)));
- pmrafqFilesQueueItem->dwFilesTotalSize+=pmrafqFilesQueueItem->pmfqfFiles[pmrafqFilesQueueItem->dwFilesCount].dwSize;
- pmrafqFilesQueueItem->pmfqfFiles[pmrafqFilesQueueItem->dwFilesCount].dwNameLen=(dwMemSize/sizeof(WCHAR));
- dwFileNameTotalSize+=dwMemSize;
+ dwMemSize = ((size_t)lpwszDelimiter-(size_t)lpwszCurrentItem);
+ dat->pmfqfFiles[dat->dwFilesCount].lpwszName = (LPWSTR)mir_calloc(dwMemSize);
+ memmove(dat->pmfqfFiles[dat->dwFilesCount].lpwszName, lpwszCurrentItem, dwMemSize);
+ dat->pmfqfFiles[dat->dwFilesCount].dwSize = StrToUNum64((LPSTR)((size_t)lpwszDelimiter+1), ((size_t)lpwszEndItem-((size_t)lpwszDelimiter+1)));
+ dat->dwFilesTotalSize += dat->pmfqfFiles[dat->dwFilesCount].dwSize;
+ dat->pmfqfFiles[dat->dwFilesCount].dwNameLen = (dwMemSize/sizeof(WCHAR));
+ dwFileNameTotalSize += dwMemSize;
- pmrafqFilesQueueItem->dwFilesCount++;
- lpwszCurrentItem=(lpwszEndItem+1);
- }else{
+ dat->dwFilesCount++;
+ lpwszCurrentItem = (lpwszEndItem+1);
+ }else {
break;
}
- }else{
+ }else {
break;
}
}
- pmrafqFilesQueueItem->pmfqfFiles=(MRA_FILES_QUEUE_FILE*)MEMREALLOC(pmrafqFilesQueueItem->pmfqfFiles,(sizeof(MRA_FILES_QUEUE_FILE)*(pmrafqFilesQueueItem->dwFilesCount+4)));
+ dat->pmfqfFiles = (MRA_FILES_QUEUE_FILE*)mir_realloc(dat->pmfqfFiles, (sizeof(MRA_FILES_QUEUE_FILE)*(dat->dwFilesCount+4)));
- dwMemSize=(((pmrafqFilesQueueItem->dwFilesCount+4)*64)+(dwFileNameTotalSize*sizeof(WCHAR))+(dwAddresesSize*sizeof(WCHAR))+128);
- pmrafqFilesQueueItem->pwszFilesList=(LPWSTR)MEMALLOC(dwMemSize);
- pmrafqFilesQueueItem->pwszDescription=(LPWSTR)MEMALLOC(dwMemSize);
+ dwMemSize = (((dat->dwFilesCount+4)*64)+(dwFileNameTotalSize*sizeof(WCHAR))+(dwAddresesSize*sizeof(WCHAR))+128);
+ dat->pwszFilesList = (LPWSTR)mir_calloc(dwMemSize);
+ dat->pwszDescription = (LPWSTR)mir_calloc(dwMemSize);
- lpwszDelimiter=pmrafqFilesQueueItem->pwszFilesList;
- lpwszCurrentItem=pmrafqFilesQueueItem->pwszDescription;
- StrFormatByteSizeW(pmrafqFilesQueueItem->dwFilesTotalSize,szBuff,SIZEOF(szBuff));
- lpwszCurrentItem+=mir_sntprintf(lpwszCurrentItem,((dwMemSize-((SIZE_T)lpwszCurrentItem-(SIZE_T)pmrafqFilesQueueItem->pwszDescription))/sizeof(WCHAR)),L"%I64u Files (%s)\r\n",pmrafqFilesQueueItem->dwFilesCount,szBuff);
+ lpwszDelimiter = dat->pwszFilesList;
+ lpwszCurrentItem = dat->pwszDescription;
+ StrFormatByteSizeW(dat->dwFilesTotalSize, szBuff, SIZEOF(szBuff));
+ lpwszCurrentItem += mir_sntprintf(lpwszCurrentItem, ((dwMemSize-((size_t)lpwszCurrentItem-(size_t)dat->pwszDescription))/sizeof(WCHAR)), L"%I64u Files (%s)\r\n", dat->dwFilesCount, szBuff);
// description + filesnames
- for(SIZE_T i=0;i<pmrafqFilesQueueItem->dwFilesCount;i++)
+ for (size_t i = 0;i<dat->dwFilesCount;i++)
{
- lpwszDelimiter+=mir_sntprintf(lpwszDelimiter,((dwMemSize-((SIZE_T)lpwszDelimiter-(SIZE_T)pmrafqFilesQueueItem->pwszFilesList))/sizeof(WCHAR)),L"%s; ",pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName);
- StrFormatByteSizeW(pmrafqFilesQueueItem->pmfqfFiles[i].dwSize,szBuff,SIZEOF(szBuff));
- lpwszCurrentItem+=mir_sntprintf(lpwszCurrentItem,((dwMemSize-((SIZE_T)lpwszCurrentItem-(SIZE_T)pmrafqFilesQueueItem->pwszDescription))/sizeof(WCHAR)),L"%s - %s\r\n",pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName,szBuff);
+ lpwszDelimiter += mir_sntprintf(lpwszDelimiter, ((dwMemSize-((size_t)lpwszDelimiter-(size_t)dat->pwszFilesList))/sizeof(WCHAR)), L"%s; ", dat->pmfqfFiles[i].lpwszName);
+ StrFormatByteSizeW(dat->pmfqfFiles[i].dwSize, szBuff, SIZEOF(szBuff));
+ lpwszCurrentItem += mir_sntprintf(lpwszCurrentItem, ((dwMemSize-((size_t)lpwszCurrentItem-(size_t)dat->pwszDescription))/sizeof(WCHAR)), L"%s - %s\r\n", dat->pmfqfFiles[i].lpwszName, szBuff);
}
- lpwszCurrentItem+=MultiByteToWideChar(MRA_CODE_PAGE,0,lpszAddreses,dwAddresesSize,lpwszCurrentItem,((dwMemSize-((SIZE_T)lpwszCurrentItem-(SIZE_T)pmrafqFilesQueueItem->pwszDescription))/sizeof(WCHAR)));
- (*lpwszCurrentItem)=0;
+ lpwszCurrentItem += MultiByteToWideChar(MRA_CODE_PAGE, 0, lpszAddreses, dwAddresesSize, lpwszCurrentItem, ((dwMemSize-((size_t)lpwszCurrentItem-(size_t)dat->pwszDescription))/sizeof(WCHAR)));
+ (*lpwszCurrentItem) = 0;
//lpwszCurrentItem++;
- MraAddrListGetFromBuff(lpszAddreses,dwAddresesSize,&pmrafqFilesQueueItem->malAddrList);
- MraAddrListStoreToContact(pmrafqFilesQueueItem->hContact,&pmrafqFilesQueueItem->malAddrList);
+ MraAddrListGetFromBuff(lpszAddreses, dwAddresesSize, &dat->malAddrList);
+ MraAddrListStoreToContact(dat->hContact, &dat->malAddrList);
- ListMTLock(&pmrafqFilesQueue->lmtListMT);
- ListMTItemAdd(&pmrafqFilesQueue->lmtListMT,&pmrafqFilesQueueItem->lmtListMTItem,pmrafqFilesQueueItem);
- ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ ListMTLock(pmrafqFilesQueue);
+ ListMTItemAdd(pmrafqFilesQueue, dat, dat);
+ ListMTUnLock(pmrafqFilesQueue);
// Send chain event
- ccs.szProtoService=PSR_FILE;
- ccs.hContact=hContact;
- ccs.wParam=0;
- ccs.lParam=(LPARAM)&prf;
- prf.flags=PREF_UNICODE;
- prf.timestamp=_time32(NULL);
- prf.tszDescription=pmrafqFilesQueueItem->pwszDescription;
- prf.fileCount=1;//pmrafqFilesQueueItem->dwFilesCount;
- prf.ptszFiles=&pmrafqFilesQueueItem->pwszFilesList;
- prf.lParam=dwIDRequest;
+ ccs.szProtoService = PSR_FILE;
+ ccs.hContact = hContact;
+ ccs.wParam = 0;
+ ccs.lParam = (LPARAM)&prf;
+ prf.flags = PREF_UNICODE;
+ prf.timestamp = _time32(NULL);
+ prf.tszDescription = dat->pwszDescription;
+ prf.fileCount = 1;//dat->dwFilesCount;
+ prf.ptszFiles = &dat->pwszFilesList;
+ prf.lParam = dwIDRequest;
- CallService(MS_PROTO_CHAINRECV,0,(LPARAM)&ccs);
+ CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
- dwRetErrorCode=NO_ERROR;
- }else{
- dwRetErrorCode=GetLastError();
+ dwRetErrorCode = NO_ERROR;
+ }else {
+ dwRetErrorCode = GetLastError();
}
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }else {
+ dwRetErrorCode = ERROR_INVALID_HANDLE;
}
return(dwRetErrorCode);
}
-
-
-DWORD MraFilesQueueAddSend(HANDLE hFilesQueueHandle,DWORD dwFlags,HANDLE hContact,LPWSTR *plpwszFiles,SIZE_T dwFilesCount,DWORD *pdwIDRequest)
+DWORD CMraProto::MraFilesQueueAddSend(HANDLE hFilesQueueHandle, DWORD dwFlags, HANDLE hContact, LPWSTR *plpwszFiles, size_t dwFilesCount, DWORD *pdwIDRequest)
{
DWORD dwRetErrorCode;
if (hFilesQueueHandle)
{
- MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
- MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+ MRA_FILES_QUEUE *pmrafqFilesQueue = (MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *dat;
- pmrafqFilesQueueItem=(MRA_FILES_QUEUE_ITEM*)MEMALLOC(sizeof(MRA_FILES_QUEUE_ITEM)+sizeof(LPSTR)+64);
- if (pmrafqFilesQueueItem)
+ dat = (MRA_FILES_QUEUE_ITEM*)mir_calloc(sizeof(MRA_FILES_QUEUE_ITEM)+sizeof(LPSTR)+64);
+ if (dat)
{
- SIZE_T i;
+ size_t i;
ULARGE_INTEGER uliFileSize;
WIN32_FILE_ATTRIBUTE_DATA wfad;
- //pmrafqFilesQueueItem->lmtListMTItem;
- pmrafqFilesQueueItem->bIsWorking=TRUE;
- pmrafqFilesQueueItem->dwSendTime=GetTickCount();
- pmrafqFilesQueueItem->dwIDRequest=InterlockedIncrement((LONG volatile*)&masMraSettings.dwCMDNum);// уникальный, рандомный идентификатор
- pmrafqFilesQueueItem->dwFlags=dwFlags;
- pmrafqFilesQueueItem->hContact=hContact;
- if (DB_Mra_GetByte(NULL,"FileSendEnableMRIMProxyCons",MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS)) pmrafqFilesQueueItem->hMraMrimProxyData=MraMrimProxyCreate();
- pmrafqFilesQueueItem->dwFilesCount=dwFilesCount;
- pmrafqFilesQueueItem->pmfqfFiles=(MRA_FILES_QUEUE_FILE*)MEMALLOC((sizeof(MRA_FILES_QUEUE_FILE)*(pmrafqFilesQueueItem->dwFilesCount+1)));
- pmrafqFilesQueueItem->dwFilesTotalSize=0;
-
- for(i=0;i<pmrafqFilesQueueItem->dwFilesCount;i++)
+ //dat->lmtListMTItem;
+ dat->bIsWorking = TRUE;
+ dat->dwSendTime = GetTickCount();
+ dat->dwIDRequest = InterlockedIncrement((LONG volatile*)&dwCMDNum);// уникальный, рандомный идентификатор
+ dat->dwFlags = dwFlags;
+ dat->hContact = hContact;
+ if (mraGetByte(NULL, "FileSendEnableMRIMProxyCons", MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS)) dat->hMraMrimProxyData = MraMrimProxyCreate();
+ dat->dwFilesCount = dwFilesCount;
+ dat->pmfqfFiles = (MRA_FILES_QUEUE_FILE*)mir_calloc((sizeof(MRA_FILES_QUEUE_FILE)*(dat->dwFilesCount+1)));
+ dat->dwFilesTotalSize = 0;
+
+ for (i = 0;i<dat->dwFilesCount;i++)
{
- if (GetFileAttributesExW(plpwszFiles[i],GetFileExInfoStandard,&wfad))
+ if (GetFileAttributesExW(plpwszFiles[i], GetFileExInfoStandard, &wfad))
{
- uliFileSize.LowPart=wfad.nFileSizeLow;
- uliFileSize.HighPart=wfad.nFileSizeHigh;
- pmrafqFilesQueueItem->pmfqfFiles[i].dwSize=uliFileSize.QuadPart;
- pmrafqFilesQueueItem->dwFilesTotalSize+=uliFileSize.QuadPart;
- }else{
- pmrafqFilesQueueItem->pmfqfFiles[i].dwSize=0;
+ uliFileSize.LowPart = wfad.nFileSizeLow;
+ uliFileSize.HighPart = wfad.nFileSizeHigh;
+ dat->pmfqfFiles[i].dwSize = uliFileSize.QuadPart;
+ dat->dwFilesTotalSize += uliFileSize.QuadPart;
+ }else {
+ dat->pmfqfFiles[i].dwSize = 0;
}
- pmrafqFilesQueueItem->pmfqfFiles[i].dwNameLen=lstrlenW(plpwszFiles[i]);
- pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName=(LPWSTR)MEMALLOC((pmrafqFilesQueueItem->pmfqfFiles[i].dwNameLen*sizeof(WCHAR)));
- if (pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName)
+ dat->pmfqfFiles[i].dwNameLen = lstrlenW(plpwszFiles[i]);
+ dat->pmfqfFiles[i].lpwszName = (LPWSTR)mir_calloc((dat->pmfqfFiles[i].dwNameLen*sizeof(WCHAR)));
+ if (dat->pmfqfFiles[i].lpwszName)
{
- memmove(pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName,plpwszFiles[i],(pmrafqFilesQueueItem->pmfqfFiles[i].dwNameLen*sizeof(WCHAR)));
+ memmove(dat->pmfqfFiles[i].lpwszName, plpwszFiles[i], (dat->pmfqfFiles[i].dwNameLen*sizeof(WCHAR)));
}
}
- //pmrafqFilesQueueItem->malAddrList.dwAddrCount=0;
- //pmrafqFilesQueueItem->pmfqaAddreses=NULL;
- pmrafqFilesQueueItem->bSending=TRUE;
- if (pdwIDRequest) (*pdwIDRequest)=pmrafqFilesQueueItem->dwIDRequest;
+ //dat->malAddrList.dwAddrCount = 0;
+ //dat->pmfqaAddreses = NULL;
+ dat->bSending = TRUE;
+ if (pdwIDRequest) (*pdwIDRequest) = dat->dwIDRequest;
- ListMTLock(&pmrafqFilesQueue->lmtListMT);
- ListMTItemAdd(&pmrafqFilesQueue->lmtListMT,&pmrafqFilesQueueItem->lmtListMTItem,pmrafqFilesQueueItem);
- ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ ListMTLock(pmrafqFilesQueue);
+ ListMTItemAdd(pmrafqFilesQueue, dat, dat);
+ ListMTUnLock(pmrafqFilesQueue);
{
- MRA_FILES_THREADPROC_PARAMS *pmftpp=(MRA_FILES_THREADPROC_PARAMS*)MEMALLOC(sizeof(MRA_FILES_THREADPROC_PARAMS));
- pmftpp->hFilesQueueHandle=hFilesQueueHandle;
- pmftpp->pmrafqFilesQueueItem=pmrafqFilesQueueItem;
+ MRA_FILES_THREADPROC_PARAMS *pmftpp = (MRA_FILES_THREADPROC_PARAMS*)mir_calloc(sizeof(MRA_FILES_THREADPROC_PARAMS));
+ pmftpp->hFilesQueueHandle = hFilesQueueHandle;
+ pmftpp->dat = dat;
- pmrafqFilesQueueItem->hThread=(HANDLE)mir_forkthread((pThreadFunc)MraFilesQueueSendThreadProc,pmftpp);
+ dat->hThread = ForkThreadEx(&CMraProto::MraFilesQueueSendThreadProc, pmftpp);
}
- dwRetErrorCode=NO_ERROR;
- }else{
- dwRetErrorCode=GetLastError();
+ dwRetErrorCode = NO_ERROR;
+ }else {
+ dwRetErrorCode = GetLastError();
}
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }else {
+ dwRetErrorCode = ERROR_INVALID_HANDLE;
}
return(dwRetErrorCode);
}
-
-
-DWORD MraFilesQueueAccept(HANDLE hFilesQueueHandle,DWORD dwIDRequest,LPWSTR lpwszPath,SIZE_T dwPathSize)
+DWORD CMraProto::MraFilesQueueAccept(HANDLE hFilesQueueHandle, DWORD dwIDRequest, LPCWSTR lpwszPath, size_t dwPathSize)
{
DWORD dwRetErrorCode;
if (hFilesQueueHandle && lpwszPath && dwPathSize)
{
- MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
- MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+ MRA_FILES_QUEUE *pmrafqFilesQueue = (MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *dat;
- ListMTLock(&pmrafqFilesQueue->lmtListMT);
- if ((dwRetErrorCode=MraFilesQueueItemFindByID(hFilesQueueHandle,dwIDRequest,&pmrafqFilesQueueItem))==NO_ERROR)
+ ListMTLock(pmrafqFilesQueue);
+ if ((dwRetErrorCode = MraFilesQueueItemFindByID(hFilesQueueHandle, dwIDRequest, &dat)) == NO_ERROR)
{
- MRA_FILES_THREADPROC_PARAMS *pmftpp=(MRA_FILES_THREADPROC_PARAMS*)MEMALLOC(sizeof(MRA_FILES_THREADPROC_PARAMS));
- pmrafqFilesQueueItem->lpwszPath=(LPWSTR)MEMALLOC((dwPathSize*sizeof(WCHAR)));
- pmrafqFilesQueueItem->dwPathSize=dwPathSize;
- memmove(pmrafqFilesQueueItem->lpwszPath,lpwszPath,(dwPathSize*sizeof(WCHAR)));
+ MRA_FILES_THREADPROC_PARAMS *pmftpp = (MRA_FILES_THREADPROC_PARAMS*)mir_calloc(sizeof(MRA_FILES_THREADPROC_PARAMS));
+ dat->lpwszPath = (LPWSTR)mir_calloc((dwPathSize*sizeof(WCHAR)));
+ dat->dwPathSize = dwPathSize;
+ memmove(dat->lpwszPath, lpwszPath, (dwPathSize*sizeof(WCHAR)));
- if ( (*(WCHAR*)(pmrafqFilesQueueItem->lpwszPath+(pmrafqFilesQueueItem->dwPathSize-1)))!='\\')
+ if ( (*(WCHAR*)(dat->lpwszPath+(dat->dwPathSize-1))) != '\\')
{// add slash at the end if needed
- (*(WCHAR*)(pmrafqFilesQueueItem->lpwszPath+pmrafqFilesQueueItem->dwPathSize))='\\';
- pmrafqFilesQueueItem->dwPathSize++;
- (*(WCHAR*)(pmrafqFilesQueueItem->lpwszPath+pmrafqFilesQueueItem->dwPathSize))=0;
+ (*(WCHAR*)(dat->lpwszPath+dat->dwPathSize)) = '\\';
+ dat->dwPathSize++;
+ (*(WCHAR*)(dat->lpwszPath+dat->dwPathSize)) = 0;
}
- pmftpp->hFilesQueueHandle=hFilesQueueHandle;
- pmftpp->pmrafqFilesQueueItem=pmrafqFilesQueueItem;
+ pmftpp->hFilesQueueHandle = hFilesQueueHandle;
+ pmftpp->dat = dat;
- pmrafqFilesQueueItem->hThread=(HANDLE)mir_forkthread((pThreadFunc)MraFilesQueueRecvThreadProc,pmftpp);
+ dat->hThread = ForkThreadEx(&CMraProto::MraFilesQueueRecvThreadProc, pmftpp);
}
- ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ ListMTUnLock(pmrafqFilesQueue);
+ }else {
+ dwRetErrorCode = ERROR_INVALID_HANDLE;
}
return(dwRetErrorCode);
}
-DWORD MraFilesQueueCancel(HANDLE hFilesQueueHandle,DWORD dwIDRequest,BOOL bSendDecline)
+DWORD CMraProto::MraFilesQueueCancel(HANDLE hFilesQueueHandle, DWORD dwIDRequest, BOOL bSendDecline)
{
DWORD dwRetErrorCode;
if (hFilesQueueHandle)
{
- MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
- MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+ MRA_FILES_QUEUE *pmrafqFilesQueue = (MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *dat;
- ListMTLock(&pmrafqFilesQueue->lmtListMT);
- if ((dwRetErrorCode=MraFilesQueueItemFindByID(hFilesQueueHandle,dwIDRequest,&pmrafqFilesQueueItem))==NO_ERROR)
+ ListMTLock(pmrafqFilesQueue);
+ if ((dwRetErrorCode = MraFilesQueueItemFindByID(hFilesQueueHandle, dwIDRequest, &dat)) == NO_ERROR)
{//***deb closesocket, send message to thread
- InterlockedExchange((volatile LONG*)&pmrafqFilesQueueItem->bIsWorking,FALSE);
+ InterlockedExchange((volatile LONG*)&dat->bIsWorking, FALSE);
if (bSendDecline)
{
CHAR szEMail[MAX_EMAIL_LEN];
- SIZE_T dwEMailSize;
+ size_t dwEMailSize;
- if (DB_Mra_GetStaticStringA(pmrafqFilesQueueItem->hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ if (mraGetStaticStringA(dat->hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize))
{
- MraSendCommand_FileTransferAck(FILE_TRANSFER_STATUS_DECLINE,szEMail,dwEMailSize,dwIDRequest,NULL,0);
+ MraFileTransferAck(FILE_TRANSFER_STATUS_DECLINE, szEMail, dwEMailSize, dwIDRequest, NULL, 0);
}
}
- MraMrimProxyCloseConnection(pmrafqFilesQueueItem->hMraMrimProxyData);
+ MraMrimProxyCloseConnection(dat->hMraMrimProxyData);
- Netlib_CloseHandle(pmrafqFilesQueueItem->hListen);
- pmrafqFilesQueueItem->hListen=NULL;
+ Netlib_CloseHandle(dat->hListen);
+ dat->hListen = NULL;
- Netlib_CloseHandle(pmrafqFilesQueueItem->hConnection);
- pmrafqFilesQueueItem->hConnection=NULL;
+ Netlib_CloseHandle(dat->hConnection);
+ dat->hConnection = NULL;
- SetEvent(pmrafqFilesQueueItem->hWaitHandle);
+ SetEvent(dat->hWaitHandle);
- if (pmrafqFilesQueueItem->hThread==NULL)
+ if (dat->hThread == NULL)
{
- MraFilesQueueItemFree(pmrafqFilesQueueItem);
+ MraFilesQueueItemFree(dat);
}
}
- ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ ListMTUnLock(pmrafqFilesQueue);
+ }else {
+ dwRetErrorCode = ERROR_INVALID_HANDLE;
}
return(dwRetErrorCode);
}
-DWORD MraFilesQueueStartMrimProxy(HANDLE hFilesQueueHandle,DWORD dwIDRequest)
+DWORD CMraProto::MraFilesQueueStartMrimProxy(HANDLE hFilesQueueHandle, DWORD dwIDRequest)
{
DWORD dwRetErrorCode;
- if (hFilesQueueHandle && DB_Mra_GetByte(NULL,"FileSendEnableMRIMProxyCons",MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS))
+ if (hFilesQueueHandle && mraGetByte(NULL, "FileSendEnableMRIMProxyCons", MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS))
{
- MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
- MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+ MRA_FILES_QUEUE *pmrafqFilesQueue = (MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *dat;
- ListMTLock(&pmrafqFilesQueue->lmtListMT);
- if ((dwRetErrorCode=MraFilesQueueItemFindByID(hFilesQueueHandle,dwIDRequest,&pmrafqFilesQueueItem))==NO_ERROR)
+ ListMTLock(pmrafqFilesQueue);
+ if ((dwRetErrorCode = MraFilesQueueItemFindByID(hFilesQueueHandle, dwIDRequest, &dat)) == NO_ERROR)
{//***deb
- if (pmrafqFilesQueueItem->bSending==FALSE)
+ if (dat->bSending == FALSE)
{// receiving
- SetEvent(pmrafqFilesQueueItem->hWaitHandle);// cancel wait incomming connection
- }else{// sending
+ SetEvent(dat->hWaitHandle);// cancel wait incomming connection
+ }else {// sending
}
}
- ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ ListMTUnLock(pmrafqFilesQueue);
+ }else {
+ dwRetErrorCode = ERROR_INVALID_HANDLE;
}
return(dwRetErrorCode);
}
-DWORD MraFilesQueueFree(HANDLE hFilesQueueHandle,DWORD dwIDRequest)
+DWORD MraFilesQueueFree(HANDLE hFilesQueueHandle, DWORD dwIDRequest)
{
DWORD dwRetErrorCode;
if (hFilesQueueHandle)
{
- MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
- MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+ MRA_FILES_QUEUE *pmrafqFilesQueue = (MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *dat;
LIST_MT_ITERATOR lmtiIterator;
- dwRetErrorCode=ERROR_NOT_FOUND;
- ListMTLock(&pmrafqFilesQueue->lmtListMT);
- ListMTIteratorMoveFirst(&pmrafqFilesQueue->lmtListMT,&lmtiIterator);
+ dwRetErrorCode = ERROR_NOT_FOUND;
+ ListMTLock(pmrafqFilesQueue);
+ ListMTIteratorMoveFirst(pmrafqFilesQueue, &lmtiIterator);
do
{// цикл
- if (ListMTIteratorGet(&lmtiIterator,NULL,(LPVOID*)&pmrafqFilesQueueItem)==NO_ERROR)
- if (pmrafqFilesQueueItem->dwIDRequest==dwIDRequest)
+ if (ListMTIteratorGet(&lmtiIterator, NULL, (LPVOID*)&dat) == NO_ERROR)
+ if (dat->dwIDRequest == dwIDRequest)
{
- MraFilesQueueItemFree(pmrafqFilesQueueItem);
- dwRetErrorCode=NO_ERROR;
+ MraFilesQueueItemFree(dat);
+ dwRetErrorCode = NO_ERROR;
break;
}
}while(ListMTIteratorMoveNext(&lmtiIterator));
- ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ ListMTUnLock(pmrafqFilesQueue);
+ }else {
+ dwRetErrorCode = ERROR_INVALID_HANDLE;
}
return(dwRetErrorCode);
}
-DWORD MraFilesQueueSendMirror(HANDLE hFilesQueueHandle,DWORD dwIDRequest,LPSTR lpszAddreses,SIZE_T dwAddresesSize)
+DWORD CMraProto::MraFilesQueueSendMirror(HANDLE hFilesQueueHandle, DWORD dwIDRequest, LPSTR lpszAddreses, size_t dwAddresesSize)
{
DWORD dwRetErrorCode;
if (hFilesQueueHandle)
{
- MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
- MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+ MRA_FILES_QUEUE *pmrafqFilesQueue = (MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *dat;
- ListMTLock(&pmrafqFilesQueue->lmtListMT);
- if ((dwRetErrorCode=MraFilesQueueItemFindByID(hFilesQueueHandle,dwIDRequest,&pmrafqFilesQueueItem))==NO_ERROR)
- {//
- MraAddrListGetFromBuff(lpszAddreses,dwAddresesSize,&pmrafqFilesQueueItem->malAddrList);
- MraAddrListStoreToContact(pmrafqFilesQueueItem->hContact,&pmrafqFilesQueueItem->malAddrList);
+ ListMTLock(pmrafqFilesQueue);
+ if ((dwRetErrorCode = MraFilesQueueItemFindByID(hFilesQueueHandle, dwIDRequest, &dat)) == NO_ERROR)
+ {
+ MraAddrListGetFromBuff(lpszAddreses, dwAddresesSize, &dat->malAddrList);
+ MraAddrListStoreToContact(dat->hContact, &dat->malAddrList);
- pmrafqFilesQueueItem->hConnection=NULL;
- SetEvent(pmrafqFilesQueueItem->hWaitHandle);
+ dat->hConnection = NULL;
+ SetEvent(dat->hWaitHandle);
}
- ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ ListMTUnLock(pmrafqFilesQueue);
+ }else {
+ dwRetErrorCode = ERROR_INVALID_HANDLE;
}
return(dwRetErrorCode);
}
-BOOL MraFilesQueueHandCheck(HANDLE hConnection,MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem)
+BOOL CMraProto::MraFilesQueueHandCheck(HANDLE hConnection, MRA_FILES_QUEUE_ITEM *dat)
{
- BOOL bRet=FALSE;
+ BOOL bRet = FALSE;
- if (hConnection && pmrafqFilesQueueItem)
+ if (hConnection && dat)
{
- CHAR szEMail[MAX_EMAIL_LEN]={0},szEMailMy[MAX_EMAIL_LEN]={0};
- BYTE btBuff[((MAX_EMAIL_LEN*2)+(sizeof(MRA_FT_HELLO)*2)+8)]={0};
- SIZE_T dwEMailSize,dwEMailMySize,dwBuffSize;
+ CHAR szEMail[MAX_EMAIL_LEN] = {0}, szEMailMy[MAX_EMAIL_LEN] = {0};
+ BYTE btBuff[((MAX_EMAIL_LEN*2)+(sizeof(MRA_FT_HELLO)*2)+8)] = {0};
+ size_t dwEMailSize, dwEMailMySize, dwBuffSize;
- DB_Mra_GetStaticStringA(NULL,"e-mail",szEMailMy,SIZEOF(szEMailMy),&dwEMailMySize);BuffToLowerCase(szEMailMy,szEMailMy,dwEMailMySize);
- DB_Mra_GetStaticStringA(pmrafqFilesQueueItem->hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize);BuffToLowerCase(szEMail,szEMail,dwEMailSize);
+ mraGetStaticStringA(NULL, "e-mail", szEMailMy, SIZEOF(szEMailMy), &dwEMailMySize);BuffToLowerCase(szEMailMy, szEMailMy, dwEMailMySize);
+ mraGetStaticStringA(dat->hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize);BuffToLowerCase(szEMail, szEMail, dwEMailSize);
- if (pmrafqFilesQueueItem->bSending==FALSE)
+ if (dat->bSending == FALSE)
{// receiving
- dwBuffSize=(mir_snprintf((LPSTR)btBuff,SIZEOF(btBuff),"%s %s",MRA_FT_HELLO,szEMailMy)+1);
- if (dwBuffSize==Netlib_Send(hConnection,(LPSTR)btBuff,dwBuffSize,0))
+ dwBuffSize = (mir_snprintf((LPSTR)btBuff, SIZEOF(btBuff), "%s %s", MRA_FT_HELLO, szEMailMy)+1);
+ if (dwBuffSize == Netlib_Send(hConnection, (LPSTR)btBuff, dwBuffSize, 0))
{// my email sended
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_INITIALISING,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
- dwBuffSize=Netlib_Recv(hConnection,(LPSTR)btBuff,sizeof(btBuff),0);
- if ((dwEMailSize+sizeof(MRA_FT_HELLO)+1)==dwBuffSize)
+ ProtoBroadcastAck(m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, (HANDLE)dat->dwIDRequest, 0);
+ dwBuffSize = Netlib_Recv(hConnection, (LPSTR)btBuff, sizeof(btBuff), 0);
+ if ((dwEMailSize+sizeof(MRA_FT_HELLO)+1) == dwBuffSize)
{// email received
- mir_snprintf(((LPSTR)btBuff+dwBuffSize),(SIZEOF(btBuff)-dwBuffSize),"%s %s",MRA_FT_HELLO,szEMail);
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,(LPSTR)btBuff,dwBuffSize,((LPSTR)btBuff+dwBuffSize),dwBuffSize)==CSTR_EQUAL)
+ mir_snprintf(((LPSTR)btBuff+dwBuffSize), (SIZEOF(btBuff)-dwBuffSize), "%s %s", MRA_FT_HELLO, szEMail);
+ if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, (LPSTR)btBuff, dwBuffSize, ((LPSTR)btBuff+dwBuffSize), dwBuffSize) == CSTR_EQUAL)
{// email verifyed
- bRet=TRUE;
+ bRet = TRUE;
}
}
}
- }else{// sending
- dwBuffSize=Netlib_Recv(hConnection,(LPSTR)btBuff,sizeof(btBuff),0);
- if ((dwEMailSize+sizeof(MRA_FT_HELLO)+1)==dwBuffSize)
+ }else {// sending
+ dwBuffSize = Netlib_Recv(hConnection, (LPSTR)btBuff, sizeof(btBuff), 0);
+ if ((dwEMailSize+sizeof(MRA_FT_HELLO)+1) == dwBuffSize)
{// email received
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_INITIALISING,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
- mir_snprintf(((LPSTR)btBuff+dwBuffSize),(SIZEOF(btBuff)-dwBuffSize),"%s %s",MRA_FT_HELLO,szEMail);
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,(LPSTR)btBuff,dwBuffSize,((LPSTR)btBuff+dwBuffSize),dwBuffSize)==CSTR_EQUAL)
+ ProtoBroadcastAck(m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, (HANDLE)dat->dwIDRequest, 0);
+ mir_snprintf(((LPSTR)btBuff+dwBuffSize), (SIZEOF(btBuff)-dwBuffSize), "%s %s", MRA_FT_HELLO, szEMail);
+ if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, (LPSTR)btBuff, dwBuffSize, ((LPSTR)btBuff+dwBuffSize), dwBuffSize) == CSTR_EQUAL)
{// email verifyed
- dwBuffSize=(mir_snprintf((LPSTR)btBuff,SIZEOF(btBuff),"%s %s",MRA_FT_HELLO,szEMailMy)+1);
- if (dwBuffSize==Netlib_Send(hConnection,(LPSTR)btBuff,dwBuffSize,0))
+ dwBuffSize = (mir_snprintf((LPSTR)btBuff, SIZEOF(btBuff), "%s %s", MRA_FT_HELLO, szEMailMy)+1);
+ if (dwBuffSize == Netlib_Send(hConnection, (LPSTR)btBuff, dwBuffSize, 0))
{// my email sended
- bRet=TRUE;
+ bRet = TRUE;
}
}
}
@@ -781,101 +712,101 @@ return(bRet);
}
-HANDLE MraFilesQueueConnectOut(MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem)
+HANDLE CMraProto::MraFilesQueueConnectOut(MRA_FILES_QUEUE_ITEM *dat)
{
HANDLE hRet;
- if (pmrafqFilesQueueItem)
+ if (dat)
{
- if (DB_Mra_GetByte(NULL,"FileSendEnableDirectConn",MRA_DEF_FS_ENABLE_DIRECT_CONN) && InterlockedExchangeAdd((volatile LONG*)&pmrafqFilesQueueItem->bIsWorking,0) && ((pmrafqFilesQueueItem->bSending==FALSE && DB_Mra_GetByte(NULL,"FileSendNoOutConnOnRcv",MRA_DEF_FS_NO_OUT_CONN_ON_RCV)==FALSE) || (pmrafqFilesQueueItem->bSending==TRUE && DB_Mra_GetByte(NULL,"FileSendNoOutConnOnSend",MRA_DEF_FS_NO_OUT_CONN_ON_SEND)==FALSE)))
+ if (mraGetByte(NULL, "FileSendEnableDirectConn", MRA_DEF_FS_ENABLE_DIRECT_CONN) && InterlockedExchangeAdd((volatile LONG*)&dat->bIsWorking, 0) && ((dat->bSending == FALSE && mraGetByte(NULL, "FileSendNoOutConnOnRcv", MRA_DEF_FS_NO_OUT_CONN_ON_RCV) == FALSE) || (dat->bSending == TRUE && mraGetByte(NULL, "FileSendNoOutConnOnSend", MRA_DEF_FS_NO_OUT_CONN_ON_SEND) == FALSE)))
{
- BOOL bFiltering=FALSE,bIsHTTPSProxyUsed=IsHTTPSProxyUsed(masMraSettings.hNetlibUser);
- DWORD dwLocalPort,dwConnectReTryCount,dwCurConnectReTryCount;
- SIZE_T i,dwAddrCount;
- NETLIBOPENCONNECTION nloc={0};
+ BOOL bFiltering = FALSE, bIsHTTPSProxyUsed = IsHTTPSProxyUsed(hNetlibUser);
+ DWORD dwLocalPort, dwConnectReTryCount, dwCurConnectReTryCount;
+ size_t i, dwAddrCount;
+ NETLIBOPENCONNECTION nloc = {0};
- dwLocalPort=0;
+ dwLocalPort = 0;
- if (DB_Mra_GetByte(NULL,"FileSendIgnoryAdditionalPorts",MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS) || bIsHTTPSProxyUsed)
+ if (mraGetByte(NULL, "FileSendIgnoryAdditionalPorts", MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS) || bIsHTTPSProxyUsed)
{// фильтруем порты для одного IP, вместо 3 будем коннектится только к одному
if (bIsHTTPSProxyUsed)
{// через https прокси только 443 порт
- dwLocalPort=MRA_SERVER_PORT_HTTPS;
- }else{
- if ((dwLocalPort=DB_Mra_GetWord(NULL,"ServerPort",MRA_DEFAULT_SERVER_PORT))==MRA_SERVER_PORT_STANDART_NLB) dwLocalPort=MRA_SERVER_PORT_STANDART;
+ dwLocalPort = MRA_SERVER_PORT_HTTPS;
+ }else {
+ if ((dwLocalPort = mraGetWord(NULL, "ServerPort", MRA_DEFAULT_SERVER_PORT)) == MRA_SERVER_PORT_STANDART_NLB) dwLocalPort = MRA_SERVER_PORT_STANDART;
}
- dwAddrCount=0;
- for(i=0;i<pmrafqFilesQueueItem->malAddrList.dwAddrCount;i++)
+ dwAddrCount = 0;
+ for (i = 0;i<dat->malAddrList.dwAddrCount;i++)
{
- if (dwLocalPort==pmrafqFilesQueueItem->malAddrList.pmaliAddress[i].dwPort)
+ if (dwLocalPort == dat->malAddrList.pmaliAddress[i].dwPort)
{
- bFiltering=TRUE;
+ bFiltering = TRUE;
dwAddrCount++;
}
}
}
- if (bFiltering==FALSE) dwAddrCount=pmrafqFilesQueueItem->malAddrList.dwAddrCount;
+ if (bFiltering == FALSE) dwAddrCount = dat->malAddrList.dwAddrCount;
if (dwAddrCount)
{
- pmrafqFilesQueueItem->hConnection=NULL;
- dwConnectReTryCount=DB_Mra_GetDword(NULL,"ConnectReTryCountFileSend",MRA_DEFAULT_CONN_RETRY_COUNT_FILES);
- nloc.cbSize=sizeof(nloc);
- nloc.flags=NLOCF_V2;
- nloc.timeout=DB_Mra_GetDword(NULL,"TimeOutConnectFileSend",((MRA_TIMEOUT_DIRECT_CONN-1)/(dwAddrCount*dwConnectReTryCount)));// -1 сек чтобы был запас
- if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout=MRA_TIMEOUT_CONN_MIN;
- if (nloc.timeout>MRA_TIMEOUT_CONN_МАХ) nloc.timeout=MRA_TIMEOUT_CONN_МАХ;
-
- for(i=0;i<pmrafqFilesQueueItem->malAddrList.dwAddrCount;i++)
+ dat->hConnection = NULL;
+ dwConnectReTryCount = mraGetDword(NULL, "ConnectReTryCountFileSend", MRA_DEFAULT_CONN_RETRY_COUNT_FILES);
+ nloc.cbSize = sizeof(nloc);
+ nloc.flags = NLOCF_V2;
+ nloc.timeout = mraGetDword(NULL, "TimeOutConnectFileSend", ((MRA_TIMEOUT_DIRECT_CONN-1)/(dwAddrCount*dwConnectReTryCount)));// -1 сек чтобы был запас
+ if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout = MRA_TIMEOUT_CONN_MIN;
+ if (nloc.timeout>MRA_TIMEOUT_CONN_МАХ) nloc.timeout = MRA_TIMEOUT_CONN_МАХ;
+
+ for (i = 0;i<dat->malAddrList.dwAddrCount;i++)
{// Set up the sockaddr structure
- if (dwLocalPort==pmrafqFilesQueueItem->malAddrList.pmaliAddress[i].dwPort || bFiltering==FALSE)
+ if (dwLocalPort == dat->malAddrList.pmaliAddress[i].dwPort || bFiltering == FALSE)
{
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_CONNECTING,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ ProtoBroadcastAck(m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_CONNECTING, (HANDLE)dat->dwIDRequest, 0);
- nloc.szHost=inet_ntoa((*((in_addr*)&pmrafqFilesQueueItem->malAddrList.pmaliAddress[i].dwAddr)));
- nloc.wPort=(WORD)pmrafqFilesQueueItem->malAddrList.pmaliAddress[i].dwPort;
+ nloc.szHost = inet_ntoa((*((in_addr*)&dat->malAddrList.pmaliAddress[i].dwAddr)));
+ nloc.wPort = (WORD)dat->malAddrList.pmaliAddress[i].dwPort;
- dwCurConnectReTryCount=dwConnectReTryCount;
+ dwCurConnectReTryCount = dwConnectReTryCount;
do{
- pmrafqFilesQueueItem->hConnection=(HANDLE)CallService(MS_NETLIB_OPENCONNECTION,(WPARAM)masMraSettings.hNetlibUser,(LPARAM)&nloc);
- }while(--dwCurConnectReTryCount && pmrafqFilesQueueItem->hConnection==NULL);
+ dat->hConnection = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)hNetlibUser, (LPARAM)&nloc);
+ }while(--dwCurConnectReTryCount && dat->hConnection == NULL);
- if (pmrafqFilesQueueItem->hConnection)
+ if (dat->hConnection)
{
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_CONNECTED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
- if (MraFilesQueueHandCheck(pmrafqFilesQueueItem->hConnection,pmrafqFilesQueueItem))
+ ProtoBroadcastAck(m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_CONNECTED, (HANDLE)dat->dwIDRequest, 0);
+ if (MraFilesQueueHandCheck(dat->hConnection, dat))
{// связь установленная с тем кем нужно
- DB_Mra_SetDword(pmrafqFilesQueueItem->hContact,"OldIP",DB_Mra_GetDword(pmrafqFilesQueueItem->hContact,"IP",0));
- DB_Mra_SetDword(pmrafqFilesQueueItem->hContact,"IP",HTONL(pmrafqFilesQueueItem->malAddrList.pmaliAddress[i].dwAddr));
+ mraSetDword(dat->hContact, "OldIP", mraGetDword(dat->hContact, "IP", 0));
+ mraSetDword(dat->hContact, "IP", HTONL(dat->malAddrList.pmaliAddress[i].dwAddr));
break;
- }else{// кажется не туда подключились :)
- Netlib_CloseHandle(pmrafqFilesQueueItem->hConnection);
- pmrafqFilesQueueItem->hConnection=NULL;
+ }else {// кажется не туда подключились :)
+ Netlib_CloseHandle(dat->hConnection);
+ dat->hConnection = NULL;
}
}
}
}
}
}
- hRet=pmrafqFilesQueueItem->hConnection;
- }else{
- hRet=NULL;
+ hRet = dat->hConnection;
+ }else {
+ hRet = NULL;
}
return(hRet);
}
-LPWSTR GetFileNameFromFullPathW(LPWSTR lpwszFullPath,SIZE_T dwFullPathSize)
+LPWSTR GetFileNameFromFullPathW(LPWSTR lpwszFullPath, size_t dwFullPathSize)
{
- LPWSTR lpwszFileName=lpwszFullPath,lpwszCurPos;
+ LPWSTR lpwszFileName = lpwszFullPath, lpwszCurPos;
- lpwszCurPos=(lpwszFullPath+dwFullPathSize);
+ lpwszCurPos = (lpwszFullPath+dwFullPathSize);
for (;lpwszCurPos>lpwszFullPath;lpwszCurPos--)
{
- if ((*lpwszCurPos)=='\\')
+ if ((*lpwszCurPos) == '\\')
{
- lpwszFileName=(lpwszCurPos+1);
+ lpwszFileName = (lpwszCurPos+1);
break;
}
}
@@ -884,184 +815,176 @@ return(lpwszFileName);
-HANDLE MraFilesQueueConnectIn(MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem)
+HANDLE CMraProto::MraFilesQueueConnectIn(MRA_FILES_QUEUE_ITEM *dat)
{
- HANDLE hRet=NULL;
+ HANDLE hRet = NULL;
- if (pmrafqFilesQueueItem)
- if (InterlockedExchangeAdd((volatile LONG*)&pmrafqFilesQueueItem->bIsWorking,0))
+ if (dat)
+ if (InterlockedExchangeAdd((volatile LONG*)&dat->bIsWorking, 0))
{
CHAR szEMail[MAX_EMAIL_LEN];
- SIZE_T dwEMailSize;
+ size_t dwEMailSize;
- if (DB_Mra_GetStaticStringA(pmrafqFilesQueueItem->hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ if (mraGetStaticStringA(dat->hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize))
{
- CHAR szAddrList[2048]={0};
- SIZE_T dwAddrListSize;
+ CHAR szAddrList[2048] = {0};
+ size_t dwAddrListSize;
- if (DB_Mra_GetByte(NULL,"FileSendEnableDirectConn",MRA_DEF_FS_ENABLE_DIRECT_CONN))
+ if (mraGetByte(NULL, "FileSendEnableDirectConn", MRA_DEF_FS_ENABLE_DIRECT_CONN))
{// копируем адреса в соответствии с правилами и начинаем слушать порт
- NETLIBBIND nlbBind={0};
+ NETLIBBIND nlbBind = {0};
- nlbBind.cbSize=sizeof(nlbBind);
- nlbBind.pfnNewConnectionV2=MraFilesQueueConnectionReceived;
- nlbBind.wPort=0;
- nlbBind.pExtra=(LPVOID)pmrafqFilesQueueItem;
+ nlbBind.cbSize = sizeof(nlbBind);
+ nlbBind.pfnNewConnectionV2 = MraFilesQueueConnectionReceived;
+ nlbBind.wPort = 0;
+ nlbBind.pExtra = (LPVOID)dat;
- pmrafqFilesQueueItem->hListen=(HANDLE)CallService(MS_NETLIB_BINDPORT,(WPARAM)masMraSettings.hNetlibUser,(LPARAM)&nlbBind);
- if (pmrafqFilesQueueItem->hListen)
+ dat->hListen = (HANDLE)CallService(MS_NETLIB_BINDPORT, (WPARAM)hNetlibUser, (LPARAM)&nlbBind);
+ if (dat->hListen)
{
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_LISTENING,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
- dwAddrListSize=MraFilesQueueGetLocalAddressesList(szAddrList,sizeof(szAddrList),nlbBind.wPort);
- }else{// не смогли слушать порт, хз почему.
- ShowFormatedErrorMessage(L"Files exchange: cant create listen soscket, will try connect to remonte host. Error",GetLastError());
+ ProtoBroadcastAck(m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_LISTENING, (HANDLE)dat->dwIDRequest, 0);
+ dwAddrListSize = MraFilesQueueGetLocalAddressesList(szAddrList, sizeof(szAddrList), nlbBind.wPort);
+ }else {// не смогли слушать порт, хз почему.
+ ShowFormattedErrorMessage(L"Files exchange: cant create listen soscket, will try connect to remonte host. Error", GetLastError());
- //dwAddrListSize=0;
- memmove(szAddrList,MRA_FILES_NULL_ADDRR,sizeof(MRA_FILES_NULL_ADDRR));
- dwAddrListSize=(sizeof(MRA_FILES_NULL_ADDRR)-1);
+ //dwAddrListSize = 0;
+ memmove(szAddrList, MRA_FILES_NULL_ADDRR, sizeof(MRA_FILES_NULL_ADDRR));
+ dwAddrListSize = (sizeof(MRA_FILES_NULL_ADDRR)-1);
}
- }else{// подставляем ложный адрес, чтобы точно не подключились и не слушаем порт
- memmove(szAddrList,MRA_FILES_NULL_ADDRR,sizeof(MRA_FILES_NULL_ADDRR));
- dwAddrListSize=(sizeof(MRA_FILES_NULL_ADDRR)-1);
+ }else {// подставляем ложный адрес, чтобы точно не подключились и не слушаем порт
+ memmove(szAddrList, MRA_FILES_NULL_ADDRR, sizeof(MRA_FILES_NULL_ADDRR));
+ dwAddrListSize = (sizeof(MRA_FILES_NULL_ADDRR)-1);
}
if (dwAddrListSize)
{
- pmrafqFilesQueueItem->hWaitHandle=CreateEvent(NULL,TRUE,FALSE,NULL);
- if (pmrafqFilesQueueItem->bSending==FALSE)
+ dat->hWaitHandle = CreateEvent(NULL, TRUE, FALSE, NULL);
+ if (dat->bSending == FALSE)
{// запрашиваем зеркальное соединение, тк сами подключится не смогли
- MraSendCommand_FileTransferAck(FILE_TRANSFER_MIRROR,szEMail,dwEMailSize,pmrafqFilesQueueItem->dwIDRequest,(LPBYTE)szAddrList,dwAddrListSize);
- }else{// здесь отправляем запрос на передачу(установление соединения)
+ MraFileTransferAck(FILE_TRANSFER_MIRROR, szEMail, dwEMailSize, dat->dwIDRequest, (LPBYTE)szAddrList, dwAddrListSize);
+ }else {// здесь отправляем запрос на передачу(установление соединения)
// создаём текстовый список файлов для отправки другой стороне
- LPWSTR lpwszFiles,lpwszCurPos;
- SIZE_T dwFilesSize;
+ LPWSTR lpwszFiles, lpwszCurPos;
+ size_t dwFilesSize;
- dwFilesSize=((MAX_PATH*2)*pmrafqFilesQueueItem->dwFilesCount);
- lpwszFiles=(LPWSTR)MEMALLOC((dwFilesSize*sizeof(WCHAR)));
+ dwFilesSize = ((MAX_PATH*2)*dat->dwFilesCount);
+ lpwszFiles = (LPWSTR)mir_calloc((dwFilesSize*sizeof(WCHAR)));
if (lpwszFiles)
{
- lpwszCurPos=lpwszFiles;
- for(SIZE_T i=0;i<pmrafqFilesQueueItem->dwFilesCount;i++)
+ lpwszCurPos = lpwszFiles;
+ for (size_t i = 0;i<dat->dwFilesCount;i++)
{
- lpwszCurPos+=mir_sntprintf(lpwszCurPos,(dwFilesSize-((SIZE_T)lpwszCurPos-(SIZE_T)lpwszFiles)),L"%s;%I64u;",GetFileNameFromFullPathW(pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName,pmrafqFilesQueueItem->pmfqfFiles[i].dwNameLen),pmrafqFilesQueueItem->pmfqfFiles[i].dwSize);
+ lpwszCurPos += mir_sntprintf(lpwszCurPos, (dwFilesSize-((size_t)lpwszCurPos-(size_t)lpwszFiles)), L"%s;%I64u;", GetFileNameFromFullPathW(dat->pmfqfFiles[i].lpwszName, dat->pmfqfFiles[i].dwNameLen), dat->pmfqfFiles[i].dwSize);
}
- dwFilesSize=(lpwszCurPos-lpwszFiles);// size in WCHARs
+ dwFilesSize = (lpwszCurPos-lpwszFiles);// size in WCHARs
- if (pmrafqFilesQueueItem->hMraMrimProxyData)
+ if (dat->hMraMrimProxyData)
{// устанавливаем данные для майловской прокси, если она разрешена
LPSTR lpszFiles;
- SIZE_T dwFilesSizeA;
+ size_t dwFilesSizeA;
- dwFilesSizeA=WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszFiles,dwFilesSize,NULL,0,NULL,NULL);
- lpszFiles=(LPSTR)MEMALLOC((dwFilesSizeA+MAX_PATH));
+ dwFilesSizeA = WideCharToMultiByte(MRA_CODE_PAGE, 0, lpwszFiles, dwFilesSize, NULL, 0, NULL, NULL);
+ lpszFiles = (LPSTR)mir_calloc((dwFilesSizeA+MAX_PATH));
if (lpszFiles)
{
- dwFilesSizeA=WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszFiles,dwFilesSize,lpszFiles,(dwFilesSizeA+MAX_PATH),NULL,NULL);
- MraMrimProxySetData(pmrafqFilesQueueItem->hMraMrimProxyData,szEMail,dwEMailSize,pmrafqFilesQueueItem->dwIDRequest,MRIM_PROXY_TYPE_FILES,lpszFiles,dwFilesSizeA,NULL,0,NULL);
- MEMFREE(lpszFiles);
+ dwFilesSizeA = WideCharToMultiByte(MRA_CODE_PAGE, 0, lpwszFiles, dwFilesSize, lpszFiles, (dwFilesSizeA+MAX_PATH), NULL, NULL);
+ MraMrimProxySetData(dat->hMraMrimProxyData, szEMail, dwEMailSize, dat->dwIDRequest, MRIM_PROXY_TYPE_FILES, lpszFiles, dwFilesSizeA, NULL, 0, NULL);
+ mir_free(lpszFiles);
}
- //MraMrimProxySetData(pmrafqFilesQueueItem->hMraMrimProxyData,szEMail,dwEMailSize,pmrafqFilesQueueItem->dwIDRequest,MRIM_PROXY_TYPE_FILES,(LPSTR)lpwszFiles,dwFilesSize,NULL,0,NULL);
}
- MraSendCommand_FileTransfer(szEMail,dwEMailSize,pmrafqFilesQueueItem->dwIDRequest,pmrafqFilesQueueItem->dwFilesTotalSize,lpwszFiles,dwFilesSize,szAddrList,dwAddrListSize);
+ MraFileTransfer(szEMail, dwEMailSize, dat->dwIDRequest, dat->dwFilesTotalSize, lpwszFiles, dwFilesSize, szAddrList, dwAddrListSize);
- MEMFREE(lpwszFiles);
+ mir_free(lpwszFiles);
}
}
- WaitForSingleObjectEx(pmrafqFilesQueueItem->hWaitHandle,INFINITE,FALSE);
- CloseHandle(pmrafqFilesQueueItem->hWaitHandle);
- pmrafqFilesQueueItem->hWaitHandle=NULL;
+ WaitForSingleObjectEx(dat->hWaitHandle, INFINITE, FALSE);
+ CloseHandle(dat->hWaitHandle);
+ dat->hWaitHandle = NULL;
}
}
- hRet=pmrafqFilesQueueItem->hConnection;
+ hRet = dat->hConnection;
}
return(hRet);
}
// This function is called from the Netlib when someone is connecting to
// one of our incomming DC ports
-void MraFilesQueueConnectionReceived(HANDLE hNewConnection,DWORD dwRemoteIP,void *pExtra)
+void MraFilesQueueConnectionReceived(HANDLE hNewConnection, DWORD dwRemoteIP, void *pExtra)
{
- if (pExtra)
- {
- MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem=(MRA_FILES_QUEUE_ITEM*)pExtra;
-
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_CONNECTED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
- if (MraFilesQueueHandCheck(hNewConnection,pmrafqFilesQueueItem))
- {// связь установленная с тем кем нужно
- pmrafqFilesQueueItem->hConnection=hNewConnection;
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_CONNECTED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
- DB_Mra_SetDword(pmrafqFilesQueueItem->hContact,"OldIP",DB_Mra_GetDword(pmrafqFilesQueueItem->hContact,"IP",0));
- DB_Mra_SetDword(pmrafqFilesQueueItem->hContact,"IP",dwRemoteIP);
- SetEvent(pmrafqFilesQueueItem->hWaitHandle);
- }else{// кажется кто то не туда подключилися :)
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_LISTENING,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ if (pExtra) {
+ MRA_FILES_QUEUE_ITEM *dat = (MRA_FILES_QUEUE_ITEM*)pExtra;
+
+ ProtoBroadcastAck(dat->ppro->m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_CONNECTED, (HANDLE)dat->dwIDRequest, 0);
+ if ( dat->ppro->MraFilesQueueHandCheck(hNewConnection, dat)) { // связь установленная с тем кем нужно
+ dat->hConnection = hNewConnection;
+ ProtoBroadcastAck(dat->ppro->m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_CONNECTED, (HANDLE)dat->dwIDRequest, 0);
+ dat->ppro->mraSetDword(dat->hContact, "OldIP", dat->ppro->mraGetDword(dat->hContact, "IP", 0));
+ dat->ppro->mraSetDword(dat->hContact, "IP", dwRemoteIP);
+ SetEvent(dat->hWaitHandle);
+ }else {// кажется кто то не туда подключилися :)
+ ProtoBroadcastAck(dat->ppro->m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_LISTENING, (HANDLE)dat->dwIDRequest, 0);
Netlib_CloseHandle(hNewConnection);
}
- }else{
- Netlib_CloseHandle(hNewConnection);
- MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG,0,TranslateW(L"MraFilesQueueConnectionReceived: connection accepted, but pExtra=NULL, this is miranda bug."));
- DebugBreak();
}
+ else Netlib_CloseHandle(hNewConnection);
}
-
-
-void MraFilesQueueRecvThreadProc(LPVOID lpParameter)
+void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter)
{
- DWORD dwRetErrorCode=NO_ERROR;
+ DWORD dwRetErrorCode = NO_ERROR;
if (lpParameter)
{
- MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)((MRA_FILES_THREADPROC_PARAMS*)lpParameter)->hFilesQueueHandle;
- MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem=((MRA_FILES_THREADPROC_PARAMS*)lpParameter)->pmrafqFilesQueueItem;
+ MRA_FILES_QUEUE *pmrafqFilesQueue = (MRA_FILES_QUEUE*)((MRA_FILES_THREADPROC_PARAMS*)lpParameter)->hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *dat = ((MRA_FILES_THREADPROC_PARAMS*)lpParameter)->dat;
- WCHAR wszFileName[MAX_FILEPATH]={0};
+ WCHAR wszFileName[MAX_FILEPATH] = {0};
WCHAR szErrorText[2048];
BYTE btBuff[BUFF_SIZE_RCV];
- BOOL bContinue,bFailed,bOK,bConnected;
- DWORD dwReceived,dwUpdateTimeNext,dwUpdateTimeCur;
+ BOOL bContinue, bFailed, bOK, bConnected;
+ DWORD dwReceived, dwUpdateTimeNext, dwUpdateTimeCur;
HANDLE hFile;
- SIZE_T i,dwBuffSizeUsed;
+ size_t i, dwBuffSizeUsed;
LARGE_INTEGER liFileSize;
- NETLIBSELECT nls={0};
- PROTOFILETRANSFERSTATUS pfts={0};
+ NETLIBSELECT nls = {0};
+ PROTOFILETRANSFERSTATUS pfts = {0};
- MEMFREE(lpParameter);
+ mir_free(lpParameter);
- bFailed=TRUE;
- bConnected=FALSE;
- nls.cbSize=sizeof(nls);
- pfts.cbSize=sizeof(pfts);
- pfts.hContact=pmrafqFilesQueueItem->hContact;
- pfts.flags=(PFTS_RECEIVING|PFTS_UNICODE);// pfts.sending=pmrafqFilesQueueItem->bSending; //true if sending, false if receiving
+ bFailed = TRUE;
+ bConnected = FALSE;
+ nls.cbSize = sizeof(nls);
+ pfts.cbSize = sizeof(pfts);
+ pfts.hContact = dat->hContact;
+ pfts.flags = (PFTS_RECEIVING|PFTS_UNICODE);// pfts.sending = dat->bSending; //true if sending, false if receiving
//pfts.files;
- pfts.totalFiles=pmrafqFilesQueueItem->dwFilesCount;
- //pfts.currentFileNumber=0;
- pfts.totalBytes=pmrafqFilesQueueItem->dwFilesTotalSize;
- //pfts.totalProgress=0;
- pfts.wszWorkingDir=pmrafqFilesQueueItem->lpwszPath;
+ pfts.totalFiles = dat->dwFilesCount;
+ //pfts.currentFileNumber = 0;
+ pfts.totalBytes = dat->dwFilesTotalSize;
+ //pfts.totalProgress = 0;
+ pfts.wszWorkingDir = dat->lpwszPath;
//pfts.currentFile;
//pfts.currentFileSize;
//pfts.currentFileProgress;
//pfts.currentFileTime; //as seconds since 1970
- if (MraFilesQueueConnectOut(pmrafqFilesQueueItem))
+ if (MraFilesQueueConnectOut(dat))
{
- bConnected=TRUE;
- }else{
- if (MraFilesQueueConnectIn(pmrafqFilesQueueItem))
+ bConnected = TRUE;
+ }else {
+ if (MraFilesQueueConnectIn(dat))
{
- bConnected=TRUE;
- }else{
- if (InterlockedExchangeAdd((volatile LONG*)&pmrafqFilesQueueItem->bIsWorking,0))
+ bConnected = TRUE;
+ }else {
+ if (InterlockedExchangeAdd((volatile LONG*)&dat->bIsWorking, 0))
{
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKRESULT_CONNECTPROXY,ACKRESULT_CONNECTED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
- if (MraMrimProxyConnect(pmrafqFilesQueueItem->hMraMrimProxyData,&pmrafqFilesQueueItem->hConnection)==NO_ERROR)
+ ProtoBroadcastAck(m_szModuleName, dat->hContact, ACKRESULT_CONNECTPROXY, ACKRESULT_CONNECTED, (HANDLE)dat->dwIDRequest, 0);
+ if (MraMrimProxyConnect(dat->hMraMrimProxyData, &dat->hConnection) == NO_ERROR)
{// подключились к прокси, проверяем та ли сессия (ещё раз, на этот раз сами)
- if (MraFilesQueueHandCheck(pmrafqFilesQueueItem->hConnection,pmrafqFilesQueueItem))
- {// связь установленная с тем кем нужно// pmrafqFilesQueueItem->bSending
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_CONNECTED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
- bConnected=TRUE;
+ if (MraFilesQueueHandCheck(dat->hConnection, dat))
+ {// связь установленная с тем кем нужно// dat->bSending
+ ProtoBroadcastAck(m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_CONNECTED, (HANDLE)dat->dwIDRequest, 0);
+ bConnected = TRUE;
}
}
}
@@ -1070,218 +993,218 @@ void MraFilesQueueRecvThreadProc(LPVOID lpParameter)
if (bConnected)
{// email verifyed
- bFailed=FALSE;
- for(i=0;i<pmrafqFilesQueueItem->dwFilesCount;i++)
+ bFailed = FALSE;
+ for (i = 0;i<dat->dwFilesCount;i++)
{// receiving files
- pfts.currentFileNumber=i;
- pfts.wszCurrentFile=wszFileName;
- pfts.currentFileSize=pmrafqFilesQueueItem->pmfqfFiles[i].dwSize;
- pfts.currentFileProgress=0;
+ pfts.currentFileNumber = i;
+ pfts.wszCurrentFile = wszFileName;
+ pfts.currentFileSize = dat->pmfqfFiles[i].dwSize;
+ pfts.currentFileProgress = 0;
//pfts.currentFileTime; //as seconds since 1970
- if ((pmrafqFilesQueueItem->dwPathSize+pmrafqFilesQueueItem->pmfqfFiles[i].dwNameLen)<SIZEOF(wszFileName))
+ if ((dat->dwPathSize+dat->pmfqfFiles[i].dwNameLen)<SIZEOF(wszFileName))
{
- memmove(wszFileName,pmrafqFilesQueueItem->lpwszPath,(pmrafqFilesQueueItem->dwPathSize*sizeof(WCHAR)));
- memmove((wszFileName+pmrafqFilesQueueItem->dwPathSize),pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName,((pmrafqFilesQueueItem->pmfqfFiles[i].dwNameLen+1)*sizeof(WCHAR)));
- wszFileName[pmrafqFilesQueueItem->dwPathSize+pmrafqFilesQueueItem->pmfqfFiles[i].dwNameLen]=0;
- }else{
- dwRetErrorCode=ERROR_BAD_PATHNAME;
- ShowFormatedErrorMessage(L"Receive files: error",dwRetErrorCode);
- bFailed=TRUE;
+ memmove(wszFileName, dat->lpwszPath, (dat->dwPathSize*sizeof(WCHAR)));
+ memmove((wszFileName+dat->dwPathSize), dat->pmfqfFiles[i].lpwszName, ((dat->pmfqfFiles[i].dwNameLen+1)*sizeof(WCHAR)));
+ wszFileName[dat->dwPathSize+dat->pmfqfFiles[i].dwNameLen] = 0;
+ }else {
+ dwRetErrorCode = ERROR_BAD_PATHNAME;
+ ShowFormattedErrorMessage(L"Receive files: error", dwRetErrorCode);
+ bFailed = TRUE;
break;
}
//***deb add
- //dwBuffSizeUsed=ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_FILERESUME,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,(LPARAM)&pfts);
+ //dwBuffSizeUsed = ProtoBroadcastAck(m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, (HANDLE)dat->dwIDRequest, (LPARAM)&pfts);
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_NEXTFILE,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ ProtoBroadcastAck(m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, (HANDLE)dat->dwIDRequest, 0);
- //dwBuffSizeUsed=(mir_snprintf((LPSTR)btBuff,SIZEOF(btBuff),"%s %S",MRA_FT_GET_FILE,pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName)+1);
- memmove(btBuff,MRA_FT_GET_FILE,sizeof(MRA_FT_GET_FILE));
- btBuff[(sizeof(MRA_FT_GET_FILE)-1)]=' ';
- dwBuffSizeUsed=sizeof(MRA_FT_GET_FILE)+WideCharToMultiByte(MRA_CODE_PAGE,0,pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName,pmrafqFilesQueueItem->pmfqfFiles[i].dwNameLen,(LPSTR)(btBuff+sizeof(MRA_FT_GET_FILE)),(SIZEOF(btBuff)-sizeof(MRA_FT_GET_FILE)),NULL,NULL);
- btBuff[dwBuffSizeUsed]=0;
+ //dwBuffSizeUsed = (mir_snprintf((LPSTR)btBuff, SIZEOF(btBuff), "%s %S", MRA_FT_GET_FILE, dat->pmfqfFiles[i].lpwszName)+1);
+ memmove(btBuff, MRA_FT_GET_FILE, sizeof(MRA_FT_GET_FILE));
+ btBuff[(sizeof(MRA_FT_GET_FILE)-1)] = ' ';
+ dwBuffSizeUsed = sizeof(MRA_FT_GET_FILE)+WideCharToMultiByte(MRA_CODE_PAGE, 0, dat->pmfqfFiles[i].lpwszName, dat->pmfqfFiles[i].dwNameLen, (LPSTR)(btBuff+sizeof(MRA_FT_GET_FILE)), (SIZEOF(btBuff)-sizeof(MRA_FT_GET_FILE)), NULL, NULL);
+ btBuff[dwBuffSizeUsed] = 0;
dwBuffSizeUsed++;
- if (dwBuffSizeUsed==Netlib_Send(pmrafqFilesQueueItem->hConnection,(LPSTR)btBuff,dwBuffSizeUsed,0))
+ if (dwBuffSizeUsed == Netlib_Send(dat->hConnection, (LPSTR)btBuff, dwBuffSizeUsed, 0))
{// file request sended
- hFile=CreateFileW(wszFileName,GENERIC_WRITE,FILE_SHARE_READ,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
- if (hFile!=INVALID_HANDLE_VALUE)
+ hFile = CreateFileW(wszFileName, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (hFile != INVALID_HANDLE_VALUE)
{// file opened/created, pre allocating disk space, for best perfomance
- bOK=FALSE;
+ bOK = FALSE;
- liFileSize.QuadPart=(LONGLONG)pmrafqFilesQueueItem->pmfqfFiles[i].dwSize;
- if (SetFilePointerEx(hFile,liFileSize,NULL,FILE_BEGIN))
+ liFileSize.QuadPart = (LONGLONG)dat->pmfqfFiles[i].dwSize;
+ if (SetFilePointerEx(hFile, liFileSize, NULL, FILE_BEGIN))
if (SetEndOfFile(hFile))
{
- liFileSize.QuadPart=0;
- bOK=SetFilePointerEx(hFile,liFileSize,NULL,FILE_BEGIN);
+ liFileSize.QuadPart = 0;
+ bOK = SetFilePointerEx(hFile, liFileSize, NULL, FILE_BEGIN);
}
if (bOK)
{// disk space pre allocated
- bOK=FALSE;
- bContinue=TRUE;
- dwUpdateTimeNext=GetTickCount();
- nls.dwTimeout=(1000*DB_Mra_GetDword(NULL,"TimeOutReceiveFileData",MRA_DEF_FS_TIMEOUT_RECV));
- nls.hReadConns[0]=pmrafqFilesQueueItem->hConnection;
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_DATA,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,(LPARAM)&pfts);
+ bOK = FALSE;
+ bContinue = TRUE;
+ dwUpdateTimeNext = GetTickCount();
+ nls.dwTimeout = (1000*mraGetDword(NULL, "TimeOutReceiveFileData", MRA_DEF_FS_TIMEOUT_RECV));
+ nls.hReadConns[0] = dat->hConnection;
+ ProtoBroadcastAck(m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_DATA, (HANDLE)dat->dwIDRequest, (LPARAM)&pfts);
while(bContinue)
{
- switch(CallService(MS_NETLIB_SELECT,0,(LPARAM)&nls)) {
+ switch (CallService(MS_NETLIB_SELECT, 0, (LPARAM)&nls)) {
case SOCKET_ERROR:
case 0:// Time out
- dwRetErrorCode=GetLastError();
- ShowFormatedErrorMessage(L"Receive files: error on receive file data",dwRetErrorCode);
- bContinue=FALSE;
+ dwRetErrorCode = GetLastError();
+ ShowFormattedErrorMessage(L"Receive files: error on receive file data", dwRetErrorCode);
+ bContinue = FALSE;
break;
case 1:
- dwReceived=Netlib_Recv(pmrafqFilesQueueItem->hConnection,(LPSTR)&btBuff,SIZEOF(btBuff),0);
- if (dwReceived==0 || dwReceived==SOCKET_ERROR)
+ dwReceived = Netlib_Recv(dat->hConnection, (LPSTR)&btBuff, SIZEOF(btBuff), 0);
+ if (dwReceived == 0 || dwReceived == SOCKET_ERROR)
{
- dwRetErrorCode=GetLastError();
- ShowFormatedErrorMessage(L"Receive files: error on receive file data",dwRetErrorCode);
- bContinue=FALSE;
- }else{
- if (WriteFile(hFile,(LPVOID)&btBuff,dwReceived,&dwReceived,NULL))
+ dwRetErrorCode = GetLastError();
+ ShowFormattedErrorMessage(L"Receive files: error on receive file data", dwRetErrorCode);
+ bContinue = FALSE;
+ }else {
+ if (WriteFile(hFile, (LPVOID)&btBuff, dwReceived, &dwReceived, NULL))
{
- pfts.currentFileProgress+=dwReceived;
- pfts.totalProgress+=dwReceived;
+ pfts.currentFileProgress += dwReceived;
+ pfts.totalProgress += dwReceived;
// progress updates
- dwUpdateTimeCur=GetTickCount();
- if (dwUpdateTimeNext<=dwUpdateTimeCur || pfts.currentFileProgress>=pmrafqFilesQueueItem->pmfqfFiles[i].dwSize)
+ dwUpdateTimeCur = GetTickCount();
+ if (dwUpdateTimeNext <= dwUpdateTimeCur || pfts.currentFileProgress >= dat->pmfqfFiles[i].dwSize)
{// we update it
- dwUpdateTimeNext=dwUpdateTimeCur+MRA_FILES_QUEUE_PROGRESS_INTERVAL;
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_DATA,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,(LPARAM)&pfts);
+ dwUpdateTimeNext = dwUpdateTimeCur+MRA_FILES_QUEUE_PROGRESS_INTERVAL;
+ ProtoBroadcastAck(m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_DATA, (HANDLE)dat->dwIDRequest, (LPARAM)&pfts);
- if (pfts.currentFileProgress>=pmrafqFilesQueueItem->pmfqfFiles[i].dwSize)
+ if (pfts.currentFileProgress >= dat->pmfqfFiles[i].dwSize)
{// file received
- bOK=TRUE;
- bContinue=FALSE;
+ bOK = TRUE;
+ bContinue = FALSE;
}
}
- }else{// err on write file
- dwRetErrorCode=GetLastError();
- ShowFormatedErrorMessage(L"Receive files: cant write file data, error",dwRetErrorCode);
- bContinue=FALSE;
+ }else {// err on write file
+ dwRetErrorCode = GetLastError();
+ ShowFormattedErrorMessage(L"Receive files: cant write file data, error", dwRetErrorCode);
+ bContinue = FALSE;
}
}
break;
}
}// end while
- }else{// err allocating file disk space
- dwRetErrorCode=GetLastError();
- mir_sntprintf(szErrorText,SIZEOF(szErrorText),TranslateW(L"Receive files: cant allocate disk space for file, size %lu bytes, error"),pmrafqFilesQueueItem->pmfqfFiles[i].dwSize);
- ShowFormatedErrorMessage(szErrorText,dwRetErrorCode);
+ }else {// err allocating file disk space
+ dwRetErrorCode = GetLastError();
+ mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateW(L"Receive files: cant allocate disk space for file, size %lu bytes, error"), dat->pmfqfFiles[i].dwSize);
+ ShowFormattedErrorMessage(szErrorText, dwRetErrorCode);
}
CloseHandle(hFile);
- if (bOK==FALSE)
+ if (bOK == FALSE)
{// file recv failed
DeleteFileW(wszFileName);
- bFailed=TRUE;
+ bFailed = TRUE;
break;
}
- }else{// err on open file
- dwRetErrorCode=GetLastError();
- mir_sntprintf(szErrorText,SIZEOF(szErrorText),TranslateW(L"Receive files: cant open file %s, error"),wszFileName);
- ShowFormatedErrorMessage(szErrorText,dwRetErrorCode);
- bFailed=TRUE;
+ }else {// err on open file
+ dwRetErrorCode = GetLastError();
+ mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateW(L"Receive files: cant open file %s, error"), wszFileName);
+ ShowFormattedErrorMessage(szErrorText, dwRetErrorCode);
+ bFailed = TRUE;
break;
}
- }else{// err on send request for file
- dwRetErrorCode=GetLastError();
- mir_sntprintf(szErrorText,SIZEOF(szErrorText),TranslateW(L"Receive files: request for file %s not sended, error"),pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName);
- ShowFormatedErrorMessage(szErrorText,NO_ERROR);
- bFailed=TRUE;
+ }else {// err on send request for file
+ dwRetErrorCode = GetLastError();
+ mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateW(L"Receive files: request for file %s not sended, error"), dat->pmfqfFiles[i].lpwszName);
+ ShowFormattedErrorMessage(szErrorText, NO_ERROR);
+ bFailed = TRUE;
break;
}
}// end for
- Netlib_CloseHandle(pmrafqFilesQueueItem->hConnection);
- pmrafqFilesQueueItem->hConnection=NULL;
+ Netlib_CloseHandle(dat->hConnection);
+ dat->hConnection = NULL;
}
if (bFailed)
{
CHAR szEMail[MAX_EMAIL_LEN];
- SIZE_T dwEMailSize;
+ size_t dwEMailSize;
- if (DB_Mra_GetStaticStringA(pmrafqFilesQueueItem->hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ if (mraGetStaticStringA(dat->hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize))
{
- MraSendCommand_FileTransferAck(FILE_TRANSFER_STATUS_ERROR,szEMail,dwEMailSize,pmrafqFilesQueueItem->dwIDRequest,NULL,0);
+ MraFileTransferAck(FILE_TRANSFER_STATUS_ERROR, szEMail, dwEMailSize, dat->dwIDRequest, NULL, 0);
}
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_FAILED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
- }else{
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_SUCCESS,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ ProtoBroadcastAck(m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_FAILED, (HANDLE)dat->dwIDRequest, 0);
+ }else {
+ ProtoBroadcastAck(m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_SUCCESS, (HANDLE)dat->dwIDRequest, 0);
}
- ListMTLock(&pmrafqFilesQueue->lmtListMT);
- MraFilesQueueItemFree(pmrafqFilesQueueItem);
- ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ ListMTLock(pmrafqFilesQueue);
+ MraFilesQueueItemFree(dat);
+ ListMTUnLock(pmrafqFilesQueue);
}
}
-void MraFilesQueueSendThreadProc(LPVOID lpParameter)
+void CMraProto::MraFilesQueueSendThreadProc(LPVOID lpParameter)
{
- DWORD dwRetErrorCode=NO_ERROR;
+ DWORD dwRetErrorCode = NO_ERROR;
if (lpParameter)
{
- MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)((MRA_FILES_THREADPROC_PARAMS*)lpParameter)->hFilesQueueHandle;
- MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem=((MRA_FILES_THREADPROC_PARAMS*)lpParameter)->pmrafqFilesQueueItem;
+ MRA_FILES_QUEUE *pmrafqFilesQueue = (MRA_FILES_QUEUE*)((MRA_FILES_THREADPROC_PARAMS*)lpParameter)->hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *dat = ((MRA_FILES_THREADPROC_PARAMS*)lpParameter)->dat;
- CHAR szFileName[MAX_FILEPATH]={0};
+ CHAR szFileName[MAX_FILEPATH] = {0};
WCHAR szErrorText[2048];
BYTE btBuff[BUFF_SIZE_RCV];
- BOOL bFailed=TRUE,bOK,bConnected=FALSE;
- DWORD dwReceived,dwSendBlockSize,dwUpdateTimeNext,dwUpdateTimeCur;
+ BOOL bFailed = TRUE, bOK, bConnected = FALSE;
+ DWORD dwReceived, dwSendBlockSize, dwUpdateTimeNext, dwUpdateTimeCur;
HANDLE hFile;
- SIZE_T i,j,dwBuffSizeUsed=0;
+ size_t i, j, dwBuffSizeUsed = 0;
LPWSTR lpwszFileName;
- PROTOFILETRANSFERSTATUS pfts={0};
+ PROTOFILETRANSFERSTATUS pfts = {0};
- MEMFREE(lpParameter);
+ mir_free(lpParameter);
- pfts.cbSize=sizeof(pfts);
- pfts.hContact=pmrafqFilesQueueItem->hContact;
- pfts.flags=(PFTS_SENDING|PFTS_UNICODE);// pfts.sending=pmrafqFilesQueueItem->bSending; //true if sending, false if receiving
+ pfts.cbSize = sizeof(pfts);
+ pfts.hContact = dat->hContact;
+ pfts.flags = (PFTS_SENDING|PFTS_UNICODE);// pfts.sending = dat->bSending; //true if sending, false if receiving
//pfts.files;
- pfts.totalFiles=pmrafqFilesQueueItem->dwFilesCount;
- //pfts.currentFileNumber=0;
- pfts.totalBytes=pmrafqFilesQueueItem->dwFilesTotalSize;
- //pfts.totalProgress=0;
- pfts.wszWorkingDir=pmrafqFilesQueueItem->lpwszPath;
+ pfts.totalFiles = dat->dwFilesCount;
+ //pfts.currentFileNumber = 0;
+ pfts.totalBytes = dat->dwFilesTotalSize;
+ //pfts.totalProgress = 0;
+ pfts.wszWorkingDir = dat->lpwszPath;
//pfts.currentFile;
//pfts.currentFileSize;
//pfts.currentFileProgress;
//pfts.currentFileTime; //as seconds since 1970
- dwSendBlockSize=DB_Mra_GetDword(NULL,"FileSendBlockSize",MRA_DEFAULT_FILE_SEND_BLOCK_SIZE);
- if (dwSendBlockSize>SIZEOF(btBuff)) dwSendBlockSize=SIZEOF(btBuff);
- if (dwSendBlockSize<512) dwSendBlockSize=MRA_DEFAULT_FILE_SEND_BLOCK_SIZE;
+ dwSendBlockSize = mraGetDword(NULL, "FileSendBlockSize", MRA_DEFAULT_FILE_SEND_BLOCK_SIZE);
+ if (dwSendBlockSize>SIZEOF(btBuff)) dwSendBlockSize = SIZEOF(btBuff);
+ if (dwSendBlockSize<512) dwSendBlockSize = MRA_DEFAULT_FILE_SEND_BLOCK_SIZE;
- if (MraFilesQueueConnectIn(pmrafqFilesQueueItem))
+ if (MraFilesQueueConnectIn(dat))
{
- bConnected=TRUE;
- }else{
- if (MraFilesQueueConnectOut(pmrafqFilesQueueItem))
+ bConnected = TRUE;
+ }else {
+ if (MraFilesQueueConnectOut(dat))
{
- bConnected=TRUE;
- }else{
- if (InterlockedExchangeAdd((volatile LONG*)&pmrafqFilesQueueItem->bIsWorking,0))
+ bConnected = TRUE;
+ }else {
+ if (InterlockedExchangeAdd((volatile LONG*)&dat->bIsWorking, 0))
{
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKRESULT_CONNECTPROXY,ACKRESULT_CONNECTED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
- if (MraMrimProxyConnect(pmrafqFilesQueueItem->hMraMrimProxyData,&pmrafqFilesQueueItem->hConnection)==NO_ERROR)
+ ProtoBroadcastAck(m_szModuleName, dat->hContact, ACKRESULT_CONNECTPROXY, ACKRESULT_CONNECTED, (HANDLE)dat->dwIDRequest, 0);
+ if (MraMrimProxyConnect(dat->hMraMrimProxyData, &dat->hConnection) == NO_ERROR)
{// подключились к прокси, проверяем та ли сессия (ещё раз, на этот раз сами)
- if (MraFilesQueueHandCheck(pmrafqFilesQueueItem->hConnection,pmrafqFilesQueueItem))
- {// связь установленная с тем кем нужно// pmrafqFilesQueueItem->bSending
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_CONNECTED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
- bConnected=TRUE;
+ if (MraFilesQueueHandCheck(dat->hConnection, dat))
+ {// связь установленная с тем кем нужно// dat->bSending
+ ProtoBroadcastAck(m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_CONNECTED, (HANDLE)dat->dwIDRequest, 0);
+ bConnected = TRUE;
}
}
}
@@ -1290,154 +1213,154 @@ void MraFilesQueueSendThreadProc(LPVOID lpParameter)
if (bConnected)
{// email verifyed
- bFailed=FALSE;
- for(i=0;i<pmrafqFilesQueueItem->dwFilesCount;i++)
+ bFailed = FALSE;
+ for (i = 0;i<dat->dwFilesCount;i++)
{// sending files
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_NEXTFILE,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ ProtoBroadcastAck(m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, (HANDLE)dat->dwIDRequest, 0);
- dwBuffSizeUsed=0;
+ dwBuffSizeUsed = 0;
while(TRUE)
{
- dwReceived=Netlib_Recv(pmrafqFilesQueueItem->hConnection,((LPSTR)btBuff+dwBuffSizeUsed),(SIZEOF(btBuff)-dwBuffSizeUsed),0);
- if (dwReceived==0 || dwReceived==SOCKET_ERROR)
+ dwReceived = Netlib_Recv(dat->hConnection, ((LPSTR)btBuff+dwBuffSizeUsed), (SIZEOF(btBuff)-dwBuffSizeUsed), 0);
+ if (dwReceived == 0 || dwReceived == SOCKET_ERROR)
{// err on receive file name to send
- dwRetErrorCode=GetLastError();
- ShowFormatedErrorMessage(L"Send files: file send request not received, error",dwRetErrorCode);
- bFailed=TRUE;
+ dwRetErrorCode = GetLastError();
+ ShowFormattedErrorMessage(L"Send files: file send request not received, error", dwRetErrorCode);
+ bFailed = TRUE;
break;
- }else{
- dwBuffSizeUsed+=dwReceived;
- if (MemoryFindByte((dwBuffSizeUsed-dwReceived),btBuff,dwBuffSizeUsed,0)) break;
+ }else {
+ dwBuffSizeUsed += dwReceived;
+ if (MemoryFindByte((dwBuffSizeUsed-dwReceived), btBuff, dwBuffSizeUsed, 0)) break;
}
}// end while (file name passible received)*/
- if (bFailed==FALSE)
+ if (bFailed == FALSE)
{// ...received
if (dwBuffSizeUsed>(sizeof(MRA_FT_GET_FILE)+1))
{// file name received
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,(LPSTR)btBuff,(sizeof(MRA_FT_GET_FILE)-1),MRA_FT_GET_FILE,(sizeof(MRA_FT_GET_FILE)-1))==CSTR_EQUAL)
+ if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, (LPSTR)btBuff, (sizeof(MRA_FT_GET_FILE)-1), MRA_FT_GET_FILE, (sizeof(MRA_FT_GET_FILE)-1)) == CSTR_EQUAL)
{// MRA_FT_GET_FILE verifyed
- bFailed=TRUE;
- for(j=0;j<pmrafqFilesQueueItem->dwFilesCount;j++)
+ bFailed = TRUE;
+ for (j = 0;j<dat->dwFilesCount;j++)
{
- lpwszFileName=GetFileNameFromFullPathW(pmrafqFilesQueueItem->pmfqfFiles[j].lpwszName,pmrafqFilesQueueItem->pmfqfFiles[j].dwNameLen);
- szFileName[WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszFileName,(pmrafqFilesQueueItem->pmfqfFiles[j].dwNameLen-(lpwszFileName-pmrafqFilesQueueItem->pmfqfFiles[j].lpwszName)),szFileName,SIZEOF(szFileName),NULL,NULL)]=0;
+ lpwszFileName = GetFileNameFromFullPathW(dat->pmfqfFiles[j].lpwszName, dat->pmfqfFiles[j].dwNameLen);
+ szFileName[WideCharToMultiByte(MRA_CODE_PAGE, 0, lpwszFileName, (dat->pmfqfFiles[j].dwNameLen-(lpwszFileName-dat->pmfqfFiles[j].lpwszName)), szFileName, SIZEOF(szFileName), NULL, NULL)] = 0;
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,(((LPSTR)btBuff)+sizeof(MRA_FT_GET_FILE)),(dwBuffSizeUsed-(sizeof(MRA_FT_GET_FILE)+1)),szFileName,-1)==CSTR_EQUAL)
+ if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, (((LPSTR)btBuff)+sizeof(MRA_FT_GET_FILE)), (dwBuffSizeUsed-(sizeof(MRA_FT_GET_FILE)+1)), szFileName, -1) == CSTR_EQUAL)
{
- bFailed=FALSE;
+ bFailed = FALSE;
break;
}
}
- if (bFailed==FALSE)
+ if (bFailed == FALSE)
{
- hFile=CreateFileW(pmrafqFilesQueueItem->pmfqfFiles[j].lpwszName,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,(FILE_ATTRIBUTE_NORMAL|FILE_FLAG_SEQUENTIAL_SCAN),NULL);
- if (hFile!=INVALID_HANDLE_VALUE)
+ hFile = CreateFileW(dat->pmfqfFiles[j].lpwszName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, (FILE_ATTRIBUTE_NORMAL|FILE_FLAG_SEQUENTIAL_SCAN), NULL);
+ if (hFile != INVALID_HANDLE_VALUE)
{
- bOK=FALSE;
- dwUpdateTimeNext=GetTickCount();
- pfts.currentFileNumber=i;
- pfts.wszCurrentFile=pmrafqFilesQueueItem->pmfqfFiles[j].lpwszName;
- pfts.currentFileSize=pmrafqFilesQueueItem->pmfqfFiles[j].dwSize;
- pfts.currentFileProgress=0;
+ bOK = FALSE;
+ dwUpdateTimeNext = GetTickCount();
+ pfts.currentFileNumber = i;
+ pfts.wszCurrentFile = dat->pmfqfFiles[j].lpwszName;
+ pfts.currentFileSize = dat->pmfqfFiles[j].dwSize;
+ pfts.currentFileProgress = 0;
//pfts.currentFileTime; //as seconds since 1970
- WideCharToMultiByte(MRA_CODE_PAGE,0,pmrafqFilesQueueItem->pmfqfFiles[j].lpwszName,pmrafqFilesQueueItem->pmfqfFiles[j].dwNameLen,szFileName,SIZEOF(szFileName),NULL,NULL);
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_DATA,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,(LPARAM)&pfts);
+ WideCharToMultiByte(MRA_CODE_PAGE, 0, dat->pmfqfFiles[j].lpwszName, dat->pmfqfFiles[j].dwNameLen, szFileName, SIZEOF(szFileName), NULL, NULL);
+ ProtoBroadcastAck(m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_DATA, (HANDLE)dat->dwIDRequest, (LPARAM)&pfts);
while(TRUE)
{// read and sending
- if (ReadFile(hFile,btBuff,dwSendBlockSize,(DWORD*)&dwBuffSizeUsed,NULL))
+ if (ReadFile(hFile, btBuff, dwSendBlockSize, (DWORD*)&dwBuffSizeUsed, NULL))
{
- dwReceived=Netlib_Send(pmrafqFilesQueueItem->hConnection,(LPSTR)btBuff,dwBuffSizeUsed,0);
- if (dwBuffSizeUsed==dwReceived)
+ dwReceived = Netlib_Send(dat->hConnection, (LPSTR)btBuff, dwBuffSizeUsed, 0);
+ if (dwBuffSizeUsed == dwReceived)
{
- pfts.currentFileProgress+=dwBuffSizeUsed;
- pfts.totalProgress+=dwBuffSizeUsed;
+ pfts.currentFileProgress += dwBuffSizeUsed;
+ pfts.totalProgress += dwBuffSizeUsed;
// progress updates
- dwUpdateTimeCur=GetTickCount();
- if (dwUpdateTimeNext<=dwUpdateTimeCur || pfts.currentFileProgress>=pmrafqFilesQueueItem->pmfqfFiles[j].dwSize)
+ dwUpdateTimeCur = GetTickCount();
+ if (dwUpdateTimeNext <= dwUpdateTimeCur || pfts.currentFileProgress >= dat->pmfqfFiles[j].dwSize)
{// we update it
- dwUpdateTimeNext=dwUpdateTimeCur+MRA_FILES_QUEUE_PROGRESS_INTERVAL;
+ dwUpdateTimeNext = dwUpdateTimeCur+MRA_FILES_QUEUE_PROGRESS_INTERVAL;
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_DATA,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,(LPARAM)&pfts);
+ ProtoBroadcastAck(m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_DATA, (HANDLE)dat->dwIDRequest, (LPARAM)&pfts);
- if (pfts.currentFileProgress>=pmrafqFilesQueueItem->pmfqfFiles[j].dwSize)
+ if (pfts.currentFileProgress >= dat->pmfqfFiles[j].dwSize)
{// file received
- bOK=TRUE;
+ bOK = TRUE;
break;
}
}
- }else{// err on send file data
- dwRetErrorCode=GetLastError();
- ShowFormatedErrorMessage(L"Send files: error on send file data",dwRetErrorCode);
+ }else {// err on send file data
+ dwRetErrorCode = GetLastError();
+ ShowFormattedErrorMessage(L"Send files: error on send file data", dwRetErrorCode);
break;
}
- }else{// read failure
- dwRetErrorCode=GetLastError();
- ShowFormatedErrorMessage(L"Send files: cant read file data, error",dwRetErrorCode);
+ }else {// read failure
+ dwRetErrorCode = GetLastError();
+ ShowFormattedErrorMessage(L"Send files: cant read file data, error", dwRetErrorCode);
break;
}
}// end while
CloseHandle(hFile);
- if (bOK==FALSE)
+ if (bOK == FALSE)
{// file recv failed
- bFailed=TRUE;
+ bFailed = TRUE;
break;
}
- }else{// err on open file
- dwRetErrorCode=GetLastError();
+ }else {// err on open file
+ dwRetErrorCode = GetLastError();
- mir_sntprintf(szErrorText,SIZEOF(szErrorText),TranslateW(L"Send files: cant open file %s, error"),pmrafqFilesQueueItem->pmfqfFiles[j].lpwszName);
- ShowFormatedErrorMessage(szErrorText,dwRetErrorCode);
- bFailed=TRUE;
+ mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateW(L"Send files: cant open file %s, error"), dat->pmfqfFiles[j].lpwszName);
+ ShowFormattedErrorMessage(szErrorText, dwRetErrorCode);
+ bFailed = TRUE;
break;
}
- }else{
- mir_sntprintf(szErrorText,SIZEOF(szErrorText),TranslateW(L"Send files: requested file: %S - not found in send files list."),(((LPSTR)btBuff)+sizeof(MRA_FT_GET_FILE)));
- ShowFormatedErrorMessage(szErrorText,NO_ERROR);
- bFailed=TRUE;
+ }else {
+ mir_sntprintf(szErrorText, SIZEOF(szErrorText), TranslateW(L"Send files: requested file: %S - not found in send files list."), (((LPSTR)btBuff)+sizeof(MRA_FT_GET_FILE)));
+ ShowFormattedErrorMessage(szErrorText, NO_ERROR);
+ bFailed = TRUE;
break;
}
- }else{// err on receive, trash
- ShowFormatedErrorMessage(L"Send files: bad file send request - invalid header",NO_ERROR);
- bFailed=TRUE;
+ }else {// err on receive, trash
+ ShowFormattedErrorMessage(L"Send files: bad file send request - invalid header", NO_ERROR);
+ bFailed = TRUE;
break;
}
- }else{// bad file name or trash
- ShowFormatedErrorMessage(L"Send files: bad file send request - to small packet",NO_ERROR);
- bFailed=TRUE;
+ }else {// bad file name or trash
+ ShowFormattedErrorMessage(L"Send files: bad file send request - to small packet", NO_ERROR);
+ bFailed = TRUE;
break;
}
- }else{
+ }else {
break;
}
}// end for
- Netlib_CloseHandle(pmrafqFilesQueueItem->hConnection);
- pmrafqFilesQueueItem->hConnection=NULL;
+ Netlib_CloseHandle(dat->hConnection);
+ dat->hConnection = NULL;
}
if (bFailed)
{
CHAR szEMail[MAX_EMAIL_LEN];
- SIZE_T dwEMailSize;
+ size_t dwEMailSize;
- if (DB_Mra_GetStaticStringA(pmrafqFilesQueueItem->hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ if (mraGetStaticStringA(dat->hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize))
{
- MraSendCommand_FileTransferAck(FILE_TRANSFER_STATUS_ERROR,szEMail,dwEMailSize,pmrafqFilesQueueItem->dwIDRequest,NULL,0);
+ MraFileTransferAck(FILE_TRANSFER_STATUS_ERROR, szEMail, dwEMailSize, dat->dwIDRequest, NULL, 0);
}
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_FAILED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
- }else{
- ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_SUCCESS,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ ProtoBroadcastAck(m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_FAILED, (HANDLE)dat->dwIDRequest, 0);
+ }else {
+ ProtoBroadcastAck(m_szModuleName, dat->hContact, ACKTYPE_FILE, ACKRESULT_SUCCESS, (HANDLE)dat->dwIDRequest, 0);
}
- ListMTLock(&pmrafqFilesQueue->lmtListMT);
- MraFilesQueueItemFree(pmrafqFilesQueueItem);
- ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ ListMTLock(pmrafqFilesQueue);
+ MraFilesQueueItemFree(dat);
+ ListMTUnLock(pmrafqFilesQueue);
}
}
diff --git a/protocols/MRA/MraFilesQueue.h b/protocols/MRA/MraFilesQueue.h
index 2b00405e82..5c55c5b8ad 100644
--- a/protocols/MRA/MraFilesQueue.h
+++ b/protocols/MRA/MraFilesQueue.h
@@ -7,18 +7,15 @@
#endif // _MSC_VER > 1000
-INT_PTR CALLBACK MraFilesQueueDlgProcOpts(HWND hWndDlg,UINT msg,WPARAM wParam,LPARAM lParam);
-DWORD MraFilesQueueInitialize (DWORD dwFilesTimeOutInterval,HANDLE *phFilesQueueHandle);
+INT_PTR CALLBACK MraFilesQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+DWORD MraFilesQueueInitialize (DWORD dwFilesTimeOutInterval, HANDLE *phFilesQueueHandle);
void MraFilesQueueDestroy (HANDLE hFilesQueueHandle);
-HANDLE MraFilesQueueItemProxyByID (HANDLE hFilesQueueHandle,DWORD dwIDRequest);
-DWORD MraFilesQueueAddReceive (HANDLE hFilesQueueHandle,DWORD dwFlags,HANDLE hContact,DWORD dwIDRequest,LPWSTR lpwszFiles,SIZE_T dwFilesSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize);
-DWORD MraFilesQueueAddSend (HANDLE hFilesQueueHandle,DWORD dwFlags,HANDLE hContact,LPWSTR *plpwszFiles,SIZE_T dwFilesCount,DWORD *pdwIDRequest);
-DWORD MraFilesQueueAccept (HANDLE hFilesQueueHandle,DWORD dwIDRequest,LPWSTR lpwszPath,SIZE_T dwPathSize);
-DWORD MraFilesQueueCancel (HANDLE hFilesQueueHandle,DWORD dwIDRequest,BOOL bSendDecline);
-DWORD MraFilesQueueStartMrimProxy (HANDLE hFilesQueueHandle,DWORD dwIDRequest);
-DWORD MraFilesQueueFree (HANDLE hFilesQueueHandle,DWORD dwCMDNum);
-DWORD MraFilesQueueSendMirror (HANDLE hFilesQueueHandle,DWORD dwIDRequest,LPSTR lpszAddreses,SIZE_T dwAddresesSize);
+void MraFilesQueueConnectionReceived(HANDLE hNewConnection, DWORD dwRemoteIP, void *pExtra);
+
+HANDLE MraFilesQueueItemProxyByID (HANDLE hFilesQueueHandle, DWORD dwIDRequest);
+DWORD MraFilesQueueStartMrimProxy (HANDLE hFilesQueueHandle, DWORD dwIDRequest);
+DWORD MraFilesQueueFree (HANDLE hFilesQueueHandle, DWORD dwCMDNum);
diff --git a/protocols/MRA/MraIcons.cpp b/protocols/MRA/MraIcons.cpp
index 0da6ee011e..d45e03bd73 100644
--- a/protocols/MRA/MraIcons.cpp
+++ b/protocols/MRA/MraIcons.cpp
@@ -1,148 +1,116 @@
#include "Mra.h"
#include "MraIcons.h"
-
-
-
-void AddIcoLibItems(LPWSTR lpwszRootSectionName,LPWSTR lpwszSubSectionName,const GUI_DISPLAY_ITEM *pgdiItems,SIZE_T dwCount,HANDLE *hResult)
+void CMraProto::AddIcoLibItems(LPWSTR lpwszRootSectionName, LPWSTR lpwszSubSectionName, const GUI_DISPLAY_ITEM *pgdiItems, size_t dwCount, HANDLE *hResult)
{
char szBuff[MAX_PATH];
- WCHAR wszSection[MAX_PATH],wszPath[MAX_FILEPATH];
+ WCHAR wszSection[MAX_PATH], wszPath[MAX_FILEPATH];
- SKINICONDESC sid={0};
+ SKINICONDESC sid = {0};
sid.cbSize = sizeof(sid);
sid.pwszSection = wszSection;
sid.pwszDefaultFile = wszPath;
sid.cx = sid.cy = 16;
sid.flags = SIDF_ALL_UNICODE;
- if (lpwszSubSectionName==NULL) lpwszSubSectionName=L"";
- GetModuleFileName(masMraSettings.hInstance,wszPath,SIZEOF(wszPath));
- mir_sntprintf(wszSection,SIZEOF(wszSection),L"%s%s%s",lpwszRootSectionName,PROTOCOL_NAMEW,lpwszSubSectionName);
-
- for (SIZE_T i=0;i<dwCount;i++) {
- mir_snprintf(szBuff,SIZEOF(szBuff),"%s_%s",PROTOCOL_NAMEA,pgdiItems[i].lpszName);
- sid.pszName=szBuff;
- sid.pwszDescription=pgdiItems[i].lpwszDescr;
- sid.iDefaultIndex=-pgdiItems[i].defIcon;
- sid.hDefaultIcon=(HICON)LoadImage(masMraSettings.hInstance,MAKEINTRESOURCE(pgdiItems[i].defIcon),IMAGE_ICON,0,0,LR_SHARED);
- if (sid.hDefaultIcon==NULL) sid.hDefaultIcon=(HICON)LoadImage(NULL,MAKEINTRESOURCE(pgdiItems[i].defIcon),IMAGE_ICON,0,0,LR_SHARED);
+ if (lpwszSubSectionName == NULL) lpwszSubSectionName = L"";
+ GetModuleFileName(masMraSettings.hInstance, wszPath, SIZEOF(wszPath));
+ mir_sntprintf(wszSection, SIZEOF(wszSection), L"%s%s%s", lpwszRootSectionName, m_tszUserName, lpwszSubSectionName);
+
+ for (size_t i = 0;i<dwCount;i++) {
+ mir_snprintf(szBuff, SIZEOF(szBuff), "%s_%s", m_szModuleName, pgdiItems[i].lpszName);
+ sid.pszName = szBuff;
+ sid.pwszDescription = pgdiItems[i].lpwszDescr;
+ sid.iDefaultIndex = -pgdiItems[i].defIcon;
+ sid.hDefaultIcon = (HICON)LoadImage(masMraSettings.hInstance, MAKEINTRESOURCE(pgdiItems[i].defIcon), IMAGE_ICON, 0, 0, LR_SHARED);
+ if (sid.hDefaultIcon == NULL) sid.hDefaultIcon = (HICON)LoadImage(NULL, MAKEINTRESOURCE(pgdiItems[i].defIcon), IMAGE_ICON, 0, 0, LR_SHARED);
hResult[i] = Skin_AddIcon(&sid);
}
}
-void RemoveIcoLibItems(const GUI_DISPLAY_ITEM *pgdiItems,SIZE_T dwCount)
-{
- char szBuff[MAX_PATH];
-
- for (SIZE_T i=0;i<dwCount;i++)
- {
- mir_snprintf(szBuff,SIZEOF(szBuff),"%s_%s",PROTOCOL_NAMEA,pgdiItems[i].lpszName);
- //***deb until 08 release
- //CallService(MS_SKIN2_REMOVEICON,0,(LPARAM)szBuff);
- }
-}
-
-
HICON IconLibGetIcon(HANDLE hIcon)
{
-return(IconLibGetIconEx(hIcon,LR_SHARED));
+ return IconLibGetIconEx(hIcon, LR_SHARED);
}
-
-HICON IconLibGetIconEx(HANDLE hIcon,DWORD dwFlags)
+HICON IconLibGetIconEx(HANDLE hIcon, DWORD dwFlags)
{
- HICON hiIcon=NULL;
-
- if (hIcon)
- {
- hiIcon=(HICON)CallService(MS_SKIN2_GETICONBYHANDLE,0,(LPARAM)hIcon);
- if ((dwFlags&LR_SHARED)==0)
- {
- hiIcon=CopyIcon(hiIcon);
- }
+ HICON hiIcon = NULL;
+ if (hIcon) {
+ hiIcon = Skin_GetIconByHandle(hIcon);
+ if ((dwFlags & LR_SHARED) == 0)
+ hiIcon = CopyIcon(hiIcon);
}
-return(hiIcon);
+ return hiIcon;
}
//////////////////////////////////////////////////////////////////////////////////////
-void IconsLoad()
+
+void CMraProto::IconsLoad()
{
- AddIcoLibItems(L"Protocols/",L"/MainMenu",gdiMenuItems,SIZEOF(gdiMenuItems),masMraSettings.hMainMenuIcons);
- AddIcoLibItems(L"Protocols/",L"/ContactMenu",gdiContactMenuItems,SIZEOF(gdiContactMenuItems),masMraSettings.hContactMenuIcons);
+ AddIcoLibItems(L"Protocols/", L"/MainMenu", gdiMenuItems, gdiMenuItemsCount, hMainMenuIcons);
+ AddIcoLibItems(L"Protocols/", L"/ContactMenu", gdiContactMenuItems, gdiContactMenuItemsCount, hContactMenuIcons);
+
// Advanced Status Icons initialization
- AddIcoLibItems(L"Protocols/",L"/Extra status",gdiExtraStatusIconsItems,SIZEOF(gdiExtraStatusIconsItems),masMraSettings.hAdvancedStatusIcons);
+ AddIcoLibItems(L"Protocols/", L"/Extra status", gdiExtraStatusIconsItems, gdiExtraStatusIconsItemsCount, hAdvancedStatusIcons);
}
-void IconsUnLoad()
+void CMraProto::IconsUnLoad()
{
- RemoveIcoLibItems(gdiMenuItems,SIZEOF(gdiMenuItems));
- bzero(masMraSettings.hMainMenuIcons,sizeof(masMraSettings.hMainMenuIcons));
-
- RemoveIcoLibItems(gdiContactMenuItems,SIZEOF(gdiContactMenuItems));
- bzero(masMraSettings.hContactMenuIcons,sizeof(masMraSettings.hContactMenuIcons));
-
// Advanced Status Icons initialization
- RemoveIcoLibItems(gdiExtraStatusIconsItems,SIZEOF(gdiExtraStatusIconsItems));
- bzero(masMraSettings.hAdvancedStatusIcons,sizeof(masMraSettings.hAdvancedStatusIcons));
- bzero(masMraSettings.hAdvancedStatusItems,sizeof(masMraSettings.hAdvancedStatusItems));
+ bzero(hAdvancedStatusIcons, sizeof(hAdvancedStatusIcons));
+ bzero(hAdvancedStatusItems, sizeof(hAdvancedStatusItems));
}
-
-
-
-void InitXStatusIcons()
+void CMraProto::InitXStatusIcons()
{
int iCurIndex;
char szBuff[MAX_PATH];
- WCHAR wszSection[MAX_PATH],wszPath[MAX_FILEPATH];
+ WCHAR wszSection[MAX_PATH], wszPath[MAX_FILEPATH];
- SKINICONDESC sid={0};
+ SKINICONDESC sid = {0};
sid.cbSize = sizeof(sid);
- sid.pwszSection=wszSection;
- sid.pwszDefaultFile=wszPath;
- sid.cx=sid.cy=16;
- sid.flags=SIDF_ALL_UNICODE;
+ sid.pwszSection = wszSection;
+ sid.pwszDefaultFile = wszPath;
+ sid.cx = sid.cy = 16;
+ sid.flags = SIDF_ALL_UNICODE;
if (masMraSettings.hDLLXStatusIcons)
- GetModuleFileName(masMraSettings.hDLLXStatusIcons,wszPath,SIZEOF(wszPath));
+ GetModuleFileName(masMraSettings.hDLLXStatusIcons, wszPath, SIZEOF(wszPath));
else
- bzero(wszPath,sizeof(wszPath));
-
- mir_sntprintf(wszSection,SIZEOF(wszSection),L"Status Icons/%s/Custom Status",PROTOCOL_NAMEW);
-
- masMraSettings.hXStatusAdvancedStatusIcons[0]=NULL;
- for (SIZE_T i=1;i<(MRA_XSTATUS_COUNT+1);i++)
- {
- mir_snprintf(szBuff,SIZEOF(szBuff),"%s_xstatus%ld",PROTOCOL_NAMEA,i);
- iCurIndex=(IDI_XSTATUS1-1+i);
- sid.pszName=szBuff;
- sid.pwszDescription=lpcszXStatusNameDef[i];
- sid.iDefaultIndex=-iCurIndex;
+ bzero(wszPath, sizeof(wszPath));
+
+ mir_sntprintf(wszSection, SIZEOF(wszSection), L"Status Icons/%s/Custom Status", m_tszUserName);
+
+ hXStatusAdvancedStatusIcons[0] = NULL;
+ for (size_t i = 1; i < MRA_XSTATUS_COUNT+1; i++) {
+ mir_snprintf(szBuff, SIZEOF(szBuff), "%s_xstatus%ld", m_szModuleName, i);
+ iCurIndex = (IDI_XSTATUS1-1+i);
+ sid.pszName = szBuff;
+ sid.pwszDescription = lpcszXStatusNameDef[i];
+ sid.iDefaultIndex = -iCurIndex;
if (masMraSettings.hDLLXStatusIcons)
- {
- sid.hDefaultIcon=(HICON)LoadImage(masMraSettings.hDLLXStatusIcons,MAKEINTRESOURCE(iCurIndex),IMAGE_ICON,0,0,LR_SHARED);
- }else{
- sid.hDefaultIcon=NULL;
- }
- masMraSettings.hXStatusAdvancedStatusIcons[i] = Skin_AddIcon(&sid);
+ sid.hDefaultIcon = (HICON)LoadImage(masMraSettings.hDLLXStatusIcons, MAKEINTRESOURCE(iCurIndex), IMAGE_ICON, 0, 0, LR_SHARED);
+ else
+ sid.hDefaultIcon = NULL;
+
+ hXStatusAdvancedStatusIcons[i] = Skin_AddIcon(&sid);
}
}
-void DestroyXStatusIcons()
+void CMraProto::DestroyXStatusIcons()
{
char szBuff[MAX_PATH];
- for (SIZE_T i=1;i<(MRA_XSTATUS_COUNT+1);i++)
- {
- mir_snprintf(szBuff,SIZEOF(szBuff),"xstatus%ld",i);
- //***deb until 08 release
- //CallService(MS_SKIN2_REMOVEICON,0,(LPARAM)szBuff);
+ for (size_t i = 1; i < MRA_XSTATUS_COUNT+1; i++) {
+ mir_snprintf(szBuff, SIZEOF(szBuff), "xstatus%ld", i);
+ Skin_RemoveIcon(szBuff);
}
- bzero(masMraSettings.hXStatusAdvancedStatusIcons,sizeof(masMraSettings.hXStatusAdvancedStatusIcons));
- bzero(masMraSettings.hXStatusAdvancedStatusItems,sizeof(masMraSettings.hXStatusAdvancedStatusItems));
+
+ bzero(hXStatusAdvancedStatusIcons, sizeof(hXStatusAdvancedStatusIcons));
+ bzero(hXStatusAdvancedStatusItems, sizeof(hXStatusAdvancedStatusItems));
}
diff --git a/protocols/MRA/MraIcons.h b/protocols/MRA/MraIcons.h
index 7d6523c80d..992914805b 100644
--- a/protocols/MRA/MraIcons.h
+++ b/protocols/MRA/MraIcons.h
@@ -8,13 +8,6 @@
HICON IconLibGetIcon(HANDLE hIcon);
-HICON IconLibGetIconEx(HANDLE hIcon,DWORD dwFlags);
-
-void IconsLoad();
-void IconsUnLoad();
-
-void InitXStatusIcons();
-void DestroyXStatusIcons();
-
+HICON IconLibGetIconEx(HANDLE hIcon, DWORD dwFlags);
#endif // !defined(AFX_MRA_ICONS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_) \ No newline at end of file
diff --git a/protocols/MRA/MraMPop.cpp b/protocols/MRA/MraMPop.cpp
index ad510184e8..55bc9dda4e 100644
--- a/protocols/MRA/MraMPop.cpp
+++ b/protocols/MRA/MraMPop.cpp
@@ -1,238 +1,178 @@
#include "Mra.h"
#include "MraMPop.h"
-
-
-
// MPOP_SESSION
-typedef struct
+struct MRA_MPOP_SESSION_QUEUE : public FIFO_MT
{
- FIFO_MT ffmtQueueToQuery;
- BOOL bKeyValid;
- LPSTR lpszMPOPKey;
- SIZE_T dwMPOPKeySize;
-} MRA_MPOP_SESSION_QUEUE;
+ BOOL bKeyValid;
+ LPSTR lpszMPOPKey;
+ size_t dwMPOPKeySize;
+};
-
-typedef struct
+struct MRA_MPOP_SESSION_QUEUE_ITEM : public FIFO_MT_ITEM
{
- FIFO_MT_ITEM ffmtiFifoItem;
- LPSTR lpszUrl;
- SIZE_T dwUrlSize;
-} MRA_MPOP_SESSION_QUEUE_ITEM;
-
-
-
-void MraMPopSessionQueueClear (HANDLE hMPopSessionQueue);
-
-
+ LPSTR lpszUrl;
+ size_t dwUrlSize;
+};
+void MraMPopSessionQueueClear(HANDLE hMPopSessionQueue);
DWORD MraMPopSessionQueueInitialize(HANDLE *phMPopSessionQueue)
{
- DWORD dwRetErrorCode;
+ if (!phMPopSessionQueue)
+ return ERROR_ALREADY_INITIALIZED;
- if (phMPopSessionQueue)
- {
- MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue;
-
- pmpsqMPopSessionQueue=(MRA_MPOP_SESSION_QUEUE*)MEMALLOC(sizeof(MRA_MPOP_SESSION_QUEUE));
- if (pmpsqMPopSessionQueue)
- {
- pmpsqMPopSessionQueue->bKeyValid=FALSE;
- pmpsqMPopSessionQueue->lpszMPOPKey=NULL;
- pmpsqMPopSessionQueue->dwMPOPKeySize=0;
- FifoMTInitialize(&pmpsqMPopSessionQueue->ffmtQueueToQuery,0);
-
- (*phMPopSessionQueue)=(HANDLE)pmpsqMPopSessionQueue;
- dwRetErrorCode=NO_ERROR;
- }else{
- dwRetErrorCode=GetLastError();
- }
- }else{
- dwRetErrorCode=ERROR_ALREADY_INITIALIZED;
- }
-return(dwRetErrorCode);
+ MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue = (MRA_MPOP_SESSION_QUEUE*)mir_calloc(sizeof(MRA_MPOP_SESSION_QUEUE));
+ if (!pmpsqMPopSessionQueue)
+ return GetLastError();
+
+ pmpsqMPopSessionQueue->bKeyValid = FALSE;
+ pmpsqMPopSessionQueue->lpszMPOPKey = NULL;
+ pmpsqMPopSessionQueue->dwMPOPKeySize = 0;
+ FifoMTInitialize(pmpsqMPopSessionQueue, 0);
+ *phMPopSessionQueue = (HANDLE)pmpsqMPopSessionQueue;
+ return NO_ERROR;
}
-
void MraMPopSessionQueueClear(HANDLE hMPopSessionQueue)
{
- if (hMPopSessionQueue)
- {
- MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue=(MRA_MPOP_SESSION_QUEUE*)hMPopSessionQueue;
- MRA_MPOP_SESSION_QUEUE_ITEM *pmpsqi;
+ if (hMPopSessionQueue) {
+ MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue = (MRA_MPOP_SESSION_QUEUE*)hMPopSessionQueue;
+ pmpsqMPopSessionQueue->bKeyValid = FALSE;
+ mir_free(pmpsqMPopSessionQueue->lpszMPOPKey);
+ pmpsqMPopSessionQueue->dwMPOPKeySize = 0;
- pmpsqMPopSessionQueue->bKeyValid=FALSE;
- MEMFREE(pmpsqMPopSessionQueue->lpszMPOPKey);
- pmpsqMPopSessionQueue->dwMPOPKeySize=0;
- while(FifoMTItemPop(&pmpsqMPopSessionQueue->ffmtQueueToQuery,NULL,(LPVOID*)&pmpsqi)==NO_ERROR) MEMFREE(pmpsqi);
+ MRA_MPOP_SESSION_QUEUE_ITEM *pmpsqi;
+ while( !FifoMTItemPop(pmpsqMPopSessionQueue, NULL, (LPVOID*)&pmpsqi))
+ mir_free(pmpsqi);
}
}
-
-void MraMPopSessionQueueFlush(HANDLE hMPopSessionQueue)
+void CMraProto::MraMPopSessionQueueFlush(HANDLE hMPopSessionQueue)
{
- if (hMPopSessionQueue)
- {
- MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue=(MRA_MPOP_SESSION_QUEUE*)hMPopSessionQueue;
-
- while(FifoMTGetCount(&pmpsqMPopSessionQueue->ffmtQueueToQuery))
- {
- MraMPopSessionQueueSetNewMPopKey(hMPopSessionQueue,NULL,0);
+ if (hMPopSessionQueue) {
+ MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue = (MRA_MPOP_SESSION_QUEUE*)hMPopSessionQueue;
+ while( FifoMTGetCount(pmpsqMPopSessionQueue)) {
+ MraMPopSessionQueueSetNewMPopKey(hMPopSessionQueue, NULL, 0);
MraMPopSessionQueueStart(hMPopSessionQueue);
}
}
}
-
void MraMPopSessionQueueDestroy(HANDLE hMPopSessionQueue)
{
- if (hMPopSessionQueue)
- {
- MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue=(MRA_MPOP_SESSION_QUEUE*)hMPopSessionQueue;
+ if (hMPopSessionQueue) {
+ MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue = (MRA_MPOP_SESSION_QUEUE*)hMPopSessionQueue;
MraMPopSessionQueueClear(hMPopSessionQueue);
- FifoMTDestroy(&pmpsqMPopSessionQueue->ffmtQueueToQuery);
- MEMFREE(pmpsqMPopSessionQueue);
+ FifoMTDestroy(pmpsqMPopSessionQueue);
+ mir_free(pmpsqMPopSessionQueue);
}
}
-
-DWORD MraMPopSessionQueueAddUrl(HANDLE hMPopSessionQueue,LPSTR lpszUrl,SIZE_T dwUrlSize)
+DWORD CMraProto::MraMPopSessionQueueAddUrl(HANDLE hMPopSessionQueue, LPSTR lpszUrl, size_t dwUrlSize)
{
- DWORD dwRetErrorCode;
+ if (!hMPopSessionQueue || !lpszUrl || !dwUrlSize)
+ return ERROR_INVALID_HANDLE;
+
+ MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue = (MRA_MPOP_SESSION_QUEUE*)hMPopSessionQueue;
+ MRA_MPOP_SESSION_QUEUE_ITEM *pmpsqi = (MRA_MPOP_SESSION_QUEUE_ITEM*)mir_calloc((sizeof(MRA_MPOP_SESSION_QUEUE_ITEM)+dwUrlSize+sizeof(size_t)));
+ if (!pmpsqi)
+ return GetLastError();
+
+ pmpsqi->dwUrlSize = dwUrlSize;
+ pmpsqi->lpszUrl = (LPSTR)(pmpsqi+1);
+ memmove(pmpsqi->lpszUrl, lpszUrl, dwUrlSize);
+ FifoMTItemPush(pmpsqMPopSessionQueue, pmpsqi, (LPVOID)pmpsqi);
+ if (pmpsqMPopSessionQueue->bKeyValid)
+ return MraMPopSessionQueueStart(hMPopSessionQueue);
+
+ if (m_bLoggedIn)
+ MraSendCMD(MRIM_CS_GET_MPOP_SESSION, NULL, 0);
+ else
+ MraMPopSessionQueueFlush(hMPopSessionQueue);
+
+ return NO_ERROR;
+}
- if (hMPopSessionQueue && lpszUrl && dwUrlSize)
- {
- MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue=(MRA_MPOP_SESSION_QUEUE*)hMPopSessionQueue;
- MRA_MPOP_SESSION_QUEUE_ITEM *pmpsqi=(MRA_MPOP_SESSION_QUEUE_ITEM*)MEMALLOC((sizeof(MRA_MPOP_SESSION_QUEUE_ITEM)+dwUrlSize+sizeof(SIZE_T)));
-
- if (pmpsqi)
- {
- pmpsqi->dwUrlSize=dwUrlSize;
- pmpsqi->lpszUrl=(LPSTR)(pmpsqi+1);
- memmove(pmpsqi->lpszUrl,lpszUrl,dwUrlSize);
- FifoMTItemPush(&pmpsqMPopSessionQueue->ffmtQueueToQuery,&pmpsqi->ffmtiFifoItem,(LPVOID)pmpsqi);
- if (pmpsqMPopSessionQueue->bKeyValid)
- {
- dwRetErrorCode=MraMPopSessionQueueStart(hMPopSessionQueue);
- }else{
- if (masMraSettings.bLoggedIn)
- {
- MraSendCMD(MRIM_CS_GET_MPOP_SESSION,NULL,0);
- }else{
- MraMPopSessionQueueFlush(hMPopSessionQueue);
- }
- dwRetErrorCode=NO_ERROR;
- }
- }else{
- dwRetErrorCode=GetLastError();
- }
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+DWORD CMraProto::MraMPopSessionQueueAddUrlAndEMail(HANDLE hMPopSessionQueue, LPSTR lpszUrl, size_t dwUrlSize, LPSTR lpszEMail, size_t dwEMailSize)
+{
+ if (!hMPopSessionQueue || !lpszUrl || !dwUrlSize || !lpszEMail || !dwEMailSize)
+ return ERROR_INVALID_HANDLE;
+
+ char szUrl[BUFF_SIZE_URL], szEMail[MAX_EMAIL_LEN];
+ LPSTR lpszUser, lpszDomain;
+
+ BuffToLowerCase(szEMail, lpszEMail, dwEMailSize);
+ lpszDomain = (LPSTR)MemoryFindByte(0, szEMail, dwEMailSize, '@');
+ if (lpszDomain)
+ if (lpszUser = (LPSTR)MemoryFindByte((lpszDomain-szEMail), szEMail, dwEMailSize, '.')) {
+ *lpszUser = 0;
+ lpszUser = szEMail;
+ *lpszDomain = 0;
+ lpszDomain++;
+
+ dwUrlSize = mir_snprintf(szUrl, SIZEOF(szUrl), "%s/%s/%s", lpszUrl, lpszDomain, lpszUser);
+ return MraMPopSessionQueueAddUrl(hMPopSessionQueue, szUrl, dwUrlSize);
}
-return(dwRetErrorCode);
+ return ERROR_INVALID_DATA;
}
-
-DWORD MraMPopSessionQueueAddUrlAndEMail(HANDLE hMPopSessionQueue,LPSTR lpszUrl,SIZE_T dwUrlSize,LPSTR lpszEMail,SIZE_T dwEMailSize)
+DWORD CMraProto::MraMPopSessionQueueStart(HANDLE hMPopSessionQueue)
{
DWORD dwRetErrorCode;
- if (hMPopSessionQueue && lpszUrl && dwUrlSize && lpszEMail && dwEMailSize)
- {
- char szUrl[BUFF_SIZE_URL],szEMail[MAX_EMAIL_LEN];
- LPSTR lpszUser,lpszDomain;
-
- dwRetErrorCode=ERROR_INVALID_DATA;
- BuffToLowerCase(szEMail,lpszEMail,dwEMailSize);
- lpszDomain=(LPSTR)MemoryFindByte(0,szEMail,dwEMailSize,'@');
- if (lpszDomain)
- if (lpszUser=(LPSTR)MemoryFindByte((lpszDomain-szEMail),szEMail,dwEMailSize,'.'))
- {
- (*lpszUser)=0;
- lpszUser=szEMail;
- (*lpszDomain)=0;
- lpszDomain++;
-
- dwUrlSize=mir_snprintf(szUrl,SIZEOF(szUrl),"%s/%s/%s",lpszUrl,lpszDomain,lpszUser);
- dwRetErrorCode=MraMPopSessionQueueAddUrl(hMPopSessionQueue,szUrl,dwUrlSize);
+ if (!hMPopSessionQueue)
+ return ERROR_INVALID_HANDLE;
+
+ MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue = (MRA_MPOP_SESSION_QUEUE*)hMPopSessionQueue;
+ MRA_MPOP_SESSION_QUEUE_ITEM *pmpsqi;
+
+ dwRetErrorCode = NO_ERROR;
+ if (pmpsqMPopSessionQueue->bKeyValid == TRUE)
+ if ( FifoMTItemPop(pmpsqMPopSessionQueue, NULL, (LPVOID*)&pmpsqi) == NO_ERROR) {
+ char szUrl[BUFF_SIZE_URL], szEMail[MAX_EMAIL_LEN];
+ size_t dwUrlSize, dwEMailSize;
+
+ if (mraGetStaticStringA(NULL, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize)) {
+ pmpsqMPopSessionQueue->bKeyValid = FALSE;
+ BuffToLowerCase(szEMail, szEMail, dwEMailSize);
+ dwUrlSize = mir_snprintf(szUrl, SIZEOF(szUrl), MRA_MPOP_AUTH_URL, szEMail, pmpsqMPopSessionQueue->lpszMPOPKey, pmpsqi->lpszUrl);
+
+ CallService(MS_UTILS_OPENURL, TRUE, (LPARAM)szUrl);
+ DebugPrint(L"Opening URL: ");DebugPrintCRLFA(szUrl);
}
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ mir_free(pmpsqi);
}
-return(dwRetErrorCode);
+ return NO_ERROR;
}
-DWORD MraMPopSessionQueueStart(HANDLE hMPopSessionQueue)
+DWORD MraMPopSessionQueueSetNewMPopKey(HANDLE hMPopSessionQueue, LPSTR lpszKey, size_t dwKeySize)
{
- DWORD dwRetErrorCode;
+ if (!hMPopSessionQueue)
+ return ERROR_INVALID_HANDLE;
- if (hMPopSessionQueue)
- {
- MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue=(MRA_MPOP_SESSION_QUEUE*)hMPopSessionQueue;
- MRA_MPOP_SESSION_QUEUE_ITEM *pmpsqi;
+ if (lpszKey == NULL) dwKeySize = 0;
- dwRetErrorCode=NO_ERROR;
- if (pmpsqMPopSessionQueue->bKeyValid==TRUE)
- if (FifoMTItemPop(&pmpsqMPopSessionQueue->ffmtQueueToQuery,NULL,(LPVOID*)&pmpsqi)==NO_ERROR)
- {
- char szUrl[BUFF_SIZE_URL],szEMail[MAX_EMAIL_LEN];
- SIZE_T dwUrlSize,dwEMailSize;
-
- if (DB_Mra_GetStaticStringA(NULL,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- pmpsqMPopSessionQueue->bKeyValid=FALSE;
- BuffToLowerCase(szEMail,szEMail,dwEMailSize);
- dwUrlSize=mir_snprintf(szUrl,SIZEOF(szUrl),MRA_MPOP_AUTH_URL,szEMail,pmpsqMPopSessionQueue->lpszMPOPKey,pmpsqi->lpszUrl);
-
- CallService(MS_UTILS_OPENURL,TRUE,(LPARAM)szUrl);
- DebugPrint(L"Opening URL: ");DebugPrintCRLFA(szUrl);
- //MraSendCMD(MRIM_CS_GET_MPOP_SESSION,NULL,0);
- }
- MEMFREE(pmpsqi);
- }
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue = (MRA_MPOP_SESSION_QUEUE*)hMPopSessionQueue;
+ if (pmpsqMPopSessionQueue->dwMPOPKeySize<dwKeySize || dwKeySize == 0) {
+ mir_free(pmpsqMPopSessionQueue->lpszMPOPKey);
+ pmpsqMPopSessionQueue->lpszMPOPKey = (LPSTR)mir_calloc(dwKeySize+sizeof(size_t));
}
-return(dwRetErrorCode);
-}
+ if (pmpsqMPopSessionQueue->lpszMPOPKey) {
+ pmpsqMPopSessionQueue->bKeyValid = TRUE;
+ pmpsqMPopSessionQueue->dwMPOPKeySize = dwKeySize;
+ memmove(pmpsqMPopSessionQueue->lpszMPOPKey, lpszKey, dwKeySize);
+ (*(pmpsqMPopSessionQueue->lpszMPOPKey+dwKeySize)) = 0;
-DWORD MraMPopSessionQueueSetNewMPopKey(HANDLE hMPopSessionQueue,LPSTR lpszKey,SIZE_T dwKeySize)
-{
- DWORD dwRetErrorCode;
-
- if (hMPopSessionQueue)
- {
- MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue=(MRA_MPOP_SESSION_QUEUE*)hMPopSessionQueue;
-
- if (lpszKey==NULL) dwKeySize=0;
- if (pmpsqMPopSessionQueue->dwMPOPKeySize<dwKeySize || dwKeySize==0)
- {
- MEMFREE(pmpsqMPopSessionQueue->lpszMPOPKey);
- pmpsqMPopSessionQueue->lpszMPOPKey=(LPSTR)MEMALLOC(dwKeySize+sizeof(SIZE_T));
- }
-
- if (pmpsqMPopSessionQueue->lpszMPOPKey)
- {
- pmpsqMPopSessionQueue->bKeyValid=TRUE;
- pmpsqMPopSessionQueue->dwMPOPKeySize=dwKeySize;
- memmove(pmpsqMPopSessionQueue->lpszMPOPKey,lpszKey,dwKeySize);
- (*(pmpsqMPopSessionQueue->lpszMPOPKey+dwKeySize))=0;
-
- DebugPrint(L"New MPOP session key: ");DebugPrintCRLFA(pmpsqMPopSessionQueue->lpszMPOPKey);
- dwRetErrorCode=NO_ERROR;
- }else{
- pmpsqMPopSessionQueue->bKeyValid=FALSE;
- pmpsqMPopSessionQueue->lpszMPOPKey=NULL;
- pmpsqMPopSessionQueue->dwMPOPKeySize=0;
- dwRetErrorCode=GetLastError();
- }
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ DebugPrint(L"New MPOP session key: ");DebugPrintCRLFA(pmpsqMPopSessionQueue->lpszMPOPKey);
+ return NO_ERROR;
}
-return(dwRetErrorCode);
+
+ pmpsqMPopSessionQueue->bKeyValid = FALSE;
+ pmpsqMPopSessionQueue->lpszMPOPKey = NULL;
+ pmpsqMPopSessionQueue->dwMPOPKeySize = 0;
+ return GetLastError();
}
diff --git a/protocols/MRA/MraMPop.h b/protocols/MRA/MraMPop.h
index 8d04e067ad..18aef30f27 100644
--- a/protocols/MRA/MraMPop.h
+++ b/protocols/MRA/MraMPop.h
@@ -6,21 +6,8 @@
#pragma once
#endif // _MSC_VER > 1000
-
-
-
DWORD MraMPopSessionQueueInitialize (HANDLE *phMPopSessionQueue);
void MraMPopSessionQueueDestroy (HANDLE hMPopSessionQueue);
-void MraMPopSessionQueueFlush (HANDLE hMPopSessionQueue);
-DWORD MraMPopSessionQueueAddUrl (HANDLE hMPopSessionQueue,LPSTR lpszUrl,SIZE_T dwUrlSize);
-DWORD MraMPopSessionQueueAddUrlAndEMail (HANDLE hMPopSessionQueue,LPSTR lpszUrl,SIZE_T dwUrlSize,LPSTR lpszEMail,SIZE_T dwEMailSize);
-DWORD MraMPopSessionQueueStart (HANDLE hMPopSessionQueue);
-DWORD MraMPopSessionQueueSetNewMPopKey (HANDLE hMPopSessionQueue,LPSTR lpszKey,SIZE_T dwKeySize);
-
-
-
-
-
-
+DWORD MraMPopSessionQueueSetNewMPopKey (HANDLE hMPopSessionQueue, LPSTR lpszKey, size_t dwKeySize);
#endif // !defined(AFX_MRA_MPOP_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraMRIMProxy.cpp b/protocols/MRA/MraMRIMProxy.cpp
index 1eb3ac24c9..d0690141a4 100644
--- a/protocols/MRA/MraMRIMProxy.cpp
+++ b/protocols/MRA/MraMRIMProxy.cpp
@@ -2,238 +2,210 @@
#include "MraMRIMProxy.h"
#include "proto.h"
-
-
-typedef struct
+struct MRA_MRIMPROXY_DATA
{
LPSTR lpszEMail; // LPS to
- SIZE_T dwEMailSize;
+ size_t dwEMailSize;
DWORD dwIDRequest; // DWORD id_request
DWORD dwDataType; // DWORD data_type
LPSTR lpszUserData; // LPS user_data
- SIZE_T dwUserDataSize;
+ size_t dwUserDataSize;
MRA_ADDR_LIST malAddrList; // LPS lps_ip_port
MRA_GUID mguidSessionID; // DWORD session_id[4]
HANDLE hConnection;
HANDLE hWaitHandle; // internal
-} MRA_MRIMPROXY_DATA;
-
-
+};
HANDLE MraMrimProxyCreate()
{
- MRA_MRIMPROXY_DATA *pmmpd=(MRA_MRIMPROXY_DATA*)MEMALLOC(sizeof(MRA_MRIMPROXY_DATA));
-return((HANDLE)pmmpd);
+ MRA_MRIMPROXY_DATA *pmmpd = (MRA_MRIMPROXY_DATA*)mir_calloc(sizeof(MRA_MRIMPROXY_DATA));
+ return (HANDLE)pmmpd;
}
-
-DWORD MraMrimProxySetData(HANDLE hMraMrimProxyData,LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwIDRequest,DWORD dwDataType,LPSTR lpszUserData,SIZE_T dwUserDataSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize,MRA_GUID *pmguidSessionID)
+DWORD MraMrimProxySetData(HANDLE hMraMrimProxyData, LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIDRequest, DWORD dwDataType, LPSTR lpszUserData, size_t dwUserDataSize, LPSTR lpszAddreses, size_t dwAddresesSize, MRA_GUID *pmguidSessionID)
{
- DWORD dwRetErrorCode;
+ if (!hMraMrimProxyData)
+ return ERROR_INVALID_HANDLE;
- if (hMraMrimProxyData)
- {
- MRA_MRIMPROXY_DATA *pmmpd=(MRA_MRIMPROXY_DATA*)hMraMrimProxyData;
+ MRA_MRIMPROXY_DATA *pmmpd = (MRA_MRIMPROXY_DATA*)hMraMrimProxyData;
- if (lpszEMail && dwEMailSize)
- {
- MEMFREE(pmmpd->lpszEMail);
- pmmpd->lpszEMail=(LPSTR)MEMALLOC(dwEMailSize);
- memmove(pmmpd->lpszEMail,lpszEMail,dwEMailSize);
- pmmpd->dwEMailSize=dwEMailSize;
- }
- if (dwIDRequest) pmmpd->dwIDRequest=dwIDRequest;
- if (dwDataType) pmmpd->dwDataType=dwDataType;
- if (lpszUserData)
- {
- MEMFREE(pmmpd->lpszUserData);
- pmmpd->lpszUserData=(LPSTR)MEMALLOC(dwUserDataSize);
- memmove(pmmpd->lpszUserData,lpszUserData,dwUserDataSize);
- pmmpd->dwUserDataSize=dwUserDataSize;
- }
- if (lpszAddreses && dwAddresesSize) MraAddrListGetFromBuff(lpszAddreses,dwAddresesSize,&pmmpd->malAddrList);
- if (pmguidSessionID) memmove(&pmmpd->mguidSessionID,pmguidSessionID,sizeof(MRA_GUID));
-
- SetEvent(pmmpd->hWaitHandle);
-
- dwRetErrorCode=NO_ERROR;
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ if (lpszEMail && dwEMailSize) {
+ mir_free(pmmpd->lpszEMail);
+ pmmpd->lpszEMail = (LPSTR)mir_calloc(dwEMailSize);
+ memmove(pmmpd->lpszEMail, lpszEMail, dwEMailSize);
+ pmmpd->dwEMailSize = dwEMailSize;
+ }
+
+ if (dwIDRequest) pmmpd->dwIDRequest = dwIDRequest;
+ if (dwDataType) pmmpd->dwDataType = dwDataType;
+
+ if (lpszUserData) {
+ mir_free(pmmpd->lpszUserData);
+ pmmpd->lpszUserData = (LPSTR)mir_calloc(dwUserDataSize);
+ memmove(pmmpd->lpszUserData, lpszUserData, dwUserDataSize);
+ pmmpd->dwUserDataSize = dwUserDataSize;
}
-return(dwRetErrorCode);
+
+ if (lpszAddreses && dwAddresesSize)
+ MraAddrListGetFromBuff(lpszAddreses, dwAddresesSize, &pmmpd->malAddrList);
+ if (pmguidSessionID)
+ memmove(&pmmpd->mguidSessionID, pmguidSessionID, sizeof(MRA_GUID));
+
+ SetEvent(pmmpd->hWaitHandle);
+ return 0;
}
-
-
void MraMrimProxyFree(HANDLE hMraMrimProxyData)
{
- if (hMraMrimProxyData)
- {
- MRA_MRIMPROXY_DATA *pmmpd=(MRA_MRIMPROXY_DATA*)hMraMrimProxyData;
+ if (hMraMrimProxyData) {
+ MRA_MRIMPROXY_DATA *pmmpd = (MRA_MRIMPROXY_DATA*)hMraMrimProxyData;
CloseHandle(pmmpd->hWaitHandle);
Netlib_CloseHandle(pmmpd->hConnection);
- MEMFREE(pmmpd->lpszEMail);
- MEMFREE(pmmpd->lpszUserData);
+ mir_free(pmmpd->lpszEMail);
+ mir_free(pmmpd->lpszUserData);
MraAddrListFree(&pmmpd->malAddrList);
- MEMFREE(hMraMrimProxyData);
+ mir_free(hMraMrimProxyData);
}
}
-
void MraMrimProxyCloseConnection(HANDLE hMraMrimProxyData)
{
- if (hMraMrimProxyData)
- {
- MRA_MRIMPROXY_DATA *pmmpd=(MRA_MRIMPROXY_DATA*)hMraMrimProxyData;
-
+ if (hMraMrimProxyData) {
+ MRA_MRIMPROXY_DATA *pmmpd = (MRA_MRIMPROXY_DATA*)hMraMrimProxyData;
SetEvent(pmmpd->hWaitHandle);
Netlib_CloseHandle(pmmpd->hConnection);
}
}
-
-DWORD MraMrimProxyConnect(HANDLE hMraMrimProxyData,HANDLE *phConnection)
+DWORD CMraProto::MraMrimProxyConnect(HANDLE hMraMrimProxyData, HANDLE *phConnection)
{
DWORD dwRetErrorCode;
- if (hMraMrimProxyData && phConnection)
- {
- BOOL bIsHTTPSProxyUsed,bContinue;
+ if (hMraMrimProxyData && phConnection) {
+ BOOL bIsHTTPSProxyUsed, bContinue;
BYTE lpbBufferRcv[BUFF_SIZE_RCV_MIN_FREE];
- DWORD dwBytesReceived,dwConnectReTryCount,dwCurConnectReTryCount;
- SIZE_T dwRcvBuffSize=BUFF_SIZE_RCV_MIN_FREE,dwRcvBuffSizeUsed;
- NETLIBSELECT nls={0};
- MRA_MRIMPROXY_DATA *pmmpd=(MRA_MRIMPROXY_DATA*)hMraMrimProxyData;
- NETLIBOPENCONNECTION nloc={0};
-
-
- if (pmmpd->malAddrList.dwAddrCount)
- {// адреса есть, значит инициаторы не мы
- MraAddrListGetToBuff(&pmmpd->malAddrList,(LPSTR)lpbBufferRcv,SIZEOF(lpbBufferRcv),&dwRcvBuffSizeUsed);
- MraSendCommand_ProxyAck(PROXY_STATUS_OK,pmmpd->lpszEMail,pmmpd->dwEMailSize,pmmpd->dwIDRequest,pmmpd->dwDataType,pmmpd->lpszUserData,pmmpd->dwUserDataSize,(LPSTR)lpbBufferRcv,dwRcvBuffSizeUsed,pmmpd->mguidSessionID);
- }else{// мы инициаторы
- pmmpd->hWaitHandle=CreateEvent(NULL,TRUE,FALSE,NULL);
+ DWORD dwBytesReceived, dwConnectReTryCount, dwCurConnectReTryCount;
+ size_t dwRcvBuffSize = BUFF_SIZE_RCV_MIN_FREE, dwRcvBuffSizeUsed;
+ NETLIBSELECT nls = {0};
+ MRA_MRIMPROXY_DATA *pmmpd = (MRA_MRIMPROXY_DATA*)hMraMrimProxyData;
+ NETLIBOPENCONNECTION nloc = {0};
+
+ // адреса есть, значит инициаторы не мы
+ if (pmmpd->malAddrList.dwAddrCount) {
+ MraAddrListGetToBuff(&pmmpd->malAddrList, (LPSTR)lpbBufferRcv, SIZEOF(lpbBufferRcv), &dwRcvBuffSizeUsed);
+ MraProxyAck(PROXY_STATUS_OK, pmmpd->lpszEMail, pmmpd->dwEMailSize, pmmpd->dwIDRequest, pmmpd->dwDataType, pmmpd->lpszUserData, pmmpd->dwUserDataSize, (LPSTR)lpbBufferRcv, dwRcvBuffSizeUsed, pmmpd->mguidSessionID);
+ }
+ // мы инициаторы
+ else {
+ pmmpd->hWaitHandle = CreateEvent(NULL, TRUE, FALSE, NULL);
if (pmmpd->lpszEMail && pmmpd->dwEMailSize)
- if (MraSendCommand_Proxy(pmmpd->lpszEMail,pmmpd->dwEMailSize,pmmpd->dwIDRequest,pmmpd->dwDataType,pmmpd->lpszUserData,pmmpd->dwUserDataSize,NULL,0,pmmpd->mguidSessionID))
- {
- WaitForSingleObjectEx(pmmpd->hWaitHandle,INFINITE,FALSE);
- }
+ if (MraProxy(pmmpd->lpszEMail, pmmpd->dwEMailSize, pmmpd->dwIDRequest, pmmpd->dwDataType, pmmpd->lpszUserData, pmmpd->dwUserDataSize, NULL, 0, pmmpd->mguidSessionID))
+ WaitForSingleObjectEx(pmmpd->hWaitHandle, INFINITE, FALSE);
+
CloseHandle(pmmpd->hWaitHandle);
- pmmpd->hWaitHandle=NULL;
+ pmmpd->hWaitHandle = NULL;
}
- dwRetErrorCode=ERROR_NO_NETWORK;
- if (pmmpd->malAddrList.dwAddrCount)
- {
- pmmpd->hConnection=NULL;
- bIsHTTPSProxyUsed=IsHTTPSProxyUsed(masMraSettings.hNetlibUser);
- dwConnectReTryCount=DB_Mra_GetDword(NULL,"ConnectReTryCountMRIMProxy",MRA_DEFAULT_CONN_RETRY_COUNT_MRIMPROXY);
- nloc.cbSize=sizeof(nloc);
- nloc.flags=NLOCF_V2;
- nloc.timeout=((MRA_TIMEOUT_DIRECT_CONN-1)/(pmmpd->malAddrList.dwAddrCount*dwConnectReTryCount));// -1 сек чтобы был запас
- if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout=MRA_TIMEOUT_CONN_MIN;
- if (nloc.timeout>MRA_TIMEOUT_CONN_МАХ) nloc.timeout=MRA_TIMEOUT_CONN_МАХ;
-
- for(SIZE_T i=0;(i<pmmpd->malAddrList.dwAddrCount && dwRetErrorCode!=NO_ERROR);i++)
- {// Set up the sockaddr structure
- if ((pmmpd->malAddrList.pmaliAddress[i].dwPort==MRA_SERVER_PORT_HTTPS && bIsHTTPSProxyUsed) || bIsHTTPSProxyUsed==FALSE)
- {// через https прокси только 443 порт
- if (pmmpd->dwDataType==MRIM_PROXY_TYPE_FILES) ProtoBroadcastAck(PROTOCOL_NAMEA,MraHContactFromEmail(pmmpd->lpszEMail,pmmpd->dwEMailSize,FALSE,TRUE,NULL),ACKTYPE_FILE,ACKRESULT_CONNECTING,(HANDLE)pmmpd->dwIDRequest,0);
-
- nloc.szHost=inet_ntoa((*((in_addr*)&pmmpd->malAddrList.pmaliAddress[i].dwAddr)));
- nloc.wPort=(WORD)pmmpd->malAddrList.pmaliAddress[i].dwPort;
-
- dwCurConnectReTryCount=dwConnectReTryCount;
- do{
- pmmpd->hConnection=(HANDLE)CallService(MS_NETLIB_OPENCONNECTION,(WPARAM)masMraSettings.hNetlibUser,(LPARAM)&nloc);
- }while(--dwCurConnectReTryCount && pmmpd->hConnection==NULL);
-
- if (pmmpd->hConnection)
- {
- nls.cbSize=sizeof(nls);
- nls.dwTimeout=(MRA_TIMEOUT_DIRECT_CONN*1000*2);
- nls.hReadConns[0]=pmmpd->hConnection;
- bContinue=TRUE;
- dwRcvBuffSizeUsed=0;
-
- if (pmmpd->dwDataType==MRIM_PROXY_TYPE_FILES) ProtoBroadcastAck(PROTOCOL_NAMEA,MraHContactFromEmail(pmmpd->lpszEMail,pmmpd->dwEMailSize,FALSE,TRUE,NULL),ACKTYPE_FILE,ACKRESULT_CONNECTED,(HANDLE)pmmpd->dwIDRequest,0);
- MraSendPacket(nls.hReadConns[0],0,MRIM_CS_PROXY_HELLO,&pmmpd->mguidSessionID,sizeof(MRA_GUID));
+ dwRetErrorCode = ERROR_NO_NETWORK;
+ if (pmmpd->malAddrList.dwAddrCount) {
+ pmmpd->hConnection = NULL;
+ bIsHTTPSProxyUsed = IsHTTPSProxyUsed(hNetlibUser);
+ dwConnectReTryCount = mraGetDword(NULL, "ConnectReTryCountMRIMProxy", MRA_DEFAULT_CONN_RETRY_COUNT_MRIMPROXY);
+ nloc.cbSize = sizeof(nloc);
+ nloc.flags = NLOCF_V2;
+ nloc.timeout = ((MRA_TIMEOUT_DIRECT_CONN-1)/(pmmpd->malAddrList.dwAddrCount*dwConnectReTryCount));// -1 сек чтобы был запас
+ if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout = MRA_TIMEOUT_CONN_MIN;
+ if (nloc.timeout>MRA_TIMEOUT_CONN_МАХ) nloc.timeout = MRA_TIMEOUT_CONN_МАХ;
+
+ // Set up the sockaddr structure
+ for (size_t i = 0; i < pmmpd->malAddrList.dwAddrCount && dwRetErrorCode != NO_ERROR; i++) {
+ // через https прокси только 443 порт
+ if ((pmmpd->malAddrList.pmaliAddress[i].dwPort == MRA_SERVER_PORT_HTTPS && bIsHTTPSProxyUsed) || bIsHTTPSProxyUsed == FALSE) {
+ if (pmmpd->dwDataType == MRIM_PROXY_TYPE_FILES)
+ ProtoBroadcastAck(m_szModuleName, MraHContactFromEmail(pmmpd->lpszEMail, pmmpd->dwEMailSize, FALSE, TRUE, NULL), ACKTYPE_FILE, ACKRESULT_CONNECTING, (HANDLE)pmmpd->dwIDRequest, 0);
+
+ nloc.szHost = inet_ntoa((*((in_addr*)&pmmpd->malAddrList.pmaliAddress[i].dwAddr)));
+ nloc.wPort = (WORD)pmmpd->malAddrList.pmaliAddress[i].dwPort;
+
+ dwCurConnectReTryCount = dwConnectReTryCount;
+ do {
+ pmmpd->hConnection = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)hNetlibUser, (LPARAM)&nloc);
+ }
+ while(--dwCurConnectReTryCount && pmmpd->hConnection == NULL);
+
+ if (pmmpd->hConnection) {
+ nls.cbSize = sizeof(nls);
+ nls.dwTimeout = (MRA_TIMEOUT_DIRECT_CONN*1000*2);
+ nls.hReadConns[0] = pmmpd->hConnection;
+ bContinue = TRUE;
+ dwRcvBuffSizeUsed = 0;
+
+ if (pmmpd->dwDataType == MRIM_PROXY_TYPE_FILES)
+ ProtoBroadcastAck(m_szModuleName, MraHContactFromEmail(pmmpd->lpszEMail, pmmpd->dwEMailSize, FALSE, TRUE, NULL), ACKTYPE_FILE, ACKRESULT_CONNECTED, (HANDLE)pmmpd->dwIDRequest, 0);
+ MraSendPacket(nls.hReadConns[0], 0, MRIM_CS_PROXY_HELLO, &pmmpd->mguidSessionID, sizeof(MRA_GUID));
- while(bContinue)
- {
- switch(CallService(MS_NETLIB_SELECT,0,(LPARAM)&nls)) {
+ while(bContinue) {
+ switch (CallService(MS_NETLIB_SELECT, 0, (LPARAM)&nls)) {
case SOCKET_ERROR:
case 0:// Time out
- dwRetErrorCode=GetLastError();
- ShowFormatedErrorMessage(L"Disconnected, socket error",dwRetErrorCode);
- bContinue=FALSE;
+ dwRetErrorCode = GetLastError();
+ ShowFormattedErrorMessage(L"Disconnected, socket error", dwRetErrorCode);
+ bContinue = FALSE;
break;
+
case 1:
- if (dwRcvBuffSizeUsed==BUFF_SIZE_RCV_MIN_FREE)
- {// bad packet
- bContinue=FALSE;
+ if (dwRcvBuffSizeUsed == BUFF_SIZE_RCV_MIN_FREE) { // bad packet
+ bContinue = FALSE;
DebugBreak();
- }else{
- dwBytesReceived=Netlib_Recv(nls.hReadConns[0],(LPSTR)(lpbBufferRcv+dwRcvBuffSizeUsed),(dwRcvBuffSize-dwRcvBuffSizeUsed),0);
- if (dwBytesReceived && dwBytesReceived!=SOCKET_ERROR)
- {// connected
- dwRcvBuffSizeUsed+=dwBytesReceived;
- if (dwRcvBuffSizeUsed>=sizeof(mrim_packet_header_t))
- {// packet header received
- if (((mrim_packet_header_t*)lpbBufferRcv)->magic==CS_MAGIC)
- {// packet OK
- if ((dwRcvBuffSizeUsed-sizeof(mrim_packet_header_t))>=((mrim_packet_header_t*)lpbBufferRcv)->dlen)
- {// full packet received, may be more than one
- if (((mrim_packet_header_t*)lpbBufferRcv)->msg=MRIM_CS_PROXY_HELLO_ACK)
- {// connect OK!
- dwRetErrorCode=NO_ERROR;
- }else{// bad/wrong
+ }
+ else {
+ dwBytesReceived = Netlib_Recv(nls.hReadConns[0], (LPSTR)(lpbBufferRcv+dwRcvBuffSizeUsed), (dwRcvBuffSize-dwRcvBuffSizeUsed), 0);
+ if (dwBytesReceived && dwBytesReceived != SOCKET_ERROR) { // connected
+ dwRcvBuffSizeUsed += dwBytesReceived;
+ if (dwRcvBuffSizeUsed >= sizeof(mrim_packet_header_t)) { // packet header received
+ if (((mrim_packet_header_t*)lpbBufferRcv)->magic == CS_MAGIC) { // packet OK
+ if ((dwRcvBuffSizeUsed-sizeof(mrim_packet_header_t)) >= ((mrim_packet_header_t*)lpbBufferRcv)->dlen) { // full packet received, may be more than one
+ if (((mrim_packet_header_t*)lpbBufferRcv)->msg == MRIM_CS_PROXY_HELLO_ACK) // connect OK!
+ dwRetErrorCode = NO_ERROR;
+ else // bad/wrong
DebugBreak();
- }
- bContinue=FALSE;
- }else{// not all packet received, continue receiving
- DebugPrintCRLF(L"Not all packet received, continue receiving");
+
+ bContinue = FALSE;
}
- }else{// bad packet
+ else // not all packet received, continue receiving
+ DebugPrintCRLF(L"Not all packet received, continue receiving");
+ }
+ else { // bad packet
DebugPrintCRLF(L"Bad packet");
DebugBreak();
- bContinue=FALSE;
+ bContinue = FALSE;
}
- }else{// packet to small, continue receiving
- DebugPrintCRLF(L"Packet to small, continue receiving");
}
- }else{// disconnected
- dwRetErrorCode=GetLastError();
- ShowFormatedErrorMessage(L"Disconnected, socket read error",dwRetErrorCode);
- bContinue=FALSE;
+ else // packet too small, continue receiving
+ DebugPrintCRLF(L"Packet to small, continue receiving");
+ }
+ else { // disconnected
+ dwRetErrorCode = GetLastError();
+ ShowFormattedErrorMessage(L"Disconnected, socket read error", dwRetErrorCode);
+ bContinue = FALSE;
}
}
break;
}// end switch
}// end while
- }else{// cant connect
- dwRetErrorCode=GetLastError();
}
+ else dwRetErrorCode = GetLastError();
}// filtered
}// end for
-
- if (dwRetErrorCode!=NO_ERROR)
- {// кажется не туда подключились :)
+ if (dwRetErrorCode != NO_ERROR) { // кажется не туда подключились :)
Netlib_CloseHandle(pmmpd->hConnection);
- pmmpd->hConnection=NULL;
+ pmmpd->hConnection = NULL;
}
}
- (*phConnection)=pmmpd->hConnection;
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ *phConnection = pmmpd->hConnection;
}
-return(dwRetErrorCode);
+ else dwRetErrorCode = ERROR_INVALID_HANDLE;
+ return dwRetErrorCode;
}
-
-
-
-
-
-
diff --git a/protocols/MRA/MraMRIMProxy.h b/protocols/MRA/MraMRIMProxy.h
index f0c2f70880..c0051daec9 100644
--- a/protocols/MRA/MraMRIMProxy.h
+++ b/protocols/MRA/MraMRIMProxy.h
@@ -6,16 +6,10 @@
#pragma once
#endif // _MSC_VER > 1000
+DWORD MraMrimProxySetData(HANDLE hMraMrimProxyData, LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIDRequest, DWORD dwDataType, LPSTR lpszUserData, size_t dwUserDataSize, LPSTR lpszAddreses, size_t dwAddresesSize, MRA_GUID *pmguidSessionID);
-
-
-
-HANDLE MraMrimProxyCreate ();
-DWORD MraMrimProxySetData (HANDLE hMraMrimProxyData,LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwIDRequest,DWORD dwDataType,LPSTR lpszUserData,SIZE_T dwUserDataSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize,MRA_GUID *pmguidSessionID);
-void MraMrimProxyFree (HANDLE hMraMrimProxyData);
-void MraMrimProxyCloseConnection (HANDLE hMraMrimProxyData);
-DWORD MraMrimProxyConnect (HANDLE hMraMrimProxyData,HANDLE *phConnection);
-
-
+HANDLE MraMrimProxyCreate();
+void MraMrimProxyFree(HANDLE hMraMrimProxyData);
+void MraMrimProxyCloseConnection(HANDLE hMraMrimProxyData);
#endif // !defined(AFX_MRA_MRIMPROXY_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraOfflineMsg.cpp b/protocols/MRA/MraOfflineMsg.cpp
index 514e34af30..abf7bf45d2 100644
--- a/protocols/MRA/MraOfflineMsg.cpp
+++ b/protocols/MRA/MraOfflineMsg.cpp
@@ -9,245 +9,245 @@
#define CRLFCRLF "\r\n\r\n"
-DWORD MraOfflineMessageGetMIMEHeadAndBody (LPSTR lpszMessage,SIZE_T dwMessageSize,LPSTR *plpszHeader,SIZE_T *pdwHeaderSize,LPSTR *plpszBody,SIZE_T *pdwBodySize);
-DWORD MraOfflineMessageGetNextMIMEPart (LPSTR lpszBody,SIZE_T dwBodySize,LPSTR lpszBoundary,SIZE_T dwBoundarySize,LPSTR *plpszCurMIMEPos,LPSTR *plpszMIMEPart,SIZE_T *pdwMIMEPartSize);
-DWORD MraOfflineMessageGetHeaderValue (LPSTR lpszHeader,LPSTR lpszHeaderLow,SIZE_T dwHeaderSize,LPSTR lpszValueName,SIZE_T dwValueNameSize,LPSTR *plpszValue,SIZE_T *pdwValueSize);
-DWORD MraOfflineMessageGetHeaderValueLow (LPSTR lpszHeaderLow,SIZE_T dwHeaderSize,LPSTR lpszValueName,SIZE_T dwValueNameSize,LPSTR *plpszValue,SIZE_T *pdwValueSize);
+DWORD MraOfflineMessageGetMIMEHeadAndBody (LPSTR lpszMessage, size_t dwMessageSize, LPSTR *plpszHeader, size_t *pdwHeaderSize, LPSTR *plpszBody, size_t *pdwBodySize);
+DWORD MraOfflineMessageGetNextMIMEPart (LPSTR lpszBody, size_t dwBodySize, LPSTR lpszBoundary, size_t dwBoundarySize, LPSTR *plpszCurMIMEPos, LPSTR *plpszMIMEPart, size_t *pdwMIMEPartSize);
+DWORD MraOfflineMessageGetHeaderValue (LPSTR lpszHeader, LPSTR lpszHeaderLow, size_t dwHeaderSize, LPSTR lpszValueName, size_t dwValueNameSize, LPSTR *plpszValue, size_t *pdwValueSize);
+DWORD MraOfflineMessageGetHeaderValueLow (LPSTR lpszHeaderLow, size_t dwHeaderSize, LPSTR lpszValueName, size_t dwValueNameSize, LPSTR *plpszValue, size_t *pdwValueSize);
DWORD MraOfflineMessageConvertTime (INTERNET_TIME *pitTime);
-DWORD MraOfflineMessageGet(MRA_LPS *plpsMsg,DWORD *pdwTime,DWORD *pdwFlags,MRA_LPS *plpsEMail,MRA_LPS *plpsText,MRA_LPS *plpsRTFText,MRA_LPS *plpsMultiChatData,LPBYTE *plpbBuff)
+DWORD MraOfflineMessageGet(MRA_LPS *plpsMsg, DWORD *pdwTime, DWORD *pdwFlags, MRA_LPS *plpsEMail, MRA_LPS *plpsText, MRA_LPS *plpsRTFText, MRA_LPS *plpsMultiChatData, LPBYTE *plpbBuff)
{// Сообщение
- DWORD dwRetErrorCode=ERROR_INVALID_HANDLE;
+ DWORD dwRetErrorCode = ERROR_INVALID_HANDLE;
if (plpsMsg)
if (plpsMsg->lpszData && plpsMsg->dwSize)
{
- LPSTR lpszHeader,lpszHeaderLow,lpszBody,lpszContentTypeLow,lpszTemp;
- SIZE_T dwHeaderSize,dwBodySize,dwContentTypeSize,dwTempSize;
+ LPSTR lpszHeader, lpszHeaderLow, lpszBody, lpszContentTypeLow, lpszTemp;
+ size_t dwHeaderSize, dwBodySize, dwContentTypeSize, dwTempSize;
DWORD dwMultichatType;
#ifdef _DEBUG
DebugPrintCRLFA(plpsMsg->lpszData);
#endif
- if (MraOfflineMessageGetMIMEHeadAndBody(plpsMsg->lpszData,plpsMsg->dwSize,&lpszHeader,&dwHeaderSize,&lpszBody,&dwBodySize)==NO_ERROR)
+ if (MraOfflineMessageGetMIMEHeadAndBody(plpsMsg->lpszData, plpsMsg->dwSize, &lpszHeader, &dwHeaderSize, &lpszBody, &dwBodySize) == NO_ERROR)
{
- lpszHeaderLow=(LPSTR)MEMALLOC(dwHeaderSize);
- if (lpszHeaderLow) BuffToLowerCase(lpszHeaderLow,lpszHeader,dwHeaderSize);
+ lpszHeaderLow = (LPSTR)mir_calloc(dwHeaderSize);
+ if (lpszHeaderLow) BuffToLowerCase(lpszHeaderLow, lpszHeader, dwHeaderSize);
if (pdwTime)
- if (MraOfflineMessageGetHeaderValue(lpszHeader,lpszHeaderLow,dwHeaderSize,"date",4,&lpszTemp,&dwTempSize)==NO_ERROR)
+ if (MraOfflineMessageGetHeaderValue(lpszHeader, lpszHeaderLow, dwHeaderSize, "date", 4, &lpszTemp, &dwTempSize) == NO_ERROR)
{
INTERNET_TIME itTime;
- InternetTimeGetTime(lpszTemp,dwTempSize,&itTime);
- (*pdwTime)=MraOfflineMessageConvertTime(&itTime);
- }else{
- (*pdwTime)=0;
+ InternetTimeGetTime(lpszTemp, dwTempSize, &itTime);
+ (*pdwTime) = MraOfflineMessageConvertTime(&itTime);
+ }else {
+ (*pdwTime) = 0;
}
if (pdwFlags)
- if (MraOfflineMessageGetHeaderValue(lpszHeader,lpszHeaderLow,dwHeaderSize,"x-mrim-flags",12,&lpszTemp,&dwTempSize)==NO_ERROR)
+ if (MraOfflineMessageGetHeaderValue(lpszHeader, lpszHeaderLow, dwHeaderSize, "x-mrim-flags", 12, &lpszTemp, &dwTempSize) == NO_ERROR)
{
- (*pdwFlags)=StrHexToUNum32(lpszTemp,dwTempSize);
- }else{
- (*pdwFlags)=0;
+ (*pdwFlags) = StrHexToUNum32(lpszTemp, dwTempSize);
+ }else {
+ (*pdwFlags) = 0;
}
- if (MraOfflineMessageGetHeaderValue(lpszHeader,lpszHeaderLow,dwHeaderSize,"x-mrim-multichat-type",21,&lpszTemp,&dwTempSize)==NO_ERROR)
+ if (MraOfflineMessageGetHeaderValue(lpszHeader, lpszHeaderLow, dwHeaderSize, "x-mrim-multichat-type", 21, &lpszTemp, &dwTempSize) == NO_ERROR)
{
- dwMultichatType=StrHexToUNum32(lpszTemp,dwTempSize);
- }else{
- dwMultichatType=0;
+ dwMultichatType = StrHexToUNum32(lpszTemp, dwTempSize);
+ }else {
+ dwMultichatType = 0;
}
if (plpsEMail)
- if (MraOfflineMessageGetHeaderValue(lpszHeader,lpszHeaderLow,dwHeaderSize,"from",4,&plpsEMail->lpszData,&plpsEMail->dwSize)!=NO_ERROR)
+ if (MraOfflineMessageGetHeaderValue(lpszHeader, lpszHeaderLow, dwHeaderSize, "from", 4, &plpsEMail->lpszData, &plpsEMail->dwSize) != NO_ERROR)
{
- plpsEMail->lpszData=NULL;
- plpsEMail->dwSize=0;
+ plpsEMail->lpszData = NULL;
+ plpsEMail->dwSize = 0;
}
if (plpsText)
{
- plpsText->lpszData=NULL;
- plpsText->dwSize=0;
+ plpsText->lpszData = NULL;
+ plpsText->dwSize = 0;
}
if (plpsRTFText)
{
- plpsRTFText->lpszData=NULL;
- plpsRTFText->dwSize=0;
+ plpsRTFText->lpszData = NULL;
+ plpsRTFText->dwSize = 0;
}
if (plpsMultiChatData)
{
- plpsMultiChatData->lpszData=NULL;
- plpsMultiChatData->dwSize=0;
+ plpsMultiChatData->lpszData = NULL;
+ plpsMultiChatData->dwSize = 0;
}
- if (plpbBuff) (*plpbBuff)=NULL;
+ if (plpbBuff) (*plpbBuff) = NULL;
if (plpsText || plpsRTFText)
- if (MraOfflineMessageGetHeaderValueLow(lpszHeaderLow,dwHeaderSize,"content-type",12,&lpszContentTypeLow,&dwContentTypeSize)==NO_ERROR)
+ if (MraOfflineMessageGetHeaderValueLow(lpszHeaderLow, dwHeaderSize, "content-type", 12, &lpszContentTypeLow, &dwContentTypeSize) == NO_ERROR)
{
- if (MemoryFind(0,lpszContentTypeLow,dwContentTypeSize,"multipart/alternative",21))
- {// Content-Type: multipart/alternative; boundary=1217508709J3777283291217508709T31197726
- LPSTR lpszBoundary,lpszMIMEPart,lpszCurMIMEPos,lpszMIMEHeader,lpszMIMEHeaderLow,lpszMIMEBody,lpszMIMEContentType;
- SIZE_T i,dwBoundarySize,dwMIMEPartSize,dwMIMEHeaderSize,dwMIMEBodySize,dwMIMEContentTypeSize;
+ if (MemoryFind(0, lpszContentTypeLow, dwContentTypeSize, "multipart/alternative", 21))
+ {// Content-Type: multipart/alternative; boundary = 1217508709J3777283291217508709T31197726
+ LPSTR lpszBoundary, lpszMIMEPart, lpszCurMIMEPos, lpszMIMEHeader, lpszMIMEHeaderLow, lpszMIMEBody, lpszMIMEContentType;
+ size_t i, dwBoundarySize, dwMIMEPartSize, dwMIMEHeaderSize, dwMIMEBodySize, dwMIMEContentTypeSize;
- lpszBoundary=(LPSTR)MemoryFind(0,lpszContentTypeLow,dwContentTypeSize,"boundary=",9);
+ lpszBoundary = (LPSTR)MemoryFind(0, lpszContentTypeLow, dwContentTypeSize, "boundary = ", 9);
if (lpszBoundary)
{
- dwBoundarySize=((dwContentTypeSize-(lpszBoundary-lpszContentTypeLow))-9);
- lpszBoundary=(lpszHeader+((lpszBoundary+9)-lpszHeaderLow));
+ dwBoundarySize = ((dwContentTypeSize-(lpszBoundary-lpszContentTypeLow))-9);
+ lpszBoundary = (lpszHeader+((lpszBoundary+9)-lpszHeaderLow));
- i=0;
- lpszCurMIMEPos=lpszBody;
- while(MraOfflineMessageGetNextMIMEPart(lpszBody,dwBodySize,lpszBoundary,dwBoundarySize,&lpszCurMIMEPos,&lpszMIMEPart,&dwMIMEPartSize)==NO_ERROR)
+ i = 0;
+ lpszCurMIMEPos = lpszBody;
+ while(MraOfflineMessageGetNextMIMEPart(lpszBody, dwBodySize, lpszBoundary, dwBoundarySize, &lpszCurMIMEPos, &lpszMIMEPart, &dwMIMEPartSize) == NO_ERROR)
{
- if (MraOfflineMessageGetMIMEHeadAndBody(lpszMIMEPart,dwMIMEPartSize,&lpszMIMEHeader,&dwMIMEHeaderSize,&lpszMIMEBody,&dwMIMEBodySize)==NO_ERROR)
+ if (MraOfflineMessageGetMIMEHeadAndBody(lpszMIMEPart, dwMIMEPartSize, &lpszMIMEHeader, &dwMIMEHeaderSize, &lpszMIMEBody, &dwMIMEBodySize) == NO_ERROR)
{
- lpszMIMEHeaderLow=(LPSTR)MEMALLOC(dwMIMEHeaderSize);
+ lpszMIMEHeaderLow = (LPSTR)mir_calloc(dwMIMEHeaderSize);
if (lpszMIMEHeaderLow)
{
- BuffToLowerCase(lpszMIMEHeaderLow,lpszMIMEHeader,dwMIMEHeaderSize);
- if (MraOfflineMessageGetHeaderValueLow(lpszMIMEHeaderLow,dwMIMEHeaderSize,"content-type",12,&lpszMIMEContentType,&dwMIMEContentTypeSize)==NO_ERROR)
+ BuffToLowerCase(lpszMIMEHeaderLow, lpszMIMEHeader, dwMIMEHeaderSize);
+ if (MraOfflineMessageGetHeaderValueLow(lpszMIMEHeaderLow, dwMIMEHeaderSize, "content-type", 12, &lpszMIMEContentType, &dwMIMEContentTypeSize) == NO_ERROR)
{
- if (MemoryFind(0,lpszMIMEContentType,dwMIMEContentTypeSize,"text/plain",10))
+ if (MemoryFind(0, lpszMIMEContentType, dwMIMEContentTypeSize, "text/plain", 10))
{// this is simple text part: text/plain
if (plpsText)
{
- if (MemoryFind(0,lpszMIMEContentType,dwMIMEContentTypeSize,"utf-16le",8))
- {// charset=UTF-16LE// предполагаем что оно в base64
+ if (MemoryFind(0, lpszMIMEContentType, dwMIMEContentTypeSize, "utf-16le", 8))
+ {// charset = UTF-16LE// предполагаем что оно в base64
if (plpbBuff)
{// буффер для декодирования текста можно выделять
LPWSTR lpwszText;
- SIZE_T dwTextSize;
+ size_t dwTextSize;
- lpwszText=(LPWSTR)MEMALLOC(dwMIMEBodySize);
+ lpwszText = (LPWSTR)mir_calloc(dwMIMEBodySize);
if (lpwszText)
{
- BASE64DecodeFormated(lpszMIMEBody,dwMIMEBodySize,lpwszText,dwMIMEBodySize,&dwTextSize);
- plpsText->lpwszData=lpwszText;
- plpsText->dwSize=dwTextSize;
+ BASE64DecodeFormated(lpszMIMEBody, dwMIMEBodySize, lpwszText, dwMIMEBodySize, &dwTextSize);
+ plpsText->lpwszData = lpwszText;
+ plpsText->dwSize = dwTextSize;
if (pdwFlags)
{
- (*pdwFlags)|=MESSAGE_FLAG_v1p16; // set unocode flag if not exist
- (*pdwFlags)&=~MESSAGE_FLAG_CP1251; // reset ansi flag if exist
+ (*pdwFlags) |= MESSAGE_FLAG_v1p16; // set unocode flag if not exist
+ (*pdwFlags) &= ~MESSAGE_FLAG_CP1251; // reset ansi flag if exist
}
- (*plpbBuff)=(LPBYTE)lpwszText;
- dwRetErrorCode=NO_ERROR;
+ (*plpbBuff) = (LPBYTE)lpwszText;
+ dwRetErrorCode = NO_ERROR;
}
}
}else
- if (MemoryFind(0,lpszMIMEContentType,dwMIMEContentTypeSize,"cp-1251",7))
- {// charset=CP-1251
- plpsText->lpszData=lpszMIMEBody;
- plpsText->dwSize=dwMIMEBodySize;
+ if (MemoryFind(0, lpszMIMEContentType, dwMIMEContentTypeSize, "cp-1251", 7))
+ {// charset = CP-1251
+ plpsText->lpszData = lpszMIMEBody;
+ plpsText->dwSize = dwMIMEBodySize;
if (pdwFlags)
{
- (*pdwFlags)&=~MESSAGE_FLAG_v1p16; // reset unocode flag if exist
- (*pdwFlags)|=MESSAGE_FLAG_CP1251; // set ansi flag
+ (*pdwFlags) &= ~MESSAGE_FLAG_v1p16; // reset unocode flag if exist
+ (*pdwFlags) |= MESSAGE_FLAG_CP1251; // set ansi flag
}
- dwRetErrorCode=NO_ERROR;
- }else{
+ dwRetErrorCode = NO_ERROR;
+ }else {
DebugBreak();
}
}
}else
- if (MemoryFind(0,lpszMIMEContentType,dwMIMEContentTypeSize,"application/x-mrim-rtf",22))
+ if (MemoryFind(0, lpszMIMEContentType, dwMIMEContentTypeSize, "application/x-mrim-rtf", 22))
{
if (plpsRTFText)
{
- plpsRTFText->lpszData=lpszMIMEBody;
- plpsRTFText->dwSize=dwMIMEBodySize;
- if (pdwFlags) (*pdwFlags)|=MESSAGE_FLAG_RTF; // set RTF flag if not exist
- dwRetErrorCode=NO_ERROR;
+ plpsRTFText->lpszData = lpszMIMEBody;
+ plpsRTFText->dwSize = dwMIMEBodySize;
+ if (pdwFlags) (*pdwFlags) |= MESSAGE_FLAG_RTF; // set RTF flag if not exist
+ dwRetErrorCode = NO_ERROR;
}
}else
- if (MemoryFind(0,lpszMIMEContentType,dwMIMEContentTypeSize,"application/x-mrim+xml",22))
+ if (MemoryFind(0, lpszMIMEContentType, dwMIMEContentTypeSize, "application/x-mrim+xml", 22))
{
if (plpsMultiChatData)
{
- plpsMultiChatData->lpszData=lpszMIMEBody;
- plpsMultiChatData->dwSize=dwMIMEBodySize;
- if (pdwFlags) (*pdwFlags)|=MESSAGE_FLAG_MULTICHAT; // set MESSAGE_FLAG_MULTICHAT flag if not exist
- dwRetErrorCode=NO_ERROR;
+ plpsMultiChatData->lpszData = lpszMIMEBody;
+ plpsMultiChatData->dwSize = dwMIMEBodySize;
+ if (pdwFlags) (*pdwFlags) |= MESSAGE_FLAG_MULTICHAT; // set MESSAGE_FLAG_MULTICHAT flag if not exist
+ dwRetErrorCode = NO_ERROR;
}
- }else{
+ }else {
DebugBreak();
}
}
- MEMFREE(lpszMIMEHeaderLow);
+ mir_free(lpszMIMEHeaderLow);
}
}
i++;
}
- DebugBreakIf((i>3 || i==0));
- }else{// boundary not found
+ DebugBreakIf((i>3 || i == 0));
+ }else {// boundary not found
DebugBreak();
}
}else
- if (MemoryFind(0,lpszContentTypeLow,dwContentTypeSize,"text/plain",10))
- {// Content-Type: text/plain; charset=CP-1251
- if (MemoryFind(0,lpszContentTypeLow,dwContentTypeSize,"utf-16le",8))
- {// charset=UTF-16LE// предполагаем что оно в base64
+ if (MemoryFind(0, lpszContentTypeLow, dwContentTypeSize, "text/plain", 10))
+ {// Content-Type: text/plain; charset = CP-1251
+ if (MemoryFind(0, lpszContentTypeLow, dwContentTypeSize, "utf-16le", 8))
+ {// charset = UTF-16LE// предполагаем что оно в base64
if (plpbBuff)
{// буффер для декодирования текста можно выделять
LPWSTR lpwszText;
- SIZE_T dwTextSize;
+ size_t dwTextSize;
- lpwszText=(LPWSTR)MEMALLOC(dwBodySize);
+ lpwszText = (LPWSTR)mir_calloc(dwBodySize);
if (lpwszText)
{
- BASE64DecodeFormated(lpszBody,dwBodySize,lpwszText,dwBodySize,&dwTextSize);
- plpsText->lpwszData=lpwszText;
- plpsText->dwSize=dwTextSize;
+ BASE64DecodeFormated(lpszBody, dwBodySize, lpwszText, dwBodySize, &dwTextSize);
+ plpsText->lpwszData = lpwszText;
+ plpsText->dwSize = dwTextSize;
if (pdwFlags)
{
- (*pdwFlags)|=MESSAGE_FLAG_v1p16; // set unocode flag if not exist
- (*pdwFlags)&=~MESSAGE_FLAG_CP1251; // reset ansi flag if exist
+ (*pdwFlags) |= MESSAGE_FLAG_v1p16; // set unocode flag if not exist
+ (*pdwFlags) &= ~MESSAGE_FLAG_CP1251; // reset ansi flag if exist
}
- (*plpbBuff)=(LPBYTE)lpwszText;
- dwRetErrorCode=NO_ERROR;
+ (*plpbBuff) = (LPBYTE)lpwszText;
+ dwRetErrorCode = NO_ERROR;
}
}
}else
- if (MemoryFind(0,lpszContentTypeLow,dwContentTypeSize,"cp-1251",7))
- {// charset=CP-1251
- plpsText->lpszData=lpszBody;
- plpsText->dwSize=dwBodySize;
+ if (MemoryFind(0, lpszContentTypeLow, dwContentTypeSize, "cp-1251", 7))
+ {// charset = CP-1251
+ plpsText->lpszData = lpszBody;
+ plpsText->dwSize = dwBodySize;
if (pdwFlags)
{
- (*pdwFlags)&=~MESSAGE_FLAG_v1p16; // reset unocode flag if exist
- (*pdwFlags)|=MESSAGE_FLAG_CP1251; // set ansi flag
+ (*pdwFlags) &= ~MESSAGE_FLAG_v1p16; // reset unocode flag if exist
+ (*pdwFlags) |= MESSAGE_FLAG_CP1251; // set ansi flag
}
- dwRetErrorCode=NO_ERROR;
- }else{
+ dwRetErrorCode = NO_ERROR;
+ }else {
DebugBreak();
}
}else
- if (MemoryFind(0,lpszContentTypeLow,dwContentTypeSize,"application/x-mrim-auth-req",27))
+ if (MemoryFind(0, lpszContentTypeLow, dwContentTypeSize, "application/x-mrim-auth-req", 27))
{// Content-Type: application/x-mrim-auth-req
if (plpsText)
{
- plpsText->lpszData=lpszBody;
- plpsText->dwSize=dwBodySize;
+ plpsText->lpszData = lpszBody;
+ plpsText->dwSize = dwBodySize;
}
- dwRetErrorCode=NO_ERROR;
- }else{
+ dwRetErrorCode = NO_ERROR;
+ }else {
DebugBreak();
}
- }else{
+ }else {
DebugBreak();
}
- MEMFREE(lpszHeaderLow);
+ mir_free(lpszHeaderLow);
}
}
@@ -255,156 +255,156 @@ return(dwRetErrorCode);
}
-DWORD MraOfflineMessageGetMIMEHeadAndBody(LPSTR lpszMessage,SIZE_T dwMessageSize,LPSTR *plpszHeader,SIZE_T *pdwHeaderSize,LPSTR *plpszBody,SIZE_T *pdwBodySize)
+DWORD MraOfflineMessageGetMIMEHeadAndBody(LPSTR lpszMessage, size_t dwMessageSize, LPSTR *plpszHeader, size_t *pdwHeaderSize, LPSTR *plpszBody, size_t *pdwBodySize)
{
- DWORD dwRetErrorCode=ERROR_NOT_FOUND;
+ DWORD dwRetErrorCode = ERROR_NOT_FOUND;
if (lpszMessage && dwMessageSize)
{
LPSTR lpszBody;
- SIZE_T dwBodySize;
+ size_t dwBodySize;
// затычка: майл не придерживается RFC и вместо CRLFCRLF ставит LFLF в MIME частях, иногда ставит
- lpszBody=(LPSTR)MemoryFind(0,lpszMessage,dwMessageSize,CRLFCRLF,(sizeof(CRLFCRLF)-1));
+ lpszBody = (LPSTR)MemoryFind(0, lpszMessage, dwMessageSize, CRLFCRLF, (sizeof(CRLFCRLF)-1));
if (lpszBody)
{
- lpszBody+=(sizeof(CRLFCRLF)-1);
- }else{
- lpszBody=(LPSTR)MemoryFind(0,lpszMessage,dwMessageSize,LFLF,(sizeof(LFLF)-1));
- if (lpszBody) lpszBody+=(sizeof(LFLF)-1);
+ lpszBody += (sizeof(CRLFCRLF)-1);
+ }else {
+ lpszBody = (LPSTR)MemoryFind(0, lpszMessage, dwMessageSize, LFLF, (sizeof(LFLF)-1));
+ if (lpszBody) lpszBody += (sizeof(LFLF)-1);
}
if (lpszBody)
{// нашли начало контента миме части
- dwBodySize=(dwMessageSize-(lpszBody-lpszMessage));
+ dwBodySize = (dwMessageSize-(lpszBody-lpszMessage));
- if (plpszHeader) (*plpszHeader)=lpszMessage;
- if (pdwHeaderSize) (*pdwHeaderSize)=((lpszBody-(sizeof(LFLF)-1))-lpszMessage);
- if (plpszBody) (*plpszBody)=lpszBody;
- if (pdwBodySize) (*pdwBodySize)=dwBodySize;
+ if (plpszHeader) (*plpszHeader) = lpszMessage;
+ if (pdwHeaderSize) (*pdwHeaderSize) = ((lpszBody-(sizeof(LFLF)-1))-lpszMessage);
+ if (plpszBody) (*plpszBody) = lpszBody;
+ if (pdwBodySize) (*pdwBodySize) = dwBodySize;
- dwRetErrorCode=NO_ERROR;
+ dwRetErrorCode = NO_ERROR;
}
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }else {
+ dwRetErrorCode = ERROR_INVALID_HANDLE;
}
return(dwRetErrorCode);
}
-DWORD MraOfflineMessageGetNextMIMEPart(LPSTR lpszBody,SIZE_T dwBodySize,LPSTR lpszBoundary,SIZE_T dwBoundarySize,LPSTR *plpszCurMIMEPos,LPSTR *plpszMIMEPart,SIZE_T *pdwMIMEPartSize)
+DWORD MraOfflineMessageGetNextMIMEPart(LPSTR lpszBody, size_t dwBodySize, LPSTR lpszBoundary, size_t dwBoundarySize, LPSTR *plpszCurMIMEPos, LPSTR *plpszMIMEPart, size_t *pdwMIMEPartSize)
{
- DWORD dwRetErrorCode=ERROR_NOT_FOUND;
+ DWORD dwRetErrorCode = ERROR_NOT_FOUND;
if (lpszBody && dwBodySize)
{
- LPSTR lpszMIMEPart,lpszCurMIMEPos,lpszTemp;
- SIZE_T dwMIMEPartSize;
+ LPSTR lpszMIMEPart, lpszCurMIMEPos, lpszTemp;
+ size_t dwMIMEPartSize;
- if (plpszCurMIMEPos) lpszCurMIMEPos=(*plpszCurMIMEPos);
- lpszMIMEPart=(LPSTR)MemoryFind((lpszCurMIMEPos-lpszBody),lpszBody,dwBodySize,lpszBoundary,dwBoundarySize);
+ if (plpszCurMIMEPos) lpszCurMIMEPos = (*plpszCurMIMEPos);
+ lpszMIMEPart = (LPSTR)MemoryFind((lpszCurMIMEPos-lpszBody), lpszBody, dwBodySize, lpszBoundary, dwBoundarySize);
if (lpszMIMEPart)
{// первая миме часть
- lpszMIMEPart+=dwBoundarySize;
+ lpszMIMEPart += dwBoundarySize;
// затычка: майл не придерживается RFC и вместо CRLF ставит LF в MIME частях, иногда ставит
- if ((*((WORD*)lpszMIMEPart))==(*((WORD*)CRLF)))
+ if ((*((WORD*)lpszMIMEPart)) == (*((WORD*)CRLF)))
{
- lpszMIMEPart+=(sizeof(CRLF)-1);
+ lpszMIMEPart += (sizeof(CRLF)-1);
}else
- if ((*((BYTE*)lpszMIMEPart))==(*((BYTE*)LF)))
+ if ((*((BYTE*)lpszMIMEPart)) == (*((BYTE*)LF)))
{
- lpszMIMEPart+=(sizeof(LF)-1);
+ lpszMIMEPart += (sizeof(LF)-1);
}else
- if ((*((WORD*)lpszMIMEPart))=='--')
+ if ((*((WORD*)lpszMIMEPart)) == '--')
{
- lpszMIMEPart=NULL;
- }else{
+ lpszMIMEPart = NULL;
+ }else {
DebugBreak();
}
if (lpszMIMEPart)
{
- lpszTemp=(LPSTR)MemoryFind((lpszMIMEPart-lpszBody),lpszBody,dwBodySize,lpszBoundary,dwBoundarySize);
+ lpszTemp = (LPSTR)MemoryFind((lpszMIMEPart-lpszBody), lpszBody, dwBodySize, lpszBoundary, dwBoundarySize);
if (lpszTemp)
{// нашли конец миме части с текстом
- dwMIMEPartSize=(lpszTemp-lpszMIMEPart);// 4=CRLF"--"Boundary / 3=LF"--"Boundary
+ dwMIMEPartSize = (lpszTemp-lpszMIMEPart);// 4 = CRLF"--"Boundary / 3 = LF"--"Boundary
// затычка: майл не придерживается RFC и вместо CRLF ставит LF в MIME частях, иногда ставит
- if ((*((WORD*)(lpszTemp-4)))==(*((WORD*)CRLF)))
+ if ((*((WORD*)(lpszTemp-4))) == (*((WORD*)CRLF)))
{
dwMIMEPartSize-=4;
}else
- if ((*((BYTE*)(lpszTemp-3)))==(*((BYTE*)LF)))
+ if ((*((BYTE*)(lpszTemp-3))) == (*((BYTE*)LF)))
{
dwMIMEPartSize-=3;
- }else{
+ }else {
DebugBreak();
}
- if (plpszMIMEPart) (*plpszMIMEPart)=lpszMIMEPart;
- if (pdwMIMEPartSize) (*pdwMIMEPartSize)=dwMIMEPartSize;
- if (plpszCurMIMEPos) (*plpszCurMIMEPos)=lpszTemp;
- dwRetErrorCode=NO_ERROR;
+ if (plpszMIMEPart) (*plpszMIMEPart) = lpszMIMEPart;
+ if (pdwMIMEPartSize) (*pdwMIMEPartSize) = dwMIMEPartSize;
+ if (plpszCurMIMEPos) (*plpszCurMIMEPos) = lpszTemp;
+ dwRetErrorCode = NO_ERROR;
}
- }else{
- dwRetErrorCode=ERROR_NO_MORE_ITEMS;
+ }else {
+ dwRetErrorCode = ERROR_NO_MORE_ITEMS;
}
}
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }else {
+ dwRetErrorCode = ERROR_INVALID_HANDLE;
}
return(dwRetErrorCode);
}
-DWORD MraOfflineMessageGetHeaderValue(LPSTR lpszHeader,LPSTR lpszHeaderLow,SIZE_T dwHeaderSize,LPSTR lpszValueName,SIZE_T dwValueNameSize,LPSTR *plpszValue,SIZE_T *pdwValueSize)
+DWORD MraOfflineMessageGetHeaderValue(LPSTR lpszHeader, LPSTR lpszHeaderLow, size_t dwHeaderSize, LPSTR lpszValueName, size_t dwValueNameSize, LPSTR *plpszValue, size_t *pdwValueSize)
{
- DWORD dwRetErrorCode=ERROR_NOT_FOUND;
- LPSTR lpszValue,lpszValueEnd;
- SIZE_T dwValueSize;
+ DWORD dwRetErrorCode = ERROR_NOT_FOUND;
+ LPSTR lpszValue, lpszValueEnd;
+ size_t dwValueSize;
- lpszValue=(LPSTR)MemoryFind(0,lpszHeaderLow,dwHeaderSize,lpszValueName,dwValueNameSize);
+ lpszValue = (LPSTR)MemoryFind(0, lpszHeaderLow, dwHeaderSize, lpszValueName, dwValueNameSize);
if (lpszValue)
{
- lpszValue+=dwValueNameSize;
- lpszValueEnd=(LPSTR)MemoryFind((lpszValue-lpszHeaderLow),lpszHeaderLow,dwHeaderSize,CRLF,(sizeof(CRLF)-1));
- if (lpszValueEnd==NULL) lpszValueEnd=(LPSTR)MemoryFind((lpszValue-lpszHeaderLow),lpszHeaderLow,dwHeaderSize,LF,(sizeof(LF)-1));
- if (lpszValueEnd==NULL) lpszValueEnd=(LPSTR)(lpszHeaderLow+dwHeaderSize);
+ lpszValue += dwValueNameSize;
+ lpszValueEnd = (LPSTR)MemoryFind((lpszValue-lpszHeaderLow), lpszHeaderLow, dwHeaderSize, CRLF, (sizeof(CRLF)-1));
+ if (lpszValueEnd == NULL) lpszValueEnd = (LPSTR)MemoryFind((lpszValue-lpszHeaderLow), lpszHeaderLow, dwHeaderSize, LF, (sizeof(LF)-1));
+ if (lpszValueEnd == NULL) lpszValueEnd = (LPSTR)(lpszHeaderLow+dwHeaderSize);
- lpszValue=(LPSTR)MemoryFind((lpszValue-lpszHeaderLow),lpszHeaderLow,(lpszValueEnd-lpszHeaderLow),":",1);
+ lpszValue = (LPSTR)MemoryFind((lpszValue-lpszHeaderLow), lpszHeaderLow, (lpszValueEnd-lpszHeaderLow), ":", 1);
if (lpszValue)
{
lpszValue++;
- dwValueSize=(lpszValueEnd-lpszValue);
- SkeepSPWSP((lpszHeader+(lpszValue-lpszHeaderLow)),dwValueSize,plpszValue,pdwValueSize);
- dwRetErrorCode=NO_ERROR;
+ dwValueSize = (lpszValueEnd-lpszValue);
+ SkeepSPWSP((lpszHeader+(lpszValue-lpszHeaderLow)), dwValueSize, plpszValue, pdwValueSize);
+ dwRetErrorCode = NO_ERROR;
}
}
return(dwRetErrorCode);
}
-DWORD MraOfflineMessageGetHeaderValueLow(LPSTR lpszHeaderLow,SIZE_T dwHeaderSize,LPSTR lpszValueName,SIZE_T dwValueNameSize,LPSTR *plpszValue,SIZE_T *pdwValueSize)
+DWORD MraOfflineMessageGetHeaderValueLow(LPSTR lpszHeaderLow, size_t dwHeaderSize, LPSTR lpszValueName, size_t dwValueNameSize, LPSTR *plpszValue, size_t *pdwValueSize)
{
- DWORD dwRetErrorCode=ERROR_NOT_FOUND;
- LPSTR lpszValue,lpszValueEnd;
- SIZE_T dwValueSize;
+ DWORD dwRetErrorCode = ERROR_NOT_FOUND;
+ LPSTR lpszValue, lpszValueEnd;
+ size_t dwValueSize;
- lpszValue=(LPSTR)MemoryFind(0,lpszHeaderLow,dwHeaderSize,lpszValueName,dwValueNameSize);
+ lpszValue = (LPSTR)MemoryFind(0, lpszHeaderLow, dwHeaderSize, lpszValueName, dwValueNameSize);
if (lpszValue)
{
- lpszValue+=dwValueNameSize;
- lpszValueEnd=(LPSTR)MemoryFind((lpszValue-lpszHeaderLow),lpszHeaderLow,dwHeaderSize,CRLF,(sizeof(CRLF)-1));
- if (lpszValueEnd==NULL) lpszValueEnd=(LPSTR)MemoryFind((lpszValue-lpszHeaderLow),lpszHeaderLow,dwHeaderSize,LF,(sizeof(LF)-1));
- if (lpszValueEnd==NULL) lpszValueEnd=(LPSTR)(lpszHeaderLow+dwHeaderSize);
+ lpszValue += dwValueNameSize;
+ lpszValueEnd = (LPSTR)MemoryFind((lpszValue-lpszHeaderLow), lpszHeaderLow, dwHeaderSize, CRLF, (sizeof(CRLF)-1));
+ if (lpszValueEnd == NULL) lpszValueEnd = (LPSTR)MemoryFind((lpszValue-lpszHeaderLow), lpszHeaderLow, dwHeaderSize, LF, (sizeof(LF)-1));
+ if (lpszValueEnd == NULL) lpszValueEnd = (LPSTR)(lpszHeaderLow+dwHeaderSize);
- lpszValue=(LPSTR)MemoryFind((lpszValue-lpszHeaderLow),lpszHeaderLow,(lpszValueEnd-lpszHeaderLow),":",1);
+ lpszValue = (LPSTR)MemoryFind((lpszValue-lpszHeaderLow), lpszHeaderLow, (lpszValueEnd-lpszHeaderLow), ":", 1);
if (lpszValue)
{
lpszValue++;
- dwValueSize=(lpszValueEnd-lpszValue);
- SkeepSPWSP(lpszValue,dwValueSize,plpszValue,pdwValueSize);
- dwRetErrorCode=NO_ERROR;
+ dwValueSize = (lpszValueEnd-lpszValue);
+ SkeepSPWSP(lpszValue, dwValueSize, plpszValue, pdwValueSize);
+ dwRetErrorCode = NO_ERROR;
}
}
return(dwRetErrorCode);
@@ -413,20 +413,20 @@ return(dwRetErrorCode);
DWORD MraOfflineMessageConvertTime(INTERNET_TIME *pitTime)
{
- SYSTEMTIME stTime,stUniversalTime;
- TIME_ZONE_INFORMATION tziTimeZoneMailRu={0},tziTimeZoneLocal;
+ SYSTEMTIME stTime, stUniversalTime;
+ TIME_ZONE_INFORMATION tziTimeZoneMailRu = {0}, tziTimeZoneLocal;
GetTimeZoneInformation(&tziTimeZoneLocal);
- if (GetTimeZoneInformation(&tziTimeZoneMailRu)==TIME_ZONE_ID_DAYLIGHT) tziTimeZoneMailRu.DaylightBias*=2;
- tziTimeZoneMailRu.Bias=MAILRU_SERVER_TIME_ZONE;
+ if (GetTimeZoneInformation(&tziTimeZoneMailRu) == TIME_ZONE_ID_DAYLIGHT) tziTimeZoneMailRu.DaylightBias *= 2;
+ tziTimeZoneMailRu.Bias = MAILRU_SERVER_TIME_ZONE;
- //TzSpecificLocalTimeToSystemTime(&tziTimeZoneMailRu,&pitTime->stTime,&stUniversalTime);
+ //TzSpecificLocalTimeToSystemTime(&tziTimeZoneMailRu, &pitTime->stTime, &stUniversalTime);
{// for win 2000 compatible
- tziTimeZoneMailRu.Bias=-tziTimeZoneMailRu.Bias;
- tziTimeZoneMailRu.DaylightBias=-tziTimeZoneMailRu.DaylightBias;
- SystemTimeToTzSpecificLocalTime(&tziTimeZoneMailRu,&pitTime->stTime,&stUniversalTime);
+ tziTimeZoneMailRu.Bias = -tziTimeZoneMailRu.Bias;
+ tziTimeZoneMailRu.DaylightBias = -tziTimeZoneMailRu.DaylightBias;
+ SystemTimeToTzSpecificLocalTime(&tziTimeZoneMailRu, &pitTime->stTime, &stUniversalTime);
}//*/
- SystemTimeToTzSpecificLocalTime(&tziTimeZoneLocal,&stUniversalTime,&stTime);
+ SystemTimeToTzSpecificLocalTime(&tziTimeZoneLocal, &stUniversalTime, &stTime);
return((DWORD)MakeTime32FromLocalSystemTime(&stTime));
}
diff --git a/protocols/MRA/MraOfflineMsg.h b/protocols/MRA/MraOfflineMsg.h
index 657a1a0412..2958fbe4a9 100644
--- a/protocols/MRA/MraOfflineMsg.h
+++ b/protocols/MRA/MraOfflineMsg.h
@@ -10,7 +10,7 @@
-DWORD MraOfflineMessageGet(MRA_LPS *plpsMsg,DWORD *pdwTime,DWORD *pdwFlags,MRA_LPS *plpsEMail,MRA_LPS *plpsText,MRA_LPS *plpsRTFText,MRA_LPS *plpsMultiChatData,LPBYTE *plpbBuff);
+DWORD MraOfflineMessageGet(MRA_LPS *plpsMsg, DWORD *pdwTime, DWORD *pdwFlags, MRA_LPS *plpsEMail, MRA_LPS *plpsText, MRA_LPS *plpsRTFText, MRA_LPS *plpsMultiChatData, LPBYTE *plpbBuff);
diff --git a/protocols/MRA/MraPlaces.h b/protocols/MRA/MraPlaces.h
index 255dd3ac72..56a0573a6d 100644
--- a/protocols/MRA/MraPlaces.h
+++ b/protocols/MRA/MraPlaces.h
@@ -8,7 +8,7 @@
#define lpwszOther TEXT("Другое")
-//static LPWSTR lpwszOther=TEXT("Другое");
+//static LPWSTR lpwszOther = TEXT("Другое");
typedef struct
@@ -39,2757 +39,2757 @@ typedef struct
/* WCHAR szBuff[MAX_FILEPATH];
- DebugPrintCRLFA("static const MRA_COUNTRY mracCountrys[]=\r\n{");
- for(SIZE_T i=0;mrapPlaces[i].lpszData;i++)
+ DebugPrintCRLFA("static const MRA_COUNTRY mracCountrys[] = \r\n{");
+ for (size_t i = 0;mrapPlaces[i].lpszData;i++)
{
- if (mrapPlaces[i].dwCityID==0 && mrapPlaces[i].dwPlaceID==0)
+ if (mrapPlaces[i].dwCityID == 0 && mrapPlaces[i].dwPlaceID == 0)
{
- mir_sntprintf(szBuff,SIZEOF(szBuff),L" {%ld, TEXT(\"%s\")},",mrapPlaces[i].dwCountryID,mrapPlaces[i].lpszData);
+ mir_sntprintf(szBuff, SIZEOF(szBuff), L" {%ld, TEXT(\"%s\")}, ", mrapPlaces[i].dwCountryID, mrapPlaces[i].lpszData);
DebugPrintCRLFW(szBuff);
}
}
- DebugPrintCRLFA(" {0, NULL}\r\n};");
+ DebugPrintCRLFA(" {0, NULL}\r\n};");
- DebugPrintCRLFA("static const MRA_CITY mracCitys[]=\r\n{");
- for(SIZE_T i=0;mrapPlaces[i].lpszData;i++)
+ DebugPrintCRLFA("static const MRA_CITY mracCitys[] = \r\n{");
+ for (size_t i = 0;mrapPlaces[i].lpszData;i++)
{
- if (mrapPlaces[i].dwCityID && mrapPlaces[i].dwPlaceID==0)
+ if (mrapPlaces[i].dwCityID && mrapPlaces[i].dwPlaceID == 0)
{
- mir_sntprintf(szBuff,SIZEOF(szBuff),L" {%ld, %ld, TEXT(\"%s\")},",mrapPlaces[i].dwCountryID,mrapPlaces[i].dwCityID,mrapPlaces[i].lpszData);
+ mir_sntprintf(szBuff, SIZEOF(szBuff), L" {%ld, %ld, TEXT(\"%s\")}, ", mrapPlaces[i].dwCountryID, mrapPlaces[i].dwCityID, mrapPlaces[i].lpszData);
DebugPrintCRLFW(szBuff);
}
}
- DebugPrintCRLFA(" {0, NULL}\r\n};");
+ DebugPrintCRLFA(" {0, NULL}\r\n};");
-static const MRA_PLACE mrapPlaces[]=
+static const MRA_PLACE mrapPlaces[] =
{
- {24, 0, 0, TEXT("Россия")},
- {81, 0, 0, TEXT("Азербайджан")},
- {82, 0, 0, TEXT("Армения")},
- {97, 0, 0, TEXT("Афганистан")},
- {96, 0, 0, TEXT("Бангладеш")},
- {99, 0, 0, TEXT("Бахрейн")},
- {100, 0, 0, TEXT("Бруней-Даруссалам")},
- {101, 0, 0, TEXT("Бутан")},
- {102, 0, 0, TEXT("Вьетнам")},
- {83, 0, 0, TEXT("Грузия")},
- {86, 0, 0, TEXT("Израиль")},
- {95, 0, 0, TEXT("Индия")},
- {103, 0, 0, TEXT("Индонезия")},
- {79, 0, 0, TEXT("Иордания")},
- {85, 0, 0, TEXT("Ирак")},
- {87, 0, 0, TEXT("Иран")},
- {104, 0, 0, TEXT("Йемен")},
- {84, 0, 0, TEXT("Казахстан")},
- {105, 0, 0, TEXT("Камбоджа")},
- {106, 0, 0, TEXT("Катар")},
- {107, 0, 0, TEXT("Кипр")},
- {92, 0, 0, TEXT("Киргизия (Кыргызстан)")},
- {76, 0, 0, TEXT("Китай")},
- {3215, 0, 0, TEXT("Кокосовые острова (Австр.)")},
- {29, 0, 0, TEXT("Корея (КНДР)")},
- {108, 0, 0, TEXT("Корея")},
- {88, 0, 0, TEXT("Кувейт")},
- {109, 0, 0, TEXT("Лаос")},
- {110, 0, 0, TEXT("Ливан")},
- {111, 0, 0, TEXT("Малайзия")},
- {112, 0, 0, TEXT("Мальдивы")},
- {113, 0, 0, TEXT("Монголия")},
- {114, 0, 0, TEXT("Мьянма")},
- {115, 0, 0, TEXT("Непал")},
- {116, 0, 0, TEXT("Объединенные Арабские Эмираты")},
- {117, 0, 0, TEXT("Оман")},
- {3216, 0, 0, TEXT("Остров Рождества (Австр.)")},
- {122, 0, 0, TEXT("Пакистан")},
- {89, 0, 0, TEXT("Палестина")},
- {94, 0, 0, TEXT("Саудовская Аравия")},
- {118, 0, 0, TEXT("Сингапур")},
- {78, 0, 0, TEXT("Сирия")},
- {91, 0, 0, TEXT("Таджикистан")},
- {119, 0, 0, TEXT("Таиланд")},
- {120, 0, 0, TEXT("Тайвань")},
- {132, 0, 0, TEXT("Тимор")},
- {90, 0, 0, TEXT("Туркмения")},
- {77, 0, 0, TEXT("Турция")},
- {93, 0, 0, TEXT("Узбекистан")},
- {121, 0, 0, TEXT("Филиппины")},
- {98, 0, 0, TEXT("Шри Ланка")},
- {75, 0, 0, TEXT("Япония")},
- {123, 0, 0, TEXT("Австралия")},
- {454, 0, 0, TEXT("Американское Самоа")},
- {124, 0, 0, TEXT("Вануату")},
- {453, 0, 0, TEXT("Гуам (США)")},
- {126, 0, 0, TEXT("Кирибати")},
- {127, 0, 0, TEXT("Маршалловы Острова")},
- {128, 0, 0, TEXT("Микронезия (Федеративные Штаты Микронезии)")},
- {129, 0, 0, TEXT("Науру")},
- {3220, 0, 0, TEXT("Ниуэ (Н.Зел.)")},
- {130, 0, 0, TEXT("Новая Зеландия")},
- {3218, 0, 0, TEXT("Новая Каледония (Фр.)")},
- {3221, 0, 0, TEXT("Острова Кука (Н.Зел.)")},
- {3230, 0, 0, TEXT("Острова Херд и Макдональд (Австр.)")},
- {131, 0, 0, TEXT("Палау")},
- {133, 0, 0, TEXT("Папуа - Новая Гвинея")},
- {3222, 0, 0, TEXT("Питкерн (Брит.)")},
- {125, 0, 0, TEXT("Самоа")},
- {3219, 0, 0, TEXT("Сев. Марианские острова (США)")},
- {134, 0, 0, TEXT("Соломоновы Острова")},
- {3223, 0, 0, TEXT("Токелау (Н.Зел.)")},
- {135, 0, 0, TEXT("Тонга")},
- {136, 0, 0, TEXT("Тувалу")},
- {3224, 0, 0, TEXT("Уоллис и Футуна острова (Фр.)")},
- {137, 0, 0, TEXT("Фиджи")},
- {3226, 0, 0, TEXT("Французская Полинезия")},
- {3225, 0, 0, TEXT("Французские Южные территории")},
- {138, 0, 0, TEXT("Канада")},
- {139, 0, 0, TEXT("США")},
- {3200, 0, 0, TEXT("Ангилья (Брит.)")},
- {140, 0, 0, TEXT("Антигуа и Барбуда")},
- {141, 0, 0, TEXT("Аргентина")},
- {3202, 0, 0, TEXT("Аруба (Нид.)")},
- {142, 0, 0, TEXT("Багамы")},
- {143, 0, 0, TEXT("Барбадос")},
- {146, 0, 0, TEXT("Белиз")},
- {3203, 0, 0, TEXT("Бермуды (Брит.)")},
- {144, 0, 0, TEXT("Боливия")},
- {145, 0, 0, TEXT("Бразилия")},
- {147, 0, 0, TEXT("Венесуэла")},
- {3204, 0, 0, TEXT("Виргинские острова (Брит.)")},
- {452, 0, 0, TEXT("Виргинские острова (США)")},
- {149, 0, 0, TEXT("Гаити")},
- {148, 0, 0, TEXT("Гайана")},
- {3205, 0, 0, TEXT("Гваделупа (Фр.)")},
- {173, 0, 0, TEXT("Гватемала")},
- {150, 0, 0, TEXT("Гондурас")},
- {151, 0, 0, TEXT("Гренада")},
- {152, 0, 0, TEXT("Гренландия (Дат.)")},
- {153, 0, 0, TEXT("Доминика")},
- {154, 0, 0, TEXT("Доминиканская Республика")},
- {155, 0, 0, TEXT("Колумбия")},
- {156, 0, 0, TEXT("Коста-Рика")},
- {157, 0, 0, TEXT("Куба")},
- {3208, 0, 0, TEXT("Мартиника (Фр.)")},
- {158, 0, 0, TEXT("Мексика")},
- {3209, 0, 0, TEXT("Монтсеррат (Брит)")},
- {3201, 0, 0, TEXT("Нидерландские Антилы")},
- {159, 0, 0, TEXT("Никарагуа")},
- {3207, 0, 0, TEXT("Остров Кайман (Брит.)")},
- {3211, 0, 0, TEXT("Острова Теркс и Кайкос (Брит.)")},
- {160, 0, 0, TEXT("Панама")},
- {161, 0, 0, TEXT("Парагвай")},
- {162, 0, 0, TEXT("Перу")},
- {163, 0, 0, TEXT("Сальвадор")},
- {164, 0, 0, TEXT("Сент-Винсент и Гренадины")},
- {165, 0, 0, TEXT("Сент-Китс и Невис")},
- {166, 0, 0, TEXT("Сент-Люсия")},
- {3210, 0, 0, TEXT("Сент-Пьер и Микелон (Фр.)")},
- {167, 0, 0, TEXT("Суринам")},
- {168, 0, 0, TEXT("Тринидат и Тобаго")},
- {169, 0, 0, TEXT("Уругвай")},
- {3212, 0, 0, TEXT("Фолклендские острова (Брит.)")},
- {3206, 0, 0, TEXT("Французская Гвиана")},
- {170, 0, 0, TEXT("Чили")},
- {171, 0, 0, TEXT("Эквадор")},
- {3213, 0, 0, TEXT("Юж. Джорджия и Юж. Сандвичевы о-ва (Брит.)")},
- {172, 0, 0, TEXT("Ямайка")},
- {174, 0, 0, TEXT("Алжир")},
- {175, 0, 0, TEXT("Ангола")},
- {176, 0, 0, TEXT("Бенин")},
- {177, 0, 0, TEXT("Ботсвана")},
- {3228, 0, 0, TEXT("Британская территория в Индийском океане")},
- {178, 0, 0, TEXT("Буркина-Фасо")},
- {179, 0, 0, TEXT("Бурунди")},
- {180, 0, 0, TEXT("Габон")},
- {181, 0, 0, TEXT("Гамбия")},
- {182, 0, 0, TEXT("Гана")},
- {183, 0, 0, TEXT("Гвинея")},
- {184, 0, 0, TEXT("Гвинея-Бисау")},
- {185, 0, 0, TEXT("Джибути")},
- {186, 0, 0, TEXT("Египет")},
- {187, 0, 0, TEXT("Замбия")},
- {3198, 0, 0, TEXT("Зап. Сахара")},
- {23, 0, 0, TEXT("Зимбабве")},
- {188, 0, 0, TEXT("Кабо-Верде")},
- {189, 0, 0, TEXT("Камерун")},
- {190, 0, 0, TEXT("Кения")},
- {191, 0, 0, TEXT("Коморы")},
- {193, 0, 0, TEXT("Конго (Заир)")},
- {192, 0, 0, TEXT("Конго")},
- {194, 0, 0, TEXT("Кот-д`Ивуар")},
- {195, 0, 0, TEXT("Лесото")},
- {196, 0, 0, TEXT("Либерия")},
- {197, 0, 0, TEXT("Ливия")},
- {198, 0, 0, TEXT("Маврикий")},
- {199, 0, 0, TEXT("Мавритания")},
- {200, 0, 0, TEXT("Мадагаскар")},
- {3229, 0, 0, TEXT("Майотт (Фр.)")},
- {201, 0, 0, TEXT("Малави")},
- {202, 0, 0, TEXT("Мали")},
- {203, 0, 0, TEXT("Марокко")},
- {204, 0, 0, TEXT("Мозамбик")},
- {205, 0, 0, TEXT("Намибия")},
- {206, 0, 0, TEXT("Нигер")},
- {207, 0, 0, TEXT("Нигерия")},
- {3227, 0, 0, TEXT("Остров Буве (Норв.)")},
- {3197, 0, 0, TEXT("Реюньон (Фр.)")},
- {208, 0, 0, TEXT("Руанда")},
- {209, 0, 0, TEXT("Сан-Томе и Принсипи")},
- {210, 0, 0, TEXT("Свазиленд")},
- {3199, 0, 0, TEXT("Святая Елена (Брит.)")},
- {211, 0, 0, TEXT("Сейшелы")},
- {212, 0, 0, TEXT("Сенегал")},
- {213, 0, 0, TEXT("Сомали")},
- {214, 0, 0, TEXT("Судан")},
- {215, 0, 0, TEXT("Сьерра-Леоне")},
- {216, 0, 0, TEXT("Танзания")},
- {217, 0, 0, TEXT("Того")},
- {218, 0, 0, TEXT("Тунис")},
- {219, 0, 0, TEXT("Уганда")},
- {220, 0, 0, TEXT("Центральноафриканская Республика")},
- {222, 0, 0, TEXT("Чад")},
- {223, 0, 0, TEXT("Экваториальная Гвинея")},
- {221, 0, 0, TEXT("Эритрея")},
- {224, 0, 0, TEXT("Эфиопия")},
- {225, 0, 0, TEXT("Южно-Африканская Республика (ЮАР)")},
- {39, 0, 0, TEXT("Украина")},
- {40, 0, 0, TEXT("Австрия")},
- {32, 0, 0, TEXT("Албания")},
- {33, 0, 0, TEXT("Андорра")},
- {340, 0, 0, TEXT("Белоруссия")},
- {38, 0, 0, TEXT("Бельгия")},
- {41, 0, 0, TEXT("Болгария")},
- {42, 0, 0, TEXT("Босния и Герцеговина")},
- {43, 0, 0, TEXT("Ватикан")},
- {45, 0, 0, TEXT("Великобритания")},
- {44, 0, 0, TEXT("Венгрия")},
- {46, 0, 0, TEXT("Германия")},
- {3193, 0, 0, TEXT("Гернси (Брит.)")},
- {47, 0, 0, TEXT("Гибралтар (Брит.)")},
- {48, 0, 0, TEXT("Греция")},
- {49, 0, 0, TEXT("Дания")},
- {3194, 0, 0, TEXT("Джерси (Брит.)")},
- {50, 0, 0, TEXT("Ирландия")},
- {51, 0, 0, TEXT("Исландия")},
- {34, 0, 0, TEXT("Испания")},
- {52, 0, 0, TEXT("Италия")},
- {53, 0, 0, TEXT("Латвия")},
- {54, 0, 0, TEXT("Литва")},
- {55, 0, 0, TEXT("Лихтенштейн")},
- {56, 0, 0, TEXT("Люксембург")},
- {57, 0, 0, TEXT("Македония")},
- {58, 0, 0, TEXT("Мальта")},
- {59, 0, 0, TEXT("Молдавия")},
- {36, 0, 0, TEXT("Монако")},
- {60, 0, 0, TEXT("Нидерланды")},
- {61, 0, 0, TEXT("Норвегия")},
- {3195, 0, 0, TEXT("Остров Мэн (Брит.)")},
- {62, 0, 0, TEXT("Польша")},
- {35, 0, 0, TEXT("Португалия")},
- {63, 0, 0, TEXT("Румыния")},
- {64, 0, 0, TEXT("Сан-Марино")},
- {74, 0, 0, TEXT("Сербия и Черногория")},
- {65, 0, 0, TEXT("Словакия")},
- {66, 0, 0, TEXT("Словения")},
- {67, 0, 0, TEXT("Фарерские о-ва (Дания)")},
- {68, 0, 0, TEXT("Финляндия")},
- {37, 0, 0, TEXT("Франция")},
- {69, 0, 0, TEXT("Хорватия")},
- {70, 0, 0, TEXT("Чехия")},
- {71, 0, 0, TEXT("Швейцария")},
- {72, 0, 0, TEXT("Швеция")},
- {3196, 0, 0, TEXT("Шпицберген (Норв.)")},
- {73, 0, 0, TEXT("Эстония")},
- {24, 25, 0, TEXT("Москва")},
- {24, 226, 0, TEXT("Санкт-Петербург")},
- {24, 233, 0, TEXT("Саха (Якутия)")},
- {24, 232, 0, TEXT("Приморский край")},
- {24, 235, 0, TEXT("Хабаровский край")},
- {24, 227, 0, TEXT("Амурская обл.")},
- {24, 229, 0, TEXT("Камчатская обл.")},
- {24, 231, 0, TEXT("Магаданская обл.")},
- {24, 234, 0, TEXT("Сахалинская обл.")},
- {24, 228, 0, TEXT("Еврейская АО")},
- {24, 230, 0, TEXT("Корякский АО")},
- {24, 236, 0, TEXT("Чукотский АО")},
- {24, 237, 0, TEXT("Башкортостан")},
- {24, 240, 0, TEXT("Марий-Эл")},
- {24, 241, 0, TEXT("Мордовия")},
- {24, 248, 0, TEXT("Татарстан")},
- {24, 249, 0, TEXT("Удмуртия")},
- {24, 251, 0, TEXT("Чувашия")},
- {24, 238, 0, TEXT("Кировская обл.")},
- {24, 242, 0, TEXT("Нижегородская обл.")},
- {24, 243, 0, TEXT("Оренбургская обл.")},
- {24, 244, 0, TEXT("Пензенская обл.")},
- {24, 245, 0, TEXT("Пермская обл.")},
- {24, 246, 0, TEXT("Самарская обл.")},
- {24, 247, 0, TEXT("Саратовская обл.")},
- {24, 250, 0, TEXT("Ульяновская обл.")},
- {24, 239, 0, TEXT("Коми-Пермяцкий АО")},
- {24, 255, 0, TEXT("Карелия")},
- {24, 256, 0, TEXT("Коми")},
- {24, 252, 0, TEXT("Архангельская обл.")},
- {24, 253, 0, TEXT("Вологодская обл.")},
- {24, 254, 0, TEXT("Калининградская обл.")},
- {24, 257, 0, TEXT("Ленинградская обл.")},
- {24, 258, 0, TEXT("Мурманская обл.")},
- {24, 260, 0, TEXT("Новгородская обл.")},
- {24, 261, 0, TEXT("Псковская обл.")},
- {24, 259, 0, TEXT("Ненецкий АО")},
- {24, 265, 0, TEXT("Бурятия")},
- {24, 263, 0, TEXT("Республика Алтай")},
- {24, 273, 0, TEXT("Тыва")},
- {24, 275, 0, TEXT("Хакасия")},
- {24, 264, 0, TEXT("Алтайский край")},
- {24, 268, 0, TEXT("Красноярский край")},
- {24, 266, 0, TEXT("Иркутская обл.")},
- {24, 267, 0, TEXT("Кемеровская обл.")},
- {24, 269, 0, TEXT("Новосибирская обл.")},
- {24, 270, 0, TEXT("Омская обл.")},
- {24, 272, 0, TEXT("Томская обл.")},
- {24, 276, 0, TEXT("Читинская обл.")},
- {24, 262, 0, TEXT("Агинский Бурятский АО")},
- {24, 271, 0, TEXT("Таймырский АО")},
- {24, 274, 0, TEXT("Усть-Ордынский Бурятский АО")},
- {24, 277, 0, TEXT("Эвенкийский АО")},
- {24, 278, 0, TEXT("Курганская обл.")},
- {24, 279, 0, TEXT("Свердловская обл.")},
- {24, 280, 0, TEXT("Тюменская обл.")},
- {24, 282, 0, TEXT("Челябинская обл.")},
- {24, 281, 0, TEXT("Ханты-Мансийский АО - Югра")},
- {24, 283, 0, TEXT("Ямало-Ненецкий АО")},
- {24, 284, 0, TEXT("Белгородская обл.")},
- {24, 285, 0, TEXT("Брянская обл.")},
- {24, 286, 0, TEXT("Владимирская обл.")},
- {24, 287, 0, TEXT("Воронежская обл.")},
- {24, 288, 0, TEXT("Ивановская обл.")},
- {24, 289, 0, TEXT("Калужская обл.")},
- {24, 290, 0, TEXT("Костромская обл.")},
- {24, 291, 0, TEXT("Курская обл.")},
- {24, 292, 0, TEXT("Липецкая обл.")},
- {24, 293, 0, TEXT("Московская обл.")},
- {24, 294, 0, TEXT("Орловская обл.")},
- {24, 295, 0, TEXT("Рязанская обл.")},
- {24, 296, 0, TEXT("Смоленская обл.")},
- {24, 297, 0, TEXT("Тамбовская обл.")},
- {24, 298, 0, TEXT("Тверская обл.")},
- {24, 299, 0, TEXT("Тульская обл.")},
- {24, 300, 0, TEXT("Ярославская обл.")},
- {24, 301, 0, TEXT("Адыгея")},
- {24, 304, 0, TEXT("Дагестан")},
- {24, 305, 0, TEXT("Ингушетия")},
- {24, 306, 0, TEXT("Кабардино-Балкария")},
- {24, 307, 0, TEXT("Калмыкия")},
- {24, 308, 0, TEXT("Карачаево-Черкессия")},
- {24, 311, 0, TEXT("Северная Осетия - Алания")},
- {24, 313, 0, TEXT("Чечня")},
- {24, 309, 0, TEXT("Краснодарский край")},
- {24, 312, 0, TEXT("Ставропольский край")},
- {24, 302, 0, TEXT("Астраханская обл.")},
- {24, 303, 0, TEXT("Волгоградская обл.")},
- {24, 310, 0, TEXT("Ростовская обл.")},
- {81, 1055, 0, TEXT("Баку")},
- {81, 1058, 0, TEXT("Гянджа")},
- {81, 1056, 0, TEXT("Нахичевань")},
- {81, 1057, 0, TEXT("Ханкенди")},
- {81, 3153, 0, TEXT("Шеки")},
- {81, 2291, 0, lpwszOther},
- {82, 2932, 0, TEXT("Абовян")},
- {82, 1060, 0, TEXT("Аштарак")},
- {82, 3084, 0, TEXT("Ванадзор")},
- {82, 3011, 0, TEXT("Гюмри")},
- {82, 3306, 0, TEXT("Дилижан")},
- {82, 1059, 0, TEXT("Ереван")},
- {82, 3145, 0, TEXT("Ханкенди")},
- {82, 2292, 0, lpwszOther},
- {97, 1061, 0, TEXT("Кабул")},
- {97, 2293, 0, lpwszOther},
- {96, 1062, 0, TEXT("Дакка")},
- {96, 2294, 0, lpwszOther},
- {99, 1063, 0, TEXT("Манама")},
- {99, 2295, 0, lpwszOther},
- {100, 1064, 0, TEXT("Бандар-Сери-Бегаван")},
- {100, 2296, 0, lpwszOther},
- {101, 1065, 0, TEXT("Тхимпху")},
- {101, 2297, 0, lpwszOther},
- {102, 1066, 0, TEXT("Ханой")},
- {102, 2298, 0, lpwszOther},
- {83, 1067, 0, TEXT("Батуми")},
- {83, 3158, 0, TEXT("Боржоми")},
- {83, 1068, 0, TEXT("Поти")},
- {83, 3129, 0, TEXT("Рустави")},
- {83, 1069, 0, TEXT("Сухуми")},
- {83, 1070, 0, TEXT("Тбилиси")},
- {83, 2299, 0, lpwszOther},
- {86, 3345, 0, TEXT("Ариэль")},
- {86, 1071, 0, TEXT("Афула")},
- {86, 2992, 0, TEXT("Ашдод")},
- {86, 3175, 0, TEXT("Ашкелон")},
- {86, 3363, 0, TEXT("Бат-Ям")},
- {86, 2884, 0, TEXT("Беер-Яков")},
- {86, 3243, 0, TEXT("Бейт-Шемеш")},
- {86, 1074, 0, TEXT("Беэр-Шева")},
- {86, 3348, 0, TEXT("Герцелия")},
- {86, 3241, 0, TEXT("Димона")},
- {86, 1075, 0, TEXT("Иерусалим")},
- {86, 3350, 0, TEXT("Йокнеам-Иллит")},
- {86, 2982, 0, TEXT("Кармиэль")},
- {86, 2971, 0, TEXT("Кфар-Саба")},
- {86, 3136, 0, TEXT("Назарет")},
- {86, 1080, 0, TEXT("Натания")},
- {86, 3303, 0, TEXT("Офаким")},
- {86, 3050, 0, TEXT("Раанана")},
- {86, 3151, 0, TEXT("Рамат Ган")},
- {86, 3141, 0, TEXT("Реховот")},
- {86, 3012, 0, TEXT("Ришон ле Цион")},
- {86, 1081, 0, TEXT("Тверия")},
- {86, 1077, 0, TEXT("Тель-Авив")},
- {86, 1079, 0, TEXT("Хадера")},
- {86, 1078, 0, TEXT("Хайфа")},
- {86, 1076, 0, TEXT("Хеврон")},
- {86, 2929, 0, TEXT("Цфат")},
- {86, 2928, 0, TEXT("Эйлат")},
- {86, 2300, 0, lpwszOther},
- {95, 3315, 0, TEXT("Бангалор")},
- {95, 1082, 0, TEXT("Дели")},
- {95, 1083, 0, TEXT("Джайпур")},
- {95, 3144, 0, TEXT("Калькутта")},
- {95, 3025, 0, TEXT("Мумбаи")},
- {95, 3277, 0, TEXT("Панаджи")},
- {95, 1084, 0, TEXT("Ченнаи")},
- {95, 2301, 0, lpwszOther},
- {103, 1085, 0, TEXT("Джакарта")},
- {103, 2302, 0, lpwszOther},
- {79, 1086, 0, TEXT("Амман")},
- {79, 2303, 0, lpwszOther},
- {85, 1087, 0, TEXT("Багдад")},
- {85, 2304, 0, lpwszOther},
- {87, 1088, 0, TEXT("Тегеран")},
- {87, 2305, 0, lpwszOther},
- {104, 1089, 0, TEXT("Сана")},
- {104, 2306, 0, lpwszOther},
- {84, 1090, 0, TEXT("Актау")},
- {84, 1091, 0, TEXT("Актюбинск")},
- {84, 1092, 0, TEXT("Алма-Ата")},
- {84, 3242, 0, TEXT("Аршалы")},
- {84, 1093, 0, TEXT("Астана")},
- {84, 1094, 0, TEXT("Атырау (Гурьев)")},
- {84, 1095, 0, TEXT("Байконур")},
- {84, 3245, 0, TEXT("Балхаш")},
- {84, 3083, 0, TEXT("Жезказган")},
- {84, 1096, 0, TEXT("Капчагай")},
- {84, 1097, 0, TEXT("Караганда")},
- {84, 1098, 0, TEXT("Кокшетау")},
- {84, 1099, 0, TEXT("Кустанай")},
- {84, 2868, 0, TEXT("Лисаковск")},
- {84, 1100, 0, TEXT("Павлодар")},
- {84, 1101, 0, TEXT("Петропавловск (Сев.-Каз. обл.)")},
- {84, 1102, 0, TEXT("Рудный")},
- {84, 1103, 0, TEXT("Семипалатинск")},
- {84, 1104, 0, TEXT("Степногорск")},
- {84, 3166, 0, TEXT("Талгар")},
- {84, 1105, 0, TEXT("Талды-Курган")},
- {84, 2927, 0, TEXT("Тараз")},
- {84, 1106, 0, TEXT("Темиртау")},
- {84, 1107, 0, TEXT("Уральск")},
- {84, 1108, 0, TEXT("Усть-Каменогорск")},
- {84, 1109, 0, TEXT("Чимкент")},
- {84, 1110, 0, TEXT("Экибастуз")},
- {84, 2307, 0, lpwszOther},
- {105, 1111, 0, TEXT("Пномпень")},
- {105, 2308, 0, lpwszOther},
- {106, 1112, 0, TEXT("Доха")},
- {106, 2309, 0, lpwszOther},
- {107, 1113, 0, TEXT("Ларнака")},
- {107, 1114, 0, TEXT("Лимассол")},
- {107, 1115, 0, TEXT("Никосия")},
- {107, 2954, 0, TEXT("Пафос")},
- {107, 2310, 0, lpwszOther},
- {92, 1116, 0, TEXT("Бишкек")},
- {92, 1117, 0, TEXT("Джалал-Абад")},
- {92, 3027, 0, TEXT("Кара-Балта")},
- {92, 1118, 0, TEXT("Каракол")},
- {92, 1119, 0, TEXT("Ош")},
- {92, 1120, 0, TEXT("Талас")},
- {92, 2933, 0, TEXT("Хайдаркен")},
- {92, 2311, 0, lpwszOther},
- {76, 3214, 0, TEXT("Аомынь (Макао)")},
- {76, 1121, 0, TEXT("Гонконг")},
- {76, 2869, 0, TEXT("Гуанчжоу")},
- {76, 3262, 0, TEXT("Далянь")},
- {76, 1122, 0, TEXT("Пекин")},
- {76, 1123, 0, TEXT("Харбин")},
- {76, 1124, 0, TEXT("Шанхай")},
- {76, 3043, 0, TEXT("Шеньян")},
- {76, 2312, 0, lpwszOther},
- {29, 1125, 0, TEXT("Пхеньян")},
- {29, 2313, 0, lpwszOther},
- {108, 1126, 0, TEXT("Сеул")},
- {108, 3240, 0, TEXT("Тейджон")},
- {108, 2314, 0, lpwszOther},
- {88, 1127, 0, TEXT("Эль-Кувейт")},
- {88, 2315, 0, lpwszOther},
- {109, 1128, 0, TEXT("Вьентьян")},
- {109, 2316, 0, lpwszOther},
- {110, 1129, 0, TEXT("Бейрут")},
- {110, 2317, 0, lpwszOther},
- {111, 1130, 0, TEXT("Джохор-Бару")},
- {111, 1131, 0, TEXT("Куала-Лумпур")},
- {111, 2318, 0, lpwszOther},
- {112, 1132, 0, TEXT("Мале")},
- {112, 2319, 0, lpwszOther},
- {113, 1133, 0, TEXT("Улан-Батор")},
- {113, 1134, 0, TEXT("Эрдэнэт")},
- {113, 2320, 0, lpwszOther},
- {114, 1135, 0, TEXT("Янгон")},
- {114, 2321, 0, lpwszOther},
- {115, 1136, 0, TEXT("Катманду")},
- {115, 2322, 0, lpwszOther},
- {116, 1137, 0, TEXT("Абу-Даби")},
- {116, 1138, 0, TEXT("Дубай")},
- {116, 1139, 0, TEXT("Шарджа")},
- {116, 2323, 0, lpwszOther},
- {117, 1140, 0, TEXT("Маскат")},
- {117, 2324, 0, lpwszOther},
- {122, 1141, 0, TEXT("Исламабад")},
- {122, 2325, 0, lpwszOther},
- {89, 1072, 0, TEXT("Ашдод")},
- {89, 1073, 0, TEXT("Ашкелон")},
- {89, 1142, 0, TEXT("Газа")},
- {89, 2326, 0, lpwszOther},
- {94, 3250, 0, TEXT("Медина")},
- {94, 1143, 0, TEXT("Эр-Рияд")},
- {94, 2327, 0, lpwszOther},
- {78, 1144, 0, TEXT("Дамаск")},
- {78, 2328, 0, lpwszOther},
- {91, 1145, 0, TEXT("Душанбе")},
- {91, 3307, 0, TEXT("Кайраккум")},
- {91, 3308, 0, TEXT("Худжанд")},
- {91, 2329, 0, lpwszOther},
- {119, 1146, 0, TEXT("Бангкок")},
- {119, 1147, 0, TEXT("Пхукет")},
- {119, 2330, 0, lpwszOther},
- {120, 1148, 0, TEXT("Тайбэй")},
- {120, 2331, 0, lpwszOther},
- {132, 1149, 0, TEXT("Дили")},
- {132, 2332, 0, lpwszOther},
- {90, 1150, 0, TEXT("Ашхабад")},
- {90, 3079, 0, TEXT("Безмеин")},
- {90, 2333, 0, lpwszOther},
- {77, 1152, 0, TEXT("Анкара")},
- {77, 1153, 0, TEXT("Анталия")},
- {77, 3080, 0, TEXT("Бурса")},
- {77, 1151, 0, TEXT("Мармарис")},
- {77, 1154, 0, TEXT("Стамбул")},
- {77, 1155, 0, TEXT("Трабзон")},
- {77, 2334, 0, lpwszOther},
- {93, 3362, 0, TEXT("Алмалык")},
- {93, 3137, 0, TEXT("Андижан")},
- {93, 3273, 0, TEXT("Асака")},
- {93, 1156, 0, TEXT("Ахангаран")},
- {93, 1157, 0, TEXT("Бухара")},
- {93, 3167, 0, TEXT("Джизак")},
- {93, 3347, 0, TEXT("Кунград")},
- {93, 1158, 0, TEXT("Навои")},
- {93, 1159, 0, TEXT("Наманган")},
- {93, 1160, 0, TEXT("Самарканд")},
- {93, 1161, 0, TEXT("Ташкент")},
- {93, 1162, 0, TEXT("Ургенч")},
- {93, 1163, 0, TEXT("Фергана")},
- {93, 1164, 0, TEXT("Чирчик")},
- {93, 2335, 0, lpwszOther},
- {121, 1165, 0, TEXT("Манила")},
- {121, 3319, 0, TEXT("Себу")},
- {121, 2336, 0, lpwszOther},
- {98, 1166, 0, TEXT("Коломбо")},
- {98, 2337, 0, lpwszOther},
- {75, 3176, 0, TEXT("Исесаки")},
- {75, 3339, 0, TEXT("Корияма")},
- {75, 1167, 0, TEXT("Саппоро")},
- {75, 1168, 0, TEXT("Токио")},
- {75, 2338, 0, lpwszOther},
- {123, 1914, 0, TEXT("Аделаида")},
- {123, 2957, 0, TEXT("Блэк Рок")},
- {123, 1915, 0, TEXT("Брисбен")},
- {123, 3331, 0, TEXT("Горокан")},
- {123, 1916, 0, TEXT("Канберра")},
- {123, 3001, 0, TEXT("Лидкомб")},
- {123, 1917, 0, TEXT("Мельбурн")},
- {123, 3217, 0, TEXT("Норфолк")},
- {123, 3064, 0, TEXT("Перт")},
- {123, 3020, 0, TEXT("Санта Люсиа")},
- {123, 1918, 0, TEXT("Сидней")},
- {123, 3238, 0, TEXT("Энеабба")},
- {123, 2339, 0, lpwszOther},
- {454, 1192, 0, TEXT("Паго-Паго")},
- {454, 2366, 0, lpwszOther},
- {124, 1919, 0, TEXT("Порт-Вила")},
- {124, 2340, 0, lpwszOther},
- {453, 1193, 0, TEXT("Аганья")},
- {453, 2368, 0, lpwszOther},
- {126, 1921, 0, TEXT("Баирики")},
- {126, 2342, 0, lpwszOther},
- {127, 1922, 0, TEXT("Маджуро")},
- {127, 2343, 0, lpwszOther},
- {128, 1923, 0, TEXT("Паликир")},
- {128, 2344, 0, lpwszOther},
- {129, 1924, 0, TEXT("Ярен")},
- {129, 2345, 0, lpwszOther},
- {130, 1925, 0, TEXT("Веллингтон")},
- {130, 1926, 0, TEXT("Гамильтон")},
- {130, 1928, 0, TEXT("Данидин")},
- {130, 1929, 0, TEXT("Крайстчерч")},
- {130, 3235, 0, TEXT("Кромвель")},
- {130, 1927, 0, TEXT("Окленд")},
- {130, 3323, 0, TEXT("Тауранга")},
- {130, 2346, 0, lpwszOther},
- {131, 1930, 0, TEXT("Корор")},
- {131, 2347, 0, lpwszOther},
- {133, 1931, 0, TEXT("Порт-Морсби")},
- {133, 2348, 0, lpwszOther},
- {125, 1920, 0, TEXT("Апиа")},
- {125, 2341, 0, lpwszOther},
- {134, 1932, 0, TEXT("Хониара")},
- {134, 2349, 0, lpwszOther},
- {135, 1933, 0, TEXT("Нукуалофа")},
- {135, 2350, 0, lpwszOther},
- {136, 1934, 0, TEXT("Фунафути")},
- {136, 2351, 0, lpwszOther},
- {137, 1935, 0, TEXT("Сува")},
- {137, 2352, 0, lpwszOther},
- {138, 3055, 0, TEXT("Барлингтон")},
- {138, 3049, 0, TEXT("Броссард")},
- {138, 3330, 0, TEXT("Бурнаби")},
- {138, 1169, 0, TEXT("Ванкувер")},
- {138, 3106, 0, TEXT("Ватерлоо")},
- {138, 1170, 0, TEXT("Виннипег")},
- {138, 1171, 0, TEXT("Галифакс")},
- {138, 1172, 0, TEXT("Гамильтон")},
- {138, 3365, 0, TEXT("Денвер")},
- {138, 1173, 0, TEXT("Калгари")},
- {138, 3104, 0, TEXT("Камлупс")},
- {138, 3366, 0, TEXT("Каннингтон")},
- {138, 1174, 0, TEXT("Квебек")},
- {138, 2964, 0, TEXT("Кингстон")},
- {138, 3113, 0, TEXT("Коквитлам")},
- {138, 1175, 0, TEXT("Монреаль")},
- {138, 2920, 0, TEXT("Ниагара-Фолс")},
- {138, 2889, 0, TEXT("Норд-Йорк")},
- {138, 1176, 0, TEXT("Оттава")},
- {138, 2903, 0, TEXT("Порт Алберни")},
- {138, 1177, 0, TEXT("Ричмонд")},
- {138, 1178, 0, TEXT("Тимминс")},
- {138, 2946, 0, TEXT("Торнхилл")},
- {138, 1179, 0, TEXT("Торонто")},
- {138, 1180, 0, TEXT("Эдмонтон")},
- {138, 2353, 0, lpwszOther},
- {139, 407, 0, TEXT("Вашингтон")},
- {139, 426, 0, TEXT("Айдахо")},
- {139, 378, 0, TEXT("Айова")},
- {139, 412, 0, TEXT("Алабама")},
- {139, 446, 0, TEXT("Аляска")},
- {139, 434, 0, TEXT("Аризона")},
- {139, 416, 0, TEXT("Арканзас")},
- {139, 428, 0, TEXT("Вайоминг")},
- {139, 440, 0, TEXT("Вашингтон")},
- {139, 352, 0, TEXT("Вермонт")},
- {139, 394, 0, TEXT("Виргиния")},
- {139, 374, 0, TEXT("Висконсин")},
- {139, 448, 0, TEXT("Гавайи")},
- {139, 390, 0, TEXT("Делавер")},
- {139, 402, 0, TEXT("Джорджия")},
- {139, 396, 0, TEXT("Западная Виргиния")},
- {139, 370, 0, TEXT("Иллинойс")},
- {139, 368, 0, TEXT("Индиана")},
- {139, 444, 0, TEXT("Калифорния")},
- {139, 388, 0, TEXT("Канзас")},
- {139, 408, 0, TEXT("Кентукки")},
- {139, 430, 0, TEXT("Колорадо")},
- {139, 358, 0, TEXT("Коннектикут")},
- {139, 418, 0, TEXT("Луизиана")},
- {139, 354, 0, TEXT("Массачусетс")},
- {139, 376, 0, TEXT("Миннесота")},
- {139, 414, 0, TEXT("Миссисипи")},
- {139, 380, 0, TEXT("Миссури")},
- {139, 372, 0, TEXT("Мичиган")},
- {139, 424, 0, TEXT("Монтана")},
- {139, 348, 0, TEXT("Мэн")},
- {139, 392, 0, TEXT("Мэриленд")},
- {139, 386, 0, TEXT("Небраска")},
- {139, 438, 0, TEXT("Невада")},
- {139, 362, 0, TEXT("Нью-Джерси")},
- {139, 360, 0, TEXT("Нью-Йорк")},
- {139, 432, 0, TEXT("Нью-Мексико")},
- {139, 350, 0, TEXT("Нью-Хэмпшир")},
- {139, 366, 0, TEXT("Огайо")},
- {139, 420, 0, TEXT("Оклахома")},
- {139, 442, 0, TEXT("Орегон")},
- {139, 364, 0, TEXT("Пенсильвания")},
- {139, 450, 0, TEXT("Пуэрто-Рико")},
- {139, 356, 0, TEXT("Род-Айленд")},
- {139, 382, 0, TEXT("Северная Дакота")},
- {139, 398, 0, TEXT("Северная Каролина")},
- {139, 410, 0, TEXT("Теннесси")},
- {139, 422, 0, TEXT("Техас")},
- {139, 406, 0, TEXT("Федеральный округ Колумбия")},
- {139, 404, 0, TEXT("Флорида")},
- {139, 384, 0, TEXT("Южная Дакота")},
- {139, 400, 0, TEXT("Южная Каролина")},
- {139, 436, 0, TEXT("Юта")},
- {140, 1238, 0, TEXT("Сент-Джонс")},
- {140, 2442, 0, lpwszOther},
- {141, 1239, 0, TEXT("Буэнос-Айрес")},
- {141, 2441, 0, lpwszOther},
- {142, 1240, 0, TEXT("Нассау")},
- {142, 2440, 0, lpwszOther},
- {143, 1241, 0, TEXT("Бриджтаун")},
- {143, 2439, 0, lpwszOther},
- {146, 1242, 0, TEXT("Бельмопан")},
- {146, 2438, 0, lpwszOther},
- {144, 1243, 0, TEXT("Ла-Пас")},
- {144, 2437, 0, lpwszOther},
- {145, 1244, 0, TEXT("Бразилиа")},
- {145, 3094, 0, TEXT("Пассо Фундо")},
- {145, 1245, 0, TEXT("Рио-де-Жанейро")},
- {145, 1246, 0, TEXT("Сан-Паулу")},
- {145, 2436, 0, lpwszOther},
- {147, 1247, 0, TEXT("Каракас")},
- {147, 2435, 0, lpwszOther},
- {452, 1190, 0, TEXT("Шарлотта-Амалия")},
- {452, 2364, 0, lpwszOther},
- {149, 1248, 0, TEXT("Порт-о-Пренс")},
- {149, 2434, 0, lpwszOther},
- {148, 1249, 0, TEXT("Джоржтаун")},
- {148, 2433, 0, lpwszOther},
- {173, 1250, 0, TEXT("Гватемала")},
- {173, 2432, 0, lpwszOther},
- {150, 1251, 0, TEXT("Тегусигальпа")},
- {150, 2431, 0, lpwszOther},
- {151, 1252, 0, TEXT("Сент-Джорджес")},
- {151, 2430, 0, lpwszOther},
- {152, 1253, 0, TEXT("Уманак")},
- {152, 2429, 0, lpwszOther},
- {153, 1254, 0, TEXT("Розо")},
- {153, 2428, 0, lpwszOther},
- {154, 1255, 0, TEXT("Санто-Доминго")},
- {154, 2427, 0, lpwszOther},
- {155, 1256, 0, TEXT("Богота")},
- {155, 2426, 0, lpwszOther},
- {156, 1257, 0, TEXT("Сан-Хосе")},
- {156, 2425, 0, lpwszOther},
- {157, 1258, 0, TEXT("Гавана")},
- {157, 2424, 0, lpwszOther},
- {158, 1259, 0, TEXT("Акапулько")},
- {158, 1260, 0, TEXT("Мехико")},
- {158, 2423, 0, lpwszOther},
- {159, 1261, 0, TEXT("Манагуа")},
- {159, 2422, 0, lpwszOther},
- {160, 1262, 0, TEXT("Панама")},
- {160, 2421, 0, lpwszOther},
- {161, 1263, 0, TEXT("Асунсьон")},
- {161, 2420, 0, lpwszOther},
- {162, 1264, 0, TEXT("Лима")},
- {162, 2419, 0, lpwszOther},
- {163, 1265, 0, TEXT("Сан-Сальвадор")},
- {163, 2418, 0, lpwszOther},
- {164, 1266, 0, TEXT("Кингстаун")},
- {164, 2417, 0, lpwszOther},
- {165, 1267, 0, TEXT("Бастер")},
- {165, 2416, 0, lpwszOther},
- {166, 1268, 0, TEXT("Кастри")},
- {166, 2415, 0, lpwszOther},
- {167, 1269, 0, TEXT("Парамарибо")},
- {167, 2414, 0, lpwszOther},
- {168, 1270, 0, TEXT("Порт-оф-Спейн")},
- {168, 2413, 0, lpwszOther},
- {169, 1271, 0, TEXT("Монтевидео")},
- {169, 2412, 0, lpwszOther},
- {170, 1272, 0, TEXT("Сантьяго")},
- {170, 2411, 0, lpwszOther},
- {171, 1273, 0, TEXT("Гуаякиль")},
- {171, 1274, 0, TEXT("Кито")},
- {171, 2410, 0, lpwszOther},
- {172, 1275, 0, TEXT("Кингстон")},
- {172, 2409, 0, lpwszOther},
- {174, 1854, 0, TEXT("Алжир")},
- {174, 2495, 0, lpwszOther},
- {175, 1855, 0, TEXT("Луанда")},
- {175, 2494, 0, lpwszOther},
- {176, 1856, 0, TEXT("Котону")},
- {176, 1857, 0, TEXT("Порто-Ново")},
- {176, 2493, 0, lpwszOther},
- {177, 1858, 0, TEXT("Габороне")},
- {177, 2492, 0, lpwszOther},
- {178, 1859, 0, TEXT("Уагадугу")},
- {178, 2491, 0, lpwszOther},
- {179, 1860, 0, TEXT("Бужумбуру")},
- {179, 2490, 0, lpwszOther},
- {180, 1861, 0, TEXT("Либревиль")},
- {180, 2489, 0, lpwszOther},
- {181, 1862, 0, TEXT("Банжул")},
- {181, 2488, 0, lpwszOther},
- {182, 1863, 0, TEXT("Аккра")},
- {182, 2487, 0, lpwszOther},
- {183, 1864, 0, TEXT("Конакри")},
- {183, 2486, 0, lpwszOther},
- {184, 1865, 0, TEXT("Бисау")},
- {184, 2485, 0, lpwszOther},
- {185, 1866, 0, TEXT("Джибути")},
- {185, 2484, 0, lpwszOther},
- {186, 3312, 0, TEXT("Дахаб")},
- {186, 1867, 0, TEXT("Каир")},
- {186, 1868, 0, TEXT("Хургада")},
- {186, 2483, 0, lpwszOther},
- {187, 1869, 0, TEXT("Лусака")},
- {187, 2482, 0, lpwszOther},
- {23, 1870, 0, TEXT("Хараре")},
- {23, 2481, 0, lpwszOther},
- {188, 1871, 0, TEXT("Прая")},
- {188, 2480, 0, lpwszOther},
- {189, 1872, 0, TEXT("Яунде")},
- {189, 2479, 0, lpwszOther},
- {190, 1873, 0, TEXT("Найроби")},
- {190, 2478, 0, lpwszOther},
- {191, 1874, 0, TEXT("Морони")},
- {191, 2477, 0, lpwszOther},
- {193, 1875, 0, TEXT("Киншаса")},
- {193, 2476, 0, lpwszOther},
- {192, 1876, 0, TEXT("Браззавиль")},
- {192, 2475, 0, lpwszOther},
- {194, 1877, 0, TEXT("Ямусукро")},
- {194, 2474, 0, lpwszOther},
- {195, 1878, 0, TEXT("Масеру")},
- {195, 2473, 0, lpwszOther},
- {196, 1879, 0, TEXT("Монровия")},
- {196, 2472, 0, lpwszOther},
- {197, 1880, 0, TEXT("Триполи")},
- {197, 2471, 0, lpwszOther},
- {198, 1881, 0, TEXT("Порт-Луи")},
- {198, 2470, 0, lpwszOther},
- {199, 1882, 0, TEXT("Нуакшот")},
- {199, 2469, 0, lpwszOther},
- {200, 1883, 0, TEXT("Антананариву")},
- {200, 2468, 0, lpwszOther},
- {201, 1884, 0, TEXT("Лилонгве")},
- {201, 2467, 0, lpwszOther},
- {202, 1885, 0, TEXT("Бамако")},
- {202, 2466, 0, lpwszOther},
- {203, 1886, 0, TEXT("Агадир")},
- {203, 1887, 0, TEXT("Рабат")},
- {203, 2465, 0, lpwszOther},
- {204, 1888, 0, TEXT("Мапуту")},
- {204, 2464, 0, lpwszOther},
- {205, 1889, 0, TEXT("Виндхук")},
- {205, 2463, 0, lpwszOther},
- {206, 1890, 0, TEXT("Ниамей")},
- {206, 2462, 0, lpwszOther},
- {207, 1891, 0, TEXT("Абуджа")},
- {207, 2461, 0, lpwszOther},
- {208, 1892, 0, TEXT("Кигали")},
- {208, 2460, 0, lpwszOther},
- {209, 1893, 0, TEXT("Сан-Томе")},
- {209, 2459, 0, lpwszOther},
- {210, 1894, 0, TEXT("Мбабане")},
- {210, 2458, 0, lpwszOther},
- {211, 1895, 0, TEXT("Виктория")},
- {211, 2457, 0, lpwszOther},
- {212, 1896, 0, TEXT("Дакар")},
- {212, 2456, 0, lpwszOther},
- {213, 1897, 0, TEXT("Могадишо")},
- {213, 2455, 0, lpwszOther},
- {214, 1898, 0, TEXT("Хартум")},
- {214, 2454, 0, lpwszOther},
- {215, 1899, 0, TEXT("Фритаун")},
- {215, 2453, 0, lpwszOther},
- {216, 1900, 0, TEXT("Дар-эс-Салам")},
- {216, 1901, 0, TEXT("Додома")},
- {216, 2452, 0, lpwszOther},
- {217, 1902, 0, TEXT("Ломе")},
- {217, 2451, 0, lpwszOther},
- {218, 1903, 0, TEXT("Тунис")},
- {218, 2450, 0, lpwszOther},
- {219, 1904, 0, TEXT("Кампала")},
- {219, 2449, 0, lpwszOther},
- {220, 1905, 0, TEXT("Банги")},
- {220, 2448, 0, lpwszOther},
- {222, 1906, 0, TEXT("Нджамена")},
- {222, 2447, 0, lpwszOther},
- {223, 1907, 0, TEXT("Малабо")},
- {223, 2446, 0, lpwszOther},
- {221, 1908, 0, TEXT("Асмэра")},
- {221, 2445, 0, lpwszOther},
- {224, 1909, 0, TEXT("Аддис-Абеба")},
- {224, 2444, 0, lpwszOther},
- {225, 1910, 0, TEXT("Дурбан")},
- {225, 1913, 0, TEXT("Йоханнесбург")},
- {225, 1912, 0, TEXT("Кейптаун")},
- {225, 3033, 0, TEXT("Пайнтаун")},
- {225, 1911, 0, TEXT("Претория")},
- {225, 2443, 0, lpwszOther},
- {39, 314, 0, TEXT("Киев")},
- {39, 315, 0, TEXT("Винницкая обл.")},
- {39, 316, 0, TEXT("Волынская обл.")},
- {39, 317, 0, TEXT("Днепропетровская обл.")},
- {39, 318, 0, TEXT("Донецкая обл.")},
- {39, 319, 0, TEXT("Житомирская обл.")},
- {39, 320, 0, TEXT("Закарпатская обл.")},
- {39, 321, 0, TEXT("Запорожская обл.")},
- {39, 322, 0, TEXT("Ивано-Франковская обл.")},
- {39, 323, 0, TEXT("Киевская обл.")},
- {39, 324, 0, TEXT("Кировоградская обл.")},
- {39, 325, 0, TEXT("Крым")},
- {39, 326, 0, TEXT("Луганская обл.")},
- {39, 327, 0, TEXT("Львовская обл.")},
- {39, 328, 0, TEXT("Николаевская обл.")},
- {39, 329, 0, TEXT("Одесская обл.")},
- {39, 330, 0, TEXT("Полтавская обл.")},
- {39, 331, 0, TEXT("Ровенская обл.")},
- {39, 332, 0, TEXT("Сумская обл.")},
- {39, 333, 0, TEXT("Тернопольская обл.")},
- {39, 334, 0, TEXT("Харьковская обл.")},
- {39, 335, 0, TEXT("Херсонская обл.")},
- {39, 336, 0, TEXT("Хмельницкая обл.")},
- {39, 337, 0, TEXT("Черкасская обл.")},
- {39, 338, 0, TEXT("Черниговская обл.")},
- {39, 339, 0, TEXT("Черновицкая обл.")},
- {40, 602, 0, TEXT("Бад Халл")},
- {40, 604, 0, TEXT("Брегенц")},
- {40, 603, 0, TEXT("Вена")},
- {40, 608, 0, TEXT("Грац")},
- {40, 606, 0, TEXT("Зальцбург")},
- {40, 3099, 0, TEXT("Зель-ам-Зее")},
- {40, 605, 0, TEXT("Инсбрук")},
- {40, 3174, 0, TEXT("Кирхберг")},
- {40, 609, 0, TEXT("Клагенфурт")},
- {40, 607, 0, TEXT("Линц")},
- {40, 610, 0, TEXT("Обдах")},
- {40, 611, 0, TEXT("Щтубайтал")},
- {40, 2541, 0, lpwszOther},
- {32, 612, 0, TEXT("Тирана")},
- {32, 2540, 0, lpwszOther},
- {33, 613, 0, TEXT("Андорра-ла-Велья")},
- {33, 2539, 0, lpwszOther},
- {340, 341, 0, TEXT("Минск")},
- {340, 342, 0, TEXT("Брестская обл.")},
- {340, 343, 0, TEXT("Витебская обл.")},
- {340, 344, 0, TEXT("Гомельская обл.")},
- {340, 345, 0, TEXT("Гродненская обл.")},
- {340, 346, 0, TEXT("Минская обл.")},
- {340, 347, 0, TEXT("Могилевская обл.")},
- {38, 760, 0, TEXT("Антверпен")},
- {38, 767, 0, TEXT("Арлон")},
- {38, 762, 0, TEXT("Брюгге")},
- {38, 761, 0, TEXT("Брюссель")},
- {38, 763, 0, TEXT("Гент")},
- {38, 769, 0, TEXT("Лувен")},
- {38, 765, 0, TEXT("Льеж")},
- {38, 764, 0, TEXT("Монс")},
- {38, 3117, 0, TEXT("Мортсель")},
- {38, 766, 0, TEXT("Намюр")},
- {38, 768, 0, TEXT("Хасселт")},
- {38, 2532, 0, lpwszOther},
- {41, 3098, 0, TEXT("Банско")},
- {41, 792, 0, TEXT("Благоевград")},
- {41, 770, 0, TEXT("Бургас")},
- {41, 771, 0, TEXT("Бяла")},
- {41, 773, 0, TEXT("Варна")},
- {41, 776, 0, TEXT("Велико-Тырново")},
- {41, 788, 0, TEXT("Видин")},
- {41, 789, 0, TEXT("Враца")},
- {41, 796, 0, TEXT("Габрово")},
- {41, 777, 0, TEXT("Димитровград")},
- {41, 781, 0, TEXT("Каварна")},
- {41, 786, 0, TEXT("Кырджали")},
- {41, 791, 0, TEXT("Кюстендил")},
- {41, 793, 0, TEXT("Лазарджик")},
- {41, 795, 0, TEXT("Ловеч")},
- {41, 787, 0, TEXT("Михайловград")},
- {41, 790, 0, TEXT("Перник")},
- {41, 3133, 0, TEXT("Пирдоп")},
- {41, 794, 0, TEXT("Плевен")},
- {41, 782, 0, TEXT("Пловдив")},
- {41, 780, 0, TEXT("Разград")},
- {41, 779, 0, TEXT("Русе")},
- {41, 774, 0, TEXT("Силистра")},
- {41, 784, 0, TEXT("Сливен")},
- {41, 772, 0, TEXT("София")},
- {41, 775, 0, TEXT("Толбухин")},
- {41, 3116, 0, TEXT("Тырново")},
- {41, 785, 0, TEXT("Хасково")},
- {41, 778, 0, TEXT("Шумен")},
- {41, 783, 0, TEXT("Ямбол")},
- {41, 2531, 0, lpwszOther},
- {42, 797, 0, TEXT("Баня-Лука")},
- {42, 799, 0, TEXT("Зеница")},
- {42, 798, 0, TEXT("Сараево")},
- {42, 800, 0, TEXT("Тузла")},
- {42, 2530, 0, lpwszOther},
- {45, 802, 0, TEXT("Абердин")},
- {45, 3075, 0, TEXT("Айслворт")},
- {45, 801, 0, TEXT("Алнвик")},
- {45, 804, 0, TEXT("Бидефорд")},
- {45, 803, 0, TEXT("Бирмингем")},
- {45, 805, 0, TEXT("Блоксвич")},
- {45, 3168, 0, TEXT("Бостон")},
- {45, 806, 0, TEXT("Брайтон")},
- {45, 807, 0, TEXT("Бредфорд")},
- {45, 808, 0, TEXT("Бристоль")},
- {45, 809, 0, TEXT("Вилленхолл")},
- {45, 3131, 0, TEXT("Воррингтон")},
- {45, 810, 0, TEXT("Вудбридж")},
- {45, 3342, 0, TEXT("Гилфорд")},
- {45, 811, 0, TEXT("Глазго")},
- {45, 812, 0, TEXT("Дадли")},
- {45, 813, 0, TEXT("Дарем")},
- {45, 814, 0, TEXT("Дуглас")},
- {45, 3089, 0, TEXT("Кардиф")},
- {45, 815, 0, TEXT("Кембридж")},
- {45, 816, 0, TEXT("Кентербери")},
- {45, 817, 0, TEXT("Ливерпуль")},
- {45, 818, 0, TEXT("Лидс")},
- {45, 819, 0, TEXT("Лондон")},
- {45, 820, 0, TEXT("Манчестер")},
- {45, 2976, 0, TEXT("Митчем")},
- {45, 2988, 0, TEXT("Мэйденхед")},
- {45, 821, 0, TEXT("Ноттингем")},
- {45, 3088, 0, TEXT("Ньюпорт")},
- {45, 822, 0, TEXT("Оксфорд")},
- {45, 823, 0, TEXT("Плимут")},
- {45, 824, 0, TEXT("Портсмут")},
- {45, 825, 0, TEXT("Престон")},
- {45, 3343, 0, TEXT("Райд")},
- {45, 2867, 0, TEXT("Ридинг")},
- {45, 2986, 0, TEXT("Сент-Албанс")},
- {45, 826, 0, TEXT("Стаффорд")},
- {45, 3063, 0, TEXT("Стокпорт")},
- {45, 827, 0, TEXT("Уэймут")},
- {45, 3140, 0, TEXT("Челтенхэм")},
- {45, 828, 0, TEXT("Честер")},
- {45, 829, 0, TEXT("Шеффилд")},
- {45, 830, 0, TEXT("Эдинбург")},
- {45, 2529, 0, lpwszOther},
- {44, 831, 0, TEXT("Будапешт")},
- {44, 832, 0, TEXT("Геделле")},
- {44, 836, 0, TEXT("Дебрецен")},
- {44, 835, 0, TEXT("Мишкольц")},
- {44, 834, 0, TEXT("Сегед")},
- {44, 833, 0, TEXT("Шиофок")},
- {44, 2528, 0, lpwszOther},
- {46, 3007, 0, TEXT("Аахен")},
- {46, 837, 0, TEXT("Аугсбург")},
- {46, 838, 0, TEXT("Баден-Баден")},
- {46, 3371, 0, TEXT("Бамберг")},
- {46, 839, 0, TEXT("Бергиш-Гладбах")},
- {46, 840, 0, TEXT("Берлин")},
- {46, 841, 0, TEXT("Билефельд")},
- {46, 3163, 0, TEXT("Бовенден")},
- {46, 842, 0, TEXT("Бонн")},
- {46, 843, 0, TEXT("Браденбург")},
- {46, 3015, 0, TEXT("Брауншвейг")},
- {46, 844, 0, TEXT("Бремен")},
- {46, 2921, 0, TEXT("Варштайн")},
- {46, 845, 0, TEXT("Веймар")},
- {46, 846, 0, TEXT("Вупперталь")},
- {46, 847, 0, TEXT("Гамбург")},
- {46, 848, 0, TEXT("Ганновер")},
- {46, 849, 0, TEXT("Гарделеген")},
- {46, 3010, 0, TEXT("Гейдельберг")},
- {46, 850, 0, TEXT("Гота")},
- {46, 851, 0, TEXT("Дармштадт")},
- {46, 3072, 0, TEXT("Дессау")},
- {46, 852, 0, TEXT("Детмольд")},
- {46, 853, 0, TEXT("Дортмунд")},
- {46, 854, 0, TEXT("Дрезден")},
- {46, 855, 0, TEXT("Дюссельдорф")},
- {46, 3082, 0, TEXT("Иффецхайм")},
- {46, 3309, 0, TEXT("Кассел")},
- {46, 856, 0, TEXT("Кельн")},
- {46, 857, 0, TEXT("Киль")},
- {46, 3138, 0, TEXT("Кобленц")},
- {46, 858, 0, TEXT("Крефельд")},
- {46, 859, 0, TEXT("Лейпциг")},
- {46, 2872, 0, TEXT("Лимбург")},
- {46, 2965, 0, TEXT("Линген")},
- {46, 3135, 0, TEXT("Любек")},
- {46, 3156, 0, TEXT("Мангейм")},
- {46, 3192, 0, TEXT("Меерсбург")},
- {46, 860, 0, TEXT("Мюнстер")},
- {46, 861, 0, TEXT("Мюнхен")},
- {46, 2864, 0, TEXT("Нойштадт")},
- {46, 862, 0, TEXT("Нюрнберг")},
- {46, 3009, 0, TEXT("Оффенбург")},
- {46, 2993, 0, TEXT("Падерборн")},
- {46, 863, 0, TEXT("Равенсбург")},
- {46, 864, 0, TEXT("Регенсбург")},
- {46, 865, 0, TEXT("Рейнен")},
- {46, 866, 0, TEXT("Росток")},
- {46, 3191, 0, TEXT("Саарбрюкен")},
- {46, 2974, 0, TEXT("Санкт-Августин")},
- {46, 3127, 0, TEXT("Тюринген")},
- {46, 867, 0, TEXT("Фрайберг")},
- {46, 868, 0, TEXT("Фрайбург")},
- {46, 869, 0, TEXT("Франкфурт-на-Майне")},
- {46, 3373, 0, TEXT("Хемнитц")},
- {46, 3313, 0, TEXT("Хильден")},
- {46, 870, 0, TEXT("Штутгарт")},
- {46, 3045, 0, TEXT("Эрланген")},
- {46, 2906, 0, TEXT("Эшборн")},
- {46, 2527, 0, lpwszOther},
- {48, 871, 0, TEXT("Афины")},
- {48, 873, 0, TEXT("Ираклион")},
- {48, 3147, 0, TEXT("Корфу")},
- {48, 872, 0, TEXT("Салоники")},
- {48, 3178, 0, TEXT("Халкидики")},
- {48, 2526, 0, lpwszOther},
- {49, 3006, 0, TEXT("Архус")},
- {49, 874, 0, TEXT("Копенгаген")},
- {49, 875, 0, TEXT("Оденсе")},
- {49, 3285, 0, TEXT("Ольборг")},
- {49, 876, 0, TEXT("Сванеке")},
- {49, 3126, 0, TEXT("Скиве")},
- {49, 2525, 0, lpwszOther},
- {50, 3377, 0, TEXT("Виклоу")},
- {50, 3067, 0, TEXT("Голвей")},
- {50, 877, 0, TEXT("Дублин")},
- {50, 3065, 0, TEXT("Килларней")},
- {50, 3066, 0, TEXT("Корк")},
- {50, 878, 0, TEXT("Лимерик")},
- {50, 3069, 0, TEXT("Нейс")},
- {50, 3068, 0, TEXT("Типперэри")},
- {50, 2524, 0, lpwszOther},
- {51, 879, 0, TEXT("Рейкьявик")},
- {51, 2523, 0, lpwszOther},
- {34, 880, 0, TEXT("Аликанте")},
- {34, 3125, 0, TEXT("Альмерия")},
- {34, 881, 0, TEXT("Барселона")},
- {34, 890, 0, TEXT("Бильбао")},
- {34, 3076, 0, TEXT("Бланес")},
- {34, 882, 0, TEXT("Валенсия")},
- {34, 3070, 0, TEXT("Ибица")},
- {34, 888, 0, TEXT("Кадис")},
- {34, 886, 0, TEXT("Картахена")},
- {34, 891, 0, TEXT("Ла-Корунья")},
- {34, 3310, 0, TEXT("Лорет де Мар")},
- {34, 883, 0, TEXT("Мадрид")},
- {34, 884, 0, TEXT("Малага")},
- {34, 885, 0, TEXT("Марбелья")},
- {34, 892, 0, TEXT("Овьедо")},
- {34, 3179, 0, TEXT("Пальма де Майорка")},
- {34, 3177, 0, TEXT("Сан-Агустин")},
- {34, 3289, 0, TEXT("Санта-Крус-де-Тенерифе")},
- {34, 889, 0, TEXT("Сарагоса")},
- {34, 887, 0, TEXT("Севилья")},
- {34, 893, 0, TEXT("Хихон")},
- {34, 2522, 0, lpwszOther},
- {52, 3318, 0, TEXT("Аоста")},
- {52, 3278, 0, TEXT("Беллариа")},
- {52, 906, 0, TEXT("Болонья")},
- {52, 894, 0, TEXT("Брешиа")},
- {52, 895, 0, TEXT("Венеция")},
- {52, 905, 0, TEXT("Верона")},
- {52, 896, 0, TEXT("Генуя")},
- {52, 897, 0, TEXT("Лекко")},
- {52, 3369, 0, TEXT("Ливорно")},
- {52, 3327, 0, TEXT("Марсала")},
- {52, 898, 0, TEXT("Милан")},
- {52, 899, 0, TEXT("Модена")},
- {52, 907, 0, TEXT("Неаполь")},
- {52, 908, 0, TEXT("Перуджа")},
- {52, 900, 0, TEXT("Пиза")},
- {52, 901, 0, TEXT("Рим")},
- {52, 3368, 0, TEXT("Сан-Ремо")},
- {52, 3384, 0, TEXT("Сиракуза")},
- {52, 3252, 0, TEXT("Терамо")},
- {52, 902, 0, TEXT("Триест")},
- {52, 903, 0, TEXT("Турин")},
- {52, 3130, 0, TEXT("Фано")},
- {52, 904, 0, TEXT("Флоренция")},
- {52, 2521, 0, lpwszOther},
- {53, 2939, 0, TEXT("Айзкраукле")},
- {53, 3054, 0, TEXT("Валка")},
- {53, 909, 0, TEXT("Даугавпилс")},
- {53, 2934, 0, TEXT("Екабпилс")},
- {53, 913, 0, TEXT("Елгава")},
- {53, 2935, 0, TEXT("Кокнесе")},
- {53, 912, 0, TEXT("Лиепая")},
- {53, 2905, 0, TEXT("Резекне")},
- {53, 911, 0, TEXT("Рига")},
- {53, 2936, 0, TEXT("Саласпилс")},
- {53, 2937, 0, TEXT("Смилтене")},
- {53, 910, 0, TEXT("Юрмала")},
- {53, 2520, 0, lpwszOther},
- {54, 914, 0, TEXT("Вильнюс")},
- {54, 915, 0, TEXT("Висагинас")},
- {54, 916, 0, TEXT("Каунас")},
- {54, 918, 0, TEXT("Клайпеда")},
- {54, 919, 0, TEXT("Паланга")},
- {54, 3173, 0, TEXT("Пеневежис")},
- {54, 917, 0, TEXT("Шауляй")},
- {54, 2519, 0, lpwszOther},
- {55, 920, 0, TEXT("Вадуц")},
- {55, 2518, 0, lpwszOther},
- {56, 3376, 0, TEXT("Бетцдорф")},
- {56, 921, 0, TEXT("Люксембург")},
- {56, 2517, 0, lpwszOther},
- {57, 3142, 0, TEXT("Битола")},
- {57, 922, 0, TEXT("Скопье")},
- {57, 2516, 0, lpwszOther},
- {58, 923, 0, TEXT("Валлетта")},
- {58, 3154, 0, TEXT("Мзида")},
- {58, 924, 0, TEXT("Слима")},
- {58, 2515, 0, lpwszOther},
- {59, 925, 0, TEXT("Бельцы")},
- {59, 926, 0, TEXT("Бендеры")},
- {59, 3234, 0, TEXT("Дубоссары")},
- {59, 3275, 0, TEXT("Кахул")},
- {59, 927, 0, TEXT("Кишинев")},
- {59, 3321, 0, TEXT("Резина")},
- {59, 928, 0, TEXT("Рыбница")},
- {59, 929, 0, TEXT("Тирасполь")},
- {59, 3281, 0, TEXT("Чадыр-Лунга")},
- {59, 2514, 0, lpwszOther},
- {36, 930, 0, TEXT("Монте-Карло")},
- {36, 2513, 0, lpwszOther},
- {60, 931, 0, TEXT("Амстердам")},
- {60, 933, 0, TEXT("Бреда")},
- {60, 932, 0, TEXT("Гаага")},
- {60, 934, 0, TEXT("Гауда")},
- {60, 935, 0, TEXT("Делфт")},
- {60, 2977, 0, TEXT("Донген")},
- {60, 3030, 0, TEXT("Зволле")},
- {60, 3091, 0, TEXT("Ниймеген")},
- {60, 936, 0, TEXT("Роттердам")},
- {60, 937, 0, TEXT("Утрехт")},
- {60, 3044, 0, TEXT("Эйндховен")},
- {60, 3380, 0, TEXT("Эншеде")},
- {60, 2512, 0, lpwszOther},
- {61, 3190, 0, TEXT("Кристиансанд")},
- {61, 2857, 0, TEXT("Лиллехаммер")},
- {61, 938, 0, TEXT("Осло")},
- {61, 3355, 0, TEXT("Ставангер")},
- {61, 939, 0, TEXT("Тронхейм")},
- {61, 2511, 0, lpwszOther},
- {62, 940, 0, TEXT("Белосток")},
- {62, 941, 0, TEXT("Варшава")},
- {62, 3164, 0, TEXT("Вроцлав")},
- {62, 942, 0, TEXT("Гданьск")},
- {62, 943, 0, TEXT("Гливице")},
- {62, 3237, 0, TEXT("Закопане")},
- {62, 3165, 0, TEXT("Зелена Гура")},
- {62, 944, 0, TEXT("Катовице")},
- {62, 945, 0, TEXT("Краков")},
- {62, 3008, 0, TEXT("Лодзь")},
- {62, 3150, 0, TEXT("Ольштын")},
- {62, 946, 0, TEXT("Познань")},
- {62, 947, 0, TEXT("Радом")},
- {62, 948, 0, TEXT("Сопот")},
- {62, 2958, 0, TEXT("Тыхы")},
- {62, 2510, 0, lpwszOther},
- {35, 949, 0, TEXT("Лиссабон")},
- {35, 950, 0, TEXT("Порто")},
- {35, 2509, 0, lpwszOther},
- {63, 952, 0, TEXT("Брашов")},
- {63, 951, 0, TEXT("Бухарест")},
- {63, 954, 0, TEXT("Констанца")},
- {63, 955, 0, TEXT("Плоешти")},
- {63, 953, 0, TEXT("Яссы")},
- {63, 2508, 0, lpwszOther},
- {64, 956, 0, TEXT("Сан-Марино")},
- {64, 2507, 0, lpwszOther},
- {74, 957, 0, TEXT("Белград")},
- {74, 960, 0, TEXT("Ниш")},
- {74, 958, 0, TEXT("Нови-Сад")},
- {74, 959, 0, TEXT("Сараево")},
- {74, 2506, 0, lpwszOther},
- {65, 961, 0, TEXT("Братислава")},
- {65, 962, 0, TEXT("Кошице")},
- {65, 3101, 0, TEXT("Липтов")},
- {65, 963, 0, TEXT("Попрад")},
- {65, 964, 0, TEXT("Прешов")},
- {65, 965, 0, TEXT("Ружемберок")},
- {65, 966, 0, TEXT("Тврдошин")},
- {65, 2505, 0, lpwszOther},
- {66, 968, 0, TEXT("Копар")},
- {66, 967, 0, TEXT("Любляна")},
- {66, 969, 0, TEXT("Марибор")},
- {66, 2504, 0, lpwszOther},
- {67, 970, 0, TEXT("Торсхавн")},
- {67, 2503, 0, lpwszOther},
- {68, 2888, 0, TEXT("Вантаа")},
- {68, 971, 0, TEXT("Васа")},
- {68, 979, 0, TEXT("Котка")},
- {68, 972, 0, TEXT("Коувола")},
- {68, 980, 0, TEXT("Лахти")},
- {68, 973, 0, TEXT("Оулу")},
- {68, 3375, 0, TEXT("Риихимяки")},
- {68, 3159, 0, TEXT("Руовеси")},
- {68, 974, 0, TEXT("Тампере")},
- {68, 975, 0, TEXT("Турку")},
- {68, 976, 0, TEXT("Хельсинки")},
- {68, 977, 0, TEXT("Эспо")},
- {68, 978, 0, TEXT("Ювяскюля")},
- {68, 2502, 0, lpwszOther},
- {37, 996, 0, TEXT("Авиньон")},
- {37, 983, 0, TEXT("Бержерак")},
- {37, 997, 0, TEXT("Блуа")},
- {37, 984, 0, TEXT("Бордо")},
- {37, 998, 0, TEXT("Дижон")},
- {37, 987, 0, TEXT("Канн")},
- {37, 988, 0, TEXT("Кастр")},
- {37, 993, 0, TEXT("Клермон-Ферран")},
- {37, 3037, 0, TEXT("Лилль")},
- {37, 989, 0, TEXT("Лион")},
- {37, 985, 0, TEXT("Марсель")},
- {37, 991, 0, TEXT("Мец")},
- {37, 3161, 0, TEXT("Мобеж")},
- {37, 990, 0, TEXT("Нанси")},
- {37, 994, 0, TEXT("Нант")},
- {37, 995, 0, TEXT("Ницца")},
- {37, 999, 0, TEXT("Орлеан")},
- {37, 981, 0, TEXT("Париж")},
- {37, 3374, 0, TEXT("Перпиньян")},
- {37, 992, 0, TEXT("Руан")},
- {37, 982, 0, TEXT("Страсбург")},
- {37, 986, 0, TEXT("Тулуза")},
- {37, 3314, 0, TEXT("Шамбери")},
- {37, 2501, 0, lpwszOther},
- {69, 1003, 0, TEXT("Дубровник")},
- {69, 1000, 0, TEXT("Загреб")},
- {69, 1001, 0, TEXT("Задар")},
- {69, 1004, 0, TEXT("Риека")},
- {69, 1002, 0, TEXT("Сплит")},
- {69, 2500, 0, lpwszOther},
- {70, 1005, 0, TEXT("Брно")},
- {70, 3291, 0, TEXT("Гавличкув-Брод")},
- {70, 1007, 0, TEXT("Градец-Кралове")},
- {70, 1008, 0, TEXT("Карлови-Вари")},
- {70, 3019, 0, TEXT("Кладрубы")},
- {70, 1010, 0, TEXT("Лоуни")},
- {70, 1009, 0, TEXT("Острава")},
- {70, 1015, 0, TEXT("Пльзень")},
- {70, 3105, 0, TEXT("Правчицка Брана")},
- {70, 1006, 0, TEXT("Прага")},
- {70, 3246, 0, TEXT("Тачов")},
- {70, 1011, 0, TEXT("Тршебич")},
- {70, 1012, 0, TEXT("Усти-над-Лабем")},
- {70, 1014, 0, TEXT("Ческе-Будеевице")},
- {70, 1013, 0, TEXT("Яблонец-над-Нисоу")},
- {70, 2499, 0, lpwszOther},
- {71, 1016, 0, TEXT("Арау")},
- {71, 1019, 0, TEXT("Баден")},
- {71, 1017, 0, TEXT("Базель")},
- {71, 1018, 0, TEXT("Берн")},
- {71, 1020, 0, TEXT("Биль")},
- {71, 1021, 0, TEXT("Винтертур")},
- {71, 1022, 0, TEXT("Давос")},
- {71, 3189, 0, TEXT("Делемонт")},
- {71, 1023, 0, TEXT("Женева")},
- {71, 1024, 0, TEXT("Золотурн")},
- {71, 1025, 0, TEXT("Лозанна")},
- {71, 1026, 0, TEXT("Локарно")},
- {71, 1027, 0, TEXT("Лугано")},
- {71, 1028, 0, TEXT("Люцерн")},
- {71, 1029, 0, TEXT("Монтре")},
- {71, 1030, 0, TEXT("Цюрих")},
- {71, 2498, 0, lpwszOther},
- {72, 2883, 0, TEXT("Арбога")},
- {72, 1031, 0, TEXT("Гетеборг")},
- {72, 1032, 0, TEXT("Кальмар")},
- {72, 1037, 0, TEXT("Лахольм")},
- {72, 1036, 0, TEXT("Лулео")},
- {72, 1042, 0, TEXT("Лунд")},
- {72, 1033, 0, TEXT("Мальме")},
- {72, 1034, 0, TEXT("Стокгольм")},
- {72, 1041, 0, TEXT("Умео")},
- {72, 1039, 0, TEXT("Фалун")},
- {72, 1043, 0, TEXT("Хельсинборг")},
- {72, 1040, 0, TEXT("Хернесанд")},
- {72, 1038, 0, TEXT("Эстерсунд")},
- {72, 2497, 0, lpwszOther},
- {73, 3013, 0, TEXT("Валга")},
- {73, 1044, 0, TEXT("Кейла")},
- {73, 1045, 0, TEXT("Кохтла-Ярве")},
- {73, 1046, 0, TEXT("Маарду")},
- {73, 1047, 0, TEXT("Мыйзакюла")},
- {73, 1048, 0, TEXT("Нарва")},
- {73, 1049, 0, TEXT("Пярну")},
- {73, 1050, 0, TEXT("Раквере")},
- {73, 1051, 0, TEXT("Силламяэ")},
- {73, 1052, 0, TEXT("Таллин")},
- {73, 1053, 0, TEXT("Тарту")},
- {73, 1054, 0, TEXT("Хаапсалу")},
- {0, 0, 0, NULL}
+ {24, 0, 0, TEXT("Россия")},
+ {81, 0, 0, TEXT("Азербайджан")},
+ {82, 0, 0, TEXT("Армения")},
+ {97, 0, 0, TEXT("Афганистан")},
+ {96, 0, 0, TEXT("Бангладеш")},
+ {99, 0, 0, TEXT("Бахрейн")},
+ {100, 0, 0, TEXT("Бруней-Даруссалам")},
+ {101, 0, 0, TEXT("Бутан")},
+ {102, 0, 0, TEXT("Вьетнам")},
+ {83, 0, 0, TEXT("Грузия")},
+ {86, 0, 0, TEXT("Израиль")},
+ {95, 0, 0, TEXT("Индия")},
+ {103, 0, 0, TEXT("Индонезия")},
+ {79, 0, 0, TEXT("Иордания")},
+ {85, 0, 0, TEXT("Ирак")},
+ {87, 0, 0, TEXT("Иран")},
+ {104, 0, 0, TEXT("Йемен")},
+ {84, 0, 0, TEXT("Казахстан")},
+ {105, 0, 0, TEXT("Камбоджа")},
+ {106, 0, 0, TEXT("Катар")},
+ {107, 0, 0, TEXT("Кипр")},
+ {92, 0, 0, TEXT("Киргизия (Кыргызстан)")},
+ {76, 0, 0, TEXT("Китай")},
+ {3215, 0, 0, TEXT("Кокосовые острова (Австр.)")},
+ {29, 0, 0, TEXT("Корея (КНДР)")},
+ {108, 0, 0, TEXT("Корея")},
+ {88, 0, 0, TEXT("Кувейт")},
+ {109, 0, 0, TEXT("Лаос")},
+ {110, 0, 0, TEXT("Ливан")},
+ {111, 0, 0, TEXT("Малайзия")},
+ {112, 0, 0, TEXT("Мальдивы")},
+ {113, 0, 0, TEXT("Монголия")},
+ {114, 0, 0, TEXT("Мьянма")},
+ {115, 0, 0, TEXT("Непал")},
+ {116, 0, 0, TEXT("Объединенные Арабские Эмираты")},
+ {117, 0, 0, TEXT("Оман")},
+ {3216, 0, 0, TEXT("Остров Рождества (Австр.)")},
+ {122, 0, 0, TEXT("Пакистан")},
+ {89, 0, 0, TEXT("Палестина")},
+ {94, 0, 0, TEXT("Саудовская Аравия")},
+ {118, 0, 0, TEXT("Сингапур")},
+ {78, 0, 0, TEXT("Сирия")},
+ {91, 0, 0, TEXT("Таджикистан")},
+ {119, 0, 0, TEXT("Таиланд")},
+ {120, 0, 0, TEXT("Тайвань")},
+ {132, 0, 0, TEXT("Тимор")},
+ {90, 0, 0, TEXT("Туркмения")},
+ {77, 0, 0, TEXT("Турция")},
+ {93, 0, 0, TEXT("Узбекистан")},
+ {121, 0, 0, TEXT("Филиппины")},
+ {98, 0, 0, TEXT("Шри Ланка")},
+ {75, 0, 0, TEXT("Япония")},
+ {123, 0, 0, TEXT("Австралия")},
+ {454, 0, 0, TEXT("Американское Самоа")},
+ {124, 0, 0, TEXT("Вануату")},
+ {453, 0, 0, TEXT("Гуам (США)")},
+ {126, 0, 0, TEXT("Кирибати")},
+ {127, 0, 0, TEXT("Маршалловы Острова")},
+ {128, 0, 0, TEXT("Микронезия (Федеративные Штаты Микронезии)")},
+ {129, 0, 0, TEXT("Науру")},
+ {3220, 0, 0, TEXT("Ниуэ (Н.Зел.)")},
+ {130, 0, 0, TEXT("Новая Зеландия")},
+ {3218, 0, 0, TEXT("Новая Каледония (Фр.)")},
+ {3221, 0, 0, TEXT("Острова Кука (Н.Зел.)")},
+ {3230, 0, 0, TEXT("Острова Херд и Макдональд (Австр.)")},
+ {131, 0, 0, TEXT("Палау")},
+ {133, 0, 0, TEXT("Папуа - Новая Гвинея")},
+ {3222, 0, 0, TEXT("Питкерн (Брит.)")},
+ {125, 0, 0, TEXT("Самоа")},
+ {3219, 0, 0, TEXT("Сев. Марианские острова (США)")},
+ {134, 0, 0, TEXT("Соломоновы Острова")},
+ {3223, 0, 0, TEXT("Токелау (Н.Зел.)")},
+ {135, 0, 0, TEXT("Тонга")},
+ {136, 0, 0, TEXT("Тувалу")},
+ {3224, 0, 0, TEXT("Уоллис и Футуна острова (Фр.)")},
+ {137, 0, 0, TEXT("Фиджи")},
+ {3226, 0, 0, TEXT("Французская Полинезия")},
+ {3225, 0, 0, TEXT("Французские Южные территории")},
+ {138, 0, 0, TEXT("Канада")},
+ {139, 0, 0, TEXT("США")},
+ {3200, 0, 0, TEXT("Ангилья (Брит.)")},
+ {140, 0, 0, TEXT("Антигуа и Барбуда")},
+ {141, 0, 0, TEXT("Аргентина")},
+ {3202, 0, 0, TEXT("Аруба (Нид.)")},
+ {142, 0, 0, TEXT("Багамы")},
+ {143, 0, 0, TEXT("Барбадос")},
+ {146, 0, 0, TEXT("Белиз")},
+ {3203, 0, 0, TEXT("Бермуды (Брит.)")},
+ {144, 0, 0, TEXT("Боливия")},
+ {145, 0, 0, TEXT("Бразилия")},
+ {147, 0, 0, TEXT("Венесуэла")},
+ {3204, 0, 0, TEXT("Виргинские острова (Брит.)")},
+ {452, 0, 0, TEXT("Виргинские острова (США)")},
+ {149, 0, 0, TEXT("Гаити")},
+ {148, 0, 0, TEXT("Гайана")},
+ {3205, 0, 0, TEXT("Гваделупа (Фр.)")},
+ {173, 0, 0, TEXT("Гватемала")},
+ {150, 0, 0, TEXT("Гондурас")},
+ {151, 0, 0, TEXT("Гренада")},
+ {152, 0, 0, TEXT("Гренландия (Дат.)")},
+ {153, 0, 0, TEXT("Доминика")},
+ {154, 0, 0, TEXT("Доминиканская Республика")},
+ {155, 0, 0, TEXT("Колумбия")},
+ {156, 0, 0, TEXT("Коста-Рика")},
+ {157, 0, 0, TEXT("Куба")},
+ {3208, 0, 0, TEXT("Мартиника (Фр.)")},
+ {158, 0, 0, TEXT("Мексика")},
+ {3209, 0, 0, TEXT("Монтсеррат (Брит)")},
+ {3201, 0, 0, TEXT("Нидерландские Антилы")},
+ {159, 0, 0, TEXT("Никарагуа")},
+ {3207, 0, 0, TEXT("Остров Кайман (Брит.)")},
+ {3211, 0, 0, TEXT("Острова Теркс и Кайкос (Брит.)")},
+ {160, 0, 0, TEXT("Панама")},
+ {161, 0, 0, TEXT("Парагвай")},
+ {162, 0, 0, TEXT("Перу")},
+ {163, 0, 0, TEXT("Сальвадор")},
+ {164, 0, 0, TEXT("Сент-Винсент и Гренадины")},
+ {165, 0, 0, TEXT("Сент-Китс и Невис")},
+ {166, 0, 0, TEXT("Сент-Люсия")},
+ {3210, 0, 0, TEXT("Сент-Пьер и Микелон (Фр.)")},
+ {167, 0, 0, TEXT("Суринам")},
+ {168, 0, 0, TEXT("Тринидат и Тобаго")},
+ {169, 0, 0, TEXT("Уругвай")},
+ {3212, 0, 0, TEXT("Фолклендские острова (Брит.)")},
+ {3206, 0, 0, TEXT("Французская Гвиана")},
+ {170, 0, 0, TEXT("Чили")},
+ {171, 0, 0, TEXT("Эквадор")},
+ {3213, 0, 0, TEXT("Юж. Джорджия и Юж. Сандвичевы о-ва (Брит.)")},
+ {172, 0, 0, TEXT("Ямайка")},
+ {174, 0, 0, TEXT("Алжир")},
+ {175, 0, 0, TEXT("Ангола")},
+ {176, 0, 0, TEXT("Бенин")},
+ {177, 0, 0, TEXT("Ботсвана")},
+ {3228, 0, 0, TEXT("Британская территория в Индийском океане")},
+ {178, 0, 0, TEXT("Буркина-Фасо")},
+ {179, 0, 0, TEXT("Бурунди")},
+ {180, 0, 0, TEXT("Габон")},
+ {181, 0, 0, TEXT("Гамбия")},
+ {182, 0, 0, TEXT("Гана")},
+ {183, 0, 0, TEXT("Гвинея")},
+ {184, 0, 0, TEXT("Гвинея-Бисау")},
+ {185, 0, 0, TEXT("Джибути")},
+ {186, 0, 0, TEXT("Египет")},
+ {187, 0, 0, TEXT("Замбия")},
+ {3198, 0, 0, TEXT("Зап. Сахара")},
+ {23, 0, 0, TEXT("Зимбабве")},
+ {188, 0, 0, TEXT("Кабо-Верде")},
+ {189, 0, 0, TEXT("Камерун")},
+ {190, 0, 0, TEXT("Кения")},
+ {191, 0, 0, TEXT("Коморы")},
+ {193, 0, 0, TEXT("Конго (Заир)")},
+ {192, 0, 0, TEXT("Конго")},
+ {194, 0, 0, TEXT("Кот-д`Ивуар")},
+ {195, 0, 0, TEXT("Лесото")},
+ {196, 0, 0, TEXT("Либерия")},
+ {197, 0, 0, TEXT("Ливия")},
+ {198, 0, 0, TEXT("Маврикий")},
+ {199, 0, 0, TEXT("Мавритания")},
+ {200, 0, 0, TEXT("Мадагаскар")},
+ {3229, 0, 0, TEXT("Майотт (Фр.)")},
+ {201, 0, 0, TEXT("Малави")},
+ {202, 0, 0, TEXT("Мали")},
+ {203, 0, 0, TEXT("Марокко")},
+ {204, 0, 0, TEXT("Мозамбик")},
+ {205, 0, 0, TEXT("Намибия")},
+ {206, 0, 0, TEXT("Нигер")},
+ {207, 0, 0, TEXT("Нигерия")},
+ {3227, 0, 0, TEXT("Остров Буве (Норв.)")},
+ {3197, 0, 0, TEXT("Реюньон (Фр.)")},
+ {208, 0, 0, TEXT("Руанда")},
+ {209, 0, 0, TEXT("Сан-Томе и Принсипи")},
+ {210, 0, 0, TEXT("Свазиленд")},
+ {3199, 0, 0, TEXT("Святая Елена (Брит.)")},
+ {211, 0, 0, TEXT("Сейшелы")},
+ {212, 0, 0, TEXT("Сенегал")},
+ {213, 0, 0, TEXT("Сомали")},
+ {214, 0, 0, TEXT("Судан")},
+ {215, 0, 0, TEXT("Сьерра-Леоне")},
+ {216, 0, 0, TEXT("Танзания")},
+ {217, 0, 0, TEXT("Того")},
+ {218, 0, 0, TEXT("Тунис")},
+ {219, 0, 0, TEXT("Уганда")},
+ {220, 0, 0, TEXT("Центральноафриканская Республика")},
+ {222, 0, 0, TEXT("Чад")},
+ {223, 0, 0, TEXT("Экваториальная Гвинея")},
+ {221, 0, 0, TEXT("Эритрея")},
+ {224, 0, 0, TEXT("Эфиопия")},
+ {225, 0, 0, TEXT("Южно-Африканская Республика (ЮАР)")},
+ {39, 0, 0, TEXT("Украина")},
+ {40, 0, 0, TEXT("Австрия")},
+ {32, 0, 0, TEXT("Албания")},
+ {33, 0, 0, TEXT("Андорра")},
+ {340, 0, 0, TEXT("Белоруссия")},
+ {38, 0, 0, TEXT("Бельгия")},
+ {41, 0, 0, TEXT("Болгария")},
+ {42, 0, 0, TEXT("Босния и Герцеговина")},
+ {43, 0, 0, TEXT("Ватикан")},
+ {45, 0, 0, TEXT("Великобритания")},
+ {44, 0, 0, TEXT("Венгрия")},
+ {46, 0, 0, TEXT("Германия")},
+ {3193, 0, 0, TEXT("Гернси (Брит.)")},
+ {47, 0, 0, TEXT("Гибралтар (Брит.)")},
+ {48, 0, 0, TEXT("Греция")},
+ {49, 0, 0, TEXT("Дания")},
+ {3194, 0, 0, TEXT("Джерси (Брит.)")},
+ {50, 0, 0, TEXT("Ирландия")},
+ {51, 0, 0, TEXT("Исландия")},
+ {34, 0, 0, TEXT("Испания")},
+ {52, 0, 0, TEXT("Италия")},
+ {53, 0, 0, TEXT("Латвия")},
+ {54, 0, 0, TEXT("Литва")},
+ {55, 0, 0, TEXT("Лихтенштейн")},
+ {56, 0, 0, TEXT("Люксембург")},
+ {57, 0, 0, TEXT("Македония")},
+ {58, 0, 0, TEXT("Мальта")},
+ {59, 0, 0, TEXT("Молдавия")},
+ {36, 0, 0, TEXT("Монако")},
+ {60, 0, 0, TEXT("Нидерланды")},
+ {61, 0, 0, TEXT("Норвегия")},
+ {3195, 0, 0, TEXT("Остров Мэн (Брит.)")},
+ {62, 0, 0, TEXT("Польша")},
+ {35, 0, 0, TEXT("Португалия")},
+ {63, 0, 0, TEXT("Румыния")},
+ {64, 0, 0, TEXT("Сан-Марино")},
+ {74, 0, 0, TEXT("Сербия и Черногория")},
+ {65, 0, 0, TEXT("Словакия")},
+ {66, 0, 0, TEXT("Словения")},
+ {67, 0, 0, TEXT("Фарерские о-ва (Дания)")},
+ {68, 0, 0, TEXT("Финляндия")},
+ {37, 0, 0, TEXT("Франция")},
+ {69, 0, 0, TEXT("Хорватия")},
+ {70, 0, 0, TEXT("Чехия")},
+ {71, 0, 0, TEXT("Швейцария")},
+ {72, 0, 0, TEXT("Швеция")},
+ {3196, 0, 0, TEXT("Шпицберген (Норв.)")},
+ {73, 0, 0, TEXT("Эстония")},
+ {24, 25, 0, TEXT("Москва")},
+ {24, 226, 0, TEXT("Санкт-Петербург")},
+ {24, 233, 0, TEXT("Саха (Якутия)")},
+ {24, 232, 0, TEXT("Приморский край")},
+ {24, 235, 0, TEXT("Хабаровский край")},
+ {24, 227, 0, TEXT("Амурская обл.")},
+ {24, 229, 0, TEXT("Камчатская обл.")},
+ {24, 231, 0, TEXT("Магаданская обл.")},
+ {24, 234, 0, TEXT("Сахалинская обл.")},
+ {24, 228, 0, TEXT("Еврейская АО")},
+ {24, 230, 0, TEXT("Корякский АО")},
+ {24, 236, 0, TEXT("Чукотский АО")},
+ {24, 237, 0, TEXT("Башкортостан")},
+ {24, 240, 0, TEXT("Марий-Эл")},
+ {24, 241, 0, TEXT("Мордовия")},
+ {24, 248, 0, TEXT("Татарстан")},
+ {24, 249, 0, TEXT("Удмуртия")},
+ {24, 251, 0, TEXT("Чувашия")},
+ {24, 238, 0, TEXT("Кировская обл.")},
+ {24, 242, 0, TEXT("Нижегородская обл.")},
+ {24, 243, 0, TEXT("Оренбургская обл.")},
+ {24, 244, 0, TEXT("Пензенская обл.")},
+ {24, 245, 0, TEXT("Пермская обл.")},
+ {24, 246, 0, TEXT("Самарская обл.")},
+ {24, 247, 0, TEXT("Саратовская обл.")},
+ {24, 250, 0, TEXT("Ульяновская обл.")},
+ {24, 239, 0, TEXT("Коми-Пермяцкий АО")},
+ {24, 255, 0, TEXT("Карелия")},
+ {24, 256, 0, TEXT("Коми")},
+ {24, 252, 0, TEXT("Архангельская обл.")},
+ {24, 253, 0, TEXT("Вологодская обл.")},
+ {24, 254, 0, TEXT("Калининградская обл.")},
+ {24, 257, 0, TEXT("Ленинградская обл.")},
+ {24, 258, 0, TEXT("Мурманская обл.")},
+ {24, 260, 0, TEXT("Новгородская обл.")},
+ {24, 261, 0, TEXT("Псковская обл.")},
+ {24, 259, 0, TEXT("Ненецкий АО")},
+ {24, 265, 0, TEXT("Бурятия")},
+ {24, 263, 0, TEXT("Республика Алтай")},
+ {24, 273, 0, TEXT("Тыва")},
+ {24, 275, 0, TEXT("Хакасия")},
+ {24, 264, 0, TEXT("Алтайский край")},
+ {24, 268, 0, TEXT("Красноярский край")},
+ {24, 266, 0, TEXT("Иркутская обл.")},
+ {24, 267, 0, TEXT("Кемеровская обл.")},
+ {24, 269, 0, TEXT("Новосибирская обл.")},
+ {24, 270, 0, TEXT("Омская обл.")},
+ {24, 272, 0, TEXT("Томская обл.")},
+ {24, 276, 0, TEXT("Читинская обл.")},
+ {24, 262, 0, TEXT("Агинский Бурятский АО")},
+ {24, 271, 0, TEXT("Таймырский АО")},
+ {24, 274, 0, TEXT("Усть-Ордынский Бурятский АО")},
+ {24, 277, 0, TEXT("Эвенкийский АО")},
+ {24, 278, 0, TEXT("Курганская обл.")},
+ {24, 279, 0, TEXT("Свердловская обл.")},
+ {24, 280, 0, TEXT("Тюменская обл.")},
+ {24, 282, 0, TEXT("Челябинская обл.")},
+ {24, 281, 0, TEXT("Ханты-Мансийский АО - Югра")},
+ {24, 283, 0, TEXT("Ямало-Ненецкий АО")},
+ {24, 284, 0, TEXT("Белгородская обл.")},
+ {24, 285, 0, TEXT("Брянская обл.")},
+ {24, 286, 0, TEXT("Владимирская обл.")},
+ {24, 287, 0, TEXT("Воронежская обл.")},
+ {24, 288, 0, TEXT("Ивановская обл.")},
+ {24, 289, 0, TEXT("Калужская обл.")},
+ {24, 290, 0, TEXT("Костромская обл.")},
+ {24, 291, 0, TEXT("Курская обл.")},
+ {24, 292, 0, TEXT("Липецкая обл.")},
+ {24, 293, 0, TEXT("Московская обл.")},
+ {24, 294, 0, TEXT("Орловская обл.")},
+ {24, 295, 0, TEXT("Рязанская обл.")},
+ {24, 296, 0, TEXT("Смоленская обл.")},
+ {24, 297, 0, TEXT("Тамбовская обл.")},
+ {24, 298, 0, TEXT("Тверская обл.")},
+ {24, 299, 0, TEXT("Тульская обл.")},
+ {24, 300, 0, TEXT("Ярославская обл.")},
+ {24, 301, 0, TEXT("Адыгея")},
+ {24, 304, 0, TEXT("Дагестан")},
+ {24, 305, 0, TEXT("Ингушетия")},
+ {24, 306, 0, TEXT("Кабардино-Балкария")},
+ {24, 307, 0, TEXT("Калмыкия")},
+ {24, 308, 0, TEXT("Карачаево-Черкессия")},
+ {24, 311, 0, TEXT("Северная Осетия - Алания")},
+ {24, 313, 0, TEXT("Чечня")},
+ {24, 309, 0, TEXT("Краснодарский край")},
+ {24, 312, 0, TEXT("Ставропольский край")},
+ {24, 302, 0, TEXT("Астраханская обл.")},
+ {24, 303, 0, TEXT("Волгоградская обл.")},
+ {24, 310, 0, TEXT("Ростовская обл.")},
+ {81, 1055, 0, TEXT("Баку")},
+ {81, 1058, 0, TEXT("Гянджа")},
+ {81, 1056, 0, TEXT("Нахичевань")},
+ {81, 1057, 0, TEXT("Ханкенди")},
+ {81, 3153, 0, TEXT("Шеки")},
+ {81, 2291, 0, lpwszOther},
+ {82, 2932, 0, TEXT("Абовян")},
+ {82, 1060, 0, TEXT("Аштарак")},
+ {82, 3084, 0, TEXT("Ванадзор")},
+ {82, 3011, 0, TEXT("Гюмри")},
+ {82, 3306, 0, TEXT("Дилижан")},
+ {82, 1059, 0, TEXT("Ереван")},
+ {82, 3145, 0, TEXT("Ханкенди")},
+ {82, 2292, 0, lpwszOther},
+ {97, 1061, 0, TEXT("Кабул")},
+ {97, 2293, 0, lpwszOther},
+ {96, 1062, 0, TEXT("Дакка")},
+ {96, 2294, 0, lpwszOther},
+ {99, 1063, 0, TEXT("Манама")},
+ {99, 2295, 0, lpwszOther},
+ {100, 1064, 0, TEXT("Бандар-Сери-Бегаван")},
+ {100, 2296, 0, lpwszOther},
+ {101, 1065, 0, TEXT("Тхимпху")},
+ {101, 2297, 0, lpwszOther},
+ {102, 1066, 0, TEXT("Ханой")},
+ {102, 2298, 0, lpwszOther},
+ {83, 1067, 0, TEXT("Батуми")},
+ {83, 3158, 0, TEXT("Боржоми")},
+ {83, 1068, 0, TEXT("Поти")},
+ {83, 3129, 0, TEXT("Рустави")},
+ {83, 1069, 0, TEXT("Сухуми")},
+ {83, 1070, 0, TEXT("Тбилиси")},
+ {83, 2299, 0, lpwszOther},
+ {86, 3345, 0, TEXT("Ариэль")},
+ {86, 1071, 0, TEXT("Афула")},
+ {86, 2992, 0, TEXT("Ашдод")},
+ {86, 3175, 0, TEXT("Ашкелон")},
+ {86, 3363, 0, TEXT("Бат-Ям")},
+ {86, 2884, 0, TEXT("Беер-Яков")},
+ {86, 3243, 0, TEXT("Бейт-Шемеш")},
+ {86, 1074, 0, TEXT("Беэр-Шева")},
+ {86, 3348, 0, TEXT("Герцелия")},
+ {86, 3241, 0, TEXT("Димона")},
+ {86, 1075, 0, TEXT("Иерусалим")},
+ {86, 3350, 0, TEXT("Йокнеам-Иллит")},
+ {86, 2982, 0, TEXT("Кармиэль")},
+ {86, 2971, 0, TEXT("Кфар-Саба")},
+ {86, 3136, 0, TEXT("Назарет")},
+ {86, 1080, 0, TEXT("Натания")},
+ {86, 3303, 0, TEXT("Офаким")},
+ {86, 3050, 0, TEXT("Раанана")},
+ {86, 3151, 0, TEXT("Рамат Ган")},
+ {86, 3141, 0, TEXT("Реховот")},
+ {86, 3012, 0, TEXT("Ришон ле Цион")},
+ {86, 1081, 0, TEXT("Тверия")},
+ {86, 1077, 0, TEXT("Тель-Авив")},
+ {86, 1079, 0, TEXT("Хадера")},
+ {86, 1078, 0, TEXT("Хайфа")},
+ {86, 1076, 0, TEXT("Хеврон")},
+ {86, 2929, 0, TEXT("Цфат")},
+ {86, 2928, 0, TEXT("Эйлат")},
+ {86, 2300, 0, lpwszOther},
+ {95, 3315, 0, TEXT("Бангалор")},
+ {95, 1082, 0, TEXT("Дели")},
+ {95, 1083, 0, TEXT("Джайпур")},
+ {95, 3144, 0, TEXT("Калькутта")},
+ {95, 3025, 0, TEXT("Мумбаи")},
+ {95, 3277, 0, TEXT("Панаджи")},
+ {95, 1084, 0, TEXT("Ченнаи")},
+ {95, 2301, 0, lpwszOther},
+ {103, 1085, 0, TEXT("Джакарта")},
+ {103, 2302, 0, lpwszOther},
+ {79, 1086, 0, TEXT("Амман")},
+ {79, 2303, 0, lpwszOther},
+ {85, 1087, 0, TEXT("Багдад")},
+ {85, 2304, 0, lpwszOther},
+ {87, 1088, 0, TEXT("Тегеран")},
+ {87, 2305, 0, lpwszOther},
+ {104, 1089, 0, TEXT("Сана")},
+ {104, 2306, 0, lpwszOther},
+ {84, 1090, 0, TEXT("Актау")},
+ {84, 1091, 0, TEXT("Актюбинск")},
+ {84, 1092, 0, TEXT("Алма-Ата")},
+ {84, 3242, 0, TEXT("Аршалы")},
+ {84, 1093, 0, TEXT("Астана")},
+ {84, 1094, 0, TEXT("Атырау (Гурьев)")},
+ {84, 1095, 0, TEXT("Байконур")},
+ {84, 3245, 0, TEXT("Балхаш")},
+ {84, 3083, 0, TEXT("Жезказган")},
+ {84, 1096, 0, TEXT("Капчагай")},
+ {84, 1097, 0, TEXT("Караганда")},
+ {84, 1098, 0, TEXT("Кокшетау")},
+ {84, 1099, 0, TEXT("Кустанай")},
+ {84, 2868, 0, TEXT("Лисаковск")},
+ {84, 1100, 0, TEXT("Павлодар")},
+ {84, 1101, 0, TEXT("Петропавловск (Сев.-Каз. обл.)")},
+ {84, 1102, 0, TEXT("Рудный")},
+ {84, 1103, 0, TEXT("Семипалатинск")},
+ {84, 1104, 0, TEXT("Степногорск")},
+ {84, 3166, 0, TEXT("Талгар")},
+ {84, 1105, 0, TEXT("Талды-Курган")},
+ {84, 2927, 0, TEXT("Тараз")},
+ {84, 1106, 0, TEXT("Темиртау")},
+ {84, 1107, 0, TEXT("Уральск")},
+ {84, 1108, 0, TEXT("Усть-Каменогорск")},
+ {84, 1109, 0, TEXT("Чимкент")},
+ {84, 1110, 0, TEXT("Экибастуз")},
+ {84, 2307, 0, lpwszOther},
+ {105, 1111, 0, TEXT("Пномпень")},
+ {105, 2308, 0, lpwszOther},
+ {106, 1112, 0, TEXT("Доха")},
+ {106, 2309, 0, lpwszOther},
+ {107, 1113, 0, TEXT("Ларнака")},
+ {107, 1114, 0, TEXT("Лимассол")},
+ {107, 1115, 0, TEXT("Никосия")},
+ {107, 2954, 0, TEXT("Пафос")},
+ {107, 2310, 0, lpwszOther},
+ {92, 1116, 0, TEXT("Бишкек")},
+ {92, 1117, 0, TEXT("Джалал-Абад")},
+ {92, 3027, 0, TEXT("Кара-Балта")},
+ {92, 1118, 0, TEXT("Каракол")},
+ {92, 1119, 0, TEXT("Ош")},
+ {92, 1120, 0, TEXT("Талас")},
+ {92, 2933, 0, TEXT("Хайдаркен")},
+ {92, 2311, 0, lpwszOther},
+ {76, 3214, 0, TEXT("Аомынь (Макао)")},
+ {76, 1121, 0, TEXT("Гонконг")},
+ {76, 2869, 0, TEXT("Гуанчжоу")},
+ {76, 3262, 0, TEXT("Далянь")},
+ {76, 1122, 0, TEXT("Пекин")},
+ {76, 1123, 0, TEXT("Харбин")},
+ {76, 1124, 0, TEXT("Шанхай")},
+ {76, 3043, 0, TEXT("Шеньян")},
+ {76, 2312, 0, lpwszOther},
+ {29, 1125, 0, TEXT("Пхеньян")},
+ {29, 2313, 0, lpwszOther},
+ {108, 1126, 0, TEXT("Сеул")},
+ {108, 3240, 0, TEXT("Тейджон")},
+ {108, 2314, 0, lpwszOther},
+ {88, 1127, 0, TEXT("Эль-Кувейт")},
+ {88, 2315, 0, lpwszOther},
+ {109, 1128, 0, TEXT("Вьентьян")},
+ {109, 2316, 0, lpwszOther},
+ {110, 1129, 0, TEXT("Бейрут")},
+ {110, 2317, 0, lpwszOther},
+ {111, 1130, 0, TEXT("Джохор-Бару")},
+ {111, 1131, 0, TEXT("Куала-Лумпур")},
+ {111, 2318, 0, lpwszOther},
+ {112, 1132, 0, TEXT("Мале")},
+ {112, 2319, 0, lpwszOther},
+ {113, 1133, 0, TEXT("Улан-Батор")},
+ {113, 1134, 0, TEXT("Эрдэнэт")},
+ {113, 2320, 0, lpwszOther},
+ {114, 1135, 0, TEXT("Янгон")},
+ {114, 2321, 0, lpwszOther},
+ {115, 1136, 0, TEXT("Катманду")},
+ {115, 2322, 0, lpwszOther},
+ {116, 1137, 0, TEXT("Абу-Даби")},
+ {116, 1138, 0, TEXT("Дубай")},
+ {116, 1139, 0, TEXT("Шарджа")},
+ {116, 2323, 0, lpwszOther},
+ {117, 1140, 0, TEXT("Маскат")},
+ {117, 2324, 0, lpwszOther},
+ {122, 1141, 0, TEXT("Исламабад")},
+ {122, 2325, 0, lpwszOther},
+ {89, 1072, 0, TEXT("Ашдод")},
+ {89, 1073, 0, TEXT("Ашкелон")},
+ {89, 1142, 0, TEXT("Газа")},
+ {89, 2326, 0, lpwszOther},
+ {94, 3250, 0, TEXT("Медина")},
+ {94, 1143, 0, TEXT("Эр-Рияд")},
+ {94, 2327, 0, lpwszOther},
+ {78, 1144, 0, TEXT("Дамаск")},
+ {78, 2328, 0, lpwszOther},
+ {91, 1145, 0, TEXT("Душанбе")},
+ {91, 3307, 0, TEXT("Кайраккум")},
+ {91, 3308, 0, TEXT("Худжанд")},
+ {91, 2329, 0, lpwszOther},
+ {119, 1146, 0, TEXT("Бангкок")},
+ {119, 1147, 0, TEXT("Пхукет")},
+ {119, 2330, 0, lpwszOther},
+ {120, 1148, 0, TEXT("Тайбэй")},
+ {120, 2331, 0, lpwszOther},
+ {132, 1149, 0, TEXT("Дили")},
+ {132, 2332, 0, lpwszOther},
+ {90, 1150, 0, TEXT("Ашхабад")},
+ {90, 3079, 0, TEXT("Безмеин")},
+ {90, 2333, 0, lpwszOther},
+ {77, 1152, 0, TEXT("Анкара")},
+ {77, 1153, 0, TEXT("Анталия")},
+ {77, 3080, 0, TEXT("Бурса")},
+ {77, 1151, 0, TEXT("Мармарис")},
+ {77, 1154, 0, TEXT("Стамбул")},
+ {77, 1155, 0, TEXT("Трабзон")},
+ {77, 2334, 0, lpwszOther},
+ {93, 3362, 0, TEXT("Алмалык")},
+ {93, 3137, 0, TEXT("Андижан")},
+ {93, 3273, 0, TEXT("Асака")},
+ {93, 1156, 0, TEXT("Ахангаран")},
+ {93, 1157, 0, TEXT("Бухара")},
+ {93, 3167, 0, TEXT("Джизак")},
+ {93, 3347, 0, TEXT("Кунград")},
+ {93, 1158, 0, TEXT("Навои")},
+ {93, 1159, 0, TEXT("Наманган")},
+ {93, 1160, 0, TEXT("Самарканд")},
+ {93, 1161, 0, TEXT("Ташкент")},
+ {93, 1162, 0, TEXT("Ургенч")},
+ {93, 1163, 0, TEXT("Фергана")},
+ {93, 1164, 0, TEXT("Чирчик")},
+ {93, 2335, 0, lpwszOther},
+ {121, 1165, 0, TEXT("Манила")},
+ {121, 3319, 0, TEXT("Себу")},
+ {121, 2336, 0, lpwszOther},
+ {98, 1166, 0, TEXT("Коломбо")},
+ {98, 2337, 0, lpwszOther},
+ {75, 3176, 0, TEXT("Исесаки")},
+ {75, 3339, 0, TEXT("Корияма")},
+ {75, 1167, 0, TEXT("Саппоро")},
+ {75, 1168, 0, TEXT("Токио")},
+ {75, 2338, 0, lpwszOther},
+ {123, 1914, 0, TEXT("Аделаида")},
+ {123, 2957, 0, TEXT("Блэк Рок")},
+ {123, 1915, 0, TEXT("Брисбен")},
+ {123, 3331, 0, TEXT("Горокан")},
+ {123, 1916, 0, TEXT("Канберра")},
+ {123, 3001, 0, TEXT("Лидкомб")},
+ {123, 1917, 0, TEXT("Мельбурн")},
+ {123, 3217, 0, TEXT("Норфолк")},
+ {123, 3064, 0, TEXT("Перт")},
+ {123, 3020, 0, TEXT("Санта Люсиа")},
+ {123, 1918, 0, TEXT("Сидней")},
+ {123, 3238, 0, TEXT("Энеабба")},
+ {123, 2339, 0, lpwszOther},
+ {454, 1192, 0, TEXT("Паго-Паго")},
+ {454, 2366, 0, lpwszOther},
+ {124, 1919, 0, TEXT("Порт-Вила")},
+ {124, 2340, 0, lpwszOther},
+ {453, 1193, 0, TEXT("Аганья")},
+ {453, 2368, 0, lpwszOther},
+ {126, 1921, 0, TEXT("Баирики")},
+ {126, 2342, 0, lpwszOther},
+ {127, 1922, 0, TEXT("Маджуро")},
+ {127, 2343, 0, lpwszOther},
+ {128, 1923, 0, TEXT("Паликир")},
+ {128, 2344, 0, lpwszOther},
+ {129, 1924, 0, TEXT("Ярен")},
+ {129, 2345, 0, lpwszOther},
+ {130, 1925, 0, TEXT("Веллингтон")},
+ {130, 1926, 0, TEXT("Гамильтон")},
+ {130, 1928, 0, TEXT("Данидин")},
+ {130, 1929, 0, TEXT("Крайстчерч")},
+ {130, 3235, 0, TEXT("Кромвель")},
+ {130, 1927, 0, TEXT("Окленд")},
+ {130, 3323, 0, TEXT("Тауранга")},
+ {130, 2346, 0, lpwszOther},
+ {131, 1930, 0, TEXT("Корор")},
+ {131, 2347, 0, lpwszOther},
+ {133, 1931, 0, TEXT("Порт-Морсби")},
+ {133, 2348, 0, lpwszOther},
+ {125, 1920, 0, TEXT("Апиа")},
+ {125, 2341, 0, lpwszOther},
+ {134, 1932, 0, TEXT("Хониара")},
+ {134, 2349, 0, lpwszOther},
+ {135, 1933, 0, TEXT("Нукуалофа")},
+ {135, 2350, 0, lpwszOther},
+ {136, 1934, 0, TEXT("Фунафути")},
+ {136, 2351, 0, lpwszOther},
+ {137, 1935, 0, TEXT("Сува")},
+ {137, 2352, 0, lpwszOther},
+ {138, 3055, 0, TEXT("Барлингтон")},
+ {138, 3049, 0, TEXT("Броссард")},
+ {138, 3330, 0, TEXT("Бурнаби")},
+ {138, 1169, 0, TEXT("Ванкувер")},
+ {138, 3106, 0, TEXT("Ватерлоо")},
+ {138, 1170, 0, TEXT("Виннипег")},
+ {138, 1171, 0, TEXT("Галифакс")},
+ {138, 1172, 0, TEXT("Гамильтон")},
+ {138, 3365, 0, TEXT("Денвер")},
+ {138, 1173, 0, TEXT("Калгари")},
+ {138, 3104, 0, TEXT("Камлупс")},
+ {138, 3366, 0, TEXT("Каннингтон")},
+ {138, 1174, 0, TEXT("Квебек")},
+ {138, 2964, 0, TEXT("Кингстон")},
+ {138, 3113, 0, TEXT("Коквитлам")},
+ {138, 1175, 0, TEXT("Монреаль")},
+ {138, 2920, 0, TEXT("Ниагара-Фолс")},
+ {138, 2889, 0, TEXT("Норд-Йорк")},
+ {138, 1176, 0, TEXT("Оттава")},
+ {138, 2903, 0, TEXT("Порт Алберни")},
+ {138, 1177, 0, TEXT("Ричмонд")},
+ {138, 1178, 0, TEXT("Тимминс")},
+ {138, 2946, 0, TEXT("Торнхилл")},
+ {138, 1179, 0, TEXT("Торонто")},
+ {138, 1180, 0, TEXT("Эдмонтон")},
+ {138, 2353, 0, lpwszOther},
+ {139, 407, 0, TEXT("Вашингтон")},
+ {139, 426, 0, TEXT("Айдахо")},
+ {139, 378, 0, TEXT("Айова")},
+ {139, 412, 0, TEXT("Алабама")},
+ {139, 446, 0, TEXT("Аляска")},
+ {139, 434, 0, TEXT("Аризона")},
+ {139, 416, 0, TEXT("Арканзас")},
+ {139, 428, 0, TEXT("Вайоминг")},
+ {139, 440, 0, TEXT("Вашингтон")},
+ {139, 352, 0, TEXT("Вермонт")},
+ {139, 394, 0, TEXT("Виргиния")},
+ {139, 374, 0, TEXT("Висконсин")},
+ {139, 448, 0, TEXT("Гавайи")},
+ {139, 390, 0, TEXT("Делавер")},
+ {139, 402, 0, TEXT("Джорджия")},
+ {139, 396, 0, TEXT("Западная Виргиния")},
+ {139, 370, 0, TEXT("Иллинойс")},
+ {139, 368, 0, TEXT("Индиана")},
+ {139, 444, 0, TEXT("Калифорния")},
+ {139, 388, 0, TEXT("Канзас")},
+ {139, 408, 0, TEXT("Кентукки")},
+ {139, 430, 0, TEXT("Колорадо")},
+ {139, 358, 0, TEXT("Коннектикут")},
+ {139, 418, 0, TEXT("Луизиана")},
+ {139, 354, 0, TEXT("Массачусетс")},
+ {139, 376, 0, TEXT("Миннесота")},
+ {139, 414, 0, TEXT("Миссисипи")},
+ {139, 380, 0, TEXT("Миссури")},
+ {139, 372, 0, TEXT("Мичиган")},
+ {139, 424, 0, TEXT("Монтана")},
+ {139, 348, 0, TEXT("Мэн")},
+ {139, 392, 0, TEXT("Мэриленд")},
+ {139, 386, 0, TEXT("Небраска")},
+ {139, 438, 0, TEXT("Невада")},
+ {139, 362, 0, TEXT("Нью-Джерси")},
+ {139, 360, 0, TEXT("Нью-Йорк")},
+ {139, 432, 0, TEXT("Нью-Мексико")},
+ {139, 350, 0, TEXT("Нью-Хэмпшир")},
+ {139, 366, 0, TEXT("Огайо")},
+ {139, 420, 0, TEXT("Оклахома")},
+ {139, 442, 0, TEXT("Орегон")},
+ {139, 364, 0, TEXT("Пенсильвания")},
+ {139, 450, 0, TEXT("Пуэрто-Рико")},
+ {139, 356, 0, TEXT("Род-Айленд")},
+ {139, 382, 0, TEXT("Северная Дакота")},
+ {139, 398, 0, TEXT("Северная Каролина")},
+ {139, 410, 0, TEXT("Теннесси")},
+ {139, 422, 0, TEXT("Техас")},
+ {139, 406, 0, TEXT("Федеральный округ Колумбия")},
+ {139, 404, 0, TEXT("Флорида")},
+ {139, 384, 0, TEXT("Южная Дакота")},
+ {139, 400, 0, TEXT("Южная Каролина")},
+ {139, 436, 0, TEXT("Юта")},
+ {140, 1238, 0, TEXT("Сент-Джонс")},
+ {140, 2442, 0, lpwszOther},
+ {141, 1239, 0, TEXT("Буэнос-Айрес")},
+ {141, 2441, 0, lpwszOther},
+ {142, 1240, 0, TEXT("Нассау")},
+ {142, 2440, 0, lpwszOther},
+ {143, 1241, 0, TEXT("Бриджтаун")},
+ {143, 2439, 0, lpwszOther},
+ {146, 1242, 0, TEXT("Бельмопан")},
+ {146, 2438, 0, lpwszOther},
+ {144, 1243, 0, TEXT("Ла-Пас")},
+ {144, 2437, 0, lpwszOther},
+ {145, 1244, 0, TEXT("Бразилиа")},
+ {145, 3094, 0, TEXT("Пассо Фундо")},
+ {145, 1245, 0, TEXT("Рио-де-Жанейро")},
+ {145, 1246, 0, TEXT("Сан-Паулу")},
+ {145, 2436, 0, lpwszOther},
+ {147, 1247, 0, TEXT("Каракас")},
+ {147, 2435, 0, lpwszOther},
+ {452, 1190, 0, TEXT("Шарлотта-Амалия")},
+ {452, 2364, 0, lpwszOther},
+ {149, 1248, 0, TEXT("Порт-о-Пренс")},
+ {149, 2434, 0, lpwszOther},
+ {148, 1249, 0, TEXT("Джоржтаун")},
+ {148, 2433, 0, lpwszOther},
+ {173, 1250, 0, TEXT("Гватемала")},
+ {173, 2432, 0, lpwszOther},
+ {150, 1251, 0, TEXT("Тегусигальпа")},
+ {150, 2431, 0, lpwszOther},
+ {151, 1252, 0, TEXT("Сент-Джорджес")},
+ {151, 2430, 0, lpwszOther},
+ {152, 1253, 0, TEXT("Уманак")},
+ {152, 2429, 0, lpwszOther},
+ {153, 1254, 0, TEXT("Розо")},
+ {153, 2428, 0, lpwszOther},
+ {154, 1255, 0, TEXT("Санто-Доминго")},
+ {154, 2427, 0, lpwszOther},
+ {155, 1256, 0, TEXT("Богота")},
+ {155, 2426, 0, lpwszOther},
+ {156, 1257, 0, TEXT("Сан-Хосе")},
+ {156, 2425, 0, lpwszOther},
+ {157, 1258, 0, TEXT("Гавана")},
+ {157, 2424, 0, lpwszOther},
+ {158, 1259, 0, TEXT("Акапулько")},
+ {158, 1260, 0, TEXT("Мехико")},
+ {158, 2423, 0, lpwszOther},
+ {159, 1261, 0, TEXT("Манагуа")},
+ {159, 2422, 0, lpwszOther},
+ {160, 1262, 0, TEXT("Панама")},
+ {160, 2421, 0, lpwszOther},
+ {161, 1263, 0, TEXT("Асунсьон")},
+ {161, 2420, 0, lpwszOther},
+ {162, 1264, 0, TEXT("Лима")},
+ {162, 2419, 0, lpwszOther},
+ {163, 1265, 0, TEXT("Сан-Сальвадор")},
+ {163, 2418, 0, lpwszOther},
+ {164, 1266, 0, TEXT("Кингстаун")},
+ {164, 2417, 0, lpwszOther},
+ {165, 1267, 0, TEXT("Бастер")},
+ {165, 2416, 0, lpwszOther},
+ {166, 1268, 0, TEXT("Кастри")},
+ {166, 2415, 0, lpwszOther},
+ {167, 1269, 0, TEXT("Парамарибо")},
+ {167, 2414, 0, lpwszOther},
+ {168, 1270, 0, TEXT("Порт-оф-Спейн")},
+ {168, 2413, 0, lpwszOther},
+ {169, 1271, 0, TEXT("Монтевидео")},
+ {169, 2412, 0, lpwszOther},
+ {170, 1272, 0, TEXT("Сантьяго")},
+ {170, 2411, 0, lpwszOther},
+ {171, 1273, 0, TEXT("Гуаякиль")},
+ {171, 1274, 0, TEXT("Кито")},
+ {171, 2410, 0, lpwszOther},
+ {172, 1275, 0, TEXT("Кингстон")},
+ {172, 2409, 0, lpwszOther},
+ {174, 1854, 0, TEXT("Алжир")},
+ {174, 2495, 0, lpwszOther},
+ {175, 1855, 0, TEXT("Луанда")},
+ {175, 2494, 0, lpwszOther},
+ {176, 1856, 0, TEXT("Котону")},
+ {176, 1857, 0, TEXT("Порто-Ново")},
+ {176, 2493, 0, lpwszOther},
+ {177, 1858, 0, TEXT("Габороне")},
+ {177, 2492, 0, lpwszOther},
+ {178, 1859, 0, TEXT("Уагадугу")},
+ {178, 2491, 0, lpwszOther},
+ {179, 1860, 0, TEXT("Бужумбуру")},
+ {179, 2490, 0, lpwszOther},
+ {180, 1861, 0, TEXT("Либревиль")},
+ {180, 2489, 0, lpwszOther},
+ {181, 1862, 0, TEXT("Банжул")},
+ {181, 2488, 0, lpwszOther},
+ {182, 1863, 0, TEXT("Аккра")},
+ {182, 2487, 0, lpwszOther},
+ {183, 1864, 0, TEXT("Конакри")},
+ {183, 2486, 0, lpwszOther},
+ {184, 1865, 0, TEXT("Бисау")},
+ {184, 2485, 0, lpwszOther},
+ {185, 1866, 0, TEXT("Джибути")},
+ {185, 2484, 0, lpwszOther},
+ {186, 3312, 0, TEXT("Дахаб")},
+ {186, 1867, 0, TEXT("Каир")},
+ {186, 1868, 0, TEXT("Хургада")},
+ {186, 2483, 0, lpwszOther},
+ {187, 1869, 0, TEXT("Лусака")},
+ {187, 2482, 0, lpwszOther},
+ {23, 1870, 0, TEXT("Хараре")},
+ {23, 2481, 0, lpwszOther},
+ {188, 1871, 0, TEXT("Прая")},
+ {188, 2480, 0, lpwszOther},
+ {189, 1872, 0, TEXT("Яунде")},
+ {189, 2479, 0, lpwszOther},
+ {190, 1873, 0, TEXT("Найроби")},
+ {190, 2478, 0, lpwszOther},
+ {191, 1874, 0, TEXT("Морони")},
+ {191, 2477, 0, lpwszOther},
+ {193, 1875, 0, TEXT("Киншаса")},
+ {193, 2476, 0, lpwszOther},
+ {192, 1876, 0, TEXT("Браззавиль")},
+ {192, 2475, 0, lpwszOther},
+ {194, 1877, 0, TEXT("Ямусукро")},
+ {194, 2474, 0, lpwszOther},
+ {195, 1878, 0, TEXT("Масеру")},
+ {195, 2473, 0, lpwszOther},
+ {196, 1879, 0, TEXT("Монровия")},
+ {196, 2472, 0, lpwszOther},
+ {197, 1880, 0, TEXT("Триполи")},
+ {197, 2471, 0, lpwszOther},
+ {198, 1881, 0, TEXT("Порт-Луи")},
+ {198, 2470, 0, lpwszOther},
+ {199, 1882, 0, TEXT("Нуакшот")},
+ {199, 2469, 0, lpwszOther},
+ {200, 1883, 0, TEXT("Антананариву")},
+ {200, 2468, 0, lpwszOther},
+ {201, 1884, 0, TEXT("Лилонгве")},
+ {201, 2467, 0, lpwszOther},
+ {202, 1885, 0, TEXT("Бамако")},
+ {202, 2466, 0, lpwszOther},
+ {203, 1886, 0, TEXT("Агадир")},
+ {203, 1887, 0, TEXT("Рабат")},
+ {203, 2465, 0, lpwszOther},
+ {204, 1888, 0, TEXT("Мапуту")},
+ {204, 2464, 0, lpwszOther},
+ {205, 1889, 0, TEXT("Виндхук")},
+ {205, 2463, 0, lpwszOther},
+ {206, 1890, 0, TEXT("Ниамей")},
+ {206, 2462, 0, lpwszOther},
+ {207, 1891, 0, TEXT("Абуджа")},
+ {207, 2461, 0, lpwszOther},
+ {208, 1892, 0, TEXT("Кигали")},
+ {208, 2460, 0, lpwszOther},
+ {209, 1893, 0, TEXT("Сан-Томе")},
+ {209, 2459, 0, lpwszOther},
+ {210, 1894, 0, TEXT("Мбабане")},
+ {210, 2458, 0, lpwszOther},
+ {211, 1895, 0, TEXT("Виктория")},
+ {211, 2457, 0, lpwszOther},
+ {212, 1896, 0, TEXT("Дакар")},
+ {212, 2456, 0, lpwszOther},
+ {213, 1897, 0, TEXT("Могадишо")},
+ {213, 2455, 0, lpwszOther},
+ {214, 1898, 0, TEXT("Хартум")},
+ {214, 2454, 0, lpwszOther},
+ {215, 1899, 0, TEXT("Фритаун")},
+ {215, 2453, 0, lpwszOther},
+ {216, 1900, 0, TEXT("Дар-эс-Салам")},
+ {216, 1901, 0, TEXT("Додома")},
+ {216, 2452, 0, lpwszOther},
+ {217, 1902, 0, TEXT("Ломе")},
+ {217, 2451, 0, lpwszOther},
+ {218, 1903, 0, TEXT("Тунис")},
+ {218, 2450, 0, lpwszOther},
+ {219, 1904, 0, TEXT("Кампала")},
+ {219, 2449, 0, lpwszOther},
+ {220, 1905, 0, TEXT("Банги")},
+ {220, 2448, 0, lpwszOther},
+ {222, 1906, 0, TEXT("Нджамена")},
+ {222, 2447, 0, lpwszOther},
+ {223, 1907, 0, TEXT("Малабо")},
+ {223, 2446, 0, lpwszOther},
+ {221, 1908, 0, TEXT("Асмэра")},
+ {221, 2445, 0, lpwszOther},
+ {224, 1909, 0, TEXT("Аддис-Абеба")},
+ {224, 2444, 0, lpwszOther},
+ {225, 1910, 0, TEXT("Дурбан")},
+ {225, 1913, 0, TEXT("Йоханнесбург")},
+ {225, 1912, 0, TEXT("Кейптаун")},
+ {225, 3033, 0, TEXT("Пайнтаун")},
+ {225, 1911, 0, TEXT("Претория")},
+ {225, 2443, 0, lpwszOther},
+ {39, 314, 0, TEXT("Киев")},
+ {39, 315, 0, TEXT("Винницкая обл.")},
+ {39, 316, 0, TEXT("Волынская обл.")},
+ {39, 317, 0, TEXT("Днепропетровская обл.")},
+ {39, 318, 0, TEXT("Донецкая обл.")},
+ {39, 319, 0, TEXT("Житомирская обл.")},
+ {39, 320, 0, TEXT("Закарпатская обл.")},
+ {39, 321, 0, TEXT("Запорожская обл.")},
+ {39, 322, 0, TEXT("Ивано-Франковская обл.")},
+ {39, 323, 0, TEXT("Киевская обл.")},
+ {39, 324, 0, TEXT("Кировоградская обл.")},
+ {39, 325, 0, TEXT("Крым")},
+ {39, 326, 0, TEXT("Луганская обл.")},
+ {39, 327, 0, TEXT("Львовская обл.")},
+ {39, 328, 0, TEXT("Николаевская обл.")},
+ {39, 329, 0, TEXT("Одесская обл.")},
+ {39, 330, 0, TEXT("Полтавская обл.")},
+ {39, 331, 0, TEXT("Ровенская обл.")},
+ {39, 332, 0, TEXT("Сумская обл.")},
+ {39, 333, 0, TEXT("Тернопольская обл.")},
+ {39, 334, 0, TEXT("Харьковская обл.")},
+ {39, 335, 0, TEXT("Херсонская обл.")},
+ {39, 336, 0, TEXT("Хмельницкая обл.")},
+ {39, 337, 0, TEXT("Черкасская обл.")},
+ {39, 338, 0, TEXT("Черниговская обл.")},
+ {39, 339, 0, TEXT("Черновицкая обл.")},
+ {40, 602, 0, TEXT("Бад Халл")},
+ {40, 604, 0, TEXT("Брегенц")},
+ {40, 603, 0, TEXT("Вена")},
+ {40, 608, 0, TEXT("Грац")},
+ {40, 606, 0, TEXT("Зальцбург")},
+ {40, 3099, 0, TEXT("Зель-ам-Зее")},
+ {40, 605, 0, TEXT("Инсбрук")},
+ {40, 3174, 0, TEXT("Кирхберг")},
+ {40, 609, 0, TEXT("Клагенфурт")},
+ {40, 607, 0, TEXT("Линц")},
+ {40, 610, 0, TEXT("Обдах")},
+ {40, 611, 0, TEXT("Щтубайтал")},
+ {40, 2541, 0, lpwszOther},
+ {32, 612, 0, TEXT("Тирана")},
+ {32, 2540, 0, lpwszOther},
+ {33, 613, 0, TEXT("Андорра-ла-Велья")},
+ {33, 2539, 0, lpwszOther},
+ {340, 341, 0, TEXT("Минск")},
+ {340, 342, 0, TEXT("Брестская обл.")},
+ {340, 343, 0, TEXT("Витебская обл.")},
+ {340, 344, 0, TEXT("Гомельская обл.")},
+ {340, 345, 0, TEXT("Гродненская обл.")},
+ {340, 346, 0, TEXT("Минская обл.")},
+ {340, 347, 0, TEXT("Могилевская обл.")},
+ {38, 760, 0, TEXT("Антверпен")},
+ {38, 767, 0, TEXT("Арлон")},
+ {38, 762, 0, TEXT("Брюгге")},
+ {38, 761, 0, TEXT("Брюссель")},
+ {38, 763, 0, TEXT("Гент")},
+ {38, 769, 0, TEXT("Лувен")},
+ {38, 765, 0, TEXT("Льеж")},
+ {38, 764, 0, TEXT("Монс")},
+ {38, 3117, 0, TEXT("Мортсель")},
+ {38, 766, 0, TEXT("Намюр")},
+ {38, 768, 0, TEXT("Хасселт")},
+ {38, 2532, 0, lpwszOther},
+ {41, 3098, 0, TEXT("Банско")},
+ {41, 792, 0, TEXT("Благоевград")},
+ {41, 770, 0, TEXT("Бургас")},
+ {41, 771, 0, TEXT("Бяла")},
+ {41, 773, 0, TEXT("Варна")},
+ {41, 776, 0, TEXT("Велико-Тырново")},
+ {41, 788, 0, TEXT("Видин")},
+ {41, 789, 0, TEXT("Враца")},
+ {41, 796, 0, TEXT("Габрово")},
+ {41, 777, 0, TEXT("Димитровград")},
+ {41, 781, 0, TEXT("Каварна")},
+ {41, 786, 0, TEXT("Кырджали")},
+ {41, 791, 0, TEXT("Кюстендил")},
+ {41, 793, 0, TEXT("Лазарджик")},
+ {41, 795, 0, TEXT("Ловеч")},
+ {41, 787, 0, TEXT("Михайловград")},
+ {41, 790, 0, TEXT("Перник")},
+ {41, 3133, 0, TEXT("Пирдоп")},
+ {41, 794, 0, TEXT("Плевен")},
+ {41, 782, 0, TEXT("Пловдив")},
+ {41, 780, 0, TEXT("Разград")},
+ {41, 779, 0, TEXT("Русе")},
+ {41, 774, 0, TEXT("Силистра")},
+ {41, 784, 0, TEXT("Сливен")},
+ {41, 772, 0, TEXT("София")},
+ {41, 775, 0, TEXT("Толбухин")},
+ {41, 3116, 0, TEXT("Тырново")},
+ {41, 785, 0, TEXT("Хасково")},
+ {41, 778, 0, TEXT("Шумен")},
+ {41, 783, 0, TEXT("Ямбол")},
+ {41, 2531, 0, lpwszOther},
+ {42, 797, 0, TEXT("Баня-Лука")},
+ {42, 799, 0, TEXT("Зеница")},
+ {42, 798, 0, TEXT("Сараево")},
+ {42, 800, 0, TEXT("Тузла")},
+ {42, 2530, 0, lpwszOther},
+ {45, 802, 0, TEXT("Абердин")},
+ {45, 3075, 0, TEXT("Айслворт")},
+ {45, 801, 0, TEXT("Алнвик")},
+ {45, 804, 0, TEXT("Бидефорд")},
+ {45, 803, 0, TEXT("Бирмингем")},
+ {45, 805, 0, TEXT("Блоксвич")},
+ {45, 3168, 0, TEXT("Бостон")},
+ {45, 806, 0, TEXT("Брайтон")},
+ {45, 807, 0, TEXT("Бредфорд")},
+ {45, 808, 0, TEXT("Бристоль")},
+ {45, 809, 0, TEXT("Вилленхолл")},
+ {45, 3131, 0, TEXT("Воррингтон")},
+ {45, 810, 0, TEXT("Вудбридж")},
+ {45, 3342, 0, TEXT("Гилфорд")},
+ {45, 811, 0, TEXT("Глазго")},
+ {45, 812, 0, TEXT("Дадли")},
+ {45, 813, 0, TEXT("Дарем")},
+ {45, 814, 0, TEXT("Дуглас")},
+ {45, 3089, 0, TEXT("Кардиф")},
+ {45, 815, 0, TEXT("Кембридж")},
+ {45, 816, 0, TEXT("Кентербери")},
+ {45, 817, 0, TEXT("Ливерпуль")},
+ {45, 818, 0, TEXT("Лидс")},
+ {45, 819, 0, TEXT("Лондон")},
+ {45, 820, 0, TEXT("Манчестер")},
+ {45, 2976, 0, TEXT("Митчем")},
+ {45, 2988, 0, TEXT("Мэйденхед")},
+ {45, 821, 0, TEXT("Ноттингем")},
+ {45, 3088, 0, TEXT("Ньюпорт")},
+ {45, 822, 0, TEXT("Оксфорд")},
+ {45, 823, 0, TEXT("Плимут")},
+ {45, 824, 0, TEXT("Портсмут")},
+ {45, 825, 0, TEXT("Престон")},
+ {45, 3343, 0, TEXT("Райд")},
+ {45, 2867, 0, TEXT("Ридинг")},
+ {45, 2986, 0, TEXT("Сент-Албанс")},
+ {45, 826, 0, TEXT("Стаффорд")},
+ {45, 3063, 0, TEXT("Стокпорт")},
+ {45, 827, 0, TEXT("Уэймут")},
+ {45, 3140, 0, TEXT("Челтенхэм")},
+ {45, 828, 0, TEXT("Честер")},
+ {45, 829, 0, TEXT("Шеффилд")},
+ {45, 830, 0, TEXT("Эдинбург")},
+ {45, 2529, 0, lpwszOther},
+ {44, 831, 0, TEXT("Будапешт")},
+ {44, 832, 0, TEXT("Геделле")},
+ {44, 836, 0, TEXT("Дебрецен")},
+ {44, 835, 0, TEXT("Мишкольц")},
+ {44, 834, 0, TEXT("Сегед")},
+ {44, 833, 0, TEXT("Шиофок")},
+ {44, 2528, 0, lpwszOther},
+ {46, 3007, 0, TEXT("Аахен")},
+ {46, 837, 0, TEXT("Аугсбург")},
+ {46, 838, 0, TEXT("Баден-Баден")},
+ {46, 3371, 0, TEXT("Бамберг")},
+ {46, 839, 0, TEXT("Бергиш-Гладбах")},
+ {46, 840, 0, TEXT("Берлин")},
+ {46, 841, 0, TEXT("Билефельд")},
+ {46, 3163, 0, TEXT("Бовенден")},
+ {46, 842, 0, TEXT("Бонн")},
+ {46, 843, 0, TEXT("Браденбург")},
+ {46, 3015, 0, TEXT("Брауншвейг")},
+ {46, 844, 0, TEXT("Бремен")},
+ {46, 2921, 0, TEXT("Варштайн")},
+ {46, 845, 0, TEXT("Веймар")},
+ {46, 846, 0, TEXT("Вупперталь")},
+ {46, 847, 0, TEXT("Гамбург")},
+ {46, 848, 0, TEXT("Ганновер")},
+ {46, 849, 0, TEXT("Гарделеген")},
+ {46, 3010, 0, TEXT("Гейдельберг")},
+ {46, 850, 0, TEXT("Гота")},
+ {46, 851, 0, TEXT("Дармштадт")},
+ {46, 3072, 0, TEXT("Дессау")},
+ {46, 852, 0, TEXT("Детмольд")},
+ {46, 853, 0, TEXT("Дортмунд")},
+ {46, 854, 0, TEXT("Дрезден")},
+ {46, 855, 0, TEXT("Дюссельдорф")},
+ {46, 3082, 0, TEXT("Иффецхайм")},
+ {46, 3309, 0, TEXT("Кассел")},
+ {46, 856, 0, TEXT("Кельн")},
+ {46, 857, 0, TEXT("Киль")},
+ {46, 3138, 0, TEXT("Кобленц")},
+ {46, 858, 0, TEXT("Крефельд")},
+ {46, 859, 0, TEXT("Лейпциг")},
+ {46, 2872, 0, TEXT("Лимбург")},
+ {46, 2965, 0, TEXT("Линген")},
+ {46, 3135, 0, TEXT("Любек")},
+ {46, 3156, 0, TEXT("Мангейм")},
+ {46, 3192, 0, TEXT("Меерсбург")},
+ {46, 860, 0, TEXT("Мюнстер")},
+ {46, 861, 0, TEXT("Мюнхен")},
+ {46, 2864, 0, TEXT("Нойштадт")},
+ {46, 862, 0, TEXT("Нюрнберг")},
+ {46, 3009, 0, TEXT("Оффенбург")},
+ {46, 2993, 0, TEXT("Падерборн")},
+ {46, 863, 0, TEXT("Равенсбург")},
+ {46, 864, 0, TEXT("Регенсбург")},
+ {46, 865, 0, TEXT("Рейнен")},
+ {46, 866, 0, TEXT("Росток")},
+ {46, 3191, 0, TEXT("Саарбрюкен")},
+ {46, 2974, 0, TEXT("Санкт-Августин")},
+ {46, 3127, 0, TEXT("Тюринген")},
+ {46, 867, 0, TEXT("Фрайберг")},
+ {46, 868, 0, TEXT("Фрайбург")},
+ {46, 869, 0, TEXT("Франкфурт-на-Майне")},
+ {46, 3373, 0, TEXT("Хемнитц")},
+ {46, 3313, 0, TEXT("Хильден")},
+ {46, 870, 0, TEXT("Штутгарт")},
+ {46, 3045, 0, TEXT("Эрланген")},
+ {46, 2906, 0, TEXT("Эшборн")},
+ {46, 2527, 0, lpwszOther},
+ {48, 871, 0, TEXT("Афины")},
+ {48, 873, 0, TEXT("Ираклион")},
+ {48, 3147, 0, TEXT("Корфу")},
+ {48, 872, 0, TEXT("Салоники")},
+ {48, 3178, 0, TEXT("Халкидики")},
+ {48, 2526, 0, lpwszOther},
+ {49, 3006, 0, TEXT("Архус")},
+ {49, 874, 0, TEXT("Копенгаген")},
+ {49, 875, 0, TEXT("Оденсе")},
+ {49, 3285, 0, TEXT("Ольборг")},
+ {49, 876, 0, TEXT("Сванеке")},
+ {49, 3126, 0, TEXT("Скиве")},
+ {49, 2525, 0, lpwszOther},
+ {50, 3377, 0, TEXT("Виклоу")},
+ {50, 3067, 0, TEXT("Голвей")},
+ {50, 877, 0, TEXT("Дублин")},
+ {50, 3065, 0, TEXT("Килларней")},
+ {50, 3066, 0, TEXT("Корк")},
+ {50, 878, 0, TEXT("Лимерик")},
+ {50, 3069, 0, TEXT("Нейс")},
+ {50, 3068, 0, TEXT("Типперэри")},
+ {50, 2524, 0, lpwszOther},
+ {51, 879, 0, TEXT("Рейкьявик")},
+ {51, 2523, 0, lpwszOther},
+ {34, 880, 0, TEXT("Аликанте")},
+ {34, 3125, 0, TEXT("Альмерия")},
+ {34, 881, 0, TEXT("Барселона")},
+ {34, 890, 0, TEXT("Бильбао")},
+ {34, 3076, 0, TEXT("Бланес")},
+ {34, 882, 0, TEXT("Валенсия")},
+ {34, 3070, 0, TEXT("Ибица")},
+ {34, 888, 0, TEXT("Кадис")},
+ {34, 886, 0, TEXT("Картахена")},
+ {34, 891, 0, TEXT("Ла-Корунья")},
+ {34, 3310, 0, TEXT("Лорет де Мар")},
+ {34, 883, 0, TEXT("Мадрид")},
+ {34, 884, 0, TEXT("Малага")},
+ {34, 885, 0, TEXT("Марбелья")},
+ {34, 892, 0, TEXT("Овьедо")},
+ {34, 3179, 0, TEXT("Пальма де Майорка")},
+ {34, 3177, 0, TEXT("Сан-Агустин")},
+ {34, 3289, 0, TEXT("Санта-Крус-де-Тенерифе")},
+ {34, 889, 0, TEXT("Сарагоса")},
+ {34, 887, 0, TEXT("Севилья")},
+ {34, 893, 0, TEXT("Хихон")},
+ {34, 2522, 0, lpwszOther},
+ {52, 3318, 0, TEXT("Аоста")},
+ {52, 3278, 0, TEXT("Беллариа")},
+ {52, 906, 0, TEXT("Болонья")},
+ {52, 894, 0, TEXT("Брешиа")},
+ {52, 895, 0, TEXT("Венеция")},
+ {52, 905, 0, TEXT("Верона")},
+ {52, 896, 0, TEXT("Генуя")},
+ {52, 897, 0, TEXT("Лекко")},
+ {52, 3369, 0, TEXT("Ливорно")},
+ {52, 3327, 0, TEXT("Марсала")},
+ {52, 898, 0, TEXT("Милан")},
+ {52, 899, 0, TEXT("Модена")},
+ {52, 907, 0, TEXT("Неаполь")},
+ {52, 908, 0, TEXT("Перуджа")},
+ {52, 900, 0, TEXT("Пиза")},
+ {52, 901, 0, TEXT("Рим")},
+ {52, 3368, 0, TEXT("Сан-Ремо")},
+ {52, 3384, 0, TEXT("Сиракуза")},
+ {52, 3252, 0, TEXT("Терамо")},
+ {52, 902, 0, TEXT("Триест")},
+ {52, 903, 0, TEXT("Турин")},
+ {52, 3130, 0, TEXT("Фано")},
+ {52, 904, 0, TEXT("Флоренция")},
+ {52, 2521, 0, lpwszOther},
+ {53, 2939, 0, TEXT("Айзкраукле")},
+ {53, 3054, 0, TEXT("Валка")},
+ {53, 909, 0, TEXT("Даугавпилс")},
+ {53, 2934, 0, TEXT("Екабпилс")},
+ {53, 913, 0, TEXT("Елгава")},
+ {53, 2935, 0, TEXT("Кокнесе")},
+ {53, 912, 0, TEXT("Лиепая")},
+ {53, 2905, 0, TEXT("Резекне")},
+ {53, 911, 0, TEXT("Рига")},
+ {53, 2936, 0, TEXT("Саласпилс")},
+ {53, 2937, 0, TEXT("Смилтене")},
+ {53, 910, 0, TEXT("Юрмала")},
+ {53, 2520, 0, lpwszOther},
+ {54, 914, 0, TEXT("Вильнюс")},
+ {54, 915, 0, TEXT("Висагинас")},
+ {54, 916, 0, TEXT("Каунас")},
+ {54, 918, 0, TEXT("Клайпеда")},
+ {54, 919, 0, TEXT("Паланга")},
+ {54, 3173, 0, TEXT("Пеневежис")},
+ {54, 917, 0, TEXT("Шауляй")},
+ {54, 2519, 0, lpwszOther},
+ {55, 920, 0, TEXT("Вадуц")},
+ {55, 2518, 0, lpwszOther},
+ {56, 3376, 0, TEXT("Бетцдорф")},
+ {56, 921, 0, TEXT("Люксембург")},
+ {56, 2517, 0, lpwszOther},
+ {57, 3142, 0, TEXT("Битола")},
+ {57, 922, 0, TEXT("Скопье")},
+ {57, 2516, 0, lpwszOther},
+ {58, 923, 0, TEXT("Валлетта")},
+ {58, 3154, 0, TEXT("Мзида")},
+ {58, 924, 0, TEXT("Слима")},
+ {58, 2515, 0, lpwszOther},
+ {59, 925, 0, TEXT("Бельцы")},
+ {59, 926, 0, TEXT("Бендеры")},
+ {59, 3234, 0, TEXT("Дубоссары")},
+ {59, 3275, 0, TEXT("Кахул")},
+ {59, 927, 0, TEXT("Кишинев")},
+ {59, 3321, 0, TEXT("Резина")},
+ {59, 928, 0, TEXT("Рыбница")},
+ {59, 929, 0, TEXT("Тирасполь")},
+ {59, 3281, 0, TEXT("Чадыр-Лунга")},
+ {59, 2514, 0, lpwszOther},
+ {36, 930, 0, TEXT("Монте-Карло")},
+ {36, 2513, 0, lpwszOther},
+ {60, 931, 0, TEXT("Амстердам")},
+ {60, 933, 0, TEXT("Бреда")},
+ {60, 932, 0, TEXT("Гаага")},
+ {60, 934, 0, TEXT("Гауда")},
+ {60, 935, 0, TEXT("Делфт")},
+ {60, 2977, 0, TEXT("Донген")},
+ {60, 3030, 0, TEXT("Зволле")},
+ {60, 3091, 0, TEXT("Ниймеген")},
+ {60, 936, 0, TEXT("Роттердам")},
+ {60, 937, 0, TEXT("Утрехт")},
+ {60, 3044, 0, TEXT("Эйндховен")},
+ {60, 3380, 0, TEXT("Эншеде")},
+ {60, 2512, 0, lpwszOther},
+ {61, 3190, 0, TEXT("Кристиансанд")},
+ {61, 2857, 0, TEXT("Лиллехаммер")},
+ {61, 938, 0, TEXT("Осло")},
+ {61, 3355, 0, TEXT("Ставангер")},
+ {61, 939, 0, TEXT("Тронхейм")},
+ {61, 2511, 0, lpwszOther},
+ {62, 940, 0, TEXT("Белосток")},
+ {62, 941, 0, TEXT("Варшава")},
+ {62, 3164, 0, TEXT("Вроцлав")},
+ {62, 942, 0, TEXT("Гданьск")},
+ {62, 943, 0, TEXT("Гливице")},
+ {62, 3237, 0, TEXT("Закопане")},
+ {62, 3165, 0, TEXT("Зелена Гура")},
+ {62, 944, 0, TEXT("Катовице")},
+ {62, 945, 0, TEXT("Краков")},
+ {62, 3008, 0, TEXT("Лодзь")},
+ {62, 3150, 0, TEXT("Ольштын")},
+ {62, 946, 0, TEXT("Познань")},
+ {62, 947, 0, TEXT("Радом")},
+ {62, 948, 0, TEXT("Сопот")},
+ {62, 2958, 0, TEXT("Тыхы")},
+ {62, 2510, 0, lpwszOther},
+ {35, 949, 0, TEXT("Лиссабон")},
+ {35, 950, 0, TEXT("Порто")},
+ {35, 2509, 0, lpwszOther},
+ {63, 952, 0, TEXT("Брашов")},
+ {63, 951, 0, TEXT("Бухарест")},
+ {63, 954, 0, TEXT("Констанца")},
+ {63, 955, 0, TEXT("Плоешти")},
+ {63, 953, 0, TEXT("Яссы")},
+ {63, 2508, 0, lpwszOther},
+ {64, 956, 0, TEXT("Сан-Марино")},
+ {64, 2507, 0, lpwszOther},
+ {74, 957, 0, TEXT("Белград")},
+ {74, 960, 0, TEXT("Ниш")},
+ {74, 958, 0, TEXT("Нови-Сад")},
+ {74, 959, 0, TEXT("Сараево")},
+ {74, 2506, 0, lpwszOther},
+ {65, 961, 0, TEXT("Братислава")},
+ {65, 962, 0, TEXT("Кошице")},
+ {65, 3101, 0, TEXT("Липтов")},
+ {65, 963, 0, TEXT("Попрад")},
+ {65, 964, 0, TEXT("Прешов")},
+ {65, 965, 0, TEXT("Ружемберок")},
+ {65, 966, 0, TEXT("Тврдошин")},
+ {65, 2505, 0, lpwszOther},
+ {66, 968, 0, TEXT("Копар")},
+ {66, 967, 0, TEXT("Любляна")},
+ {66, 969, 0, TEXT("Марибор")},
+ {66, 2504, 0, lpwszOther},
+ {67, 970, 0, TEXT("Торсхавн")},
+ {67, 2503, 0, lpwszOther},
+ {68, 2888, 0, TEXT("Вантаа")},
+ {68, 971, 0, TEXT("Васа")},
+ {68, 979, 0, TEXT("Котка")},
+ {68, 972, 0, TEXT("Коувола")},
+ {68, 980, 0, TEXT("Лахти")},
+ {68, 973, 0, TEXT("Оулу")},
+ {68, 3375, 0, TEXT("Риихимяки")},
+ {68, 3159, 0, TEXT("Руовеси")},
+ {68, 974, 0, TEXT("Тампере")},
+ {68, 975, 0, TEXT("Турку")},
+ {68, 976, 0, TEXT("Хельсинки")},
+ {68, 977, 0, TEXT("Эспо")},
+ {68, 978, 0, TEXT("Ювяскюля")},
+ {68, 2502, 0, lpwszOther},
+ {37, 996, 0, TEXT("Авиньон")},
+ {37, 983, 0, TEXT("Бержерак")},
+ {37, 997, 0, TEXT("Блуа")},
+ {37, 984, 0, TEXT("Бордо")},
+ {37, 998, 0, TEXT("Дижон")},
+ {37, 987, 0, TEXT("Канн")},
+ {37, 988, 0, TEXT("Кастр")},
+ {37, 993, 0, TEXT("Клермон-Ферран")},
+ {37, 3037, 0, TEXT("Лилль")},
+ {37, 989, 0, TEXT("Лион")},
+ {37, 985, 0, TEXT("Марсель")},
+ {37, 991, 0, TEXT("Мец")},
+ {37, 3161, 0, TEXT("Мобеж")},
+ {37, 990, 0, TEXT("Нанси")},
+ {37, 994, 0, TEXT("Нант")},
+ {37, 995, 0, TEXT("Ницца")},
+ {37, 999, 0, TEXT("Орлеан")},
+ {37, 981, 0, TEXT("Париж")},
+ {37, 3374, 0, TEXT("Перпиньян")},
+ {37, 992, 0, TEXT("Руан")},
+ {37, 982, 0, TEXT("Страсбург")},
+ {37, 986, 0, TEXT("Тулуза")},
+ {37, 3314, 0, TEXT("Шамбери")},
+ {37, 2501, 0, lpwszOther},
+ {69, 1003, 0, TEXT("Дубровник")},
+ {69, 1000, 0, TEXT("Загреб")},
+ {69, 1001, 0, TEXT("Задар")},
+ {69, 1004, 0, TEXT("Риека")},
+ {69, 1002, 0, TEXT("Сплит")},
+ {69, 2500, 0, lpwszOther},
+ {70, 1005, 0, TEXT("Брно")},
+ {70, 3291, 0, TEXT("Гавличкув-Брод")},
+ {70, 1007, 0, TEXT("Градец-Кралове")},
+ {70, 1008, 0, TEXT("Карлови-Вари")},
+ {70, 3019, 0, TEXT("Кладрубы")},
+ {70, 1010, 0, TEXT("Лоуни")},
+ {70, 1009, 0, TEXT("Острава")},
+ {70, 1015, 0, TEXT("Пльзень")},
+ {70, 3105, 0, TEXT("Правчицка Брана")},
+ {70, 1006, 0, TEXT("Прага")},
+ {70, 3246, 0, TEXT("Тачов")},
+ {70, 1011, 0, TEXT("Тршебич")},
+ {70, 1012, 0, TEXT("Усти-над-Лабем")},
+ {70, 1014, 0, TEXT("Ческе-Будеевице")},
+ {70, 1013, 0, TEXT("Яблонец-над-Нисоу")},
+ {70, 2499, 0, lpwszOther},
+ {71, 1016, 0, TEXT("Арау")},
+ {71, 1019, 0, TEXT("Баден")},
+ {71, 1017, 0, TEXT("Базель")},
+ {71, 1018, 0, TEXT("Берн")},
+ {71, 1020, 0, TEXT("Биль")},
+ {71, 1021, 0, TEXT("Винтертур")},
+ {71, 1022, 0, TEXT("Давос")},
+ {71, 3189, 0, TEXT("Делемонт")},
+ {71, 1023, 0, TEXT("Женева")},
+ {71, 1024, 0, TEXT("Золотурн")},
+ {71, 1025, 0, TEXT("Лозанна")},
+ {71, 1026, 0, TEXT("Локарно")},
+ {71, 1027, 0, TEXT("Лугано")},
+ {71, 1028, 0, TEXT("Люцерн")},
+ {71, 1029, 0, TEXT("Монтре")},
+ {71, 1030, 0, TEXT("Цюрих")},
+ {71, 2498, 0, lpwszOther},
+ {72, 2883, 0, TEXT("Арбога")},
+ {72, 1031, 0, TEXT("Гетеборг")},
+ {72, 1032, 0, TEXT("Кальмар")},
+ {72, 1037, 0, TEXT("Лахольм")},
+ {72, 1036, 0, TEXT("Лулео")},
+ {72, 1042, 0, TEXT("Лунд")},
+ {72, 1033, 0, TEXT("Мальме")},
+ {72, 1034, 0, TEXT("Стокгольм")},
+ {72, 1041, 0, TEXT("Умео")},
+ {72, 1039, 0, TEXT("Фалун")},
+ {72, 1043, 0, TEXT("Хельсинборг")},
+ {72, 1040, 0, TEXT("Хернесанд")},
+ {72, 1038, 0, TEXT("Эстерсунд")},
+ {72, 2497, 0, lpwszOther},
+ {73, 3013, 0, TEXT("Валга")},
+ {73, 1044, 0, TEXT("Кейла")},
+ {73, 1045, 0, TEXT("Кохтла-Ярве")},
+ {73, 1046, 0, TEXT("Маарду")},
+ {73, 1047, 0, TEXT("Мыйзакюла")},
+ {73, 1048, 0, TEXT("Нарва")},
+ {73, 1049, 0, TEXT("Пярну")},
+ {73, 1050, 0, TEXT("Раквере")},
+ {73, 1051, 0, TEXT("Силламяэ")},
+ {73, 1052, 0, TEXT("Таллин")},
+ {73, 1053, 0, TEXT("Тарту")},
+ {73, 1054, 0, TEXT("Хаапсалу")},
+ {0, 0, 0, NULL}
};//*/
/*
-static const MRA_COUNTRY mracCountrys[]=
+static const MRA_COUNTRY mracCountrys[] =
{
- {24, TEXT("Россия")},
- {81, TEXT("Азербайджан")},
- {82, TEXT("Армения")},
- {97, TEXT("Афганистан")},
- {96, TEXT("Бангладеш")},
- {99, TEXT("Бахрейн")},
- {100, TEXT("Бруней-Даруссалам")},
- {101, TEXT("Бутан")},
- {102, TEXT("Вьетнам")},
- {83, TEXT("Грузия")},
- {86, TEXT("Израиль")},
- {95, TEXT("Индия")},
- {103, TEXT("Индонезия")},
- {79, TEXT("Иордания")},
- {85, TEXT("Ирак")},
- {87, TEXT("Иран")},
- {104, TEXT("Йемен")},
- {84, TEXT("Казахстан")},
- {105, TEXT("Камбоджа")},
- {106, TEXT("Катар")},
- {107, TEXT("Кипр")},
- {92, TEXT("Киргизия (Кыргызстан)")},
- {76, TEXT("Китай")},
- {3215, TEXT("Кокосовые острова (Австр.)")},
- {29, TEXT("Корея (КНДР)")},
- {108, TEXT("Корея")},
- {88, TEXT("Кувейт")},
- {109, TEXT("Лаос")},
- {110, TEXT("Ливан")},
- {111, TEXT("Малайзия")},
- {112, TEXT("Мальдивы")},
- {113, TEXT("Монголия")},
- {114, TEXT("Мьянма")},
- {115, TEXT("Непал")},
- {116, TEXT("Объединенные Арабские Эмираты")},
- {117, TEXT("Оман")},
- {3216, TEXT("Остров Рождества (Австр.)")},
- {122, TEXT("Пакистан")},
- {89, TEXT("Палестина")},
- {94, TEXT("Саудовская Аравия")},
- {118, TEXT("Сингапур")},
- {78, TEXT("Сирия")},
- {91, TEXT("Таджикистан")},
- {119, TEXT("Таиланд")},
- {120, TEXT("Тайвань")},
- {132, TEXT("Тимор")},
- {90, TEXT("Туркмения")},
- {77, TEXT("Турция")},
- {93, TEXT("Узбекистан")},
- {121, TEXT("Филиппины")},
- {98, TEXT("Шри Ланка")},
- {75, TEXT("Япония")},
- {123, TEXT("Австралия")},
- {454, TEXT("Американское Самоа")},
- {124, TEXT("Вануату")},
- {453, TEXT("Гуам (США)")},
- {126, TEXT("Кирибати")},
- {127, TEXT("Маршалловы Острова")},
- {128, TEXT("Микронезия (Федеративные Штаты Микронезии)")},
- {129, TEXT("Науру")},
- {3220, TEXT("Ниуэ (Н.Зел.)")},
- {130, TEXT("Новая Зеландия")},
- {3218, TEXT("Новая Каледония (Фр.)")},
- {3221, TEXT("Острова Кука (Н.Зел.)")},
- {3230, TEXT("Острова Херд и Макдональд (Австр.)")},
- {131, TEXT("Палау")},
- {133, TEXT("Папуа - Новая Гвинея")},
- {3222, TEXT("Питкерн (Брит.)")},
- {125, TEXT("Самоа")},
- {3219, TEXT("Сев. Марианские острова (США)")},
- {134, TEXT("Соломоновы Острова")},
- {3223, TEXT("Токелау (Н.Зел.)")},
- {135, TEXT("Тонга")},
- {136, TEXT("Тувалу")},
- {3224, TEXT("Уоллис и Футуна острова (Фр.)")},
- {137, TEXT("Фиджи")},
- {3226, TEXT("Французская Полинезия")},
- {3225, TEXT("Французские Южные территории")},
- {138, TEXT("Канада")},
- {139, TEXT("США")},
- {3200, TEXT("Ангилья (Брит.)")},
- {140, TEXT("Антигуа и Барбуда")},
- {141, TEXT("Аргентина")},
- {3202, TEXT("Аруба (Нид.)")},
- {142, TEXT("Багамы")},
- {143, TEXT("Барбадос")},
- {146, TEXT("Белиз")},
- {3203, TEXT("Бермуды (Брит.)")},
- {144, TEXT("Боливия")},
- {145, TEXT("Бразилия")},
- {147, TEXT("Венесуэла")},
- {3204, TEXT("Виргинские острова (Брит.)")},
- {452, TEXT("Виргинские острова (США)")},
- {149, TEXT("Гаити")},
- {148, TEXT("Гайана")},
- {3205, TEXT("Гваделупа (Фр.)")},
- {173, TEXT("Гватемала")},
- {150, TEXT("Гондурас")},
- {151, TEXT("Гренада")},
- {152, TEXT("Гренландия (Дат.)")},
- {153, TEXT("Доминика")},
- {154, TEXT("Доминиканская Республика")},
- {155, TEXT("Колумбия")},
- {156, TEXT("Коста-Рика")},
- {157, TEXT("Куба")},
- {3208, TEXT("Мартиника (Фр.)")},
- {158, TEXT("Мексика")},
- {3209, TEXT("Монтсеррат (Брит)")},
- {3201, TEXT("Нидерландские Антилы")},
- {159, TEXT("Никарагуа")},
- {3207, TEXT("Остров Кайман (Брит.)")},
- {3211, TEXT("Острова Теркс и Кайкос (Брит.)")},
- {160, TEXT("Панама")},
- {161, TEXT("Парагвай")},
- {162, TEXT("Перу")},
- {163, TEXT("Сальвадор")},
- {164, TEXT("Сент-Винсент и Гренадины")},
- {165, TEXT("Сент-Китс и Невис")},
- {166, TEXT("Сент-Люсия")},
- {3210, TEXT("Сент-Пьер и Микелон (Фр.)")},
- {167, TEXT("Суринам")},
- {168, TEXT("Тринидат и Тобаго")},
- {169, TEXT("Уругвай")},
- {3212, TEXT("Фолклендские острова (Брит.)")},
- {3206, TEXT("Французская Гвиана")},
- {170, TEXT("Чили")},
- {171, TEXT("Эквадор")},
- {3213, TEXT("Юж. Джорджия и Юж. Сандвичевы о-ва (Брит.)")},
- {172, TEXT("Ямайка")},
- {174, TEXT("Алжир")},
- {175, TEXT("Ангола")},
- {176, TEXT("Бенин")},
- {177, TEXT("Ботсвана")},
- {3228, TEXT("Британская территория в Индийском океане")},
- {178, TEXT("Буркина-Фасо")},
- {179, TEXT("Бурунди")},
- {180, TEXT("Габон")},
- {181, TEXT("Гамбия")},
- {182, TEXT("Гана")},
- {183, TEXT("Гвинея")},
- {184, TEXT("Гвинея-Бисау")},
- {185, TEXT("Джибути")},
- {186, TEXT("Египет")},
- {187, TEXT("Замбия")},
- {3198, TEXT("Зап. Сахара")},
- {23, TEXT("Зимбабве")},
- {188, TEXT("Кабо-Верде")},
- {189, TEXT("Камерун")},
- {190, TEXT("Кения")},
- {191, TEXT("Коморы")},
- {193, TEXT("Конго (Заир)")},
- {192, TEXT("Конго")},
- {194, TEXT("Кот-д`Ивуар")},
- {195, TEXT("Лесото")},
- {196, TEXT("Либерия")},
- {197, TEXT("Ливия")},
- {198, TEXT("Маврикий")},
- {199, TEXT("Мавритания")},
- {200, TEXT("Мадагаскар")},
- {3229, TEXT("Майотт (Фр.)")},
- {201, TEXT("Малави")},
- {202, TEXT("Мали")},
- {203, TEXT("Марокко")},
- {204, TEXT("Мозамбик")},
- {205, TEXT("Намибия")},
- {206, TEXT("Нигер")},
- {207, TEXT("Нигерия")},
- {3227, TEXT("Остров Буве (Норв.)")},
- {3197, TEXT("Реюньон (Фр.)")},
- {208, TEXT("Руанда")},
- {209, TEXT("Сан-Томе и Принсипи")},
- {210, TEXT("Свазиленд")},
- {3199, TEXT("Святая Елена (Брит.)")},
- {211, TEXT("Сейшелы")},
- {212, TEXT("Сенегал")},
- {213, TEXT("Сомали")},
- {214, TEXT("Судан")},
- {215, TEXT("Сьерра-Леоне")},
- {216, TEXT("Танзания")},
- {217, TEXT("Того")},
- {218, TEXT("Тунис")},
- {219, TEXT("Уганда")},
- {220, TEXT("Центральноафриканская Республика")},
- {222, TEXT("Чад")},
- {223, TEXT("Экваториальная Гвинея")},
- {221, TEXT("Эритрея")},
- {224, TEXT("Эфиопия")},
- {225, TEXT("Южно-Африканская Республика (ЮАР)")},
- {39, TEXT("Украина")},
- {40, TEXT("Австрия")},
- {32, TEXT("Албания")},
- {33, TEXT("Андорра")},
- {340, TEXT("Белоруссия")},
- {38, TEXT("Бельгия")},
- {41, TEXT("Болгария")},
- {42, TEXT("Босния и Герцеговина")},
- {43, TEXT("Ватикан")},
- {45, TEXT("Великобритания")},
- {44, TEXT("Венгрия")},
- {46, TEXT("Германия")},
- {3193, TEXT("Гернси (Брит.)")},
- {47, TEXT("Гибралтар (Брит.)")},
- {48, TEXT("Греция")},
- {49, TEXT("Дания")},
- {3194, TEXT("Джерси (Брит.)")},
- {50, TEXT("Ирландия")},
- {51, TEXT("Исландия")},
- {34, TEXT("Испания")},
- {52, TEXT("Италия")},
- {53, TEXT("Латвия")},
- {54, TEXT("Литва")},
- {55, TEXT("Лихтенштейн")},
- {56, TEXT("Люксембург")},
- {57, TEXT("Македония")},
- {58, TEXT("Мальта")},
- {59, TEXT("Молдавия")},
- {36, TEXT("Монако")},
- {60, TEXT("Нидерланды")},
- {61, TEXT("Норвегия")},
- {3195, TEXT("Остров Мэн (Брит.)")},
- {62, TEXT("Польша")},
- {35, TEXT("Португалия")},
- {63, TEXT("Румыния")},
- {64, TEXT("Сан-Марино")},
- {74, TEXT("Сербия и Черногория")},
- {65, TEXT("Словакия")},
- {66, TEXT("Словения")},
- {67, TEXT("Фарерские о-ва (Дания)")},
- {68, TEXT("Финляндия")},
- {37, TEXT("Франция")},
- {69, TEXT("Хорватия")},
- {70, TEXT("Чехия")},
- {71, TEXT("Швейцария")},
- {72, TEXT("Швеция")},
- {3196, TEXT("Шпицберген (Норв.)")},
- {73, TEXT("Эстония")},
- {0, NULL}
+ {24, TEXT("Россия")},
+ {81, TEXT("Азербайджан")},
+ {82, TEXT("Армения")},
+ {97, TEXT("Афганистан")},
+ {96, TEXT("Бангладеш")},
+ {99, TEXT("Бахрейн")},
+ {100, TEXT("Бруней-Даруссалам")},
+ {101, TEXT("Бутан")},
+ {102, TEXT("Вьетнам")},
+ {83, TEXT("Грузия")},
+ {86, TEXT("Израиль")},
+ {95, TEXT("Индия")},
+ {103, TEXT("Индонезия")},
+ {79, TEXT("Иордания")},
+ {85, TEXT("Ирак")},
+ {87, TEXT("Иран")},
+ {104, TEXT("Йемен")},
+ {84, TEXT("Казахстан")},
+ {105, TEXT("Камбоджа")},
+ {106, TEXT("Катар")},
+ {107, TEXT("Кипр")},
+ {92, TEXT("Киргизия (Кыргызстан)")},
+ {76, TEXT("Китай")},
+ {3215, TEXT("Кокосовые острова (Австр.)")},
+ {29, TEXT("Корея (КНДР)")},
+ {108, TEXT("Корея")},
+ {88, TEXT("Кувейт")},
+ {109, TEXT("Лаос")},
+ {110, TEXT("Ливан")},
+ {111, TEXT("Малайзия")},
+ {112, TEXT("Мальдивы")},
+ {113, TEXT("Монголия")},
+ {114, TEXT("Мьянма")},
+ {115, TEXT("Непал")},
+ {116, TEXT("Объединенные Арабские Эмираты")},
+ {117, TEXT("Оман")},
+ {3216, TEXT("Остров Рождества (Австр.)")},
+ {122, TEXT("Пакистан")},
+ {89, TEXT("Палестина")},
+ {94, TEXT("Саудовская Аравия")},
+ {118, TEXT("Сингапур")},
+ {78, TEXT("Сирия")},
+ {91, TEXT("Таджикистан")},
+ {119, TEXT("Таиланд")},
+ {120, TEXT("Тайвань")},
+ {132, TEXT("Тимор")},
+ {90, TEXT("Туркмения")},
+ {77, TEXT("Турция")},
+ {93, TEXT("Узбекистан")},
+ {121, TEXT("Филиппины")},
+ {98, TEXT("Шри Ланка")},
+ {75, TEXT("Япония")},
+ {123, TEXT("Австралия")},
+ {454, TEXT("Американское Самоа")},
+ {124, TEXT("Вануату")},
+ {453, TEXT("Гуам (США)")},
+ {126, TEXT("Кирибати")},
+ {127, TEXT("Маршалловы Острова")},
+ {128, TEXT("Микронезия (Федеративные Штаты Микронезии)")},
+ {129, TEXT("Науру")},
+ {3220, TEXT("Ниуэ (Н.Зел.)")},
+ {130, TEXT("Новая Зеландия")},
+ {3218, TEXT("Новая Каледония (Фр.)")},
+ {3221, TEXT("Острова Кука (Н.Зел.)")},
+ {3230, TEXT("Острова Херд и Макдональд (Австр.)")},
+ {131, TEXT("Палау")},
+ {133, TEXT("Папуа - Новая Гвинея")},
+ {3222, TEXT("Питкерн (Брит.)")},
+ {125, TEXT("Самоа")},
+ {3219, TEXT("Сев. Марианские острова (США)")},
+ {134, TEXT("Соломоновы Острова")},
+ {3223, TEXT("Токелау (Н.Зел.)")},
+ {135, TEXT("Тонга")},
+ {136, TEXT("Тувалу")},
+ {3224, TEXT("Уоллис и Футуна острова (Фр.)")},
+ {137, TEXT("Фиджи")},
+ {3226, TEXT("Французская Полинезия")},
+ {3225, TEXT("Французские Южные территории")},
+ {138, TEXT("Канада")},
+ {139, TEXT("США")},
+ {3200, TEXT("Ангилья (Брит.)")},
+ {140, TEXT("Антигуа и Барбуда")},
+ {141, TEXT("Аргентина")},
+ {3202, TEXT("Аруба (Нид.)")},
+ {142, TEXT("Багамы")},
+ {143, TEXT("Барбадос")},
+ {146, TEXT("Белиз")},
+ {3203, TEXT("Бермуды (Брит.)")},
+ {144, TEXT("Боливия")},
+ {145, TEXT("Бразилия")},
+ {147, TEXT("Венесуэла")},
+ {3204, TEXT("Виргинские острова (Брит.)")},
+ {452, TEXT("Виргинские острова (США)")},
+ {149, TEXT("Гаити")},
+ {148, TEXT("Гайана")},
+ {3205, TEXT("Гваделупа (Фр.)")},
+ {173, TEXT("Гватемала")},
+ {150, TEXT("Гондурас")},
+ {151, TEXT("Гренада")},
+ {152, TEXT("Гренландия (Дат.)")},
+ {153, TEXT("Доминика")},
+ {154, TEXT("Доминиканская Республика")},
+ {155, TEXT("Колумбия")},
+ {156, TEXT("Коста-Рика")},
+ {157, TEXT("Куба")},
+ {3208, TEXT("Мартиника (Фр.)")},
+ {158, TEXT("Мексика")},
+ {3209, TEXT("Монтсеррат (Брит)")},
+ {3201, TEXT("Нидерландские Антилы")},
+ {159, TEXT("Никарагуа")},
+ {3207, TEXT("Остров Кайман (Брит.)")},
+ {3211, TEXT("Острова Теркс и Кайкос (Брит.)")},
+ {160, TEXT("Панама")},
+ {161, TEXT("Парагвай")},
+ {162, TEXT("Перу")},
+ {163, TEXT("Сальвадор")},
+ {164, TEXT("Сент-Винсент и Гренадины")},
+ {165, TEXT("Сент-Китс и Невис")},
+ {166, TEXT("Сент-Люсия")},
+ {3210, TEXT("Сент-Пьер и Микелон (Фр.)")},
+ {167, TEXT("Суринам")},
+ {168, TEXT("Тринидат и Тобаго")},
+ {169, TEXT("Уругвай")},
+ {3212, TEXT("Фолклендские острова (Брит.)")},
+ {3206, TEXT("Французская Гвиана")},
+ {170, TEXT("Чили")},
+ {171, TEXT("Эквадор")},
+ {3213, TEXT("Юж. Джорджия и Юж. Сандвичевы о-ва (Брит.)")},
+ {172, TEXT("Ямайка")},
+ {174, TEXT("Алжир")},
+ {175, TEXT("Ангола")},
+ {176, TEXT("Бенин")},
+ {177, TEXT("Ботсвана")},
+ {3228, TEXT("Британская территория в Индийском океане")},
+ {178, TEXT("Буркина-Фасо")},
+ {179, TEXT("Бурунди")},
+ {180, TEXT("Габон")},
+ {181, TEXT("Гамбия")},
+ {182, TEXT("Гана")},
+ {183, TEXT("Гвинея")},
+ {184, TEXT("Гвинея-Бисау")},
+ {185, TEXT("Джибути")},
+ {186, TEXT("Египет")},
+ {187, TEXT("Замбия")},
+ {3198, TEXT("Зап. Сахара")},
+ {23, TEXT("Зимбабве")},
+ {188, TEXT("Кабо-Верде")},
+ {189, TEXT("Камерун")},
+ {190, TEXT("Кения")},
+ {191, TEXT("Коморы")},
+ {193, TEXT("Конго (Заир)")},
+ {192, TEXT("Конго")},
+ {194, TEXT("Кот-д`Ивуар")},
+ {195, TEXT("Лесото")},
+ {196, TEXT("Либерия")},
+ {197, TEXT("Ливия")},
+ {198, TEXT("Маврикий")},
+ {199, TEXT("Мавритания")},
+ {200, TEXT("Мадагаскар")},
+ {3229, TEXT("Майотт (Фр.)")},
+ {201, TEXT("Малави")},
+ {202, TEXT("Мали")},
+ {203, TEXT("Марокко")},
+ {204, TEXT("Мозамбик")},
+ {205, TEXT("Намибия")},
+ {206, TEXT("Нигер")},
+ {207, TEXT("Нигерия")},
+ {3227, TEXT("Остров Буве (Норв.)")},
+ {3197, TEXT("Реюньон (Фр.)")},
+ {208, TEXT("Руанда")},
+ {209, TEXT("Сан-Томе и Принсипи")},
+ {210, TEXT("Свазиленд")},
+ {3199, TEXT("Святая Елена (Брит.)")},
+ {211, TEXT("Сейшелы")},
+ {212, TEXT("Сенегал")},
+ {213, TEXT("Сомали")},
+ {214, TEXT("Судан")},
+ {215, TEXT("Сьерра-Леоне")},
+ {216, TEXT("Танзания")},
+ {217, TEXT("Того")},
+ {218, TEXT("Тунис")},
+ {219, TEXT("Уганда")},
+ {220, TEXT("Центральноафриканская Республика")},
+ {222, TEXT("Чад")},
+ {223, TEXT("Экваториальная Гвинея")},
+ {221, TEXT("Эритрея")},
+ {224, TEXT("Эфиопия")},
+ {225, TEXT("Южно-Африканская Республика (ЮАР)")},
+ {39, TEXT("Украина")},
+ {40, TEXT("Австрия")},
+ {32, TEXT("Албания")},
+ {33, TEXT("Андорра")},
+ {340, TEXT("Белоруссия")},
+ {38, TEXT("Бельгия")},
+ {41, TEXT("Болгария")},
+ {42, TEXT("Босния и Герцеговина")},
+ {43, TEXT("Ватикан")},
+ {45, TEXT("Великобритания")},
+ {44, TEXT("Венгрия")},
+ {46, TEXT("Германия")},
+ {3193, TEXT("Гернси (Брит.)")},
+ {47, TEXT("Гибралтар (Брит.)")},
+ {48, TEXT("Греция")},
+ {49, TEXT("Дания")},
+ {3194, TEXT("Джерси (Брит.)")},
+ {50, TEXT("Ирландия")},
+ {51, TEXT("Исландия")},
+ {34, TEXT("Испания")},
+ {52, TEXT("Италия")},
+ {53, TEXT("Латвия")},
+ {54, TEXT("Литва")},
+ {55, TEXT("Лихтенштейн")},
+ {56, TEXT("Люксембург")},
+ {57, TEXT("Македония")},
+ {58, TEXT("Мальта")},
+ {59, TEXT("Молдавия")},
+ {36, TEXT("Монако")},
+ {60, TEXT("Нидерланды")},
+ {61, TEXT("Норвегия")},
+ {3195, TEXT("Остров Мэн (Брит.)")},
+ {62, TEXT("Польша")},
+ {35, TEXT("Португалия")},
+ {63, TEXT("Румыния")},
+ {64, TEXT("Сан-Марино")},
+ {74, TEXT("Сербия и Черногория")},
+ {65, TEXT("Словакия")},
+ {66, TEXT("Словения")},
+ {67, TEXT("Фарерские о-ва (Дания)")},
+ {68, TEXT("Финляндия")},
+ {37, TEXT("Франция")},
+ {69, TEXT("Хорватия")},
+ {70, TEXT("Чехия")},
+ {71, TEXT("Швейцария")},
+ {72, TEXT("Швеция")},
+ {3196, TEXT("Шпицберген (Норв.)")},
+ {73, TEXT("Эстония")},
+ {0, NULL}
};
-static const MRA_CITY mracCitys[]=
+static const MRA_CITY mracCitys[] =
{
- {24, 25, TEXT("Москва")},
- {24, 226, TEXT("Санкт-Петербург")},
- {24, 233, TEXT("Саха (Якутия)")},
- {24, 232, TEXT("Приморский край")},
- {24, 235, TEXT("Хабаровский край")},
- {24, 227, TEXT("Амурская обл.")},
- {24, 229, TEXT("Камчатская обл.")},
- {24, 231, TEXT("Магаданская обл.")},
- {24, 234, TEXT("Сахалинская обл.")},
- {24, 228, TEXT("Еврейская АО")},
- {24, 230, TEXT("Корякский АО")},
- {24, 236, TEXT("Чукотский АО")},
- {24, 237, TEXT("Башкортостан")},
- {24, 240, TEXT("Марий-Эл")},
- {24, 241, TEXT("Мордовия")},
- {24, 248, TEXT("Татарстан")},
- {24, 249, TEXT("Удмуртия")},
- {24, 251, TEXT("Чувашия")},
- {24, 238, TEXT("Кировская обл.")},
- {24, 242, TEXT("Нижегородская обл.")},
- {24, 243, TEXT("Оренбургская обл.")},
- {24, 244, TEXT("Пензенская обл.")},
- {24, 245, TEXT("Пермская обл.")},
- {24, 246, TEXT("Самарская обл.")},
- {24, 247, TEXT("Саратовская обл.")},
- {24, 250, TEXT("Ульяновская обл.")},
- {24, 239, TEXT("Коми-Пермяцкий АО")},
- {24, 255, TEXT("Карелия")},
- {24, 256, TEXT("Коми")},
- {24, 252, TEXT("Архангельская обл.")},
- {24, 253, TEXT("Вологодская обл.")},
- {24, 254, TEXT("Калининградская обл.")},
- {24, 257, TEXT("Ленинградская обл.")},
- {24, 258, TEXT("Мурманская обл.")},
- {24, 260, TEXT("Новгородская обл.")},
- {24, 261, TEXT("Псковская обл.")},
- {24, 259, TEXT("Ненецкий АО")},
- {24, 265, TEXT("Бурятия")},
- {24, 263, TEXT("Республика Алтай")},
- {24, 273, TEXT("Тыва")},
- {24, 275, TEXT("Хакасия")},
- {24, 264, TEXT("Алтайский край")},
- {24, 268, TEXT("Красноярский край")},
- {24, 266, TEXT("Иркутская обл.")},
- {24, 267, TEXT("Кемеровская обл.")},
- {24, 269, TEXT("Новосибирская обл.")},
- {24, 270, TEXT("Омская обл.")},
- {24, 272, TEXT("Томская обл.")},
- {24, 276, TEXT("Читинская обл.")},
- {24, 262, TEXT("Агинский Бурятский АО")},
- {24, 271, TEXT("Таймырский АО")},
- {24, 274, TEXT("Усть-Ордынский Бурятский АО")},
- {24, 277, TEXT("Эвенкийский АО")},
- {24, 278, TEXT("Курганская обл.")},
- {24, 279, TEXT("Свердловская обл.")},
- {24, 280, TEXT("Тюменская обл.")},
- {24, 282, TEXT("Челябинская обл.")},
- {24, 281, TEXT("Ханты-Мансийский АО - Югра")},
- {24, 283, TEXT("Ямало-Ненецкий АО")},
- {24, 284, TEXT("Белгородская обл.")},
- {24, 285, TEXT("Брянская обл.")},
- {24, 286, TEXT("Владимирская обл.")},
- {24, 287, TEXT("Воронежская обл.")},
- {24, 288, TEXT("Ивановская обл.")},
- {24, 289, TEXT("Калужская обл.")},
- {24, 290, TEXT("Костромская обл.")},
- {24, 291, TEXT("Курская обл.")},
- {24, 292, TEXT("Липецкая обл.")},
- {24, 293, TEXT("Московская обл.")},
- {24, 294, TEXT("Орловская обл.")},
- {24, 295, TEXT("Рязанская обл.")},
- {24, 296, TEXT("Смоленская обл.")},
- {24, 297, TEXT("Тамбовская обл.")},
- {24, 298, TEXT("Тверская обл.")},
- {24, 299, TEXT("Тульская обл.")},
- {24, 300, TEXT("Ярославская обл.")},
- {24, 301, TEXT("Адыгея")},
- {24, 304, TEXT("Дагестан")},
- {24, 305, TEXT("Ингушетия")},
- {24, 306, TEXT("Кабардино-Балкария")},
- {24, 307, TEXT("Калмыкия")},
- {24, 308, TEXT("Карачаево-Черкессия")},
- {24, 311, TEXT("Северная Осетия - Алания")},
- {24, 313, TEXT("Чечня")},
- {24, 309, TEXT("Краснодарский край")},
- {24, 312, TEXT("Ставропольский край")},
- {24, 302, TEXT("Астраханская обл.")},
- {24, 303, TEXT("Волгоградская обл.")},
- {24, 310, TEXT("Ростовская обл.")},
- {81, 1055, TEXT("Баку")},
- {81, 1058, TEXT("Гянджа")},
- {81, 1056, TEXT("Нахичевань")},
- {81, 1057, TEXT("Ханкенди")},
- {81, 3153, TEXT("Шеки")},
- {81, 2291, lpwszOther},
- {82, 2932, TEXT("Абовян")},
- {82, 1060, TEXT("Аштарак")},
- {82, 3084, TEXT("Ванадзор")},
- {82, 3011, TEXT("Гюмри")},
- {82, 3306, TEXT("Дилижан")},
- {82, 1059, TEXT("Ереван")},
- {82, 3145, TEXT("Ханкенди")},
- {82, 2292, lpwszOther},
- {97, 1061, TEXT("Кабул")},
- {97, 2293, lpwszOther},
- {96, 1062, TEXT("Дакка")},
- {96, 2294, lpwszOther},
- {99, 1063, TEXT("Манама")},
- {99, 2295, lpwszOther},
- {100, 1064, TEXT("Бандар-Сери-Бегаван")},
- {100, 2296, lpwszOther},
- {101, 1065, TEXT("Тхимпху")},
- {101, 2297, lpwszOther},
- {102, 1066, TEXT("Ханой")},
- {102, 2298, lpwszOther},
- {83, 1067, TEXT("Батуми")},
- {83, 3158, TEXT("Боржоми")},
- {83, 1068, TEXT("Поти")},
- {83, 3129, TEXT("Рустави")},
- {83, 1069, TEXT("Сухуми")},
- {83, 1070, TEXT("Тбилиси")},
- {83, 2299, lpwszOther},
- {86, 3345, TEXT("Ариэль")},
- {86, 1071, TEXT("Афула")},
- {86, 2992, TEXT("Ашдод")},
- {86, 3175, TEXT("Ашкелон")},
- {86, 3363, TEXT("Бат-Ям")},
- {86, 2884, TEXT("Беер-Яков")},
- {86, 3243, TEXT("Бейт-Шемеш")},
- {86, 1074, TEXT("Беэр-Шева")},
- {86, 3348, TEXT("Герцелия")},
- {86, 3241, TEXT("Димона")},
- {86, 1075, TEXT("Иерусалим")},
- {86, 3350, TEXT("Йокнеам-Иллит")},
- {86, 2982, TEXT("Кармиэль")},
- {86, 2971, TEXT("Кфар-Саба")},
- {86, 3136, TEXT("Назарет")},
- {86, 1080, TEXT("Натания")},
- {86, 3303, TEXT("Офаким")},
- {86, 3050, TEXT("Раанана")},
- {86, 3151, TEXT("Рамат Ган")},
- {86, 3141, TEXT("Реховот")},
- {86, 3012, TEXT("Ришон ле Цион")},
- {86, 1081, TEXT("Тверия")},
- {86, 1077, TEXT("Тель-Авив")},
- {86, 1079, TEXT("Хадера")},
- {86, 1078, TEXT("Хайфа")},
- {86, 1076, TEXT("Хеврон")},
- {86, 2929, TEXT("Цфат")},
- {86, 2928, TEXT("Эйлат")},
- {86, 2300, lpwszOther},
- {95, 3315, TEXT("Бангалор")},
- {95, 1082, TEXT("Дели")},
- {95, 1083, TEXT("Джайпур")},
- {95, 3144, TEXT("Калькутта")},
- {95, 3025, TEXT("Мумбаи")},
- {95, 3277, TEXT("Панаджи")},
- {95, 1084, TEXT("Ченнаи")},
- {95, 2301, lpwszOther},
- {103, 1085, TEXT("Джакарта")},
- {103, 2302, lpwszOther},
- {79, 1086, TEXT("Амман")},
- {79, 2303, lpwszOther},
- {85, 1087, TEXT("Багдад")},
- {85, 2304, lpwszOther},
- {87, 1088, TEXT("Тегеран")},
- {87, 2305, lpwszOther},
- {104, 1089, TEXT("Сана")},
- {104, 2306, lpwszOther},
- {84, 1090, TEXT("Актау")},
- {84, 1091, TEXT("Актюбинск")},
- {84, 1092, TEXT("Алма-Ата")},
- {84, 3242, TEXT("Аршалы")},
- {84, 1093, TEXT("Астана")},
- {84, 1094, TEXT("Атырау (Гурьев)")},
- {84, 1095, TEXT("Байконур")},
- {84, 3245, TEXT("Балхаш")},
- {84, 3083, TEXT("Жезказган")},
- {84, 1096, TEXT("Капчагай")},
- {84, 1097, TEXT("Караганда")},
- {84, 1098, TEXT("Кокшетау")},
- {84, 1099, TEXT("Кустанай")},
- {84, 2868, TEXT("Лисаковск")},
- {84, 1100, TEXT("Павлодар")},
- {84, 1101, TEXT("Петропавловск (Сев.-Каз. обл.)")},
- {84, 1102, TEXT("Рудный")},
- {84, 1103, TEXT("Семипалатинск")},
- {84, 1104, TEXT("Степногорск")},
- {84, 3166, TEXT("Талгар")},
- {84, 1105, TEXT("Талды-Курган")},
- {84, 2927, TEXT("Тараз")},
- {84, 1106, TEXT("Темиртау")},
- {84, 1107, TEXT("Уральск")},
- {84, 1108, TEXT("Усть-Каменогорск")},
- {84, 1109, TEXT("Чимкент")},
- {84, 1110, TEXT("Экибастуз")},
- {84, 2307, lpwszOther},
- {105, 1111, TEXT("Пномпень")},
- {105, 2308, lpwszOther},
- {106, 1112, TEXT("Доха")},
- {106, 2309, lpwszOther},
- {107, 1113, TEXT("Ларнака")},
- {107, 1114, TEXT("Лимассол")},
- {107, 1115, TEXT("Никосия")},
- {107, 2954, TEXT("Пафос")},
- {107, 2310, lpwszOther},
- {92, 1116, TEXT("Бишкек")},
- {92, 1117, TEXT("Джалал-Абад")},
- {92, 3027, TEXT("Кара-Балта")},
- {92, 1118, TEXT("Каракол")},
- {92, 1119, TEXT("Ош")},
- {92, 1120, TEXT("Талас")},
- {92, 2933, TEXT("Хайдаркен")},
- {92, 2311, lpwszOther},
- {76, 3214, TEXT("Аомынь (Макао)")},
- {76, 1121, TEXT("Гонконг")},
- {76, 2869, TEXT("Гуанчжоу")},
- {76, 3262, TEXT("Далянь")},
- {76, 1122, TEXT("Пекин")},
- {76, 1123, TEXT("Харбин")},
- {76, 1124, TEXT("Шанхай")},
- {76, 3043, TEXT("Шеньян")},
- {76, 2312, lpwszOther},
- {29, 1125, TEXT("Пхеньян")},
- {29, 2313, lpwszOther},
- {108, 1126, TEXT("Сеул")},
- {108, 3240, TEXT("Тейджон")},
- {108, 2314, lpwszOther},
- {88, 1127, TEXT("Эль-Кувейт")},
- {88, 2315, lpwszOther},
- {109, 1128, TEXT("Вьентьян")},
- {109, 2316, lpwszOther},
- {110, 1129, TEXT("Бейрут")},
- {110, 2317, lpwszOther},
- {111, 1130, TEXT("Джохор-Бару")},
- {111, 1131, TEXT("Куала-Лумпур")},
- {111, 2318, lpwszOther},
- {112, 1132, TEXT("Мале")},
- {112, 2319, lpwszOther},
- {113, 1133, TEXT("Улан-Батор")},
- {113, 1134, TEXT("Эрдэнэт")},
- {113, 2320, lpwszOther},
- {114, 1135, TEXT("Янгон")},
- {114, 2321, lpwszOther},
- {115, 1136, TEXT("Катманду")},
- {115, 2322, lpwszOther},
- {116, 1137, TEXT("Абу-Даби")},
- {116, 1138, TEXT("Дубай")},
- {116, 1139, TEXT("Шарджа")},
- {116, 2323, lpwszOther},
- {117, 1140, TEXT("Маскат")},
- {117, 2324, lpwszOther},
- {122, 1141, TEXT("Исламабад")},
- {122, 2325, lpwszOther},
- {89, 1072, TEXT("Ашдод")},
- {89, 1073, TEXT("Ашкелон")},
- {89, 1142, TEXT("Газа")},
- {89, 2326, lpwszOther},
- {94, 3250, TEXT("Медина")},
- {94, 1143, TEXT("Эр-Рияд")},
- {94, 2327, lpwszOther},
- {78, 1144, TEXT("Дамаск")},
- {78, 2328, lpwszOther},
- {91, 1145, TEXT("Душанбе")},
- {91, 3307, TEXT("Кайраккум")},
- {91, 3308, TEXT("Худжанд")},
- {91, 2329, lpwszOther},
- {119, 1146, TEXT("Бангкок")},
- {119, 1147, TEXT("Пхукет")},
- {119, 2330, lpwszOther},
- {120, 1148, TEXT("Тайбэй")},
- {120, 2331, lpwszOther},
- {132, 1149, TEXT("Дили")},
- {132, 2332, lpwszOther},
- {90, 1150, TEXT("Ашхабад")},
- {90, 3079, TEXT("Безмеин")},
- {90, 2333, lpwszOther},
- {77, 1152, TEXT("Анкара")},
- {77, 1153, TEXT("Анталия")},
- {77, 3080, TEXT("Бурса")},
- {77, 1151, TEXT("Мармарис")},
- {77, 1154, TEXT("Стамбул")},
- {77, 1155, TEXT("Трабзон")},
- {77, 2334, lpwszOther},
- {93, 3362, TEXT("Алмалык")},
- {93, 3137, TEXT("Андижан")},
- {93, 3273, TEXT("Асака")},
- {93, 1156, TEXT("Ахангаран")},
- {93, 1157, TEXT("Бухара")},
- {93, 3167, TEXT("Джизак")},
- {93, 3347, TEXT("Кунград")},
- {93, 1158, TEXT("Навои")},
- {93, 1159, TEXT("Наманган")},
- {93, 1160, TEXT("Самарканд")},
- {93, 1161, TEXT("Ташкент")},
- {93, 1162, TEXT("Ургенч")},
- {93, 1163, TEXT("Фергана")},
- {93, 1164, TEXT("Чирчик")},
- {93, 2335, lpwszOther},
- {121, 1165, TEXT("Манила")},
- {121, 3319, TEXT("Себу")},
- {121, 2336, lpwszOther},
- {98, 1166, TEXT("Коломбо")},
- {98, 2337, lpwszOther},
- {75, 3176, TEXT("Исесаки")},
- {75, 3339, TEXT("Корияма")},
- {75, 1167, TEXT("Саппоро")},
- {75, 1168, TEXT("Токио")},
- {75, 2338, lpwszOther},
- {123, 1914, TEXT("Аделаида")},
- {123, 2957, TEXT("Блэк Рок")},
- {123, 1915, TEXT("Брисбен")},
- {123, 3331, TEXT("Горокан")},
- {123, 1916, TEXT("Канберра")},
- {123, 3001, TEXT("Лидкомб")},
- {123, 1917, TEXT("Мельбурн")},
- {123, 3217, TEXT("Норфолк")},
- {123, 3064, TEXT("Перт")},
- {123, 3020, TEXT("Санта Люсиа")},
- {123, 1918, TEXT("Сидней")},
- {123, 3238, TEXT("Энеабба")},
- {123, 2339, lpwszOther},
- {454, 1192, TEXT("Паго-Паго")},
- {454, 2366, lpwszOther},
- {124, 1919, TEXT("Порт-Вила")},
- {124, 2340, lpwszOther},
- {453, 1193, TEXT("Аганья")},
- {453, 2368, lpwszOther},
- {126, 1921, TEXT("Баирики")},
- {126, 2342, lpwszOther},
- {127, 1922, TEXT("Маджуро")},
- {127, 2343, lpwszOther},
- {128, 1923, TEXT("Паликир")},
- {128, 2344, lpwszOther},
- {129, 1924, TEXT("Ярен")},
- {129, 2345, lpwszOther},
- {130, 1925, TEXT("Веллингтон")},
- {130, 1926, TEXT("Гамильтон")},
- {130, 1928, TEXT("Данидин")},
- {130, 1929, TEXT("Крайстчерч")},
- {130, 3235, TEXT("Кромвель")},
- {130, 1927, TEXT("Окленд")},
- {130, 3323, TEXT("Тауранга")},
- {130, 2346, lpwszOther},
- {131, 1930, TEXT("Корор")},
- {131, 2347, lpwszOther},
- {133, 1931, TEXT("Порт-Морсби")},
- {133, 2348, lpwszOther},
- {125, 1920, TEXT("Апиа")},
- {125, 2341, lpwszOther},
- {134, 1932, TEXT("Хониара")},
- {134, 2349, lpwszOther},
- {135, 1933, TEXT("Нукуалофа")},
- {135, 2350, lpwszOther},
- {136, 1934, TEXT("Фунафути")},
- {136, 2351, lpwszOther},
- {137, 1935, TEXT("Сува")},
- {137, 2352, lpwszOther},
- {138, 3055, TEXT("Барлингтон")},
- {138, 3049, TEXT("Броссард")},
- {138, 3330, TEXT("Бурнаби")},
- {138, 1169, TEXT("Ванкувер")},
- {138, 3106, TEXT("Ватерлоо")},
- {138, 1170, TEXT("Виннипег")},
- {138, 1171, TEXT("Галифакс")},
- {138, 1172, TEXT("Гамильтон")},
- {138, 3365, TEXT("Денвер")},
- {138, 1173, TEXT("Калгари")},
- {138, 3104, TEXT("Камлупс")},
- {138, 3366, TEXT("Каннингтон")},
- {138, 1174, TEXT("Квебек")},
- {138, 2964, TEXT("Кингстон")},
- {138, 3113, TEXT("Коквитлам")},
- {138, 1175, TEXT("Монреаль")},
- {138, 2920, TEXT("Ниагара-Фолс")},
- {138, 2889, TEXT("Норд-Йорк")},
- {138, 1176, TEXT("Оттава")},
- {138, 2903, TEXT("Порт Алберни")},
- {138, 1177, TEXT("Ричмонд")},
- {138, 1178, TEXT("Тимминс")},
- {138, 2946, TEXT("Торнхилл")},
- {138, 1179, TEXT("Торонто")},
- {138, 1180, TEXT("Эдмонтон")},
- {138, 2353, lpwszOther},
- {139, 407, TEXT("Вашингтон")},
- {139, 426, TEXT("Айдахо")},
- {139, 378, TEXT("Айова")},
- {139, 412, TEXT("Алабама")},
- {139, 446, TEXT("Аляска")},
- {139, 434, TEXT("Аризона")},
- {139, 416, TEXT("Арканзас")},
- {139, 428, TEXT("Вайоминг")},
- {139, 440, TEXT("Вашингтон")},
- {139, 352, TEXT("Вермонт")},
- {139, 394, TEXT("Виргиния")},
- {139, 374, TEXT("Висконсин")},
- {139, 448, TEXT("Гавайи")},
- {139, 390, TEXT("Делавер")},
- {139, 402, TEXT("Джорджия")},
- {139, 396, TEXT("Западная Виргиния")},
- {139, 370, TEXT("Иллинойс")},
- {139, 368, TEXT("Индиана")},
- {139, 444, TEXT("Калифорния")},
- {139, 388, TEXT("Канзас")},
- {139, 408, TEXT("Кентукки")},
- {139, 430, TEXT("Колорадо")},
- {139, 358, TEXT("Коннектикут")},
- {139, 418, TEXT("Луизиана")},
- {139, 354, TEXT("Массачусетс")},
- {139, 376, TEXT("Миннесота")},
- {139, 414, TEXT("Миссисипи")},
- {139, 380, TEXT("Миссури")},
- {139, 372, TEXT("Мичиган")},
- {139, 424, TEXT("Монтана")},
- {139, 348, TEXT("Мэн")},
- {139, 392, TEXT("Мэриленд")},
- {139, 386, TEXT("Небраска")},
- {139, 438, TEXT("Невада")},
- {139, 362, TEXT("Нью-Джерси")},
- {139, 360, TEXT("Нью-Йорк")},
- {139, 432, TEXT("Нью-Мексико")},
- {139, 350, TEXT("Нью-Хэмпшир")},
- {139, 366, TEXT("Огайо")},
- {139, 420, TEXT("Оклахома")},
- {139, 442, TEXT("Орегон")},
- {139, 364, TEXT("Пенсильвания")},
- {139, 450, TEXT("Пуэрто-Рико")},
- {139, 356, TEXT("Род-Айленд")},
- {139, 382, TEXT("Северная Дакота")},
- {139, 398, TEXT("Северная Каролина")},
- {139, 410, TEXT("Теннесси")},
- {139, 422, TEXT("Техас")},
- {139, 406, TEXT("Федеральный округ Колумбия")},
- {139, 404, TEXT("Флорида")},
- {139, 384, TEXT("Южная Дакота")},
- {139, 400, TEXT("Южная Каролина")},
- {139, 436, TEXT("Юта")},
- {140, 1238, TEXT("Сент-Джонс")},
- {140, 2442, lpwszOther},
- {141, 1239, TEXT("Буэнос-Айрес")},
- {141, 2441, lpwszOther},
- {142, 1240, TEXT("Нассау")},
- {142, 2440, lpwszOther},
- {143, 1241, TEXT("Бриджтаун")},
- {143, 2439, lpwszOther},
- {146, 1242, TEXT("Бельмопан")},
- {146, 2438, lpwszOther},
- {144, 1243, TEXT("Ла-Пас")},
- {144, 2437, lpwszOther},
- {145, 1244, TEXT("Бразилиа")},
- {145, 3094, TEXT("Пассо Фундо")},
- {145, 1245, TEXT("Рио-де-Жанейро")},
- {145, 1246, TEXT("Сан-Паулу")},
- {145, 2436, lpwszOther},
- {147, 1247, TEXT("Каракас")},
- {147, 2435, lpwszOther},
- {452, 1190, TEXT("Шарлотта-Амалия")},
- {452, 2364, lpwszOther},
- {149, 1248, TEXT("Порт-о-Пренс")},
- {149, 2434, lpwszOther},
- {148, 1249, TEXT("Джоржтаун")},
- {148, 2433, lpwszOther},
- {173, 1250, TEXT("Гватемала")},
- {173, 2432, lpwszOther},
- {150, 1251, TEXT("Тегусигальпа")},
- {150, 2431, lpwszOther},
- {151, 1252, TEXT("Сент-Джорджес")},
- {151, 2430, lpwszOther},
- {152, 1253, TEXT("Уманак")},
- {152, 2429, lpwszOther},
- {153, 1254, TEXT("Розо")},
- {153, 2428, lpwszOther},
- {154, 1255, TEXT("Санто-Доминго")},
- {154, 2427, lpwszOther},
- {155, 1256, TEXT("Богота")},
- {155, 2426, lpwszOther},
- {156, 1257, TEXT("Сан-Хосе")},
- {156, 2425, lpwszOther},
- {157, 1258, TEXT("Гавана")},
- {157, 2424, lpwszOther},
- {158, 1259, TEXT("Акапулько")},
- {158, 1260, TEXT("Мехико")},
- {158, 2423, lpwszOther},
- {159, 1261, TEXT("Манагуа")},
- {159, 2422, lpwszOther},
- {160, 1262, TEXT("Панама")},
- {160, 2421, lpwszOther},
- {161, 1263, TEXT("Асунсьон")},
- {161, 2420, lpwszOther},
- {162, 1264, TEXT("Лима")},
- {162, 2419, lpwszOther},
- {163, 1265, TEXT("Сан-Сальвадор")},
- {163, 2418, lpwszOther},
- {164, 1266, TEXT("Кингстаун")},
- {164, 2417, lpwszOther},
- {165, 1267, TEXT("Бастер")},
- {165, 2416, lpwszOther},
- {166, 1268, TEXT("Кастри")},
- {166, 2415, lpwszOther},
- {167, 1269, TEXT("Парамарибо")},
- {167, 2414, lpwszOther},
- {168, 1270, TEXT("Порт-оф-Спейн")},
- {168, 2413, lpwszOther},
- {169, 1271, TEXT("Монтевидео")},
- {169, 2412, lpwszOther},
- {170, 1272, TEXT("Сантьяго")},
- {170, 2411, lpwszOther},
- {171, 1273, TEXT("Гуаякиль")},
- {171, 1274, TEXT("Кито")},
- {171, 2410, lpwszOther},
- {172, 1275, TEXT("Кингстон")},
- {172, 2409, lpwszOther},
- {174, 1854, TEXT("Алжир")},
- {174, 2495, lpwszOther},
- {175, 1855, TEXT("Луанда")},
- {175, 2494, lpwszOther},
- {176, 1856, TEXT("Котону")},
- {176, 1857, TEXT("Порто-Ново")},
- {176, 2493, lpwszOther},
- {177, 1858, TEXT("Габороне")},
- {177, 2492, lpwszOther},
- {178, 1859, TEXT("Уагадугу")},
- {178, 2491, lpwszOther},
- {179, 1860, TEXT("Бужумбуру")},
- {179, 2490, lpwszOther},
- {180, 1861, TEXT("Либревиль")},
- {180, 2489, lpwszOther},
- {181, 1862, TEXT("Банжул")},
- {181, 2488, lpwszOther},
- {182, 1863, TEXT("Аккра")},
- {182, 2487, lpwszOther},
- {183, 1864, TEXT("Конакри")},
- {183, 2486, lpwszOther},
- {184, 1865, TEXT("Бисау")},
- {184, 2485, lpwszOther},
- {185, 1866, TEXT("Джибути")},
- {185, 2484, lpwszOther},
- {186, 3312, TEXT("Дахаб")},
- {186, 1867, TEXT("Каир")},
- {186, 1868, TEXT("Хургада")},
- {186, 2483, lpwszOther},
- {187, 1869, TEXT("Лусака")},
- {187, 2482, lpwszOther},
- {23, 1870, TEXT("Хараре")},
- {23, 2481, lpwszOther},
- {188, 1871, TEXT("Прая")},
- {188, 2480, lpwszOther},
- {189, 1872, TEXT("Яунде")},
- {189, 2479, lpwszOther},
- {190, 1873, TEXT("Найроби")},
- {190, 2478, lpwszOther},
- {191, 1874, TEXT("Морони")},
- {191, 2477, lpwszOther},
- {193, 1875, TEXT("Киншаса")},
- {193, 2476, lpwszOther},
- {192, 1876, TEXT("Браззавиль")},
- {192, 2475, lpwszOther},
- {194, 1877, TEXT("Ямусукро")},
- {194, 2474, lpwszOther},
- {195, 1878, TEXT("Масеру")},
- {195, 2473, lpwszOther},
- {196, 1879, TEXT("Монровия")},
- {196, 2472, lpwszOther},
- {197, 1880, TEXT("Триполи")},
- {197, 2471, lpwszOther},
- {198, 1881, TEXT("Порт-Луи")},
- {198, 2470, lpwszOther},
- {199, 1882, TEXT("Нуакшот")},
- {199, 2469, lpwszOther},
- {200, 1883, TEXT("Антананариву")},
- {200, 2468, lpwszOther},
- {201, 1884, TEXT("Лилонгве")},
- {201, 2467, lpwszOther},
- {202, 1885, TEXT("Бамако")},
- {202, 2466, lpwszOther},
- {203, 1886, TEXT("Агадир")},
- {203, 1887, TEXT("Рабат")},
- {203, 2465, lpwszOther},
- {204, 1888, TEXT("Мапуту")},
- {204, 2464, lpwszOther},
- {205, 1889, TEXT("Виндхук")},
- {205, 2463, lpwszOther},
- {206, 1890, TEXT("Ниамей")},
- {206, 2462, lpwszOther},
- {207, 1891, TEXT("Абуджа")},
- {207, 2461, lpwszOther},
- {208, 1892, TEXT("Кигали")},
- {208, 2460, lpwszOther},
- {209, 1893, TEXT("Сан-Томе")},
- {209, 2459, lpwszOther},
- {210, 1894, TEXT("Мбабане")},
- {210, 2458, lpwszOther},
- {211, 1895, TEXT("Виктория")},
- {211, 2457, lpwszOther},
- {212, 1896, TEXT("Дакар")},
- {212, 2456, lpwszOther},
- {213, 1897, TEXT("Могадишо")},
- {213, 2455, lpwszOther},
- {214, 1898, TEXT("Хартум")},
- {214, 2454, lpwszOther},
- {215, 1899, TEXT("Фритаун")},
- {215, 2453, lpwszOther},
- {216, 1900, TEXT("Дар-эс-Салам")},
- {216, 1901, TEXT("Додома")},
- {216, 2452, lpwszOther},
- {217, 1902, TEXT("Ломе")},
- {217, 2451, lpwszOther},
- {218, 1903, TEXT("Тунис")},
- {218, 2450, lpwszOther},
- {219, 1904, TEXT("Кампала")},
- {219, 2449, lpwszOther},
- {220, 1905, TEXT("Банги")},
- {220, 2448, lpwszOther},
- {222, 1906, TEXT("Нджамена")},
- {222, 2447, lpwszOther},
- {223, 1907, TEXT("Малабо")},
- {223, 2446, lpwszOther},
- {221, 1908, TEXT("Асмэра")},
- {221, 2445, lpwszOther},
- {224, 1909, TEXT("Аддис-Абеба")},
- {224, 2444, lpwszOther},
- {225, 1910, TEXT("Дурбан")},
- {225, 1913, TEXT("Йоханнесбург")},
- {225, 1912, TEXT("Кейптаун")},
- {225, 3033, TEXT("Пайнтаун")},
- {225, 1911, TEXT("Претория")},
- {225, 2443, lpwszOther},
- {39, 314, TEXT("Киев")},
- {39, 315, TEXT("Винницкая обл.")},
- {39, 316, TEXT("Волынская обл.")},
- {39, 317, TEXT("Днепропетровская обл.")},
- {39, 318, TEXT("Донецкая обл.")},
- {39, 319, TEXT("Житомирская обл.")},
- {39, 320, TEXT("Закарпатская обл.")},
- {39, 321, TEXT("Запорожская обл.")},
- {39, 322, TEXT("Ивано-Франковская обл.")},
- {39, 323, TEXT("Киевская обл.")},
- {39, 324, TEXT("Кировоградская обл.")},
- {39, 325, TEXT("Крым")},
- {39, 326, TEXT("Луганская обл.")},
- {39, 327, TEXT("Львовская обл.")},
- {39, 328, TEXT("Николаевская обл.")},
- {39, 329, TEXT("Одесская обл.")},
- {39, 330, TEXT("Полтавская обл.")},
- {39, 331, TEXT("Ровенская обл.")},
- {39, 332, TEXT("Сумская обл.")},
- {39, 333, TEXT("Тернопольская обл.")},
- {39, 334, TEXT("Харьковская обл.")},
- {39, 335, TEXT("Херсонская обл.")},
- {39, 336, TEXT("Хмельницкая обл.")},
- {39, 337, TEXT("Черкасская обл.")},
- {39, 338, TEXT("Черниговская обл.")},
- {39, 339, TEXT("Черновицкая обл.")},
- {40, 602, TEXT("Бад Халл")},
- {40, 604, TEXT("Брегенц")},
- {40, 603, TEXT("Вена")},
- {40, 608, TEXT("Грац")},
- {40, 606, TEXT("Зальцбург")},
- {40, 3099, TEXT("Зель-ам-Зее")},
- {40, 605, TEXT("Инсбрук")},
- {40, 3174, TEXT("Кирхберг")},
- {40, 609, TEXT("Клагенфурт")},
- {40, 607, TEXT("Линц")},
- {40, 610, TEXT("Обдах")},
- {40, 611, TEXT("Щтубайтал")},
- {40, 2541, lpwszOther},
- {32, 612, TEXT("Тирана")},
- {32, 2540, lpwszOther},
- {33, 613, TEXT("Андорра-ла-Велья")},
- {33, 2539, lpwszOther},
- {340, 341, TEXT("Минск")},
- {340, 342, TEXT("Брестская обл.")},
- {340, 343, TEXT("Витебская обл.")},
- {340, 344, TEXT("Гомельская обл.")},
- {340, 345, TEXT("Гродненская обл.")},
- {340, 346, TEXT("Минская обл.")},
- {340, 347, TEXT("Могилевская обл.")},
- {38, 760, TEXT("Антверпен")},
- {38, 767, TEXT("Арлон")},
- {38, 762, TEXT("Брюгге")},
- {38, 761, TEXT("Брюссель")},
- {38, 763, TEXT("Гент")},
- {38, 769, TEXT("Лувен")},
- {38, 765, TEXT("Льеж")},
- {38, 764, TEXT("Монс")},
- {38, 3117, TEXT("Мортсель")},
- {38, 766, TEXT("Намюр")},
- {38, 768, TEXT("Хасселт")},
- {38, 2532, lpwszOther},
- {41, 3098, TEXT("Банско")},
- {41, 792, TEXT("Благоевград")},
- {41, 770, TEXT("Бургас")},
- {41, 771, TEXT("Бяла")},
- {41, 773, TEXT("Варна")},
- {41, 776, TEXT("Велико-Тырново")},
- {41, 788, TEXT("Видин")},
- {41, 789, TEXT("Враца")},
- {41, 796, TEXT("Габрово")},
- {41, 777, TEXT("Димитровград")},
- {41, 781, TEXT("Каварна")},
- {41, 786, TEXT("Кырджали")},
- {41, 791, TEXT("Кюстендил")},
- {41, 793, TEXT("Лазарджик")},
- {41, 795, TEXT("Ловеч")},
- {41, 787, TEXT("Михайловград")},
- {41, 790, TEXT("Перник")},
- {41, 3133, TEXT("Пирдоп")},
- {41, 794, TEXT("Плевен")},
- {41, 782, TEXT("Пловдив")},
- {41, 780, TEXT("Разград")},
- {41, 779, TEXT("Русе")},
- {41, 774, TEXT("Силистра")},
- {41, 784, TEXT("Сливен")},
- {41, 772, TEXT("София")},
- {41, 775, TEXT("Толбухин")},
- {41, 3116, TEXT("Тырново")},
- {41, 785, TEXT("Хасково")},
- {41, 778, TEXT("Шумен")},
- {41, 783, TEXT("Ямбол")},
- {41, 2531, lpwszOther},
- {42, 797, TEXT("Баня-Лука")},
- {42, 799, TEXT("Зеница")},
- {42, 798, TEXT("Сараево")},
- {42, 800, TEXT("Тузла")},
- {42, 2530, lpwszOther},
- {45, 802, TEXT("Абердин")},
- {45, 3075, TEXT("Айслворт")},
- {45, 801, TEXT("Алнвик")},
- {45, 804, TEXT("Бидефорд")},
- {45, 803, TEXT("Бирмингем")},
- {45, 805, TEXT("Блоксвич")},
- {45, 3168, TEXT("Бостон")},
- {45, 806, TEXT("Брайтон")},
- {45, 807, TEXT("Бредфорд")},
- {45, 808, TEXT("Бристоль")},
- {45, 809, TEXT("Вилленхолл")},
- {45, 3131, TEXT("Воррингтон")},
- {45, 810, TEXT("Вудбридж")},
- {45, 3342, TEXT("Гилфорд")},
- {45, 811, TEXT("Глазго")},
- {45, 812, TEXT("Дадли")},
- {45, 813, TEXT("Дарем")},
- {45, 814, TEXT("Дуглас")},
- {45, 3089, TEXT("Кардиф")},
- {45, 815, TEXT("Кембридж")},
- {45, 816, TEXT("Кентербери")},
- {45, 817, TEXT("Ливерпуль")},
- {45, 818, TEXT("Лидс")},
- {45, 819, TEXT("Лондон")},
- {45, 820, TEXT("Манчестер")},
- {45, 2976, TEXT("Митчем")},
- {45, 2988, TEXT("Мэйденхед")},
- {45, 821, TEXT("Ноттингем")},
- {45, 3088, TEXT("Ньюпорт")},
- {45, 822, TEXT("Оксфорд")},
- {45, 823, TEXT("Плимут")},
- {45, 824, TEXT("Портсмут")},
- {45, 825, TEXT("Престон")},
- {45, 3343, TEXT("Райд")},
- {45, 2867, TEXT("Ридинг")},
- {45, 2986, TEXT("Сент-Албанс")},
- {45, 826, TEXT("Стаффорд")},
- {45, 3063, TEXT("Стокпорт")},
- {45, 827, TEXT("Уэймут")},
- {45, 3140, TEXT("Челтенхэм")},
- {45, 828, TEXT("Честер")},
- {45, 829, TEXT("Шеффилд")},
- {45, 830, TEXT("Эдинбург")},
- {45, 2529, lpwszOther},
- {44, 831, TEXT("Будапешт")},
- {44, 832, TEXT("Геделле")},
- {44, 836, TEXT("Дебрецен")},
- {44, 835, TEXT("Мишкольц")},
- {44, 834, TEXT("Сегед")},
- {44, 833, TEXT("Шиофок")},
- {44, 2528, lpwszOther},
- {46, 3007, TEXT("Аахен")},
- {46, 837, TEXT("Аугсбург")},
- {46, 838, TEXT("Баден-Баден")},
- {46, 3371, TEXT("Бамберг")},
- {46, 839, TEXT("Бергиш-Гладбах")},
- {46, 840, TEXT("Берлин")},
- {46, 841, TEXT("Билефельд")},
- {46, 3163, TEXT("Бовенден")},
- {46, 842, TEXT("Бонн")},
- {46, 843, TEXT("Браденбург")},
- {46, 3015, TEXT("Брауншвейг")},
- {46, 844, TEXT("Бремен")},
- {46, 2921, TEXT("Варштайн")},
- {46, 845, TEXT("Веймар")},
- {46, 846, TEXT("Вупперталь")},
- {46, 847, TEXT("Гамбург")},
- {46, 848, TEXT("Ганновер")},
- {46, 849, TEXT("Гарделеген")},
- {46, 3010, TEXT("Гейдельберг")},
- {46, 850, TEXT("Гота")},
- {46, 851, TEXT("Дармштадт")},
- {46, 3072, TEXT("Дессау")},
- {46, 852, TEXT("Детмольд")},
- {46, 853, TEXT("Дортмунд")},
- {46, 854, TEXT("Дрезден")},
- {46, 855, TEXT("Дюссельдорф")},
- {46, 3082, TEXT("Иффецхайм")},
- {46, 3309, TEXT("Кассел")},
- {46, 856, TEXT("Кельн")},
- {46, 857, TEXT("Киль")},
- {46, 3138, TEXT("Кобленц")},
- {46, 858, TEXT("Крефельд")},
- {46, 859, TEXT("Лейпциг")},
- {46, 2872, TEXT("Лимбург")},
- {46, 2965, TEXT("Линген")},
- {46, 3135, TEXT("Любек")},
- {46, 3156, TEXT("Мангейм")},
- {46, 3192, TEXT("Меерсбург")},
- {46, 860, TEXT("Мюнстер")},
- {46, 861, TEXT("Мюнхен")},
- {46, 2864, TEXT("Нойштадт")},
- {46, 862, TEXT("Нюрнберг")},
- {46, 3009, TEXT("Оффенбург")},
- {46, 2993, TEXT("Падерборн")},
- {46, 863, TEXT("Равенсбург")},
- {46, 864, TEXT("Регенсбург")},
- {46, 865, TEXT("Рейнен")},
- {46, 866, TEXT("Росток")},
- {46, 3191, TEXT("Саарбрюкен")},
- {46, 2974, TEXT("Санкт-Августин")},
- {46, 3127, TEXT("Тюринген")},
- {46, 867, TEXT("Фрайберг")},
- {46, 868, TEXT("Фрайбург")},
- {46, 869, TEXT("Франкфурт-на-Майне")},
- {46, 3373, TEXT("Хемнитц")},
- {46, 3313, TEXT("Хильден")},
- {46, 870, TEXT("Штутгарт")},
- {46, 3045, TEXT("Эрланген")},
- {46, 2906, TEXT("Эшборн")},
- {46, 2527, lpwszOther},
- {48, 871, TEXT("Афины")},
- {48, 873, TEXT("Ираклион")},
- {48, 3147, TEXT("Корфу")},
- {48, 872, TEXT("Салоники")},
- {48, 3178, TEXT("Халкидики")},
- {48, 2526, lpwszOther},
- {49, 3006, TEXT("Архус")},
- {49, 874, TEXT("Копенгаген")},
- {49, 875, TEXT("Оденсе")},
- {49, 3285, TEXT("Ольборг")},
- {49, 876, TEXT("Сванеке")},
- {49, 3126, TEXT("Скиве")},
- {49, 2525, lpwszOther},
- {50, 3377, TEXT("Виклоу")},
- {50, 3067, TEXT("Голвей")},
- {50, 877, TEXT("Дублин")},
- {50, 3065, TEXT("Килларней")},
- {50, 3066, TEXT("Корк")},
- {50, 878, TEXT("Лимерик")},
- {50, 3069, TEXT("Нейс")},
- {50, 3068, TEXT("Типперэри")},
- {50, 2524, lpwszOther},
- {51, 879, TEXT("Рейкьявик")},
- {51, 2523, lpwszOther},
- {34, 880, TEXT("Аликанте")},
- {34, 3125, TEXT("Альмерия")},
- {34, 881, TEXT("Барселона")},
- {34, 890, TEXT("Бильбао")},
- {34, 3076, TEXT("Бланес")},
- {34, 882, TEXT("Валенсия")},
- {34, 3070, TEXT("Ибица")},
- {34, 888, TEXT("Кадис")},
- {34, 886, TEXT("Картахена")},
- {34, 891, TEXT("Ла-Корунья")},
- {34, 3310, TEXT("Лорет де Мар")},
- {34, 883, TEXT("Мадрид")},
- {34, 884, TEXT("Малага")},
- {34, 885, TEXT("Марбелья")},
- {34, 892, TEXT("Овьедо")},
- {34, 3179, TEXT("Пальма де Майорка")},
- {34, 3177, TEXT("Сан-Агустин")},
- {34, 3289, TEXT("Санта-Крус-де-Тенерифе")},
- {34, 889, TEXT("Сарагоса")},
- {34, 887, TEXT("Севилья")},
- {34, 893, TEXT("Хихон")},
- {34, 2522, lpwszOther},
- {52, 3318, TEXT("Аоста")},
- {52, 3278, TEXT("Беллариа")},
- {52, 906, TEXT("Болонья")},
- {52, 894, TEXT("Брешиа")},
- {52, 895, TEXT("Венеция")},
- {52, 905, TEXT("Верона")},
- {52, 896, TEXT("Генуя")},
- {52, 897, TEXT("Лекко")},
- {52, 3369, TEXT("Ливорно")},
- {52, 3327, TEXT("Марсала")},
- {52, 898, TEXT("Милан")},
- {52, 899, TEXT("Модена")},
- {52, 907, TEXT("Неаполь")},
- {52, 908, TEXT("Перуджа")},
- {52, 900, TEXT("Пиза")},
- {52, 901, TEXT("Рим")},
- {52, 3368, TEXT("Сан-Ремо")},
- {52, 3384, TEXT("Сиракуза")},
- {52, 3252, TEXT("Терамо")},
- {52, 902, TEXT("Триест")},
- {52, 903, TEXT("Турин")},
- {52, 3130, TEXT("Фано")},
- {52, 904, TEXT("Флоренция")},
- {52, 2521, lpwszOther},
- {53, 2939, TEXT("Айзкраукле")},
- {53, 3054, TEXT("Валка")},
- {53, 909, TEXT("Даугавпилс")},
- {53, 2934, TEXT("Екабпилс")},
- {53, 913, TEXT("Елгава")},
- {53, 2935, TEXT("Кокнесе")},
- {53, 912, TEXT("Лиепая")},
- {53, 2905, TEXT("Резекне")},
- {53, 911, TEXT("Рига")},
- {53, 2936, TEXT("Саласпилс")},
- {53, 2937, TEXT("Смилтене")},
- {53, 910, TEXT("Юрмала")},
- {53, 2520, lpwszOther},
- {54, 914, TEXT("Вильнюс")},
- {54, 915, TEXT("Висагинас")},
- {54, 916, TEXT("Каунас")},
- {54, 918, TEXT("Клайпеда")},
- {54, 919, TEXT("Паланга")},
- {54, 3173, TEXT("Пеневежис")},
- {54, 917, TEXT("Шауляй")},
- {54, 2519, lpwszOther},
- {55, 920, TEXT("Вадуц")},
- {55, 2518, lpwszOther},
- {56, 3376, TEXT("Бетцдорф")},
- {56, 921, TEXT("Люксембург")},
- {56, 2517, lpwszOther},
- {57, 3142, TEXT("Битола")},
- {57, 922, TEXT("Скопье")},
- {57, 2516, lpwszOther},
- {58, 923, TEXT("Валлетта")},
- {58, 3154, TEXT("Мзида")},
- {58, 924, TEXT("Слима")},
- {58, 2515, lpwszOther},
- {59, 925, TEXT("Бельцы")},
- {59, 926, TEXT("Бендеры")},
- {59, 3234, TEXT("Дубоссары")},
- {59, 3275, TEXT("Кахул")},
- {59, 927, TEXT("Кишинев")},
- {59, 3321, TEXT("Резина")},
- {59, 928, TEXT("Рыбница")},
- {59, 929, TEXT("Тирасполь")},
- {59, 3281, TEXT("Чадыр-Лунга")},
- {59, 2514, lpwszOther},
- {36, 930, TEXT("Монте-Карло")},
- {36, 2513, lpwszOther},
- {60, 931, TEXT("Амстердам")},
- {60, 933, TEXT("Бреда")},
- {60, 932, TEXT("Гаага")},
- {60, 934, TEXT("Гауда")},
- {60, 935, TEXT("Делфт")},
- {60, 2977, TEXT("Донген")},
- {60, 3030, TEXT("Зволле")},
- {60, 3091, TEXT("Ниймеген")},
- {60, 936, TEXT("Роттердам")},
- {60, 937, TEXT("Утрехт")},
- {60, 3044, TEXT("Эйндховен")},
- {60, 3380, TEXT("Эншеде")},
- {60, 2512, lpwszOther},
- {61, 3190, TEXT("Кристиансанд")},
- {61, 2857, TEXT("Лиллехаммер")},
- {61, 938, TEXT("Осло")},
- {61, 3355, TEXT("Ставангер")},
- {61, 939, TEXT("Тронхейм")},
- {61, 2511, lpwszOther},
- {62, 940, TEXT("Белосток")},
- {62, 941, TEXT("Варшава")},
- {62, 3164, TEXT("Вроцлав")},
- {62, 942, TEXT("Гданьск")},
- {62, 943, TEXT("Гливице")},
- {62, 3237, TEXT("Закопане")},
- {62, 3165, TEXT("Зелена Гура")},
- {62, 944, TEXT("Катовице")},
- {62, 945, TEXT("Краков")},
- {62, 3008, TEXT("Лодзь")},
- {62, 3150, TEXT("Ольштын")},
- {62, 946, TEXT("Познань")},
- {62, 947, TEXT("Радом")},
- {62, 948, TEXT("Сопот")},
- {62, 2958, TEXT("Тыхы")},
- {62, 2510, lpwszOther},
- {35, 949, TEXT("Лиссабон")},
- {35, 950, TEXT("Порто")},
- {35, 2509, lpwszOther},
- {63, 952, TEXT("Брашов")},
- {63, 951, TEXT("Бухарест")},
- {63, 954, TEXT("Констанца")},
- {63, 955, TEXT("Плоешти")},
- {63, 953, TEXT("Яссы")},
- {63, 2508, lpwszOther},
- {64, 956, TEXT("Сан-Марино")},
- {64, 2507, lpwszOther},
- {74, 957, TEXT("Белград")},
- {74, 960, TEXT("Ниш")},
- {74, 958, TEXT("Нови-Сад")},
- {74, 959, TEXT("Сараево")},
- {74, 2506, lpwszOther},
- {65, 961, TEXT("Братислава")},
- {65, 962, TEXT("Кошице")},
- {65, 3101, TEXT("Липтов")},
- {65, 963, TEXT("Попрад")},
- {65, 964, TEXT("Прешов")},
- {65, 965, TEXT("Ружемберок")},
- {65, 966, TEXT("Тврдошин")},
- {65, 2505, lpwszOther},
- {66, 968, TEXT("Копар")},
- {66, 967, TEXT("Любляна")},
- {66, 969, TEXT("Марибор")},
- {66, 2504, lpwszOther},
- {67, 970, TEXT("Торсхавн")},
- {67, 2503, lpwszOther},
- {68, 2888, TEXT("Вантаа")},
- {68, 971, TEXT("Васа")},
- {68, 979, TEXT("Котка")},
- {68, 972, TEXT("Коувола")},
- {68, 980, TEXT("Лахти")},
- {68, 973, TEXT("Оулу")},
- {68, 3375, TEXT("Риихимяки")},
- {68, 3159, TEXT("Руовеси")},
- {68, 974, TEXT("Тампере")},
- {68, 975, TEXT("Турку")},
- {68, 976, TEXT("Хельсинки")},
- {68, 977, TEXT("Эспо")},
- {68, 978, TEXT("Ювяскюля")},
- {68, 2502, lpwszOther},
- {37, 996, TEXT("Авиньон")},
- {37, 983, TEXT("Бержерак")},
- {37, 997, TEXT("Блуа")},
- {37, 984, TEXT("Бордо")},
- {37, 998, TEXT("Дижон")},
- {37, 987, TEXT("Канн")},
- {37, 988, TEXT("Кастр")},
- {37, 993, TEXT("Клермон-Ферран")},
- {37, 3037, TEXT("Лилль")},
- {37, 989, TEXT("Лион")},
- {37, 985, TEXT("Марсель")},
- {37, 991, TEXT("Мец")},
- {37, 3161, TEXT("Мобеж")},
- {37, 990, TEXT("Нанси")},
- {37, 994, TEXT("Нант")},
- {37, 995, TEXT("Ницца")},
- {37, 999, TEXT("Орлеан")},
- {37, 981, TEXT("Париж")},
- {37, 3374, TEXT("Перпиньян")},
- {37, 992, TEXT("Руан")},
- {37, 982, TEXT("Страсбург")},
- {37, 986, TEXT("Тулуза")},
- {37, 3314, TEXT("Шамбери")},
- {37, 2501, lpwszOther},
- {69, 1003, TEXT("Дубровник")},
- {69, 1000, TEXT("Загреб")},
- {69, 1001, TEXT("Задар")},
- {69, 1004, TEXT("Риека")},
- {69, 1002, TEXT("Сплит")},
- {69, 2500, lpwszOther},
- {70, 1005, TEXT("Брно")},
- {70, 3291, TEXT("Гавличкув-Брод")},
- {70, 1007, TEXT("Градец-Кралове")},
- {70, 1008, TEXT("Карлови-Вари")},
- {70, 3019, TEXT("Кладрубы")},
- {70, 1010, TEXT("Лоуни")},
- {70, 1009, TEXT("Острава")},
- {70, 1015, TEXT("Пльзень")},
- {70, 3105, TEXT("Правчицка Брана")},
- {70, 1006, TEXT("Прага")},
- {70, 3246, TEXT("Тачов")},
- {70, 1011, TEXT("Тршебич")},
- {70, 1012, TEXT("Усти-над-Лабем")},
- {70, 1014, TEXT("Ческе-Будеевице")},
- {70, 1013, TEXT("Яблонец-над-Нисоу")},
- {70, 2499, lpwszOther},
- {71, 1016, TEXT("Арау")},
- {71, 1019, TEXT("Баден")},
- {71, 1017, TEXT("Базель")},
- {71, 1018, TEXT("Берн")},
- {71, 1020, TEXT("Биль")},
- {71, 1021, TEXT("Винтертур")},
- {71, 1022, TEXT("Давос")},
- {71, 3189, TEXT("Делемонт")},
- {71, 1023, TEXT("Женева")},
- {71, 1024, TEXT("Золотурн")},
- {71, 1025, TEXT("Лозанна")},
- {71, 1026, TEXT("Локарно")},
- {71, 1027, TEXT("Лугано")},
- {71, 1028, TEXT("Люцерн")},
- {71, 1029, TEXT("Монтре")},
- {71, 1030, TEXT("Цюрих")},
- {71, 2498, lpwszOther},
- {72, 2883, TEXT("Арбога")},
- {72, 1031, TEXT("Гетеборг")},
- {72, 1032, TEXT("Кальмар")},
- {72, 1037, TEXT("Лахольм")},
- {72, 1036, TEXT("Лулео")},
- {72, 1042, TEXT("Лунд")},
- {72, 1033, TEXT("Мальме")},
- {72, 1034, TEXT("Стокгольм")},
- {72, 1041, TEXT("Умео")},
- {72, 1039, TEXT("Фалун")},
- {72, 1043, TEXT("Хельсинборг")},
- {72, 1040, TEXT("Хернесанд")},
- {72, 1038, TEXT("Эстерсунд")},
- {72, 2497, lpwszOther},
- {73, 3013, TEXT("Валга")},
- {73, 1044, TEXT("Кейла")},
- {73, 1045, TEXT("Кохтла-Ярве")},
- {73, 1046, TEXT("Маарду")},
- {73, 1047, TEXT("Мыйзакюла")},
- {73, 1048, TEXT("Нарва")},
- {73, 1049, TEXT("Пярну")},
- {73, 1050, TEXT("Раквере")},
- {73, 1051, TEXT("Силламяэ")},
- {73, 1052, TEXT("Таллин")},
- {73, 1053, TEXT("Тарту")},
- {73, 1054, TEXT("Хаапсалу")},
- {0, NULL}
+ {24, 25, TEXT("Москва")},
+ {24, 226, TEXT("Санкт-Петербург")},
+ {24, 233, TEXT("Саха (Якутия)")},
+ {24, 232, TEXT("Приморский край")},
+ {24, 235, TEXT("Хабаровский край")},
+ {24, 227, TEXT("Амурская обл.")},
+ {24, 229, TEXT("Камчатская обл.")},
+ {24, 231, TEXT("Магаданская обл.")},
+ {24, 234, TEXT("Сахалинская обл.")},
+ {24, 228, TEXT("Еврейская АО")},
+ {24, 230, TEXT("Корякский АО")},
+ {24, 236, TEXT("Чукотский АО")},
+ {24, 237, TEXT("Башкортостан")},
+ {24, 240, TEXT("Марий-Эл")},
+ {24, 241, TEXT("Мордовия")},
+ {24, 248, TEXT("Татарстан")},
+ {24, 249, TEXT("Удмуртия")},
+ {24, 251, TEXT("Чувашия")},
+ {24, 238, TEXT("Кировская обл.")},
+ {24, 242, TEXT("Нижегородская обл.")},
+ {24, 243, TEXT("Оренбургская обл.")},
+ {24, 244, TEXT("Пензенская обл.")},
+ {24, 245, TEXT("Пермская обл.")},
+ {24, 246, TEXT("Самарская обл.")},
+ {24, 247, TEXT("Саратовская обл.")},
+ {24, 250, TEXT("Ульяновская обл.")},
+ {24, 239, TEXT("Коми-Пермяцкий АО")},
+ {24, 255, TEXT("Карелия")},
+ {24, 256, TEXT("Коми")},
+ {24, 252, TEXT("Архангельская обл.")},
+ {24, 253, TEXT("Вологодская обл.")},
+ {24, 254, TEXT("Калининградская обл.")},
+ {24, 257, TEXT("Ленинградская обл.")},
+ {24, 258, TEXT("Мурманская обл.")},
+ {24, 260, TEXT("Новгородская обл.")},
+ {24, 261, TEXT("Псковская обл.")},
+ {24, 259, TEXT("Ненецкий АО")},
+ {24, 265, TEXT("Бурятия")},
+ {24, 263, TEXT("Республика Алтай")},
+ {24, 273, TEXT("Тыва")},
+ {24, 275, TEXT("Хакасия")},
+ {24, 264, TEXT("Алтайский край")},
+ {24, 268, TEXT("Красноярский край")},
+ {24, 266, TEXT("Иркутская обл.")},
+ {24, 267, TEXT("Кемеровская обл.")},
+ {24, 269, TEXT("Новосибирская обл.")},
+ {24, 270, TEXT("Омская обл.")},
+ {24, 272, TEXT("Томская обл.")},
+ {24, 276, TEXT("Читинская обл.")},
+ {24, 262, TEXT("Агинский Бурятский АО")},
+ {24, 271, TEXT("Таймырский АО")},
+ {24, 274, TEXT("Усть-Ордынский Бурятский АО")},
+ {24, 277, TEXT("Эвенкийский АО")},
+ {24, 278, TEXT("Курганская обл.")},
+ {24, 279, TEXT("Свердловская обл.")},
+ {24, 280, TEXT("Тюменская обл.")},
+ {24, 282, TEXT("Челябинская обл.")},
+ {24, 281, TEXT("Ханты-Мансийский АО - Югра")},
+ {24, 283, TEXT("Ямало-Ненецкий АО")},
+ {24, 284, TEXT("Белгородская обл.")},
+ {24, 285, TEXT("Брянская обл.")},
+ {24, 286, TEXT("Владимирская обл.")},
+ {24, 287, TEXT("Воронежская обл.")},
+ {24, 288, TEXT("Ивановская обл.")},
+ {24, 289, TEXT("Калужская обл.")},
+ {24, 290, TEXT("Костромская обл.")},
+ {24, 291, TEXT("Курская обл.")},
+ {24, 292, TEXT("Липецкая обл.")},
+ {24, 293, TEXT("Московская обл.")},
+ {24, 294, TEXT("Орловская обл.")},
+ {24, 295, TEXT("Рязанская обл.")},
+ {24, 296, TEXT("Смоленская обл.")},
+ {24, 297, TEXT("Тамбовская обл.")},
+ {24, 298, TEXT("Тверская обл.")},
+ {24, 299, TEXT("Тульская обл.")},
+ {24, 300, TEXT("Ярославская обл.")},
+ {24, 301, TEXT("Адыгея")},
+ {24, 304, TEXT("Дагестан")},
+ {24, 305, TEXT("Ингушетия")},
+ {24, 306, TEXT("Кабардино-Балкария")},
+ {24, 307, TEXT("Калмыкия")},
+ {24, 308, TEXT("Карачаево-Черкессия")},
+ {24, 311, TEXT("Северная Осетия - Алания")},
+ {24, 313, TEXT("Чечня")},
+ {24, 309, TEXT("Краснодарский край")},
+ {24, 312, TEXT("Ставропольский край")},
+ {24, 302, TEXT("Астраханская обл.")},
+ {24, 303, TEXT("Волгоградская обл.")},
+ {24, 310, TEXT("Ростовская обл.")},
+ {81, 1055, TEXT("Баку")},
+ {81, 1058, TEXT("Гянджа")},
+ {81, 1056, TEXT("Нахичевань")},
+ {81, 1057, TEXT("Ханкенди")},
+ {81, 3153, TEXT("Шеки")},
+ {81, 2291, lpwszOther},
+ {82, 2932, TEXT("Абовян")},
+ {82, 1060, TEXT("Аштарак")},
+ {82, 3084, TEXT("Ванадзор")},
+ {82, 3011, TEXT("Гюмри")},
+ {82, 3306, TEXT("Дилижан")},
+ {82, 1059, TEXT("Ереван")},
+ {82, 3145, TEXT("Ханкенди")},
+ {82, 2292, lpwszOther},
+ {97, 1061, TEXT("Кабул")},
+ {97, 2293, lpwszOther},
+ {96, 1062, TEXT("Дакка")},
+ {96, 2294, lpwszOther},
+ {99, 1063, TEXT("Манама")},
+ {99, 2295, lpwszOther},
+ {100, 1064, TEXT("Бандар-Сери-Бегаван")},
+ {100, 2296, lpwszOther},
+ {101, 1065, TEXT("Тхимпху")},
+ {101, 2297, lpwszOther},
+ {102, 1066, TEXT("Ханой")},
+ {102, 2298, lpwszOther},
+ {83, 1067, TEXT("Батуми")},
+ {83, 3158, TEXT("Боржоми")},
+ {83, 1068, TEXT("Поти")},
+ {83, 3129, TEXT("Рустави")},
+ {83, 1069, TEXT("Сухуми")},
+ {83, 1070, TEXT("Тбилиси")},
+ {83, 2299, lpwszOther},
+ {86, 3345, TEXT("Ариэль")},
+ {86, 1071, TEXT("Афула")},
+ {86, 2992, TEXT("Ашдод")},
+ {86, 3175, TEXT("Ашкелон")},
+ {86, 3363, TEXT("Бат-Ям")},
+ {86, 2884, TEXT("Беер-Яков")},
+ {86, 3243, TEXT("Бейт-Шемеш")},
+ {86, 1074, TEXT("Беэр-Шева")},
+ {86, 3348, TEXT("Герцелия")},
+ {86, 3241, TEXT("Димона")},
+ {86, 1075, TEXT("Иерусалим")},
+ {86, 3350, TEXT("Йокнеам-Иллит")},
+ {86, 2982, TEXT("Кармиэль")},
+ {86, 2971, TEXT("Кфар-Саба")},
+ {86, 3136, TEXT("Назарет")},
+ {86, 1080, TEXT("Натания")},
+ {86, 3303, TEXT("Офаким")},
+ {86, 3050, TEXT("Раанана")},
+ {86, 3151, TEXT("Рамат Ган")},
+ {86, 3141, TEXT("Реховот")},
+ {86, 3012, TEXT("Ришон ле Цион")},
+ {86, 1081, TEXT("Тверия")},
+ {86, 1077, TEXT("Тель-Авив")},
+ {86, 1079, TEXT("Хадера")},
+ {86, 1078, TEXT("Хайфа")},
+ {86, 1076, TEXT("Хеврон")},
+ {86, 2929, TEXT("Цфат")},
+ {86, 2928, TEXT("Эйлат")},
+ {86, 2300, lpwszOther},
+ {95, 3315, TEXT("Бангалор")},
+ {95, 1082, TEXT("Дели")},
+ {95, 1083, TEXT("Джайпур")},
+ {95, 3144, TEXT("Калькутта")},
+ {95, 3025, TEXT("Мумбаи")},
+ {95, 3277, TEXT("Панаджи")},
+ {95, 1084, TEXT("Ченнаи")},
+ {95, 2301, lpwszOther},
+ {103, 1085, TEXT("Джакарта")},
+ {103, 2302, lpwszOther},
+ {79, 1086, TEXT("Амман")},
+ {79, 2303, lpwszOther},
+ {85, 1087, TEXT("Багдад")},
+ {85, 2304, lpwszOther},
+ {87, 1088, TEXT("Тегеран")},
+ {87, 2305, lpwszOther},
+ {104, 1089, TEXT("Сана")},
+ {104, 2306, lpwszOther},
+ {84, 1090, TEXT("Актау")},
+ {84, 1091, TEXT("Актюбинск")},
+ {84, 1092, TEXT("Алма-Ата")},
+ {84, 3242, TEXT("Аршалы")},
+ {84, 1093, TEXT("Астана")},
+ {84, 1094, TEXT("Атырау (Гурьев)")},
+ {84, 1095, TEXT("Байконур")},
+ {84, 3245, TEXT("Балхаш")},
+ {84, 3083, TEXT("Жезказган")},
+ {84, 1096, TEXT("Капчагай")},
+ {84, 1097, TEXT("Караганда")},
+ {84, 1098, TEXT("Кокшетау")},
+ {84, 1099, TEXT("Кустанай")},
+ {84, 2868, TEXT("Лисаковск")},
+ {84, 1100, TEXT("Павлодар")},
+ {84, 1101, TEXT("Петропавловск (Сев.-Каз. обл.)")},
+ {84, 1102, TEXT("Рудный")},
+ {84, 1103, TEXT("Семипалатинск")},
+ {84, 1104, TEXT("Степногорск")},
+ {84, 3166, TEXT("Талгар")},
+ {84, 1105, TEXT("Талды-Курган")},
+ {84, 2927, TEXT("Тараз")},
+ {84, 1106, TEXT("Темиртау")},
+ {84, 1107, TEXT("Уральск")},
+ {84, 1108, TEXT("Усть-Каменогорск")},
+ {84, 1109, TEXT("Чимкент")},
+ {84, 1110, TEXT("Экибастуз")},
+ {84, 2307, lpwszOther},
+ {105, 1111, TEXT("Пномпень")},
+ {105, 2308, lpwszOther},
+ {106, 1112, TEXT("Доха")},
+ {106, 2309, lpwszOther},
+ {107, 1113, TEXT("Ларнака")},
+ {107, 1114, TEXT("Лимассол")},
+ {107, 1115, TEXT("Никосия")},
+ {107, 2954, TEXT("Пафос")},
+ {107, 2310, lpwszOther},
+ {92, 1116, TEXT("Бишкек")},
+ {92, 1117, TEXT("Джалал-Абад")},
+ {92, 3027, TEXT("Кара-Балта")},
+ {92, 1118, TEXT("Каракол")},
+ {92, 1119, TEXT("Ош")},
+ {92, 1120, TEXT("Талас")},
+ {92, 2933, TEXT("Хайдаркен")},
+ {92, 2311, lpwszOther},
+ {76, 3214, TEXT("Аомынь (Макао)")},
+ {76, 1121, TEXT("Гонконг")},
+ {76, 2869, TEXT("Гуанчжоу")},
+ {76, 3262, TEXT("Далянь")},
+ {76, 1122, TEXT("Пекин")},
+ {76, 1123, TEXT("Харбин")},
+ {76, 1124, TEXT("Шанхай")},
+ {76, 3043, TEXT("Шеньян")},
+ {76, 2312, lpwszOther},
+ {29, 1125, TEXT("Пхеньян")},
+ {29, 2313, lpwszOther},
+ {108, 1126, TEXT("Сеул")},
+ {108, 3240, TEXT("Тейджон")},
+ {108, 2314, lpwszOther},
+ {88, 1127, TEXT("Эль-Кувейт")},
+ {88, 2315, lpwszOther},
+ {109, 1128, TEXT("Вьентьян")},
+ {109, 2316, lpwszOther},
+ {110, 1129, TEXT("Бейрут")},
+ {110, 2317, lpwszOther},
+ {111, 1130, TEXT("Джохор-Бару")},
+ {111, 1131, TEXT("Куала-Лумпур")},
+ {111, 2318, lpwszOther},
+ {112, 1132, TEXT("Мале")},
+ {112, 2319, lpwszOther},
+ {113, 1133, TEXT("Улан-Батор")},
+ {113, 1134, TEXT("Эрдэнэт")},
+ {113, 2320, lpwszOther},
+ {114, 1135, TEXT("Янгон")},
+ {114, 2321, lpwszOther},
+ {115, 1136, TEXT("Катманду")},
+ {115, 2322, lpwszOther},
+ {116, 1137, TEXT("Абу-Даби")},
+ {116, 1138, TEXT("Дубай")},
+ {116, 1139, TEXT("Шарджа")},
+ {116, 2323, lpwszOther},
+ {117, 1140, TEXT("Маскат")},
+ {117, 2324, lpwszOther},
+ {122, 1141, TEXT("Исламабад")},
+ {122, 2325, lpwszOther},
+ {89, 1072, TEXT("Ашдод")},
+ {89, 1073, TEXT("Ашкелон")},
+ {89, 1142, TEXT("Газа")},
+ {89, 2326, lpwszOther},
+ {94, 3250, TEXT("Медина")},
+ {94, 1143, TEXT("Эр-Рияд")},
+ {94, 2327, lpwszOther},
+ {78, 1144, TEXT("Дамаск")},
+ {78, 2328, lpwszOther},
+ {91, 1145, TEXT("Душанбе")},
+ {91, 3307, TEXT("Кайраккум")},
+ {91, 3308, TEXT("Худжанд")},
+ {91, 2329, lpwszOther},
+ {119, 1146, TEXT("Бангкок")},
+ {119, 1147, TEXT("Пхукет")},
+ {119, 2330, lpwszOther},
+ {120, 1148, TEXT("Тайбэй")},
+ {120, 2331, lpwszOther},
+ {132, 1149, TEXT("Дили")},
+ {132, 2332, lpwszOther},
+ {90, 1150, TEXT("Ашхабад")},
+ {90, 3079, TEXT("Безмеин")},
+ {90, 2333, lpwszOther},
+ {77, 1152, TEXT("Анкара")},
+ {77, 1153, TEXT("Анталия")},
+ {77, 3080, TEXT("Бурса")},
+ {77, 1151, TEXT("Мармарис")},
+ {77, 1154, TEXT("Стамбул")},
+ {77, 1155, TEXT("Трабзон")},
+ {77, 2334, lpwszOther},
+ {93, 3362, TEXT("Алмалык")},
+ {93, 3137, TEXT("Андижан")},
+ {93, 3273, TEXT("Асака")},
+ {93, 1156, TEXT("Ахангаран")},
+ {93, 1157, TEXT("Бухара")},
+ {93, 3167, TEXT("Джизак")},
+ {93, 3347, TEXT("Кунград")},
+ {93, 1158, TEXT("Навои")},
+ {93, 1159, TEXT("Наманган")},
+ {93, 1160, TEXT("Самарканд")},
+ {93, 1161, TEXT("Ташкент")},
+ {93, 1162, TEXT("Ургенч")},
+ {93, 1163, TEXT("Фергана")},
+ {93, 1164, TEXT("Чирчик")},
+ {93, 2335, lpwszOther},
+ {121, 1165, TEXT("Манила")},
+ {121, 3319, TEXT("Себу")},
+ {121, 2336, lpwszOther},
+ {98, 1166, TEXT("Коломбо")},
+ {98, 2337, lpwszOther},
+ {75, 3176, TEXT("Исесаки")},
+ {75, 3339, TEXT("Корияма")},
+ {75, 1167, TEXT("Саппоро")},
+ {75, 1168, TEXT("Токио")},
+ {75, 2338, lpwszOther},
+ {123, 1914, TEXT("Аделаида")},
+ {123, 2957, TEXT("Блэк Рок")},
+ {123, 1915, TEXT("Брисбен")},
+ {123, 3331, TEXT("Горокан")},
+ {123, 1916, TEXT("Канберра")},
+ {123, 3001, TEXT("Лидкомб")},
+ {123, 1917, TEXT("Мельбурн")},
+ {123, 3217, TEXT("Норфолк")},
+ {123, 3064, TEXT("Перт")},
+ {123, 3020, TEXT("Санта Люсиа")},
+ {123, 1918, TEXT("Сидней")},
+ {123, 3238, TEXT("Энеабба")},
+ {123, 2339, lpwszOther},
+ {454, 1192, TEXT("Паго-Паго")},
+ {454, 2366, lpwszOther},
+ {124, 1919, TEXT("Порт-Вила")},
+ {124, 2340, lpwszOther},
+ {453, 1193, TEXT("Аганья")},
+ {453, 2368, lpwszOther},
+ {126, 1921, TEXT("Баирики")},
+ {126, 2342, lpwszOther},
+ {127, 1922, TEXT("Маджуро")},
+ {127, 2343, lpwszOther},
+ {128, 1923, TEXT("Паликир")},
+ {128, 2344, lpwszOther},
+ {129, 1924, TEXT("Ярен")},
+ {129, 2345, lpwszOther},
+ {130, 1925, TEXT("Веллингтон")},
+ {130, 1926, TEXT("Гамильтон")},
+ {130, 1928, TEXT("Данидин")},
+ {130, 1929, TEXT("Крайстчерч")},
+ {130, 3235, TEXT("Кромвель")},
+ {130, 1927, TEXT("Окленд")},
+ {130, 3323, TEXT("Тауранга")},
+ {130, 2346, lpwszOther},
+ {131, 1930, TEXT("Корор")},
+ {131, 2347, lpwszOther},
+ {133, 1931, TEXT("Порт-Морсби")},
+ {133, 2348, lpwszOther},
+ {125, 1920, TEXT("Апиа")},
+ {125, 2341, lpwszOther},
+ {134, 1932, TEXT("Хониара")},
+ {134, 2349, lpwszOther},
+ {135, 1933, TEXT("Нукуалофа")},
+ {135, 2350, lpwszOther},
+ {136, 1934, TEXT("Фунафути")},
+ {136, 2351, lpwszOther},
+ {137, 1935, TEXT("Сува")},
+ {137, 2352, lpwszOther},
+ {138, 3055, TEXT("Барлингтон")},
+ {138, 3049, TEXT("Броссард")},
+ {138, 3330, TEXT("Бурнаби")},
+ {138, 1169, TEXT("Ванкувер")},
+ {138, 3106, TEXT("Ватерлоо")},
+ {138, 1170, TEXT("Виннипег")},
+ {138, 1171, TEXT("Галифакс")},
+ {138, 1172, TEXT("Гамильтон")},
+ {138, 3365, TEXT("Денвер")},
+ {138, 1173, TEXT("Калгари")},
+ {138, 3104, TEXT("Камлупс")},
+ {138, 3366, TEXT("Каннингтон")},
+ {138, 1174, TEXT("Квебек")},
+ {138, 2964, TEXT("Кингстон")},
+ {138, 3113, TEXT("Коквитлам")},
+ {138, 1175, TEXT("Монреаль")},
+ {138, 2920, TEXT("Ниагара-Фолс")},
+ {138, 2889, TEXT("Норд-Йорк")},
+ {138, 1176, TEXT("Оттава")},
+ {138, 2903, TEXT("Порт Алберни")},
+ {138, 1177, TEXT("Ричмонд")},
+ {138, 1178, TEXT("Тимминс")},
+ {138, 2946, TEXT("Торнхилл")},
+ {138, 1179, TEXT("Торонто")},
+ {138, 1180, TEXT("Эдмонтон")},
+ {138, 2353, lpwszOther},
+ {139, 407, TEXT("Вашингтон")},
+ {139, 426, TEXT("Айдахо")},
+ {139, 378, TEXT("Айова")},
+ {139, 412, TEXT("Алабама")},
+ {139, 446, TEXT("Аляска")},
+ {139, 434, TEXT("Аризона")},
+ {139, 416, TEXT("Арканзас")},
+ {139, 428, TEXT("Вайоминг")},
+ {139, 440, TEXT("Вашингтон")},
+ {139, 352, TEXT("Вермонт")},
+ {139, 394, TEXT("Виргиния")},
+ {139, 374, TEXT("Висконсин")},
+ {139, 448, TEXT("Гавайи")},
+ {139, 390, TEXT("Делавер")},
+ {139, 402, TEXT("Джорджия")},
+ {139, 396, TEXT("Западная Виргиния")},
+ {139, 370, TEXT("Иллинойс")},
+ {139, 368, TEXT("Индиана")},
+ {139, 444, TEXT("Калифорния")},
+ {139, 388, TEXT("Канзас")},
+ {139, 408, TEXT("Кентукки")},
+ {139, 430, TEXT("Колорадо")},
+ {139, 358, TEXT("Коннектикут")},
+ {139, 418, TEXT("Луизиана")},
+ {139, 354, TEXT("Массачусетс")},
+ {139, 376, TEXT("Миннесота")},
+ {139, 414, TEXT("Миссисипи")},
+ {139, 380, TEXT("Миссури")},
+ {139, 372, TEXT("Мичиган")},
+ {139, 424, TEXT("Монтана")},
+ {139, 348, TEXT("Мэн")},
+ {139, 392, TEXT("Мэриленд")},
+ {139, 386, TEXT("Небраска")},
+ {139, 438, TEXT("Невада")},
+ {139, 362, TEXT("Нью-Джерси")},
+ {139, 360, TEXT("Нью-Йорк")},
+ {139, 432, TEXT("Нью-Мексико")},
+ {139, 350, TEXT("Нью-Хэмпшир")},
+ {139, 366, TEXT("Огайо")},
+ {139, 420, TEXT("Оклахома")},
+ {139, 442, TEXT("Орегон")},
+ {139, 364, TEXT("Пенсильвания")},
+ {139, 450, TEXT("Пуэрто-Рико")},
+ {139, 356, TEXT("Род-Айленд")},
+ {139, 382, TEXT("Северная Дакота")},
+ {139, 398, TEXT("Северная Каролина")},
+ {139, 410, TEXT("Теннесси")},
+ {139, 422, TEXT("Техас")},
+ {139, 406, TEXT("Федеральный округ Колумбия")},
+ {139, 404, TEXT("Флорида")},
+ {139, 384, TEXT("Южная Дакота")},
+ {139, 400, TEXT("Южная Каролина")},
+ {139, 436, TEXT("Юта")},
+ {140, 1238, TEXT("Сент-Джонс")},
+ {140, 2442, lpwszOther},
+ {141, 1239, TEXT("Буэнос-Айрес")},
+ {141, 2441, lpwszOther},
+ {142, 1240, TEXT("Нассау")},
+ {142, 2440, lpwszOther},
+ {143, 1241, TEXT("Бриджтаун")},
+ {143, 2439, lpwszOther},
+ {146, 1242, TEXT("Бельмопан")},
+ {146, 2438, lpwszOther},
+ {144, 1243, TEXT("Ла-Пас")},
+ {144, 2437, lpwszOther},
+ {145, 1244, TEXT("Бразилиа")},
+ {145, 3094, TEXT("Пассо Фундо")},
+ {145, 1245, TEXT("Рио-де-Жанейро")},
+ {145, 1246, TEXT("Сан-Паулу")},
+ {145, 2436, lpwszOther},
+ {147, 1247, TEXT("Каракас")},
+ {147, 2435, lpwszOther},
+ {452, 1190, TEXT("Шарлотта-Амалия")},
+ {452, 2364, lpwszOther},
+ {149, 1248, TEXT("Порт-о-Пренс")},
+ {149, 2434, lpwszOther},
+ {148, 1249, TEXT("Джоржтаун")},
+ {148, 2433, lpwszOther},
+ {173, 1250, TEXT("Гватемала")},
+ {173, 2432, lpwszOther},
+ {150, 1251, TEXT("Тегусигальпа")},
+ {150, 2431, lpwszOther},
+ {151, 1252, TEXT("Сент-Джорджес")},
+ {151, 2430, lpwszOther},
+ {152, 1253, TEXT("Уманак")},
+ {152, 2429, lpwszOther},
+ {153, 1254, TEXT("Розо")},
+ {153, 2428, lpwszOther},
+ {154, 1255, TEXT("Санто-Доминго")},
+ {154, 2427, lpwszOther},
+ {155, 1256, TEXT("Богота")},
+ {155, 2426, lpwszOther},
+ {156, 1257, TEXT("Сан-Хосе")},
+ {156, 2425, lpwszOther},
+ {157, 1258, TEXT("Гавана")},
+ {157, 2424, lpwszOther},
+ {158, 1259, TEXT("Акапулько")},
+ {158, 1260, TEXT("Мехико")},
+ {158, 2423, lpwszOther},
+ {159, 1261, TEXT("Манагуа")},
+ {159, 2422, lpwszOther},
+ {160, 1262, TEXT("Панама")},
+ {160, 2421, lpwszOther},
+ {161, 1263, TEXT("Асунсьон")},
+ {161, 2420, lpwszOther},
+ {162, 1264, TEXT("Лима")},
+ {162, 2419, lpwszOther},
+ {163, 1265, TEXT("Сан-Сальвадор")},
+ {163, 2418, lpwszOther},
+ {164, 1266, TEXT("Кингстаун")},
+ {164, 2417, lpwszOther},
+ {165, 1267, TEXT("Бастер")},
+ {165, 2416, lpwszOther},
+ {166, 1268, TEXT("Кастри")},
+ {166, 2415, lpwszOther},
+ {167, 1269, TEXT("Парамарибо")},
+ {167, 2414, lpwszOther},
+ {168, 1270, TEXT("Порт-оф-Спейн")},
+ {168, 2413, lpwszOther},
+ {169, 1271, TEXT("Монтевидео")},
+ {169, 2412, lpwszOther},
+ {170, 1272, TEXT("Сантьяго")},
+ {170, 2411, lpwszOther},
+ {171, 1273, TEXT("Гуаякиль")},
+ {171, 1274, TEXT("Кито")},
+ {171, 2410, lpwszOther},
+ {172, 1275, TEXT("Кингстон")},
+ {172, 2409, lpwszOther},
+ {174, 1854, TEXT("Алжир")},
+ {174, 2495, lpwszOther},
+ {175, 1855, TEXT("Луанда")},
+ {175, 2494, lpwszOther},
+ {176, 1856, TEXT("Котону")},
+ {176, 1857, TEXT("Порто-Ново")},
+ {176, 2493, lpwszOther},
+ {177, 1858, TEXT("Габороне")},
+ {177, 2492, lpwszOther},
+ {178, 1859, TEXT("Уагадугу")},
+ {178, 2491, lpwszOther},
+ {179, 1860, TEXT("Бужумбуру")},
+ {179, 2490, lpwszOther},
+ {180, 1861, TEXT("Либревиль")},
+ {180, 2489, lpwszOther},
+ {181, 1862, TEXT("Банжул")},
+ {181, 2488, lpwszOther},
+ {182, 1863, TEXT("Аккра")},
+ {182, 2487, lpwszOther},
+ {183, 1864, TEXT("Конакри")},
+ {183, 2486, lpwszOther},
+ {184, 1865, TEXT("Бисау")},
+ {184, 2485, lpwszOther},
+ {185, 1866, TEXT("Джибути")},
+ {185, 2484, lpwszOther},
+ {186, 3312, TEXT("Дахаб")},
+ {186, 1867, TEXT("Каир")},
+ {186, 1868, TEXT("Хургада")},
+ {186, 2483, lpwszOther},
+ {187, 1869, TEXT("Лусака")},
+ {187, 2482, lpwszOther},
+ {23, 1870, TEXT("Хараре")},
+ {23, 2481, lpwszOther},
+ {188, 1871, TEXT("Прая")},
+ {188, 2480, lpwszOther},
+ {189, 1872, TEXT("Яунде")},
+ {189, 2479, lpwszOther},
+ {190, 1873, TEXT("Найроби")},
+ {190, 2478, lpwszOther},
+ {191, 1874, TEXT("Морони")},
+ {191, 2477, lpwszOther},
+ {193, 1875, TEXT("Киншаса")},
+ {193, 2476, lpwszOther},
+ {192, 1876, TEXT("Браззавиль")},
+ {192, 2475, lpwszOther},
+ {194, 1877, TEXT("Ямусукро")},
+ {194, 2474, lpwszOther},
+ {195, 1878, TEXT("Масеру")},
+ {195, 2473, lpwszOther},
+ {196, 1879, TEXT("Монровия")},
+ {196, 2472, lpwszOther},
+ {197, 1880, TEXT("Триполи")},
+ {197, 2471, lpwszOther},
+ {198, 1881, TEXT("Порт-Луи")},
+ {198, 2470, lpwszOther},
+ {199, 1882, TEXT("Нуакшот")},
+ {199, 2469, lpwszOther},
+ {200, 1883, TEXT("Антананариву")},
+ {200, 2468, lpwszOther},
+ {201, 1884, TEXT("Лилонгве")},
+ {201, 2467, lpwszOther},
+ {202, 1885, TEXT("Бамако")},
+ {202, 2466, lpwszOther},
+ {203, 1886, TEXT("Агадир")},
+ {203, 1887, TEXT("Рабат")},
+ {203, 2465, lpwszOther},
+ {204, 1888, TEXT("Мапуту")},
+ {204, 2464, lpwszOther},
+ {205, 1889, TEXT("Виндхук")},
+ {205, 2463, lpwszOther},
+ {206, 1890, TEXT("Ниамей")},
+ {206, 2462, lpwszOther},
+ {207, 1891, TEXT("Абуджа")},
+ {207, 2461, lpwszOther},
+ {208, 1892, TEXT("Кигали")},
+ {208, 2460, lpwszOther},
+ {209, 1893, TEXT("Сан-Томе")},
+ {209, 2459, lpwszOther},
+ {210, 1894, TEXT("Мбабане")},
+ {210, 2458, lpwszOther},
+ {211, 1895, TEXT("Виктория")},
+ {211, 2457, lpwszOther},
+ {212, 1896, TEXT("Дакар")},
+ {212, 2456, lpwszOther},
+ {213, 1897, TEXT("Могадишо")},
+ {213, 2455, lpwszOther},
+ {214, 1898, TEXT("Хартум")},
+ {214, 2454, lpwszOther},
+ {215, 1899, TEXT("Фритаун")},
+ {215, 2453, lpwszOther},
+ {216, 1900, TEXT("Дар-эс-Салам")},
+ {216, 1901, TEXT("Додома")},
+ {216, 2452, lpwszOther},
+ {217, 1902, TEXT("Ломе")},
+ {217, 2451, lpwszOther},
+ {218, 1903, TEXT("Тунис")},
+ {218, 2450, lpwszOther},
+ {219, 1904, TEXT("Кампала")},
+ {219, 2449, lpwszOther},
+ {220, 1905, TEXT("Банги")},
+ {220, 2448, lpwszOther},
+ {222, 1906, TEXT("Нджамена")},
+ {222, 2447, lpwszOther},
+ {223, 1907, TEXT("Малабо")},
+ {223, 2446, lpwszOther},
+ {221, 1908, TEXT("Асмэра")},
+ {221, 2445, lpwszOther},
+ {224, 1909, TEXT("Аддис-Абеба")},
+ {224, 2444, lpwszOther},
+ {225, 1910, TEXT("Дурбан")},
+ {225, 1913, TEXT("Йоханнесбург")},
+ {225, 1912, TEXT("Кейптаун")},
+ {225, 3033, TEXT("Пайнтаун")},
+ {225, 1911, TEXT("Претория")},
+ {225, 2443, lpwszOther},
+ {39, 314, TEXT("Киев")},
+ {39, 315, TEXT("Винницкая обл.")},
+ {39, 316, TEXT("Волынская обл.")},
+ {39, 317, TEXT("Днепропетровская обл.")},
+ {39, 318, TEXT("Донецкая обл.")},
+ {39, 319, TEXT("Житомирская обл.")},
+ {39, 320, TEXT("Закарпатская обл.")},
+ {39, 321, TEXT("Запорожская обл.")},
+ {39, 322, TEXT("Ивано-Франковская обл.")},
+ {39, 323, TEXT("Киевская обл.")},
+ {39, 324, TEXT("Кировоградская обл.")},
+ {39, 325, TEXT("Крым")},
+ {39, 326, TEXT("Луганская обл.")},
+ {39, 327, TEXT("Львовская обл.")},
+ {39, 328, TEXT("Николаевская обл.")},
+ {39, 329, TEXT("Одесская обл.")},
+ {39, 330, TEXT("Полтавская обл.")},
+ {39, 331, TEXT("Ровенская обл.")},
+ {39, 332, TEXT("Сумская обл.")},
+ {39, 333, TEXT("Тернопольская обл.")},
+ {39, 334, TEXT("Харьковская обл.")},
+ {39, 335, TEXT("Херсонская обл.")},
+ {39, 336, TEXT("Хмельницкая обл.")},
+ {39, 337, TEXT("Черкасская обл.")},
+ {39, 338, TEXT("Черниговская обл.")},
+ {39, 339, TEXT("Черновицкая обл.")},
+ {40, 602, TEXT("Бад Халл")},
+ {40, 604, TEXT("Брегенц")},
+ {40, 603, TEXT("Вена")},
+ {40, 608, TEXT("Грац")},
+ {40, 606, TEXT("Зальцбург")},
+ {40, 3099, TEXT("Зель-ам-Зее")},
+ {40, 605, TEXT("Инсбрук")},
+ {40, 3174, TEXT("Кирхберг")},
+ {40, 609, TEXT("Клагенфурт")},
+ {40, 607, TEXT("Линц")},
+ {40, 610, TEXT("Обдах")},
+ {40, 611, TEXT("Щтубайтал")},
+ {40, 2541, lpwszOther},
+ {32, 612, TEXT("Тирана")},
+ {32, 2540, lpwszOther},
+ {33, 613, TEXT("Андорра-ла-Велья")},
+ {33, 2539, lpwszOther},
+ {340, 341, TEXT("Минск")},
+ {340, 342, TEXT("Брестская обл.")},
+ {340, 343, TEXT("Витебская обл.")},
+ {340, 344, TEXT("Гомельская обл.")},
+ {340, 345, TEXT("Гродненская обл.")},
+ {340, 346, TEXT("Минская обл.")},
+ {340, 347, TEXT("Могилевская обл.")},
+ {38, 760, TEXT("Антверпен")},
+ {38, 767, TEXT("Арлон")},
+ {38, 762, TEXT("Брюгге")},
+ {38, 761, TEXT("Брюссель")},
+ {38, 763, TEXT("Гент")},
+ {38, 769, TEXT("Лувен")},
+ {38, 765, TEXT("Льеж")},
+ {38, 764, TEXT("Монс")},
+ {38, 3117, TEXT("Мортсель")},
+ {38, 766, TEXT("Намюр")},
+ {38, 768, TEXT("Хасселт")},
+ {38, 2532, lpwszOther},
+ {41, 3098, TEXT("Банско")},
+ {41, 792, TEXT("Благоевград")},
+ {41, 770, TEXT("Бургас")},
+ {41, 771, TEXT("Бяла")},
+ {41, 773, TEXT("Варна")},
+ {41, 776, TEXT("Велико-Тырново")},
+ {41, 788, TEXT("Видин")},
+ {41, 789, TEXT("Враца")},
+ {41, 796, TEXT("Габрово")},
+ {41, 777, TEXT("Димитровград")},
+ {41, 781, TEXT("Каварна")},
+ {41, 786, TEXT("Кырджали")},
+ {41, 791, TEXT("Кюстендил")},
+ {41, 793, TEXT("Лазарджик")},
+ {41, 795, TEXT("Ловеч")},
+ {41, 787, TEXT("Михайловград")},
+ {41, 790, TEXT("Перник")},
+ {41, 3133, TEXT("Пирдоп")},
+ {41, 794, TEXT("Плевен")},
+ {41, 782, TEXT("Пловдив")},
+ {41, 780, TEXT("Разград")},
+ {41, 779, TEXT("Русе")},
+ {41, 774, TEXT("Силистра")},
+ {41, 784, TEXT("Сливен")},
+ {41, 772, TEXT("София")},
+ {41, 775, TEXT("Толбухин")},
+ {41, 3116, TEXT("Тырново")},
+ {41, 785, TEXT("Хасково")},
+ {41, 778, TEXT("Шумен")},
+ {41, 783, TEXT("Ямбол")},
+ {41, 2531, lpwszOther},
+ {42, 797, TEXT("Баня-Лука")},
+ {42, 799, TEXT("Зеница")},
+ {42, 798, TEXT("Сараево")},
+ {42, 800, TEXT("Тузла")},
+ {42, 2530, lpwszOther},
+ {45, 802, TEXT("Абердин")},
+ {45, 3075, TEXT("Айслворт")},
+ {45, 801, TEXT("Алнвик")},
+ {45, 804, TEXT("Бидефорд")},
+ {45, 803, TEXT("Бирмингем")},
+ {45, 805, TEXT("Блоксвич")},
+ {45, 3168, TEXT("Бостон")},
+ {45, 806, TEXT("Брайтон")},
+ {45, 807, TEXT("Бредфорд")},
+ {45, 808, TEXT("Бристоль")},
+ {45, 809, TEXT("Вилленхолл")},
+ {45, 3131, TEXT("Воррингтон")},
+ {45, 810, TEXT("Вудбридж")},
+ {45, 3342, TEXT("Гилфорд")},
+ {45, 811, TEXT("Глазго")},
+ {45, 812, TEXT("Дадли")},
+ {45, 813, TEXT("Дарем")},
+ {45, 814, TEXT("Дуглас")},
+ {45, 3089, TEXT("Кардиф")},
+ {45, 815, TEXT("Кембридж")},
+ {45, 816, TEXT("Кентербери")},
+ {45, 817, TEXT("Ливерпуль")},
+ {45, 818, TEXT("Лидс")},
+ {45, 819, TEXT("Лондон")},
+ {45, 820, TEXT("Манчестер")},
+ {45, 2976, TEXT("Митчем")},
+ {45, 2988, TEXT("Мэйденхед")},
+ {45, 821, TEXT("Ноттингем")},
+ {45, 3088, TEXT("Ньюпорт")},
+ {45, 822, TEXT("Оксфорд")},
+ {45, 823, TEXT("Плимут")},
+ {45, 824, TEXT("Портсмут")},
+ {45, 825, TEXT("Престон")},
+ {45, 3343, TEXT("Райд")},
+ {45, 2867, TEXT("Ридинг")},
+ {45, 2986, TEXT("Сент-Албанс")},
+ {45, 826, TEXT("Стаффорд")},
+ {45, 3063, TEXT("Стокпорт")},
+ {45, 827, TEXT("Уэймут")},
+ {45, 3140, TEXT("Челтенхэм")},
+ {45, 828, TEXT("Честер")},
+ {45, 829, TEXT("Шеффилд")},
+ {45, 830, TEXT("Эдинбург")},
+ {45, 2529, lpwszOther},
+ {44, 831, TEXT("Будапешт")},
+ {44, 832, TEXT("Геделле")},
+ {44, 836, TEXT("Дебрецен")},
+ {44, 835, TEXT("Мишкольц")},
+ {44, 834, TEXT("Сегед")},
+ {44, 833, TEXT("Шиофок")},
+ {44, 2528, lpwszOther},
+ {46, 3007, TEXT("Аахен")},
+ {46, 837, TEXT("Аугсбург")},
+ {46, 838, TEXT("Баден-Баден")},
+ {46, 3371, TEXT("Бамберг")},
+ {46, 839, TEXT("Бергиш-Гладбах")},
+ {46, 840, TEXT("Берлин")},
+ {46, 841, TEXT("Билефельд")},
+ {46, 3163, TEXT("Бовенден")},
+ {46, 842, TEXT("Бонн")},
+ {46, 843, TEXT("Браденбург")},
+ {46, 3015, TEXT("Брауншвейг")},
+ {46, 844, TEXT("Бремен")},
+ {46, 2921, TEXT("Варштайн")},
+ {46, 845, TEXT("Веймар")},
+ {46, 846, TEXT("Вупперталь")},
+ {46, 847, TEXT("Гамбург")},
+ {46, 848, TEXT("Ганновер")},
+ {46, 849, TEXT("Гарделеген")},
+ {46, 3010, TEXT("Гейдельберг")},
+ {46, 850, TEXT("Гота")},
+ {46, 851, TEXT("Дармштадт")},
+ {46, 3072, TEXT("Дессау")},
+ {46, 852, TEXT("Детмольд")},
+ {46, 853, TEXT("Дортмунд")},
+ {46, 854, TEXT("Дрезден")},
+ {46, 855, TEXT("Дюссельдорф")},
+ {46, 3082, TEXT("Иффецхайм")},
+ {46, 3309, TEXT("Кассел")},
+ {46, 856, TEXT("Кельн")},
+ {46, 857, TEXT("Киль")},
+ {46, 3138, TEXT("Кобленц")},
+ {46, 858, TEXT("Крефельд")},
+ {46, 859, TEXT("Лейпциг")},
+ {46, 2872, TEXT("Лимбург")},
+ {46, 2965, TEXT("Линген")},
+ {46, 3135, TEXT("Любек")},
+ {46, 3156, TEXT("Мангейм")},
+ {46, 3192, TEXT("Меерсбург")},
+ {46, 860, TEXT("Мюнстер")},
+ {46, 861, TEXT("Мюнхен")},
+ {46, 2864, TEXT("Нойштадт")},
+ {46, 862, TEXT("Нюрнберг")},
+ {46, 3009, TEXT("Оффенбург")},
+ {46, 2993, TEXT("Падерборн")},
+ {46, 863, TEXT("Равенсбург")},
+ {46, 864, TEXT("Регенсбург")},
+ {46, 865, TEXT("Рейнен")},
+ {46, 866, TEXT("Росток")},
+ {46, 3191, TEXT("Саарбрюкен")},
+ {46, 2974, TEXT("Санкт-Августин")},
+ {46, 3127, TEXT("Тюринген")},
+ {46, 867, TEXT("Фрайберг")},
+ {46, 868, TEXT("Фрайбург")},
+ {46, 869, TEXT("Франкфурт-на-Майне")},
+ {46, 3373, TEXT("Хемнитц")},
+ {46, 3313, TEXT("Хильден")},
+ {46, 870, TEXT("Штутгарт")},
+ {46, 3045, TEXT("Эрланген")},
+ {46, 2906, TEXT("Эшборн")},
+ {46, 2527, lpwszOther},
+ {48, 871, TEXT("Афины")},
+ {48, 873, TEXT("Ираклион")},
+ {48, 3147, TEXT("Корфу")},
+ {48, 872, TEXT("Салоники")},
+ {48, 3178, TEXT("Халкидики")},
+ {48, 2526, lpwszOther},
+ {49, 3006, TEXT("Архус")},
+ {49, 874, TEXT("Копенгаген")},
+ {49, 875, TEXT("Оденсе")},
+ {49, 3285, TEXT("Ольборг")},
+ {49, 876, TEXT("Сванеке")},
+ {49, 3126, TEXT("Скиве")},
+ {49, 2525, lpwszOther},
+ {50, 3377, TEXT("Виклоу")},
+ {50, 3067, TEXT("Голвей")},
+ {50, 877, TEXT("Дублин")},
+ {50, 3065, TEXT("Килларней")},
+ {50, 3066, TEXT("Корк")},
+ {50, 878, TEXT("Лимерик")},
+ {50, 3069, TEXT("Нейс")},
+ {50, 3068, TEXT("Типперэри")},
+ {50, 2524, lpwszOther},
+ {51, 879, TEXT("Рейкьявик")},
+ {51, 2523, lpwszOther},
+ {34, 880, TEXT("Аликанте")},
+ {34, 3125, TEXT("Альмерия")},
+ {34, 881, TEXT("Барселона")},
+ {34, 890, TEXT("Бильбао")},
+ {34, 3076, TEXT("Бланес")},
+ {34, 882, TEXT("Валенсия")},
+ {34, 3070, TEXT("Ибица")},
+ {34, 888, TEXT("Кадис")},
+ {34, 886, TEXT("Картахена")},
+ {34, 891, TEXT("Ла-Корунья")},
+ {34, 3310, TEXT("Лорет де Мар")},
+ {34, 883, TEXT("Мадрид")},
+ {34, 884, TEXT("Малага")},
+ {34, 885, TEXT("Марбелья")},
+ {34, 892, TEXT("Овьедо")},
+ {34, 3179, TEXT("Пальма де Майорка")},
+ {34, 3177, TEXT("Сан-Агустин")},
+ {34, 3289, TEXT("Санта-Крус-де-Тенерифе")},
+ {34, 889, TEXT("Сарагоса")},
+ {34, 887, TEXT("Севилья")},
+ {34, 893, TEXT("Хихон")},
+ {34, 2522, lpwszOther},
+ {52, 3318, TEXT("Аоста")},
+ {52, 3278, TEXT("Беллариа")},
+ {52, 906, TEXT("Болонья")},
+ {52, 894, TEXT("Брешиа")},
+ {52, 895, TEXT("Венеция")},
+ {52, 905, TEXT("Верона")},
+ {52, 896, TEXT("Генуя")},
+ {52, 897, TEXT("Лекко")},
+ {52, 3369, TEXT("Ливорно")},
+ {52, 3327, TEXT("Марсала")},
+ {52, 898, TEXT("Милан")},
+ {52, 899, TEXT("Модена")},
+ {52, 907, TEXT("Неаполь")},
+ {52, 908, TEXT("Перуджа")},
+ {52, 900, TEXT("Пиза")},
+ {52, 901, TEXT("Рим")},
+ {52, 3368, TEXT("Сан-Ремо")},
+ {52, 3384, TEXT("Сиракуза")},
+ {52, 3252, TEXT("Терамо")},
+ {52, 902, TEXT("Триест")},
+ {52, 903, TEXT("Турин")},
+ {52, 3130, TEXT("Фано")},
+ {52, 904, TEXT("Флоренция")},
+ {52, 2521, lpwszOther},
+ {53, 2939, TEXT("Айзкраукле")},
+ {53, 3054, TEXT("Валка")},
+ {53, 909, TEXT("Даугавпилс")},
+ {53, 2934, TEXT("Екабпилс")},
+ {53, 913, TEXT("Елгава")},
+ {53, 2935, TEXT("Кокнесе")},
+ {53, 912, TEXT("Лиепая")},
+ {53, 2905, TEXT("Резекне")},
+ {53, 911, TEXT("Рига")},
+ {53, 2936, TEXT("Саласпилс")},
+ {53, 2937, TEXT("Смилтене")},
+ {53, 910, TEXT("Юрмала")},
+ {53, 2520, lpwszOther},
+ {54, 914, TEXT("Вильнюс")},
+ {54, 915, TEXT("Висагинас")},
+ {54, 916, TEXT("Каунас")},
+ {54, 918, TEXT("Клайпеда")},
+ {54, 919, TEXT("Паланга")},
+ {54, 3173, TEXT("Пеневежис")},
+ {54, 917, TEXT("Шауляй")},
+ {54, 2519, lpwszOther},
+ {55, 920, TEXT("Вадуц")},
+ {55, 2518, lpwszOther},
+ {56, 3376, TEXT("Бетцдорф")},
+ {56, 921, TEXT("Люксембург")},
+ {56, 2517, lpwszOther},
+ {57, 3142, TEXT("Битола")},
+ {57, 922, TEXT("Скопье")},
+ {57, 2516, lpwszOther},
+ {58, 923, TEXT("Валлетта")},
+ {58, 3154, TEXT("Мзида")},
+ {58, 924, TEXT("Слима")},
+ {58, 2515, lpwszOther},
+ {59, 925, TEXT("Бельцы")},
+ {59, 926, TEXT("Бендеры")},
+ {59, 3234, TEXT("Дубоссары")},
+ {59, 3275, TEXT("Кахул")},
+ {59, 927, TEXT("Кишинев")},
+ {59, 3321, TEXT("Резина")},
+ {59, 928, TEXT("Рыбница")},
+ {59, 929, TEXT("Тирасполь")},
+ {59, 3281, TEXT("Чадыр-Лунга")},
+ {59, 2514, lpwszOther},
+ {36, 930, TEXT("Монте-Карло")},
+ {36, 2513, lpwszOther},
+ {60, 931, TEXT("Амстердам")},
+ {60, 933, TEXT("Бреда")},
+ {60, 932, TEXT("Гаага")},
+ {60, 934, TEXT("Гауда")},
+ {60, 935, TEXT("Делфт")},
+ {60, 2977, TEXT("Донген")},
+ {60, 3030, TEXT("Зволле")},
+ {60, 3091, TEXT("Ниймеген")},
+ {60, 936, TEXT("Роттердам")},
+ {60, 937, TEXT("Утрехт")},
+ {60, 3044, TEXT("Эйндховен")},
+ {60, 3380, TEXT("Эншеде")},
+ {60, 2512, lpwszOther},
+ {61, 3190, TEXT("Кристиансанд")},
+ {61, 2857, TEXT("Лиллехаммер")},
+ {61, 938, TEXT("Осло")},
+ {61, 3355, TEXT("Ставангер")},
+ {61, 939, TEXT("Тронхейм")},
+ {61, 2511, lpwszOther},
+ {62, 940, TEXT("Белосток")},
+ {62, 941, TEXT("Варшава")},
+ {62, 3164, TEXT("Вроцлав")},
+ {62, 942, TEXT("Гданьск")},
+ {62, 943, TEXT("Гливице")},
+ {62, 3237, TEXT("Закопане")},
+ {62, 3165, TEXT("Зелена Гура")},
+ {62, 944, TEXT("Катовице")},
+ {62, 945, TEXT("Краков")},
+ {62, 3008, TEXT("Лодзь")},
+ {62, 3150, TEXT("Ольштын")},
+ {62, 946, TEXT("Познань")},
+ {62, 947, TEXT("Радом")},
+ {62, 948, TEXT("Сопот")},
+ {62, 2958, TEXT("Тыхы")},
+ {62, 2510, lpwszOther},
+ {35, 949, TEXT("Лиссабон")},
+ {35, 950, TEXT("Порто")},
+ {35, 2509, lpwszOther},
+ {63, 952, TEXT("Брашов")},
+ {63, 951, TEXT("Бухарест")},
+ {63, 954, TEXT("Констанца")},
+ {63, 955, TEXT("Плоешти")},
+ {63, 953, TEXT("Яссы")},
+ {63, 2508, lpwszOther},
+ {64, 956, TEXT("Сан-Марино")},
+ {64, 2507, lpwszOther},
+ {74, 957, TEXT("Белград")},
+ {74, 960, TEXT("Ниш")},
+ {74, 958, TEXT("Нови-Сад")},
+ {74, 959, TEXT("Сараево")},
+ {74, 2506, lpwszOther},
+ {65, 961, TEXT("Братислава")},
+ {65, 962, TEXT("Кошице")},
+ {65, 3101, TEXT("Липтов")},
+ {65, 963, TEXT("Попрад")},
+ {65, 964, TEXT("Прешов")},
+ {65, 965, TEXT("Ружемберок")},
+ {65, 966, TEXT("Тврдошин")},
+ {65, 2505, lpwszOther},
+ {66, 968, TEXT("Копар")},
+ {66, 967, TEXT("Любляна")},
+ {66, 969, TEXT("Марибор")},
+ {66, 2504, lpwszOther},
+ {67, 970, TEXT("Торсхавн")},
+ {67, 2503, lpwszOther},
+ {68, 2888, TEXT("Вантаа")},
+ {68, 971, TEXT("Васа")},
+ {68, 979, TEXT("Котка")},
+ {68, 972, TEXT("Коувола")},
+ {68, 980, TEXT("Лахти")},
+ {68, 973, TEXT("Оулу")},
+ {68, 3375, TEXT("Риихимяки")},
+ {68, 3159, TEXT("Руовеси")},
+ {68, 974, TEXT("Тампере")},
+ {68, 975, TEXT("Турку")},
+ {68, 976, TEXT("Хельсинки")},
+ {68, 977, TEXT("Эспо")},
+ {68, 978, TEXT("Ювяскюля")},
+ {68, 2502, lpwszOther},
+ {37, 996, TEXT("Авиньон")},
+ {37, 983, TEXT("Бержерак")},
+ {37, 997, TEXT("Блуа")},
+ {37, 984, TEXT("Бордо")},
+ {37, 998, TEXT("Дижон")},
+ {37, 987, TEXT("Канн")},
+ {37, 988, TEXT("Кастр")},
+ {37, 993, TEXT("Клермон-Ферран")},
+ {37, 3037, TEXT("Лилль")},
+ {37, 989, TEXT("Лион")},
+ {37, 985, TEXT("Марсель")},
+ {37, 991, TEXT("Мец")},
+ {37, 3161, TEXT("Мобеж")},
+ {37, 990, TEXT("Нанси")},
+ {37, 994, TEXT("Нант")},
+ {37, 995, TEXT("Ницца")},
+ {37, 999, TEXT("Орлеан")},
+ {37, 981, TEXT("Париж")},
+ {37, 3374, TEXT("Перпиньян")},
+ {37, 992, TEXT("Руан")},
+ {37, 982, TEXT("Страсбург")},
+ {37, 986, TEXT("Тулуза")},
+ {37, 3314, TEXT("Шамбери")},
+ {37, 2501, lpwszOther},
+ {69, 1003, TEXT("Дубровник")},
+ {69, 1000, TEXT("Загреб")},
+ {69, 1001, TEXT("Задар")},
+ {69, 1004, TEXT("Риека")},
+ {69, 1002, TEXT("Сплит")},
+ {69, 2500, lpwszOther},
+ {70, 1005, TEXT("Брно")},
+ {70, 3291, TEXT("Гавличкув-Брод")},
+ {70, 1007, TEXT("Градец-Кралове")},
+ {70, 1008, TEXT("Карлови-Вари")},
+ {70, 3019, TEXT("Кладрубы")},
+ {70, 1010, TEXT("Лоуни")},
+ {70, 1009, TEXT("Острава")},
+ {70, 1015, TEXT("Пльзень")},
+ {70, 3105, TEXT("Правчицка Брана")},
+ {70, 1006, TEXT("Прага")},
+ {70, 3246, TEXT("Тачов")},
+ {70, 1011, TEXT("Тршебич")},
+ {70, 1012, TEXT("Усти-над-Лабем")},
+ {70, 1014, TEXT("Ческе-Будеевице")},
+ {70, 1013, TEXT("Яблонец-над-Нисоу")},
+ {70, 2499, lpwszOther},
+ {71, 1016, TEXT("Арау")},
+ {71, 1019, TEXT("Баден")},
+ {71, 1017, TEXT("Базель")},
+ {71, 1018, TEXT("Берн")},
+ {71, 1020, TEXT("Биль")},
+ {71, 1021, TEXT("Винтертур")},
+ {71, 1022, TEXT("Давос")},
+ {71, 3189, TEXT("Делемонт")},
+ {71, 1023, TEXT("Женева")},
+ {71, 1024, TEXT("Золотурн")},
+ {71, 1025, TEXT("Лозанна")},
+ {71, 1026, TEXT("Локарно")},
+ {71, 1027, TEXT("Лугано")},
+ {71, 1028, TEXT("Люцерн")},
+ {71, 1029, TEXT("Монтре")},
+ {71, 1030, TEXT("Цюрих")},
+ {71, 2498, lpwszOther},
+ {72, 2883, TEXT("Арбога")},
+ {72, 1031, TEXT("Гетеборг")},
+ {72, 1032, TEXT("Кальмар")},
+ {72, 1037, TEXT("Лахольм")},
+ {72, 1036, TEXT("Лулео")},
+ {72, 1042, TEXT("Лунд")},
+ {72, 1033, TEXT("Мальме")},
+ {72, 1034, TEXT("Стокгольм")},
+ {72, 1041, TEXT("Умео")},
+ {72, 1039, TEXT("Фалун")},
+ {72, 1043, TEXT("Хельсинборг")},
+ {72, 1040, TEXT("Хернесанд")},
+ {72, 1038, TEXT("Эстерсунд")},
+ {72, 2497, lpwszOther},
+ {73, 3013, TEXT("Валга")},
+ {73, 1044, TEXT("Кейла")},
+ {73, 1045, TEXT("Кохтла-Ярве")},
+ {73, 1046, TEXT("Маарду")},
+ {73, 1047, TEXT("Мыйзакюла")},
+ {73, 1048, TEXT("Нарва")},
+ {73, 1049, TEXT("Пярну")},
+ {73, 1050, TEXT("Раквере")},
+ {73, 1051, TEXT("Силламяэ")},
+ {73, 1052, TEXT("Таллин")},
+ {73, 1053, TEXT("Тарту")},
+ {73, 1054, TEXT("Хаапсалу")},
+ {0, NULL}
};//*/
@@ -2797,3159 +2797,3159 @@ static const MRA_CITY mracCitys[]=
-static const MRA_PLACE mrapPlaces[]=
+static const MRA_PLACE mrapPlaces[] =
{
- {24, 0, 0, L"Россия"},
- {81, 0, 0, L"Азербайджан"},
- {82, 0, 0, L"Армения"},
- {97, 0, 0, L"Афганистан"},
- {96, 0, 0, L"Бангладеш"},
- {99, 0, 0, L"Бахрейн"},
- {100, 0, 0, L"Бруней-Даруссалам"},
- {101, 0, 0, L"Бутан"},
- {102, 0, 0, L"Вьетнам"},
- {83, 0, 0, L"Грузия"},
- {86, 0, 0, L"Израиль"},
- {95, 0, 0, L"Индия"},
- {103, 0, 0, L"Индонезия"},
- {79, 0, 0, L"Иордания"},
- {85, 0, 0, L"Ирак"},
- {87, 0, 0, L"Иран"},
- {104, 0, 0, L"Йемен"},
- {84, 0, 0, L"Казахстан"},
- {105, 0, 0, L"Камбоджа"},
- {106, 0, 0, L"Катар"},
- {107, 0, 0, L"Кипр"},
- {92, 0, 0, L"Киргизия (Кыргызстан)"},
- {76, 0, 0, L"Китай"},
- {3215, 0, 0, L"Кокосовые острова (Австр.)"},
- {29, 0, 0, L"Корея (КНДР)"},
- {108, 0, 0, L"Корея"},
- {88, 0, 0, L"Кувейт"},
- {109, 0, 0, L"Лаос"},
- {110, 0, 0, L"Ливан"},
- {111, 0, 0, L"Малайзия"},
- {112, 0, 0, L"Мальдивы"},
- {113, 0, 0, L"Монголия"},
- {114, 0, 0, L"Мьянма"},
- {115, 0, 0, L"Непал"},
- {116, 0, 0, L"Объединенные Арабские Эмираты"},
- {117, 0, 0, L"Оман"},
- {3216, 0, 0, L"Остров Рождества (Австр.)"},
- {122, 0, 0, L"Пакистан"},
- {89, 0, 0, L"Палестина"},
- {94, 0, 0, L"Саудовская Аравия"},
- {118, 0, 0, L"Сингапур"},
- {78, 0, 0, L"Сирия"},
- {91, 0, 0, L"Таджикистан"},
- {119, 0, 0, L"Таиланд"},
- {120, 0, 0, L"Тайвань"},
- {132, 0, 0, L"Тимор"},
- {90, 0, 0, L"Туркмения"},
- {77, 0, 0, L"Турция"},
- {93, 0, 0, L"Узбекистан"},
- {121, 0, 0, L"Филиппины"},
- {98, 0, 0, L"Шри Ланка"},
- {75, 0, 0, L"Япония"},
- {123, 0, 0, L"Австралия"},
- {454, 0, 0, L"Американское Самоа"},
- {124, 0, 0, L"Вануату"},
- {453, 0, 0, L"Гуам (США)"},
- {126, 0, 0, L"Кирибати"},
- {127, 0, 0, L"Маршалловы Острова"},
- {128, 0, 0, L"Микронезия (Федеративные Штаты Микронезии)"},
- {129, 0, 0, L"Науру"},
- {3220, 0, 0, L"Ниуэ (Н.Зел.)"},
- {130, 0, 0, L"Новая Зеландия"},
- {3218, 0, 0, L"Новая Каледония (Фр.)"},
- {3221, 0, 0, L"Острова Кука (Н.Зел.)"},
- {3230, 0, 0, L"Острова Херд и Макдональд (Австр.)"},
- {131, 0, 0, L"Палау"},
- {133, 0, 0, L"Папуа - Новая Гвинея"},
- {3222, 0, 0, L"Питкерн (Брит.)"},
- {125, 0, 0, L"Самоа"},
- {3219, 0, 0, L"Сев. Марианские острова (США)"},
- {134, 0, 0, L"Соломоновы Острова"},
- {3223, 0, 0, L"Токелау (Н.Зел.)"},
- {135, 0, 0, L"Тонга"},
- {136, 0, 0, L"Тувалу"},
- {3224, 0, 0, L"Уоллис и Футуна острова (Фр.)"},
- {137, 0, 0, L"Фиджи"},
- {3226, 0, 0, L"Французская Полинезия"},
- {3225, 0, 0, L"Французские Южные территории"},
- {138, 0, 0, L"Канада"},
- {139, 0, 0, L"США"},
- {3200, 0, 0, L"Ангилья (Брит.)"},
- {140, 0, 0, L"Антигуа и Барбуда"},
- {141, 0, 0, L"Аргентина"},
- {3202, 0, 0, L"Аруба (Нид.)"},
- {142, 0, 0, L"Багамы"},
- {143, 0, 0, L"Барбадос"},
- {146, 0, 0, L"Белиз"},
- {3203, 0, 0, L"Бермуды (Брит.)"},
- {144, 0, 0, L"Боливия"},
- {145, 0, 0, L"Бразилия"},
- {147, 0, 0, L"Венесуэла"},
- {3204, 0, 0, L"Виргинские острова (Брит.)"},
- {452, 0, 0, L"Виргинские острова (США)"},
- {149, 0, 0, L"Гаити"},
- {148, 0, 0, L"Гайана"},
- {3205, 0, 0, L"Гваделупа (Фр.)"},
- {173, 0, 0, L"Гватемала"},
- {150, 0, 0, L"Гондурас"},
- {151, 0, 0, L"Гренада"},
- {152, 0, 0, L"Гренландия (Дат.)"},
- {153, 0, 0, L"Доминика"},
- {154, 0, 0, L"Доминиканская Республика"},
- {155, 0, 0, L"Колумбия"},
- {156, 0, 0, L"Коста-Рика"},
- {157, 0, 0, L"Куба"},
- {3208, 0, 0, L"Мартиника (Фр.)"},
- {158, 0, 0, L"Мексика"},
- {3209, 0, 0, L"Монтсеррат (Брит)"},
- {3201, 0, 0, L"Нидерландские Антилы"},
- {159, 0, 0, L"Никарагуа"},
- {3207, 0, 0, L"Остров Кайман (Брит.)"},
- {3211, 0, 0, L"Острова Теркс и Кайкос (Брит.)"},
- {160, 0, 0, L"Панама"},
- {161, 0, 0, L"Парагвай"},
- {162, 0, 0, L"Перу"},
- {163, 0, 0, L"Сальвадор"},
- {164, 0, 0, L"Сент-Винсент и Гренадины"},
- {165, 0, 0, L"Сент-Китс и Невис"},
- {166, 0, 0, L"Сент-Люсия"},
- {3210, 0, 0, L"Сент-Пьер и Микелон (Фр.)"},
- {167, 0, 0, L"Суринам"},
- {168, 0, 0, L"Тринидат и Тобаго"},
- {169, 0, 0, L"Уругвай"},
- {3212, 0, 0, L"Фолклендские острова (Брит.)"},
- {3206, 0, 0, L"Французская Гвиана"},
- {170, 0, 0, L"Чили"},
- {171, 0, 0, L"Эквадор"},
- {3213, 0, 0, L"Юж. Джорджия и Юж. Сандвичевы о-ва (Брит.)"},
- {172, 0, 0, L"Ямайка"},
- {174, 0, 0, L"Алжир"},
- {175, 0, 0, L"Ангола"},
- {176, 0, 0, L"Бенин"},
- {177, 0, 0, L"Ботсвана"},
- {3228, 0, 0, L"Британская территория в Индийском океане"},
- {178, 0, 0, L"Буркина-Фасо"},
- {179, 0, 0, L"Бурунди"},
- {180, 0, 0, L"Габон"},
- {181, 0, 0, L"Гамбия"},
- {182, 0, 0, L"Гана"},
- {183, 0, 0, L"Гвинея"},
- {184, 0, 0, L"Гвинея-Бисау"},
- {185, 0, 0, L"Джибути"},
- {186, 0, 0, L"Египет"},
- {187, 0, 0, L"Замбия"},
- {3198, 0, 0, L"Зап. Сахара"},
- {23, 0, 0, L"Зимбабве"},
- {188, 0, 0, L"Кабо-Верде"},
- {189, 0, 0, L"Камерун"},
- {190, 0, 0, L"Кения"},
- {191, 0, 0, L"Коморы"},
- {193, 0, 0, L"Конго (Заир)"},
- {192, 0, 0, L"Конго"},
- {194, 0, 0, L"Кот-д`Ивуар"},
- {195, 0, 0, L"Лесото"},
- {196, 0, 0, L"Либерия"},
- {197, 0, 0, L"Ливия"},
- {198, 0, 0, L"Маврикий"},
- {199, 0, 0, L"Мавритания"},
- {200, 0, 0, L"Мадагаскар"},
- {3229, 0, 0, L"Майотт (Фр.)"},
- {201, 0, 0, L"Малави"},
- {202, 0, 0, L"Мали"},
- {203, 0, 0, L"Марокко"},
- {204, 0, 0, L"Мозамбик"},
- {205, 0, 0, L"Намибия"},
- {206, 0, 0, L"Нигер"},
- {207, 0, 0, L"Нигерия"},
- {3227, 0, 0, L"Остров Буве (Норв.)"},
- {3197, 0, 0, L"Реюньон (Фр.)"},
- {208, 0, 0, L"Руанда"},
- {209, 0, 0, L"Сан-Томе и Принсипи"},
- {210, 0, 0, L"Свазиленд"},
- {3199, 0, 0, L"Святая Елена (Брит.)"},
- {211, 0, 0, L"Сейшелы"},
- {212, 0, 0, L"Сенегал"},
- {213, 0, 0, L"Сомали"},
- {214, 0, 0, L"Судан"},
- {215, 0, 0, L"Сьерра-Леоне"},
- {216, 0, 0, L"Танзания"},
- {217, 0, 0, L"Того"},
- {218, 0, 0, L"Тунис"},
- {219, 0, 0, L"Уганда"},
- {220, 0, 0, L"Центральноафриканская Республика"},
- {222, 0, 0, L"Чад"},
- {223, 0, 0, L"Экваториальная Гвинея"},
- {221, 0, 0, L"Эритрея"},
- {224, 0, 0, L"Эфиопия"},
- {225, 0, 0, L"Южно-Африканская Республика (ЮАР)"},
- {39, 0, 0, L"Украина"},
- {40, 0, 0, L"Австрия"},
- {32, 0, 0, L"Албания"},
- {33, 0, 0, L"Андорра"},
- {340, 0, 0, L"Белоруссия"},
- {38, 0, 0, L"Бельгия"},
- {41, 0, 0, L"Болгария"},
- {42, 0, 0, L"Босния и Герцеговина"},
- {43, 0, 0, L"Ватикан"},
- {45, 0, 0, L"Великобритания"},
- {44, 0, 0, L"Венгрия"},
- {46, 0, 0, L"Германия"},
- {3193, 0, 0, L"Гернси (Брит.)"},
- {47, 0, 0, L"Гибралтар (Брит.)"},
- {48, 0, 0, L"Греция"},
- {49, 0, 0, L"Дания"},
- {3194, 0, 0, L"Джерси (Брит.)"},
- {50, 0, 0, L"Ирландия"},
- {51, 0, 0, L"Исландия"},
- {34, 0, 0, L"Испания"},
- {52, 0, 0, L"Италия"},
- {53, 0, 0, L"Латвия"},
- {54, 0, 0, L"Литва"},
- {55, 0, 0, L"Лихтенштейн"},
- {56, 0, 0, L"Люксембург"},
- {57, 0, 0, L"Македония"},
- {58, 0, 0, L"Мальта"},
- {59, 0, 0, L"Молдавия"},
- {36, 0, 0, L"Монако"},
- {60, 0, 0, L"Нидерланды"},
- {61, 0, 0, L"Норвегия"},
- {3195, 0, 0, L"Остров Мэн (Брит.)"},
- {62, 0, 0, L"Польша"},
- {35, 0, 0, L"Португалия"},
- {63, 0, 0, L"Румыния"},
- {64, 0, 0, L"Сан-Марино"},
- {74, 0, 0, L"Сербия и Черногория"},
- {65, 0, 0, L"Словакия"},
- {66, 0, 0, L"Словения"},
- {67, 0, 0, L"Фарерские о-ва (Дания)"},
- {68, 0, 0, L"Финляндия"},
- {37, 0, 0, L"Франция"},
- {69, 0, 0, L"Хорватия"},
- {70, 0, 0, L"Чехия"},
- {71, 0, 0, L"Швейцария"},
- {72, 0, 0, L"Швеция"},
- {3196, 0, 0, L"Шпицберген (Норв.)"},
- {73, 0, 0, L"Эстония"},
- {24, 25, 0, L"Москва"},
- {24, 226, 0, L"Санкт-Петербург"},
- {24, 233, 0, L"Саха (Якутия)"},
- {24, 232, 0, L"Приморский край"},
- {24, 235, 0, L"Хабаровский край"},
- {24, 227, 0, L"Амурская обл."},
- {24, 229, 0, L"Камчатская обл."},
- {24, 231, 0, L"Магаданская обл."},
- {24, 234, 0, L"Сахалинская обл."},
- {24, 228, 0, L"Еврейская АО"},
- {24, 230, 0, L"Корякский АО"},
- {24, 236, 0, L"Чукотский АО"},
- {24, 237, 0, L"Башкортостан"},
- {24, 240, 0, L"Марий-Эл"},
- {24, 241, 0, L"Мордовия"},
- {24, 248, 0, L"Татарстан"},
- {24, 249, 0, L"Удмуртия"},
- {24, 251, 0, L"Чувашия"},
- {24, 238, 0, L"Кировская обл."},
- {24, 242, 0, L"Нижегородская обл."},
- {24, 243, 0, L"Оренбургская обл."},
- {24, 244, 0, L"Пензенская обл."},
- {24, 245, 0, L"Пермская обл."},
- {24, 246, 0, L"Самарская обл."},
- {24, 247, 0, L"Саратовская обл."},
- {24, 250, 0, L"Ульяновская обл."},
- {24, 239, 0, L"Коми-Пермяцкий АО"},
- {24, 255, 0, L"Карелия"},
- {24, 256, 0, L"Коми"},
- {24, 252, 0, L"Архангельская обл."},
- {24, 253, 0, L"Вологодская обл."},
- {24, 254, 0, L"Калининградская обл."},
- {24, 257, 0, L"Ленинградская обл."},
- {24, 258, 0, L"Мурманская обл."},
- {24, 260, 0, L"Новгородская обл."},
- {24, 261, 0, L"Псковская обл."},
- {24, 259, 0, L"Ненецкий АО"},
- {24, 265, 0, L"Бурятия"},
- {24, 263, 0, L"Республика Алтай"},
- {24, 273, 0, L"Тыва"},
- {24, 275, 0, L"Хакасия"},
- {24, 264, 0, L"Алтайский край"},
- {24, 268, 0, L"Красноярский край"},
- {24, 266, 0, L"Иркутская обл."},
- {24, 267, 0, L"Кемеровская обл."},
- {24, 269, 0, L"Новосибирская обл."},
- {24, 270, 0, L"Омская обл."},
- {24, 272, 0, L"Томская обл."},
- {24, 276, 0, L"Читинская обл."},
- {24, 262, 0, L"Агинский Бурятский АО"},
- {24, 271, 0, L"Таймырский АО"},
- {24, 274, 0, L"Усть-Ордынский Бурятский АО"},
- {24, 277, 0, L"Эвенкийский АО"},
- {24, 278, 0, L"Курганская обл."},
- {24, 279, 0, L"Свердловская обл."},
- {24, 280, 0, L"Тюменская обл."},
- {24, 282, 0, L"Челябинская обл."},
- {24, 281, 0, L"Ханты-Мансийский АО - Югра"},
- {24, 283, 0, L"Ямало-Ненецкий АО"},
- {24, 284, 0, L"Белгородская обл."},
- {24, 285, 0, L"Брянская обл."},
- {24, 286, 0, L"Владимирская обл."},
- {24, 287, 0, L"Воронежская обл."},
- {24, 288, 0, L"Ивановская обл."},
- {24, 289, 0, L"Калужская обл."},
- {24, 290, 0, L"Костромская обл."},
- {24, 291, 0, L"Курская обл."},
- {24, 292, 0, L"Липецкая обл."},
- {24, 293, 0, L"Московская обл."},
- {24, 294, 0, L"Орловская обл."},
- {24, 295, 0, L"Рязанская обл."},
- {24, 296, 0, L"Смоленская обл."},
- {24, 297, 0, L"Тамбовская обл."},
- {24, 298, 0, L"Тверская обл."},
- {24, 299, 0, L"Тульская обл."},
- {24, 300, 0, L"Ярославская обл."},
- {24, 301, 0, L"Адыгея"},
- {24, 304, 0, L"Дагестан"},
- {24, 305, 0, L"Ингушетия"},
- {24, 306, 0, L"Кабардино-Балкария"},
- {24, 307, 0, L"Калмыкия"},
- {24, 308, 0, L"Карачаево-Черкессия"},
- {24, 311, 0, L"Северная Осетия - Алания"},
- {24, 313, 0, L"Чечня"},
- {24, 309, 0, L"Краснодарский край"},
- {24, 312, 0, L"Ставропольский край"},
- {24, 302, 0, L"Астраханская обл."},
- {24, 303, 0, L"Волгоградская обл."},
- {24, 310, 0, L"Ростовская обл."},
- {81, 1055, 0, L"Баку"},
- {81, 1058, 0, L"Гянджа"},
- {81, 1056, 0, L"Нахичевань"},
- {81, 1057, 0, L"Ханкенди"},
- {81, 3153, 0, L"Шеки"},
- {81, 2291, 0, L"Другое"},
- {82, 2932, 0, L"Абовян"},
- {82, 1060, 0, L"Аштарак"},
- {82, 3084, 0, L"Ванадзор"},
- {82, 3011, 0, L"Гюмри"},
- {82, 3306, 0, L"Дилижан"},
- {82, 1059, 0, L"Ереван"},
- {82, 3145, 0, L"Ханкенди"},
- {82, 2292, 0, L"Другое"},
- {97, 1061, 0, L"Кабул"},
- {97, 2293, 0, L"Другое"},
- {96, 1062, 0, L"Дакка"},
- {96, 2294, 0, L"Другое"},
- {99, 1063, 0, L"Манама"},
- {99, 2295, 0, L"Другое"},
- {100, 1064, 0, L"Бандар-Сери-Бегаван"},
- {100, 2296, 0, L"Другое"},
- {101, 1065, 0, L"Тхимпху"},
- {101, 2297, 0, L"Другое"},
- {102, 1066, 0, L"Ханой"},
- {102, 2298, 0, L"Другое"},
- {83, 1067, 0, L"Батуми"},
- {83, 3158, 0, L"Боржоми"},
- {83, 1068, 0, L"Поти"},
- {83, 3129, 0, L"Рустави"},
- {83, 1069, 0, L"Сухуми"},
- {83, 1070, 0, L"Тбилиси"},
- {83, 2299, 0, L"Другое"},
- {86, 3345, 0, L"Ариэль"},
- {86, 1071, 0, L"Афула"},
- {86, 2992, 0, L"Ашдод"},
- {86, 3175, 0, L"Ашкелон"},
- {86, 3363, 0, L"Бат-Ям"},
- {86, 2884, 0, L"Беер-Яков"},
- {86, 3243, 0, L"Бейт-Шемеш"},
- {86, 1074, 0, L"Беэр-Шева"},
- {86, 3348, 0, L"Герцелия"},
- {86, 3241, 0, L"Димона"},
- {86, 1075, 0, L"Иерусалим"},
- {86, 3350, 0, L"Йокнеам-Иллит"},
- {86, 2982, 0, L"Кармиэль"},
- {86, 2971, 0, L"Кфар-Саба"},
- {86, 3136, 0, L"Назарет"},
- {86, 1080, 0, L"Натания"},
- {86, 3303, 0, L"Офаким"},
- {86, 3050, 0, L"Раанана"},
- {86, 3151, 0, L"Рамат Ган"},
- {86, 3141, 0, L"Реховот"},
- {86, 3012, 0, L"Ришон ле Цион"},
- {86, 1081, 0, L"Тверия"},
- {86, 1077, 0, L"Тель-Авив"},
- {86, 1079, 0, L"Хадера"},
- {86, 1078, 0, L"Хайфа"},
- {86, 1076, 0, L"Хеврон"},
- {86, 2929, 0, L"Цфат"},
- {86, 2928, 0, L"Эйлат"},
- {86, 2300, 0, L"Другое"},
- {95, 3315, 0, L"Бангалор"},
- {95, 1082, 0, L"Дели"},
- {95, 1083, 0, L"Джайпур"},
- {95, 3144, 0, L"Калькутта"},
- {95, 3025, 0, L"Мумбаи"},
- {95, 3277, 0, L"Панаджи"},
- {95, 1084, 0, L"Ченнаи"},
- {95, 2301, 0, L"Другое"},
- {103, 1085, 0, L"Джакарта"},
- {103, 2302, 0, L"Другое"},
- {79, 1086, 0, L"Амман"},
- {79, 2303, 0, L"Другое"},
- {85, 1087, 0, L"Багдад"},
- {85, 2304, 0, L"Другое"},
- {87, 1088, 0, L"Тегеран"},
- {87, 2305, 0, L"Другое"},
- {104, 1089, 0, L"Сана"},
- {104, 2306, 0, L"Другое"},
- {84, 1090, 0, L"Актау"},
- {84, 1091, 0, L"Актюбинск"},
- {84, 1092, 0, L"Алма-Ата"},
- {84, 3242, 0, L"Аршалы"},
- {84, 1093, 0, L"Астана"},
- {84, 1094, 0, L"Атырау (Гурьев)"},
- {84, 1095, 0, L"Байконур"},
- {84, 3245, 0, L"Балхаш"},
- {84, 3083, 0, L"Жезказган"},
- {84, 1096, 0, L"Капчагай"},
- {84, 1097, 0, L"Караганда"},
- {84, 1098, 0, L"Кокшетау"},
- {84, 1099, 0, L"Кустанай"},
- {84, 2868, 0, L"Лисаковск"},
- {84, 1100, 0, L"Павлодар"},
- {84, 1101, 0, L"Петропавловск (Сев.-Каз. обл.)"},
- {84, 1102, 0, L"Рудный"},
- {84, 1103, 0, L"Семипалатинск"},
- {84, 1104, 0, L"Степногорск"},
- {84, 3166, 0, L"Талгар"},
- {84, 1105, 0, L"Талды-Курган"},
- {84, 2927, 0, L"Тараз"},
- {84, 1106, 0, L"Темиртау"},
- {84, 1107, 0, L"Уральск"},
- {84, 1108, 0, L"Усть-Каменогорск"},
- {84, 1109, 0, L"Чимкент"},
- {84, 1110, 0, L"Экибастуз"},
- {84, 2307, 0, L"Другое"},
- {105, 1111, 0, L"Пномпень"},
- {105, 2308, 0, L"Другое"},
- {106, 1112, 0, L"Доха"},
- {106, 2309, 0, L"Другое"},
- {107, 1113, 0, L"Ларнака"},
- {107, 1114, 0, L"Лимассол"},
- {107, 1115, 0, L"Никосия"},
- {107, 2954, 0, L"Пафос"},
- {107, 2310, 0, L"Другое"},
- {92, 1116, 0, L"Бишкек"},
- {92, 1117, 0, L"Джалал-Абад"},
- {92, 3027, 0, L"Кара-Балта"},
- {92, 1118, 0, L"Каракол"},
- {92, 1119, 0, L"Ош"},
- {92, 1120, 0, L"Талас"},
- {92, 2933, 0, L"Хайдаркен"},
- {92, 2311, 0, L"Другое"},
- {76, 3214, 0, L"Аомынь (Макао)"},
- {76, 1121, 0, L"Гонконг"},
- {76, 2869, 0, L"Гуанчжоу"},
- {76, 3262, 0, L"Далянь"},
- {76, 1122, 0, L"Пекин"},
- {76, 1123, 0, L"Харбин"},
- {76, 1124, 0, L"Шанхай"},
- {76, 3043, 0, L"Шеньян"},
- {76, 2312, 0, L"Другое"},
- {29, 1125, 0, L"Пхеньян"},
- {29, 2313, 0, L"Другое"},
- {108, 1126, 0, L"Сеул"},
- {108, 3240, 0, L"Тейджон"},
- {108, 2314, 0, L"Другое"},
- {88, 1127, 0, L"Эль-Кувейт"},
- {88, 2315, 0, L"Другое"},
- {109, 1128, 0, L"Вьентьян"},
- {109, 2316, 0, L"Другое"},
- {110, 1129, 0, L"Бейрут"},
- {110, 2317, 0, L"Другое"},
- {111, 1130, 0, L"Джохор-Бару"},
- {111, 1131, 0, L"Куала-Лумпур"},
- {111, 2318, 0, L"Другое"},
- {112, 1132, 0, L"Мале"},
- {112, 2319, 0, L"Другое"},
- {113, 1133, 0, L"Улан-Батор"},
- {113, 1134, 0, L"Эрдэнэт"},
- {113, 2320, 0, L"Другое"},
- {114, 1135, 0, L"Янгон"},
- {114, 2321, 0, L"Другое"},
- {115, 1136, 0, L"Катманду"},
- {115, 2322, 0, L"Другое"},
- {116, 1137, 0, L"Абу-Даби"},
- {116, 1138, 0, L"Дубай"},
- {116, 1139, 0, L"Шарджа"},
- {116, 2323, 0, L"Другое"},
- {117, 1140, 0, L"Маскат"},
- {117, 2324, 0, L"Другое"},
- {122, 1141, 0, L"Исламабад"},
- {122, 2325, 0, L"Другое"},
- {89, 1072, 0, L"Ашдод"},
- {89, 1073, 0, L"Ашкелон"},
- {89, 1142, 0, L"Газа"},
- {89, 2326, 0, L"Другое"},
- {94, 3250, 0, L"Медина"},
- {94, 1143, 0, L"Эр-Рияд"},
- {94, 2327, 0, L"Другое"},
- {78, 1144, 0, L"Дамаск"},
- {78, 2328, 0, L"Другое"},
- {91, 1145, 0, L"Душанбе"},
- {91, 3307, 0, L"Кайраккум"},
- {91, 3308, 0, L"Худжанд"},
- {91, 2329, 0, L"Другое"},
- {119, 1146, 0, L"Бангкок"},
- {119, 1147, 0, L"Пхукет"},
- {119, 2330, 0, L"Другое"},
- {120, 1148, 0, L"Тайбэй"},
- {120, 2331, 0, L"Другое"},
- {132, 1149, 0, L"Дили"},
- {132, 2332, 0, L"Другое"},
- {90, 1150, 0, L"Ашхабад"},
- {90, 3079, 0, L"Безмеин"},
- {90, 2333, 0, L"Другое"},
- {77, 1152, 0, L"Анкара"},
- {77, 1153, 0, L"Анталия"},
- {77, 3080, 0, L"Бурса"},
- {77, 1151, 0, L"Мармарис"},
- {77, 1154, 0, L"Стамбул"},
- {77, 1155, 0, L"Трабзон"},
- {77, 2334, 0, L"Другое"},
- {93, 3362, 0, L"Алмалык"},
- {93, 3137, 0, L"Андижан"},
- {93, 3273, 0, L"Асака"},
- {93, 1156, 0, L"Ахангаран"},
- {93, 1157, 0, L"Бухара"},
- {93, 3167, 0, L"Джизак"},
- {93, 3347, 0, L"Кунград"},
- {93, 1158, 0, L"Навои"},
- {93, 1159, 0, L"Наманган"},
- {93, 1160, 0, L"Самарканд"},
- {93, 1161, 0, L"Ташкент"},
- {93, 1162, 0, L"Ургенч"},
- {93, 1163, 0, L"Фергана"},
- {93, 1164, 0, L"Чирчик"},
- {93, 2335, 0, L"Другое"},
- {121, 1165, 0, L"Манила"},
- {121, 3319, 0, L"Себу"},
- {121, 2336, 0, L"Другое"},
- {98, 1166, 0, L"Коломбо"},
- {98, 2337, 0, L"Другое"},
- {75, 3176, 0, L"Исесаки"},
- {75, 3339, 0, L"Корияма"},
- {75, 1167, 0, L"Саппоро"},
- {75, 1168, 0, L"Токио"},
- {75, 2338, 0, L"Другое"},
- {123, 1914, 0, L"Аделаида"},
- {123, 2957, 0, L"Блэк Рок"},
- {123, 1915, 0, L"Брисбен"},
- {123, 3331, 0, L"Горокан"},
- {123, 1916, 0, L"Канберра"},
- {123, 3001, 0, L"Лидкомб"},
- {123, 1917, 0, L"Мельбурн"},
- {123, 3217, 0, L"Норфолк"},
- {123, 3064, 0, L"Перт"},
- {123, 3020, 0, L"Санта Люсиа"},
- {123, 1918, 0, L"Сидней"},
- {123, 3238, 0, L"Энеабба"},
- {123, 2339, 0, L"Другое"},
- {454, 1192, 0, L"Паго-Паго"},
- {454, 2366, 0, L"Другое"},
- {124, 1919, 0, L"Порт-Вила"},
- {124, 2340, 0, L"Другое"},
- {453, 1193, 0, L"Аганья"},
- {453, 2368, 0, L"Другое"},
- {126, 1921, 0, L"Баирики"},
- {126, 2342, 0, L"Другое"},
- {127, 1922, 0, L"Маджуро"},
- {127, 2343, 0, L"Другое"},
- {128, 1923, 0, L"Паликир"},
- {128, 2344, 0, L"Другое"},
- {129, 1924, 0, L"Ярен"},
- {129, 2345, 0, L"Другое"},
- {130, 1925, 0, L"Веллингтон"},
- {130, 1926, 0, L"Гамильтон"},
- {130, 1928, 0, L"Данидин"},
- {130, 1929, 0, L"Крайстчерч"},
- {130, 3235, 0, L"Кромвель"},
- {130, 1927, 0, L"Окленд"},
- {130, 3323, 0, L"Тауранга"},
- {130, 2346, 0, L"Другое"},
- {131, 1930, 0, L"Корор"},
- {131, 2347, 0, L"Другое"},
- {133, 1931, 0, L"Порт-Морсби"},
- {133, 2348, 0, L"Другое"},
- {125, 1920, 0, L"Апиа"},
- {125, 2341, 0, L"Другое"},
- {134, 1932, 0, L"Хониара"},
- {134, 2349, 0, L"Другое"},
- {135, 1933, 0, L"Нукуалофа"},
- {135, 2350, 0, L"Другое"},
- {136, 1934, 0, L"Фунафути"},
- {136, 2351, 0, L"Другое"},
- {137, 1935, 0, L"Сува"},
- {137, 2352, 0, L"Другое"},
- {138, 3055, 0, L"Барлингтон"},
- {138, 3049, 0, L"Броссард"},
- {138, 3330, 0, L"Бурнаби"},
- {138, 1169, 0, L"Ванкувер"},
- {138, 3106, 0, L"Ватерлоо"},
- {138, 1170, 0, L"Виннипег"},
- {138, 1171, 0, L"Галифакс"},
- {138, 1172, 0, L"Гамильтон"},
- {138, 3365, 0, L"Денвер"},
- {138, 1173, 0, L"Калгари"},
- {138, 3104, 0, L"Камлупс"},
- {138, 3366, 0, L"Каннингтон"},
- {138, 1174, 0, L"Квебек"},
- {138, 2964, 0, L"Кингстон"},
- {138, 3113, 0, L"Коквитлам"},
- {138, 1175, 0, L"Монреаль"},
- {138, 2920, 0, L"Ниагара-Фолс"},
- {138, 2889, 0, L"Норд-Йорк"},
- {138, 1176, 0, L"Оттава"},
- {138, 2903, 0, L"Порт Алберни"},
- {138, 1177, 0, L"Ричмонд"},
- {138, 1178, 0, L"Тимминс"},
- {138, 2946, 0, L"Торнхилл"},
- {138, 1179, 0, L"Торонто"},
- {138, 1180, 0, L"Эдмонтон"},
- {138, 2353, 0, L"Другое"},
- {139, 407, 0, L"Вашингтон"},
- {139, 426, 0, L"Айдахо"},
- {139, 378, 0, L"Айова"},
- {139, 412, 0, L"Алабама"},
- {139, 446, 0, L"Аляска"},
- {139, 434, 0, L"Аризона"},
- {139, 416, 0, L"Арканзас"},
- {139, 428, 0, L"Вайоминг"},
- {139, 440, 0, L"Вашингтон"},
- {139, 352, 0, L"Вермонт"},
- {139, 394, 0, L"Виргиния"},
- {139, 374, 0, L"Висконсин"},
- {139, 448, 0, L"Гавайи"},
- {139, 390, 0, L"Делавер"},
- {139, 402, 0, L"Джорджия"},
- {139, 396, 0, L"Западная Виргиния"},
- {139, 370, 0, L"Иллинойс"},
- {139, 368, 0, L"Индиана"},
- {139, 444, 0, L"Калифорния"},
- {139, 388, 0, L"Канзас"},
- {139, 408, 0, L"Кентукки"},
- {139, 430, 0, L"Колорадо"},
- {139, 358, 0, L"Коннектикут"},
- {139, 418, 0, L"Луизиана"},
- {139, 354, 0, L"Массачусетс"},
- {139, 376, 0, L"Миннесота"},
- {139, 414, 0, L"Миссисипи"},
- {139, 380, 0, L"Миссури"},
- {139, 372, 0, L"Мичиган"},
- {139, 424, 0, L"Монтана"},
- {139, 348, 0, L"Мэн"},
- {139, 392, 0, L"Мэриленд"},
- {139, 386, 0, L"Небраска"},
- {139, 438, 0, L"Невада"},
- {139, 362, 0, L"Нью-Джерси"},
- {139, 360, 0, L"Нью-Йорк"},
- {139, 432, 0, L"Нью-Мексико"},
- {139, 350, 0, L"Нью-Хэмпшир"},
- {139, 366, 0, L"Огайо"},
- {139, 420, 0, L"Оклахома"},
- {139, 442, 0, L"Орегон"},
- {139, 364, 0, L"Пенсильвания"},
- {139, 450, 0, L"Пуэрто-Рико"},
- {139, 356, 0, L"Род-Айленд"},
- {139, 382, 0, L"Северная Дакота"},
- {139, 398, 0, L"Северная Каролина"},
- {139, 410, 0, L"Теннесси"},
- {139, 422, 0, L"Техас"},
- {139, 406, 0, L"Федеральный округ Колумбия"},
- {139, 404, 0, L"Флорида"},
- {139, 384, 0, L"Южная Дакота"},
- {139, 400, 0, L"Южная Каролина"},
- {139, 436, 0, L"Юта"},
- {140, 1238, 0, L"Сент-Джонс"},
- {140, 2442, 0, L"Другое"},
- {141, 1239, 0, L"Буэнос-Айрес"},
- {141, 2441, 0, L"Другое"},
- {142, 1240, 0, L"Нассау"},
- {142, 2440, 0, L"Другое"},
- {143, 1241, 0, L"Бриджтаун"},
- {143, 2439, 0, L"Другое"},
- {146, 1242, 0, L"Бельмопан"},
- {146, 2438, 0, L"Другое"},
- {144, 1243, 0, L"Ла-Пас"},
- {144, 2437, 0, L"Другое"},
- {145, 1244, 0, L"Бразилиа"},
- {145, 3094, 0, L"Пассо Фундо"},
- {145, 1245, 0, L"Рио-де-Жанейро"},
- {145, 1246, 0, L"Сан-Паулу"},
- {145, 2436, 0, L"Другое"},
- {147, 1247, 0, L"Каракас"},
- {147, 2435, 0, L"Другое"},
- {452, 1190, 0, L"Шарлотта-Амалия"},
- {452, 2364, 0, L"Другое"},
- {149, 1248, 0, L"Порт-о-Пренс"},
- {149, 2434, 0, L"Другое"},
- {148, 1249, 0, L"Джоржтаун"},
- {148, 2433, 0, L"Другое"},
- {173, 1250, 0, L"Гватемала"},
- {173, 2432, 0, L"Другое"},
- {150, 1251, 0, L"Тегусигальпа"},
- {150, 2431, 0, L"Другое"},
- {151, 1252, 0, L"Сент-Джорджес"},
- {151, 2430, 0, L"Другое"},
- {152, 1253, 0, L"Уманак"},
- {152, 2429, 0, L"Другое"},
- {153, 1254, 0, L"Розо"},
- {153, 2428, 0, L"Другое"},
- {154, 1255, 0, L"Санто-Доминго"},
- {154, 2427, 0, L"Другое"},
- {155, 1256, 0, L"Богота"},
- {155, 2426, 0, L"Другое"},
- {156, 1257, 0, L"Сан-Хосе"},
- {156, 2425, 0, L"Другое"},
- {157, 1258, 0, L"Гавана"},
- {157, 2424, 0, L"Другое"},
- {158, 1259, 0, L"Акапулько"},
- {158, 1260, 0, L"Мехико"},
- {158, 2423, 0, L"Другое"},
- {159, 1261, 0, L"Манагуа"},
- {159, 2422, 0, L"Другое"},
- {160, 1262, 0, L"Панама"},
- {160, 2421, 0, L"Другое"},
- {161, 1263, 0, L"Асунсьон"},
- {161, 2420, 0, L"Другое"},
- {162, 1264, 0, L"Лима"},
- {162, 2419, 0, L"Другое"},
- {163, 1265, 0, L"Сан-Сальвадор"},
- {163, 2418, 0, L"Другое"},
- {164, 1266, 0, L"Кингстаун"},
- {164, 2417, 0, L"Другое"},
- {165, 1267, 0, L"Бастер"},
- {165, 2416, 0, L"Другое"},
- {166, 1268, 0, L"Кастри"},
- {166, 2415, 0, L"Другое"},
- {167, 1269, 0, L"Парамарибо"},
- {167, 2414, 0, L"Другое"},
- {168, 1270, 0, L"Порт-оф-Спейн"},
- {168, 2413, 0, L"Другое"},
- {169, 1271, 0, L"Монтевидео"},
- {169, 2412, 0, L"Другое"},
- {170, 1272, 0, L"Сантьяго"},
- {170, 2411, 0, L"Другое"},
- {171, 1273, 0, L"Гуаякиль"},
- {171, 1274, 0, L"Кито"},
- {171, 2410, 0, L"Другое"},
- {172, 1275, 0, L"Кингстон"},
- {172, 2409, 0, L"Другое"},
- {174, 1854, 0, L"Алжир"},
- {174, 2495, 0, L"Другое"},
- {175, 1855, 0, L"Луанда"},
- {175, 2494, 0, L"Другое"},
- {176, 1856, 0, L"Котону"},
- {176, 1857, 0, L"Порто-Ново"},
- {176, 2493, 0, L"Другое"},
- {177, 1858, 0, L"Габороне"},
- {177, 2492, 0, L"Другое"},
- {178, 1859, 0, L"Уагадугу"},
- {178, 2491, 0, L"Другое"},
- {179, 1860, 0, L"Бужумбуру"},
- {179, 2490, 0, L"Другое"},
- {180, 1861, 0, L"Либревиль"},
- {180, 2489, 0, L"Другое"},
- {181, 1862, 0, L"Банжул"},
- {181, 2488, 0, L"Другое"},
- {182, 1863, 0, L"Аккра"},
- {182, 2487, 0, L"Другое"},
- {183, 1864, 0, L"Конакри"},
- {183, 2486, 0, L"Другое"},
- {184, 1865, 0, L"Бисау"},
- {184, 2485, 0, L"Другое"},
- {185, 1866, 0, L"Джибути"},
- {185, 2484, 0, L"Другое"},
- {186, 3312, 0, L"Дахаб"},
- {186, 1867, 0, L"Каир"},
- {186, 1868, 0, L"Хургада"},
- {186, 2483, 0, L"Другое"},
- {187, 1869, 0, L"Лусака"},
- {187, 2482, 0, L"Другое"},
- {23, 1870, 0, L"Хараре"},
- {23, 2481, 0, L"Другое"},
- {188, 1871, 0, L"Прая"},
- {188, 2480, 0, L"Другое"},
- {189, 1872, 0, L"Яунде"},
- {189, 2479, 0, L"Другое"},
- {190, 1873, 0, L"Найроби"},
- {190, 2478, 0, L"Другое"},
- {191, 1874, 0, L"Морони"},
- {191, 2477, 0, L"Другое"},
- {193, 1875, 0, L"Киншаса"},
- {193, 2476, 0, L"Другое"},
- {192, 1876, 0, L"Браззавиль"},
- {192, 2475, 0, L"Другое"},
- {194, 1877, 0, L"Ямусукро"},
- {194, 2474, 0, L"Другое"},
- {195, 1878, 0, L"Масеру"},
- {195, 2473, 0, L"Другое"},
- {196, 1879, 0, L"Монровия"},
- {196, 2472, 0, L"Другое"},
- {197, 1880, 0, L"Триполи"},
- {197, 2471, 0, L"Другое"},
- {198, 1881, 0, L"Порт-Луи"},
- {198, 2470, 0, L"Другое"},
- {199, 1882, 0, L"Нуакшот"},
- {199, 2469, 0, L"Другое"},
- {200, 1883, 0, L"Антананариву"},
- {200, 2468, 0, L"Другое"},
- {201, 1884, 0, L"Лилонгве"},
- {201, 2467, 0, L"Другое"},
- {202, 1885, 0, L"Бамако"},
- {202, 2466, 0, L"Другое"},
- {203, 1886, 0, L"Агадир"},
- {203, 1887, 0, L"Рабат"},
- {203, 2465, 0, L"Другое"},
- {204, 1888, 0, L"Мапуту"},
- {204, 2464, 0, L"Другое"},
- {205, 1889, 0, L"Виндхук"},
- {205, 2463, 0, L"Другое"},
- {206, 1890, 0, L"Ниамей"},
- {206, 2462, 0, L"Другое"},
- {207, 1891, 0, L"Абуджа"},
- {207, 2461, 0, L"Другое"},
- {208, 1892, 0, L"Кигали"},
- {208, 2460, 0, L"Другое"},
- {209, 1893, 0, L"Сан-Томе"},
- {209, 2459, 0, L"Другое"},
- {210, 1894, 0, L"Мбабане"},
- {210, 2458, 0, L"Другое"},
- {211, 1895, 0, L"Виктория"},
- {211, 2457, 0, L"Другое"},
- {212, 1896, 0, L"Дакар"},
- {212, 2456, 0, L"Другое"},
- {213, 1897, 0, L"Могадишо"},
- {213, 2455, 0, L"Другое"},
- {214, 1898, 0, L"Хартум"},
- {214, 2454, 0, L"Другое"},
- {215, 1899, 0, L"Фритаун"},
- {215, 2453, 0, L"Другое"},
- {216, 1900, 0, L"Дар-эс-Салам"},
- {216, 1901, 0, L"Додома"},
- {216, 2452, 0, L"Другое"},
- {217, 1902, 0, L"Ломе"},
- {217, 2451, 0, L"Другое"},
- {218, 1903, 0, L"Тунис"},
- {218, 2450, 0, L"Другое"},
- {219, 1904, 0, L"Кампала"},
- {219, 2449, 0, L"Другое"},
- {220, 1905, 0, L"Банги"},
- {220, 2448, 0, L"Другое"},
- {222, 1906, 0, L"Нджамена"},
- {222, 2447, 0, L"Другое"},
- {223, 1907, 0, L"Малабо"},
- {223, 2446, 0, L"Другое"},
- {221, 1908, 0, L"Асмэра"},
- {221, 2445, 0, L"Другое"},
- {224, 1909, 0, L"Аддис-Абеба"},
- {224, 2444, 0, L"Другое"},
- {225, 1910, 0, L"Дурбан"},
- {225, 1913, 0, L"Йоханнесбург"},
- {225, 1912, 0, L"Кейптаун"},
- {225, 3033, 0, L"Пайнтаун"},
- {225, 1911, 0, L"Претория"},
- {225, 2443, 0, L"Другое"},
- {39, 314, 0, L"Киев"},
- {39, 315, 0, L"Винницкая обл."},
- {39, 316, 0, L"Волынская обл."},
- {39, 317, 0, L"Днепропетровская обл."},
- {39, 318, 0, L"Донецкая обл."},
- {39, 319, 0, L"Житомирская обл."},
- {39, 320, 0, L"Закарпатская обл."},
- {39, 321, 0, L"Запорожская обл."},
- {39, 322, 0, L"Ивано-Франковская обл."},
- {39, 323, 0, L"Киевская обл."},
- {39, 324, 0, L"Кировоградская обл."},
- {39, 325, 0, L"Крым"},
- {39, 326, 0, L"Луганская обл."},
- {39, 327, 0, L"Львовская обл."},
- {39, 328, 0, L"Николаевская обл."},
- {39, 329, 0, L"Одесская обл."},
- {39, 330, 0, L"Полтавская обл."},
- {39, 331, 0, L"Ровенская обл."},
- {39, 332, 0, L"Сумская обл."},
- {39, 333, 0, L"Тернопольская обл."},
- {39, 334, 0, L"Харьковская обл."},
- {39, 335, 0, L"Херсонская обл."},
- {39, 336, 0, L"Хмельницкая обл."},
- {39, 337, 0, L"Черкасская обл."},
- {39, 338, 0, L"Черниговская обл."},
- {39, 339, 0, L"Черновицкая обл."},
- {40, 602, 0, L"Бад Халл"},
- {40, 604, 0, L"Брегенц"},
- {40, 603, 0, L"Вена"},
- {40, 608, 0, L"Грац"},
- {40, 606, 0, L"Зальцбург"},
- {40, 3099, 0, L"Зель-ам-Зее"},
- {40, 605, 0, L"Инсбрук"},
- {40, 3174, 0, L"Кирхберг"},
- {40, 609, 0, L"Клагенфурт"},
- {40, 607, 0, L"Линц"},
- {40, 610, 0, L"Обдах"},
- {40, 611, 0, L"Щтубайтал"},
- {40, 2541, 0, L"Другое"},
- {32, 612, 0, L"Тирана"},
- {32, 2540, 0, L"Другое"},
- {33, 613, 0, L"Андорра-ла-Велья"},
- {33, 2539, 0, L"Другое"},
- {340, 341, 0, L"Минск"},
- {340, 342, 0, L"Брестская обл."},
- {340, 343, 0, L"Витебская обл."},
- {340, 344, 0, L"Гомельская обл."},
- {340, 345, 0, L"Гродненская обл."},
- {340, 346, 0, L"Минская обл."},
- {340, 347, 0, L"Могилевская обл."},
- {38, 760, 0, L"Антверпен"},
- {38, 767, 0, L"Арлон"},
- {38, 762, 0, L"Брюгге"},
- {38, 761, 0, L"Брюссель"},
- {38, 763, 0, L"Гент"},
- {38, 769, 0, L"Лувен"},
- {38, 765, 0, L"Льеж"},
- {38, 764, 0, L"Монс"},
- {38, 3117, 0, L"Мортсель"},
- {38, 766, 0, L"Намюр"},
- {38, 768, 0, L"Хасселт"},
- {38, 2532, 0, L"Другое"},
- {41, 3098, 0, L"Банско"},
- {41, 792, 0, L"Благоевград"},
- {41, 770, 0, L"Бургас"},
- {41, 771, 0, L"Бяла"},
- {41, 773, 0, L"Варна"},
- {41, 776, 0, L"Велико-Тырново"},
- {41, 788, 0, L"Видин"},
- {41, 789, 0, L"Враца"},
- {41, 796, 0, L"Габрово"},
- {41, 777, 0, L"Димитровград"},
- {41, 781, 0, L"Каварна"},
- {41, 786, 0, L"Кырджали"},
- {41, 791, 0, L"Кюстендил"},
- {41, 793, 0, L"Лазарджик"},
- {41, 795, 0, L"Ловеч"},
- {41, 787, 0, L"Михайловград"},
- {41, 790, 0, L"Перник"},
- {41, 3133, 0, L"Пирдоп"},
- {41, 794, 0, L"Плевен"},
- {41, 782, 0, L"Пловдив"},
- {41, 780, 0, L"Разград"},
- {41, 779, 0, L"Русе"},
- {41, 774, 0, L"Силистра"},
- {41, 784, 0, L"Сливен"},
- {41, 772, 0, L"София"},
- {41, 775, 0, L"Толбухин"},
- {41, 3116, 0, L"Тырново"},
- {41, 785, 0, L"Хасково"},
- {41, 778, 0, L"Шумен"},
- {41, 783, 0, L"Ямбол"},
- {41, 2531, 0, L"Другое"},
- {42, 797, 0, L"Баня-Лука"},
- {42, 799, 0, L"Зеница"},
- {42, 798, 0, L"Сараево"},
- {42, 800, 0, L"Тузла"},
- {42, 2530, 0, L"Другое"},
- {45, 802, 0, L"Абердин"},
- {45, 3075, 0, L"Айслворт"},
- {45, 801, 0, L"Алнвик"},
- {45, 804, 0, L"Бидефорд"},
- {45, 803, 0, L"Бирмингем"},
- {45, 805, 0, L"Блоксвич"},
- {45, 3168, 0, L"Бостон"},
- {45, 806, 0, L"Брайтон"},
- {45, 807, 0, L"Бредфорд"},
- {45, 808, 0, L"Бристоль"},
- {45, 809, 0, L"Вилленхолл"},
- {45, 3131, 0, L"Воррингтон"},
- {45, 810, 0, L"Вудбридж"},
- {45, 3342, 0, L"Гилфорд"},
- {45, 811, 0, L"Глазго"},
- {45, 812, 0, L"Дадли"},
- {45, 813, 0, L"Дарем"},
- {45, 814, 0, L"Дуглас"},
- {45, 3089, 0, L"Кардиф"},
- {45, 815, 0, L"Кембридж"},
- {45, 816, 0, L"Кентербери"},
- {45, 817, 0, L"Ливерпуль"},
- {45, 818, 0, L"Лидс"},
- {45, 819, 0, L"Лондон"},
- {45, 820, 0, L"Манчестер"},
- {45, 2976, 0, L"Митчем"},
- {45, 2988, 0, L"Мэйденхед"},
- {45, 821, 0, L"Ноттингем"},
- {45, 3088, 0, L"Ньюпорт"},
- {45, 822, 0, L"Оксфорд"},
- {45, 823, 0, L"Плимут"},
- {45, 824, 0, L"Портсмут"},
- {45, 825, 0, L"Престон"},
- {45, 3343, 0, L"Райд"},
- {45, 2867, 0, L"Ридинг"},
- {45, 2986, 0, L"Сент-Албанс"},
- {45, 826, 0, L"Стаффорд"},
- {45, 3063, 0, L"Стокпорт"},
- {45, 827, 0, L"Уэймут"},
- {45, 3140, 0, L"Челтенхэм"},
- {45, 828, 0, L"Честер"},
- {45, 829, 0, L"Шеффилд"},
- {45, 830, 0, L"Эдинбург"},
- {45, 2529, 0, L"Другое"},
- {44, 831, 0, L"Будапешт"},
- {44, 832, 0, L"Геделле"},
- {44, 836, 0, L"Дебрецен"},
- {44, 835, 0, L"Мишкольц"},
- {44, 834, 0, L"Сегед"},
- {44, 833, 0, L"Шиофок"},
- {44, 2528, 0, L"Другое"},
- {46, 3007, 0, L"Аахен"},
- {46, 837, 0, L"Аугсбург"},
- {46, 838, 0, L"Баден-Баден"},
- {46, 3371, 0, L"Бамберг"},
- {46, 839, 0, L"Бергиш-Гладбах"},
- {46, 840, 0, L"Берлин"},
- {46, 841, 0, L"Билефельд"},
- {46, 3163, 0, L"Бовенден"},
- {46, 842, 0, L"Бонн"},
- {46, 843, 0, L"Браденбург"},
- {46, 3015, 0, L"Брауншвейг"},
- {46, 844, 0, L"Бремен"},
- {46, 2921, 0, L"Варштайн"},
- {46, 845, 0, L"Веймар"},
- {46, 846, 0, L"Вупперталь"},
- {46, 847, 0, L"Гамбург"},
- {46, 848, 0, L"Ганновер"},
- {46, 849, 0, L"Гарделеген"},
- {46, 3010, 0, L"Гейдельберг"},
- {46, 850, 0, L"Гота"},
- {46, 851, 0, L"Дармштадт"},
- {46, 3072, 0, L"Дессау"},
- {46, 852, 0, L"Детмольд"},
- {46, 853, 0, L"Дортмунд"},
- {46, 854, 0, L"Дрезден"},
- {46, 855, 0, L"Дюссельдорф"},
- {46, 3082, 0, L"Иффецхайм"},
- {46, 3309, 0, L"Кассел"},
- {46, 856, 0, L"Кельн"},
- {46, 857, 0, L"Киль"},
- {46, 3138, 0, L"Кобленц"},
- {46, 858, 0, L"Крефельд"},
- {46, 859, 0, L"Лейпциг"},
- {46, 2872, 0, L"Лимбург"},
- {46, 2965, 0, L"Линген"},
- {46, 3135, 0, L"Любек"},
- {46, 3156, 0, L"Мангейм"},
- {46, 3192, 0, L"Меерсбург"},
- {46, 860, 0, L"Мюнстер"},
- {46, 861, 0, L"Мюнхен"},
- {46, 2864, 0, L"Нойштадт"},
- {46, 862, 0, L"Нюрнберг"},
- {46, 3009, 0, L"Оффенбург"},
- {46, 2993, 0, L"Падерборн"},
- {46, 863, 0, L"Равенсбург"},
- {46, 864, 0, L"Регенсбург"},
- {46, 865, 0, L"Рейнен"},
- {46, 866, 0, L"Росток"},
- {46, 3191, 0, L"Саарбрюкен"},
- {46, 2974, 0, L"Санкт-Августин"},
- {46, 3127, 0, L"Тюринген"},
- {46, 867, 0, L"Фрайберг"},
- {46, 868, 0, L"Фрайбург"},
- {46, 869, 0, L"Франкфурт-на-Майне"},
- {46, 3373, 0, L"Хемнитц"},
- {46, 3313, 0, L"Хильден"},
- {46, 870, 0, L"Штутгарт"},
- {46, 3045, 0, L"Эрланген"},
- {46, 2906, 0, L"Эшборн"},
- {46, 2527, 0, L"Другое"},
- {48, 871, 0, L"Афины"},
- {48, 873, 0, L"Ираклион"},
- {48, 3147, 0, L"Корфу"},
- {48, 872, 0, L"Салоники"},
- {48, 3178, 0, L"Халкидики"},
- {48, 2526, 0, L"Другое"},
- {49, 3006, 0, L"Архус"},
- {49, 874, 0, L"Копенгаген"},
- {49, 875, 0, L"Оденсе"},
- {49, 3285, 0, L"Ольборг"},
- {49, 876, 0, L"Сванеке"},
- {49, 3126, 0, L"Скиве"},
- {49, 2525, 0, L"Другое"},
- {50, 3377, 0, L"Виклоу"},
- {50, 3067, 0, L"Голвей"},
- {50, 877, 0, L"Дублин"},
- {50, 3065, 0, L"Килларней"},
- {50, 3066, 0, L"Корк"},
- {50, 878, 0, L"Лимерик"},
- {50, 3069, 0, L"Нейс"},
- {50, 3068, 0, L"Типперэри"},
- {50, 2524, 0, L"Другое"},
- {51, 879, 0, L"Рейкьявик"},
- {51, 2523, 0, L"Другое"},
- {34, 880, 0, L"Аликанте"},
- {34, 3125, 0, L"Альмерия"},
- {34, 881, 0, L"Барселона"},
- {34, 890, 0, L"Бильбао"},
- {34, 3076, 0, L"Бланес"},
- {34, 882, 0, L"Валенсия"},
- {34, 3070, 0, L"Ибица"},
- {34, 888, 0, L"Кадис"},
- {34, 886, 0, L"Картахена"},
- {34, 891, 0, L"Ла-Корунья"},
- {34, 3310, 0, L"Лорет де Мар"},
- {34, 883, 0, L"Мадрид"},
- {34, 884, 0, L"Малага"},
- {34, 885, 0, L"Марбелья"},
- {34, 892, 0, L"Овьедо"},
- {34, 3179, 0, L"Пальма де Майорка"},
- {34, 3177, 0, L"Сан-Агустин"},
- {34, 3289, 0, L"Санта-Крус-де-Тенерифе"},
- {34, 889, 0, L"Сарагоса"},
- {34, 887, 0, L"Севилья"},
- {34, 893, 0, L"Хихон"},
- {34, 2522, 0, L"Другое"},
- {52, 3318, 0, L"Аоста"},
- {52, 3278, 0, L"Беллариа"},
- {52, 906, 0, L"Болонья"},
- {52, 894, 0, L"Брешиа"},
- {52, 895, 0, L"Венеция"},
- {52, 905, 0, L"Верона"},
- {52, 896, 0, L"Генуя"},
- {52, 897, 0, L"Лекко"},
- {52, 3369, 0, L"Ливорно"},
- {52, 3327, 0, L"Марсала"},
- {52, 898, 0, L"Милан"},
- {52, 899, 0, L"Модена"},
- {52, 907, 0, L"Неаполь"},
- {52, 908, 0, L"Перуджа"},
- {52, 900, 0, L"Пиза"},
- {52, 901, 0, L"Рим"},
- {52, 3368, 0, L"Сан-Ремо"},
- {52, 3384, 0, L"Сиракуза"},
- {52, 3252, 0, L"Терамо"},
- {52, 902, 0, L"Триест"},
- {52, 903, 0, L"Турин"},
- {52, 3130, 0, L"Фано"},
- {52, 904, 0, L"Флоренция"},
- {52, 2521, 0, L"Другое"},
- {53, 2939, 0, L"Айзкраукле"},
- {53, 3054, 0, L"Валка"},
- {53, 909, 0, L"Даугавпилс"},
- {53, 2934, 0, L"Екабпилс"},
- {53, 913, 0, L"Елгава"},
- {53, 2935, 0, L"Кокнесе"},
- {53, 912, 0, L"Лиепая"},
- {53, 2905, 0, L"Резекне"},
- {53, 911, 0, L"Рига"},
- {53, 2936, 0, L"Саласпилс"},
- {53, 2937, 0, L"Смилтене"},
- {53, 910, 0, L"Юрмала"},
- {53, 2520, 0, L"Другое"},
- {54, 914, 0, L"Вильнюс"},
- {54, 915, 0, L"Висагинас"},
- {54, 916, 0, L"Каунас"},
- {54, 918, 0, L"Клайпеда"},
- {54, 919, 0, L"Паланга"},
- {54, 3173, 0, L"Пеневежис"},
- {54, 917, 0, L"Шауляй"},
- {54, 2519, 0, L"Другое"},
- {55, 920, 0, L"Вадуц"},
- {55, 2518, 0, L"Другое"},
- {56, 3376, 0, L"Бетцдорф"},
- {56, 921, 0, L"Люксембург"},
- {56, 2517, 0, L"Другое"},
- {57, 3142, 0, L"Битола"},
- {57, 922, 0, L"Скопье"},
- {57, 2516, 0, L"Другое"},
- {58, 923, 0, L"Валлетта"},
- {58, 3154, 0, L"Мзида"},
- {58, 924, 0, L"Слима"},
- {58, 2515, 0, L"Другое"},
- {59, 925, 0, L"Бельцы"},
- {59, 926, 0, L"Бендеры"},
- {59, 3234, 0, L"Дубоссары"},
- {59, 3275, 0, L"Кахул"},
- {59, 927, 0, L"Кишинев"},
- {59, 3321, 0, L"Резина"},
- {59, 928, 0, L"Рыбница"},
- {59, 929, 0, L"Тирасполь"},
- {59, 3281, 0, L"Чадыр-Лунга"},
- {59, 2514, 0, L"Другое"},
- {36, 930, 0, L"Монте-Карло"},
- {36, 2513, 0, L"Другое"},
- {60, 931, 0, L"Амстердам"},
- {60, 933, 0, L"Бреда"},
- {60, 932, 0, L"Гаага"},
- {60, 934, 0, L"Гауда"},
- {60, 935, 0, L"Делфт"},
- {60, 2977, 0, L"Донген"},
- {60, 3030, 0, L"Зволле"},
- {60, 3091, 0, L"Ниймеген"},
- {60, 936, 0, L"Роттердам"},
- {60, 937, 0, L"Утрехт"},
- {60, 3044, 0, L"Эйндховен"},
- {60, 3380, 0, L"Эншеде"},
- {60, 2512, 0, L"Другое"},
- {61, 3190, 0, L"Кристиансанд"},
- {61, 2857, 0, L"Лиллехаммер"},
- {61, 938, 0, L"Осло"},
- {61, 3355, 0, L"Ставангер"},
- {61, 939, 0, L"Тронхейм"},
- {61, 2511, 0, L"Другое"},
- {62, 940, 0, L"Белосток"},
- {62, 941, 0, L"Варшава"},
- {62, 3164, 0, L"Вроцлав"},
- {62, 942, 0, L"Гданьск"},
- {62, 943, 0, L"Гливице"},
- {62, 3237, 0, L"Закопане"},
- {62, 3165, 0, L"Зелена Гура"},
- {62, 944, 0, L"Катовице"},
- {62, 945, 0, L"Краков"},
- {62, 3008, 0, L"Лодзь"},
- {62, 3150, 0, L"Ольштын"},
- {62, 946, 0, L"Познань"},
- {62, 947, 0, L"Радом"},
- {62, 948, 0, L"Сопот"},
- {62, 2958, 0, L"Тыхы"},
- {62, 2510, 0, L"Другое"},
- {35, 949, 0, L"Лиссабон"},
- {35, 950, 0, L"Порто"},
- {35, 2509, 0, L"Другое"},
- {63, 952, 0, L"Брашов"},
- {63, 951, 0, L"Бухарест"},
- {63, 954, 0, L"Констанца"},
- {63, 955, 0, L"Плоешти"},
- {63, 953, 0, L"Яссы"},
- {63, 2508, 0, L"Другое"},
- {64, 956, 0, L"Сан-Марино"},
- {64, 2507, 0, L"Другое"},
- {74, 957, 0, L"Белград"},
- {74, 960, 0, L"Ниш"},
- {74, 958, 0, L"Нови-Сад"},
- {74, 959, 0, L"Сараево"},
- {74, 2506, 0, L"Другое"},
- {65, 961, 0, L"Братислава"},
- {65, 962, 0, L"Кошице"},
- {65, 3101, 0, L"Липтов"},
- {65, 963, 0, L"Попрад"},
- {65, 964, 0, L"Прешов"},
- {65, 965, 0, L"Ружемберок"},
- {65, 966, 0, L"Тврдошин"},
- {65, 2505, 0, L"Другое"},
- {66, 968, 0, L"Копар"},
- {66, 967, 0, L"Любляна"},
- {66, 969, 0, L"Марибор"},
- {66, 2504, 0, L"Другое"},
- {67, 970, 0, L"Торсхавн"},
- {67, 2503, 0, L"Другое"},
- {68, 2888, 0, L"Вантаа"},
- {68, 971, 0, L"Васа"},
- {68, 979, 0, L"Котка"},
- {68, 972, 0, L"Коувола"},
- {68, 980, 0, L"Лахти"},
- {68, 973, 0, L"Оулу"},
- {68, 3375, 0, L"Риихимяки"},
- {68, 3159, 0, L"Руовеси"},
- {68, 974, 0, L"Тампере"},
- {68, 975, 0, L"Турку"},
- {68, 976, 0, L"Хельсинки"},
- {68, 977, 0, L"Эспо"},
- {68, 978, 0, L"Ювяскюля"},
- {68, 2502, 0, L"Другое"},
- {37, 996, 0, L"Авиньон"},
- {37, 983, 0, L"Бержерак"},
- {37, 997, 0, L"Блуа"},
- {37, 984, 0, L"Бордо"},
- {37, 998, 0, L"Дижон"},
- {37, 987, 0, L"Канн"},
- {37, 988, 0, L"Кастр"},
- {37, 993, 0, L"Клермон-Ферран"},
- {37, 3037, 0, L"Лилль"},
- {37, 989, 0, L"Лион"},
- {37, 985, 0, L"Марсель"},
- {37, 991, 0, L"Мец"},
- {37, 3161, 0, L"Мобеж"},
- {37, 990, 0, L"Нанси"},
- {37, 994, 0, L"Нант"},
- {37, 995, 0, L"Ницца"},
- {37, 999, 0, L"Орлеан"},
- {37, 981, 0, L"Париж"},
- {37, 3374, 0, L"Перпиньян"},
- {37, 992, 0, L"Руан"},
- {37, 982, 0, L"Страсбург"},
- {37, 986, 0, L"Тулуза"},
- {37, 3314, 0, L"Шамбери"},
- {37, 2501, 0, L"Другое"},
- {69, 1003, 0, L"Дубровник"},
- {69, 1000, 0, L"Загреб"},
- {69, 1001, 0, L"Задар"},
- {69, 1004, 0, L"Риека"},
- {69, 1002, 0, L"Сплит"},
- {69, 2500, 0, L"Другое"},
- {70, 1005, 0, L"Брно"},
- {70, 3291, 0, L"Гавличкув-Брод"},
- {70, 1007, 0, L"Градец-Кралове"},
- {70, 1008, 0, L"Карлови-Вари"},
- {70, 3019, 0, L"Кладрубы"},
- {70, 1010, 0, L"Лоуни"},
- {70, 1009, 0, L"Острава"},
- {70, 1015, 0, L"Пльзень"},
- {70, 3105, 0, L"Правчицка Брана"},
- {70, 1006, 0, L"Прага"},
- {70, 3246, 0, L"Тачов"},
- {70, 1011, 0, L"Тршебич"},
- {70, 1012, 0, L"Усти-над-Лабем"},
- {70, 1014, 0, L"Ческе-Будеевице"},
- {70, 1013, 0, L"Яблонец-над-Нисоу"},
- {70, 2499, 0, L"Другое"},
- {71, 1016, 0, L"Арау"},
- {71, 1019, 0, L"Баден"},
- {71, 1017, 0, L"Базель"},
- {71, 1018, 0, L"Берн"},
- {71, 1020, 0, L"Биль"},
- {71, 1021, 0, L"Винтертур"},
- {71, 1022, 0, L"Давос"},
- {71, 3189, 0, L"Делемонт"},
- {71, 1023, 0, L"Женева"},
- {71, 1024, 0, L"Золотурн"},
- {71, 1025, 0, L"Лозанна"},
- {71, 1026, 0, L"Локарно"},
- {71, 1027, 0, L"Лугано"},
- {71, 1028, 0, L"Люцерн"},
- {71, 1029, 0, L"Монтре"},
- {71, 1030, 0, L"Цюрих"},
- {71, 2498, 0, L"Другое"},
- {72, 2883, 0, L"Арбога"},
- {72, 1031, 0, L"Гетеборг"},
- {72, 1032, 0, L"Кальмар"},
- {72, 1037, 0, L"Лахольм"},
- {72, 1036, 0, L"Лулео"},
- {72, 1042, 0, L"Лунд"},
- {72, 1033, 0, L"Мальме"},
- {72, 1034, 0, L"Стокгольм"},
- {72, 1041, 0, L"Умео"},
- {72, 1039, 0, L"Фалун"},
- {72, 1043, 0, L"Хельсинборг"},
- {72, 1040, 0, L"Хернесанд"},
- {72, 1038, 0, L"Эстерсунд"},
- {72, 2497, 0, L"Другое"},
- {73, 3013, 0, L"Валга"},
- {73, 1044, 0, L"Кейла"},
- {73, 1045, 0, L"Кохтла-Ярве"},
- {73, 1046, 0, L"Маарду"},
- {73, 1047, 0, L"Мыйзакюла"},
- {73, 1048, 0, L"Нарва"},
- {73, 1049, 0, L"Пярну"},
- {73, 1050, 0, L"Раквере"},
- {73, 1051, 0, L"Силламяэ"},
- {73, 1052, 0, L"Таллин"},
- {73, 1053, 0, L"Тарту"},
- {73, 1054, 0, L"Хаапсалу"},
- {24, 233, 474, L"Алдан"},
- {24, 233, 2809, L"Верхоянск"},
- {24, 233, 2804, L"Вилюйск"},
- {24, 233, 475, L"Ленск"},
- {24, 233, 477, L"Мирный"},
- {24, 233, 476, L"Нерюнгри"},
- {24, 233, 2806, L"Олекминск"},
- {24, 233, 3115, L"Покровск"},
- {24, 233, 2808, L"Среднеколымск"},
- {24, 233, 2807, L"Томмот"},
- {24, 233, 2805, L"Удачный"},
- {24, 233, 478, L"Усть-Нера"},
- {24, 233, 479, L"Якутск"},
- {24, 233, 2263, L"Другое"},
- {24, 232, 2819, L"Арсеньев"},
- {24, 232, 464, L"Артем"},
- {24, 232, 465, L"Большой Камень"},
- {24, 232, 466, L"Владивосток"},
- {24, 232, 2817, L"Дальнегорск"},
- {24, 232, 2818, L"Дальнереченск"},
- {24, 232, 3359, L"Кавалерово"},
- {24, 232, 467, L"Камень-Рыболов"},
- {24, 232, 468, L"Лесозаводск"},
- {24, 232, 469, L"Лучегорск"},
- {24, 232, 470, L"Находка"},
- {24, 232, 471, L"Партизанск"},
- {24, 232, 472, L"Пластун"},
- {24, 232, 2816, L"Спасск-Дальний"},
- {24, 232, 473, L"Уссурийск"},
- {24, 232, 2258, L"Другое"},
- {24, 235, 487, L"Амурск"},
- {24, 235, 2821, L"Бикин"},
- {24, 235, 488, L"Ванино"},
- {24, 235, 2820, L"Вяземский"},
- {24, 235, 489, L"Комсомольск-на-Амуре"},
- {24, 235, 490, L"Николаевск-на-Амуре"},
- {24, 235, 491, L"Советская Гавань"},
- {24, 235, 3353, L"Солнечный"},
- {24, 235, 492, L"Хабаровск"},
- {24, 235, 2280, L"Другое"},
- {24, 227, 455, L"Белогорск"},
- {24, 227, 456, L"Благовещенск"},
- {24, 227, 2814, L"Завитинск"},
- {24, 227, 2813, L"Зея"},
- {24, 227, 2815, L"Райчихинск"},
- {24, 227, 2812, L"Свободный"},
- {24, 227, 2811, L"Сковородино"},
- {24, 227, 457, L"Тында"},
- {24, 227, 2217, L"Шимановск"},
- {24, 227, 2218, L"Другое"},
- {24, 229, 460, L"Елизово"},
- {24, 229, 2822, L"Ключи"},
- {24, 229, 459, L"Петропавловск-Камч."},
- {24, 229, 2234, L"Другое"},
- {24, 231, 462, L"Магадан"},
- {24, 231, 2823, L"Сусуман"},
- {24, 231, 463, L"Ягодное"},
- {24, 231, 2246, L"Другое"},
- {24, 234, 480, L"Александровск-Сахалинский"},
- {24, 234, 2829, L"Анива"},
- {24, 234, 2833, L"Горнозаводск"},
- {24, 234, 2825, L"Долинск"},
- {24, 234, 481, L"Корсаков"},
- {24, 234, 482, L"Красногорск"},
- {24, 234, 2826, L"Курильск"},
- {24, 234, 2832, L"Лесогорск"},
- {24, 234, 2836, L"Макаров"},
- {24, 234, 2830, L"Невельск"},
- {24, 234, 483, L"Оха"},
- {24, 234, 2828, L"Поронайск"},
- {24, 234, 2824, L"Северо-Курильск"},
- {24, 234, 2827, L"Томари"},
- {24, 234, 2831, L"Углегорск"},
- {24, 234, 484, L"Холмск"},
- {24, 234, 2834, L"Чехов"},
- {24, 234, 2835, L"Шахтерск"},
- {24, 234, 485, L"Южно-Курильск"},
- {24, 234, 486, L"Южно-Сахалинск"},
- {24, 234, 2264, L"Другое"},
- {24, 228, 458, L"Биробиджан"},
- {24, 228, 2810, L"Облучье"},
- {24, 228, 2226, L"Другое"},
- {24, 230, 461, L"Полана"},
- {24, 230, 2239, L"Другое"},
- {24, 236, 493, L"Анадырь"},
- {24, 236, 2287, L"Другое"},
- {24, 237, 2850, L"Агидель"},
- {24, 237, 2851, L"Агидель"},
- {24, 237, 2657, L"Баймак"},
- {24, 237, 2662, L"Белебей"},
- {24, 237, 494, L"Белорецк"},
- {24, 237, 2658, L"Бирск"},
- {24, 237, 2660, L"Благовещенск"},
- {24, 237, 2659, L"Давлеканово"},
- {24, 237, 2663, L"Дюртюли"},
- {24, 237, 495, L"Ишимбай"},
- {24, 237, 496, L"Кумертау"},
- {24, 237, 2655, L"Мелеуз"},
- {24, 237, 497, L"Нефтекамск"},
- {24, 237, 2654, L"Октябрьский"},
- {24, 237, 499, L"Салават"},
- {24, 237, 2656, L"Сибай"},
- {24, 237, 498, L"Стерлитамак"},
- {24, 237, 500, L"Туймазы"},
- {24, 237, 2661, L"Туймазы"},
- {24, 237, 501, L"Уфа"},
- {24, 237, 502, L"Учалы"},
- {24, 237, 2664, L"Янаул"},
- {24, 237, 2220, L"Другое"},
- {24, 240, 509, L"Волжск"},
- {24, 240, 510, L"Звенигово"},
- {24, 240, 511, L"Йошкар-Ола"},
- {24, 240, 512, L"Козьмодемьянск"},
- {24, 240, 2247, L"Другое"},
- {24, 241, 513, L"Зубова Поляна"},
- {24, 241, 2147, L"Инсар"},
- {24, 241, 2150, L"Ковылкино"},
- {24, 241, 2148, L"Краснослободск"},
- {24, 241, 2910, L"Лямбирь"},
- {24, 241, 515, L"Рузаевка"},
- {24, 241, 514, L"Саранск"},
- {24, 241, 2149, L"Темников"},
- {24, 241, 2923, L"Чамзинка"},
- {24, 241, 2248, L"Другое"},
- {24, 248, 2569, L"Агрыз"},
- {24, 248, 2575, L"Азнакаево"},
- {24, 248, 569, L"Альметьевск"},
- {24, 248, 570, L"Апастово"},
- {24, 248, 2571, L"Болгар"},
- {24, 248, 571, L"Бугульма"},
- {24, 248, 2570, L"Буинск"},
- {24, 248, 572, L"Джалиль"},
- {24, 248, 573, L"Елабуга"},
- {24, 248, 2576, L"Заинск"},
- {24, 248, 574, L"Зеленодольск"},
- {24, 248, 575, L"Казань"},
- {24, 248, 2577, L"Лениногорск"},
- {24, 248, 2572, L"Мамадыш"},
- {24, 248, 576, L"Менделеевск"},
- {24, 248, 2573, L"Мензелинск"},
- {24, 248, 577, L"Набережные Челны"},
- {24, 248, 578, L"Нижнекамск"},
- {24, 248, 579, L"Нурлат"},
- {24, 248, 2574, L"Тетюши"},
- {24, 248, 580, L"Чистополь"},
- {24, 248, 2271, L"Другое"},
- {24, 249, 3311, L"Вавож"},
- {24, 249, 581, L"Воткинск"},
- {24, 249, 582, L"Глазов"},
- {24, 249, 583, L"Игра"},
- {24, 249, 584, L"Ижевск"},
- {24, 249, 2665, L"Камбарка"},
- {24, 249, 585, L"Можга"},
- {24, 249, 586, L"Сарапул"},
- {24, 249, 587, L"Ува"},
- {24, 249, 2277, L"Другое"},
- {24, 251, 2158, L"Алатырь"},
- {24, 251, 2156, L"Канаш"},
- {24, 251, 2151, L"Козловка"},
- {24, 251, 2152, L"Марьинский Посад"},
- {24, 251, 2155, L"Новочебоксарск"},
- {24, 251, 2153, L"Цивильск"},
- {24, 251, 592, L"Чебоксары"},
- {24, 251, 2157, L"Шумерля"},
- {24, 251, 2154, L"Ядрин"},
- {24, 251, 2286, L"Другое"},
- {24, 238, 2168, L"Белая Холуница"},
- {24, 238, 503, L"Вятские Поляны"},
- {24, 238, 2164, L"Зуевка"},
- {24, 238, 504, L"Киров"},
- {24, 238, 505, L"Кирово-Чепецк"},
- {24, 238, 2160, L"Кирс"},
- {24, 238, 506, L"Котельнич"},
- {24, 238, 2167, L"Луза"},
- {24, 238, 2159, L"Малмыж"},
- {24, 238, 2169, L"Мураши"},
- {24, 238, 2163, L"Нолинск"},
- {24, 238, 2170, L"Омутнинск"},
- {24, 238, 2166, L"Слободской"},
- {24, 238, 2165, L"Советск"},
- {24, 238, 2162, L"Сосновка"},
- {24, 238, 2171, L"Уржум"},
- {24, 238, 2161, L"Халтурин"},
- {24, 238, 507, L"Яранск"},
- {24, 238, 2237, L"Другое"},
- {24, 242, 516, L"Арзамас"},
- {24, 242, 517, L"Балахна"},
- {24, 242, 2139, L"Богородск"},
- {24, 242, 518, L"Бор"},
- {24, 242, 519, L"Вахтан"},
- {24, 242, 520, L"Ветлуга"},
- {24, 242, 2140, L"Володарск"},
- {24, 242, 2138, L"Ворсма"},
- {24, 242, 521, L"Выкса"},
- {24, 242, 2137, L"Горбатов"},
- {24, 242, 522, L"Городец"},
- {24, 242, 523, L"Дзержинск"},
- {24, 242, 524, L"Заволжье"},
- {24, 242, 2891, L"Ильиногорск"},
- {24, 242, 525, L"Кстово"},
- {24, 242, 2145, L"Кулебаки"},
- {24, 242, 2143, L"Лукоянов"},
- {24, 242, 2144, L"Лысково"},
- {24, 242, 2146, L"Навашино"},
- {24, 242, 526, L"Нижний Новгород"},
- {24, 242, 527, L"Павлово"},
- {24, 242, 2135, L"Первомайск"},
- {24, 242, 528, L"Саров"},
- {24, 242, 529, L"Семенов"},
- {24, 242, 530, L"Сергач"},
- {24, 242, 2141, L"Урень"},
- {24, 242, 2136, L"Чкаловск"},
- {24, 242, 2897, L"Шатки"},
- {24, 242, 2142, L"Шахунья"},
- {24, 242, 2251, L"Другое"},
- {24, 243, 2678, L"Абдулино"},
- {24, 243, 2673, L"Бугуруслан"},
- {24, 243, 531, L"Бузулук"},
- {24, 243, 532, L"Гай"},
- {24, 243, 2674, L"Кувандык"},
- {24, 243, 2675, L"Медногорск"},
- {24, 243, 533, L"Новотроицк"},
- {24, 243, 535, L"Оренбург"},
- {24, 243, 536, L"Орск"},
- {24, 243, 3360, L"Саракташ"},
- {24, 243, 2677, L"Соль-Илецк"},
- {24, 243, 2676, L"Сорочинск"},
- {24, 243, 537, L"Тоцкое"},
- {24, 243, 538, L"Ясный"},
- {24, 243, 2254, L"Другое"},
- {24, 244, 539, L"Беднодемьяновск"},
- {24, 244, 2597, L"Белинский"},
- {24, 244, 2595, L"Городище"},
- {24, 244, 2593, L"Каменка"},
- {24, 244, 540, L"Кузнецк"},
- {24, 244, 2598, L"Нижний Ломов"},
- {24, 244, 2592, L"Никольск"},
- {24, 244, 541, L"Пенза"},
- {24, 244, 3304, L"Русский Камешкир"},
- {24, 244, 2596, L"Сердобск"},
- {24, 244, 2594, L"Сурск"},
- {24, 244, 2256, L"Другое"},
- {24, 245, 2690, L"Александровск"},
- {24, 245, 542, L"Березники"},
- {24, 245, 2679, L"Верещагино"},
- {24, 245, 2680, L"Горнозаводск"},
- {24, 245, 2687, L"Гремячинск"},
- {24, 245, 2686, L"Губаха"},
- {24, 245, 543, L"Добрянка"},
- {24, 245, 544, L"Кизел"},
- {24, 245, 2681, L"Красновишерск"},
- {24, 245, 545, L"Краснокамск"},
- {24, 245, 546, L"Кунгур"},
- {24, 245, 547, L"Лысьва"},
- {24, 245, 548, L"Нытва"},
- {24, 245, 2683, L"Оса"},
- {24, 245, 2684, L"Оханск"},
- {24, 245, 2682, L"Очер"},
- {24, 245, 549, L"Пермь"},
- {24, 245, 550, L"Соликамск"},
- {24, 245, 2685, L"Усолье"},
- {24, 245, 551, L"Чайковский"},
- {24, 245, 2689, L"Чердынь"},
- {24, 245, 2688, L"Чермоз"},
- {24, 245, 552, L"Чернушка"},
- {24, 245, 553, L"Чусовой"},
- {24, 245, 2257, L"Другое"},
- {24, 246, 554, L"Волжский"},
- {24, 246, 555, L"Жигулевск"},
- {24, 246, 2599, L"Кинель"},
- {24, 246, 3293, L"Красный Яр"},
- {24, 246, 2602, L"Нефтегорск"},
- {24, 246, 556, L"Новокуйбышевск"},
- {24, 246, 2600, L"Октябрьск"},
- {24, 246, 557, L"Отрадный"},
- {24, 246, 558, L"Похвистнево"},
- {24, 246, 559, L"Самара"},
- {24, 246, 560, L"Сызрань"},
- {24, 246, 561, L"Тольятти"},
- {24, 246, 2601, L"Чапаевск"},
- {24, 246, 562, L"Шигоны"},
- {24, 246, 2261, L"Другое"},
- {24, 247, 2613, L"Аркадак"},
- {24, 247, 2606, L"Аткарск"},
- {24, 247, 563, L"Балаково"},
- {24, 247, 564, L"Балашов"},
- {24, 247, 565, L"Вольск"},
- {24, 247, 2608, L"Ершов"},
- {24, 247, 2607, L"Калининск"},
- {24, 247, 2609, L"Красноармейск"},
- {24, 247, 2610, L"Красный Кут"},
- {24, 247, 2605, L"Маркс"},
- {24, 247, 566, L"Новоузенск"},
- {24, 247, 2603, L"Петровск"},
- {24, 247, 2604, L"Пугачев"},
- {24, 247, 2612, L"Ртищево"},
- {24, 247, 567, L"Саратов"},
- {24, 247, 2611, L"Хвалынск"},
- {24, 247, 568, L"Энгельс"},
- {24, 247, 3267, L"Энгельс-12"},
- {24, 247, 2262, L"Другое"},
- {24, 250, 2614, L"Барыш"},
- {24, 250, 588, L"Димитровград"},
- {24, 250, 2615, L"Инза"},
- {24, 250, 589, L"Новоспасское"},
- {24, 250, 2616, L"Новоульяновск"},
- {24, 250, 590, L"Сенгилей"},
- {24, 250, 591, L"Ульяновск"},
- {24, 250, 2278, L"Другое"},
- {24, 239, 508, L"Кудымкар"},
- {24, 239, 2238, L"Другое"},
- {24, 255, 1355, L"Беломорск"},
- {24, 255, 1356, L"Кемь"},
- {24, 255, 1357, L"Кондопога"},
- {24, 255, 1358, L"Костомукша"},
- {24, 255, 1359, L"Коткозеро"},
- {24, 255, 1360, L"Лахденпохья"},
- {24, 255, 1362, L"Лоухи"},
- {24, 255, 1361, L"Медвежьегорск"},
- {24, 255, 3286, L"Муезерский"},
- {24, 255, 1937, L"Олонец"},
- {24, 255, 1363, L"Петрозаводск"},
- {24, 255, 1938, L"Питкяранта"},
- {24, 255, 3287, L"Пряжа"},
- {24, 255, 1936, L"Пудож"},
- {24, 255, 1364, L"Сегежа"},
- {24, 255, 1365, L"Сортавала"},
- {24, 255, 1939, L"Суоярви"},
- {24, 255, 2201, L"Другое"},
- {24, 256, 1366, L"Воркута"},
- {24, 256, 1367, L"Вуктыл"},
- {24, 256, 2202, L"Емва"},
- {24, 256, 1368, L"Инта"},
- {24, 256, 1940, L"Микунь"},
- {24, 256, 1369, L"Печора"},
- {24, 256, 1941, L"Сосногорск"},
- {24, 256, 1370, L"Сыктывкар"},
- {24, 256, 1371, L"Усинск"},
- {24, 256, 1372, L"Ухта"},
- {24, 256, 2203, L"Другое"},
- {24, 252, 593, L"Архангельск"},
- {24, 252, 594, L"Вельск"},
- {24, 252, 1945, L"Каргополь"},
- {24, 252, 595, L"Коряжма"},
- {24, 252, 596, L"Котлас"},
- {24, 252, 1944, L"Мезень"},
- {24, 252, 597, L"Мирный"},
- {24, 252, 598, L"Новодвинск"},
- {24, 252, 1946, L"Няндома"},
- {24, 252, 599, L"Онега"},
- {24, 252, 600, L"Пинега"},
- {24, 252, 601, L"Северодвинск"},
- {24, 252, 1942, L"Сольвычегодск"},
- {24, 252, 3239, L"Холмогоры"},
- {24, 252, 1943, L"Шенкурск"},
- {24, 252, 2204, L"Другое"},
- {24, 253, 1950, L"Бабаево"},
- {24, 253, 1949, L"Белозерск"},
- {24, 253, 1338, L"Великий Устюг"},
- {24, 253, 1339, L"Вологда"},
- {24, 253, 1951, L"Вытегра"},
- {24, 253, 1340, L"Грязовец"},
- {24, 253, 1952, L"Кадников"},
- {24, 253, 2871, L"Кадуй"},
- {24, 253, 1341, L"Кириллов"},
- {24, 253, 1955, L"Красавино"},
- {24, 253, 1342, L"Михайловка"},
- {24, 253, 1947, L"Никольск"},
- {24, 253, 1343, L"Сокол"},
- {24, 253, 1953, L"Тотьма"},
- {24, 253, 1954, L"Устюжна"},
- {24, 253, 1948, L"Харовск"},
- {24, 253, 1344, L"Череповец"},
- {24, 253, 2205, L"Другое"},
- {24, 254, 2838, L"Багратионовск"},
- {24, 254, 1345, L"Балтийск"},
- {24, 254, 2846, L"Гвардейск"},
- {24, 254, 2843, L"Гурьевск"},
- {24, 254, 1346, L"Гусев"},
- {24, 254, 1347, L"Зеленоградск"},
- {24, 254, 1348, L"Калининград"},
- {24, 254, 2842, L"Краснознаменск"},
- {24, 254, 2845, L"Ладушкин"},
- {24, 254, 2848, L"Мамоново"},
- {24, 254, 2837, L"Неман"},
- {24, 254, 2844, L"Нестеров"},
- {24, 254, 1349, L"Озерск"},
- {24, 254, 2841, L"Полесск"},
- {24, 254, 2839, L"Правдинск"},
- {24, 254, 1350, L"Приморск"},
- {24, 254, 1351, L"Светлогорск"},
- {24, 254, 1352, L"Светлый"},
- {24, 254, 2840, L"Славск"},
- {24, 254, 1353, L"Советск"},
- {24, 254, 1354, L"Черняховск"},
- {24, 254, 2231, L"Другое"},
- {24, 257, 1985, L"Бокситогорск"},
- {24, 257, 1374, L"Волхов"},
- {24, 257, 1373, L"Всеволожск"},
- {24, 257, 1375, L"Выборг"},
- {24, 257, 1995, L"Высоцк"},
- {24, 257, 1376, L"Гатчина"},
- {24, 257, 1378, L"Ивангород"},
- {24, 257, 1993, L"Каменногорск"},
- {24, 257, 1379, L"Кингисепп"},
- {24, 257, 1380, L"Кириши"},
- {24, 257, 1381, L"Кировск"},
- {24, 257, 1384, L"Кузьмоловский"},
- {24, 257, 1984, L"Лодейное Поле"},
- {24, 257, 1990, L"Луга"},
- {24, 257, 1994, L"Любань"},
- {24, 257, 1386, L"Никольское"},
- {24, 257, 1987, L"Новая Ладога"},
- {24, 257, 1996, L"Отрадное"},
- {24, 257, 1986, L"Пикалево"},
- {24, 257, 1983, L"Подпорожье"},
- {24, 257, 1992, L"Приморск"},
- {24, 257, 1988, L"Приозерск"},
- {24, 257, 3071, L"Пушкин"},
- {24, 257, 1989, L"Светогорск"},
- {24, 257, 1389, L"Сертолово"},
- {24, 257, 1991, L"Сланцы"},
- {24, 257, 1391, L"Сосновый Бор"},
- {24, 257, 1392, L"Тихвин"},
- {24, 257, 1393, L"Тосно"},
- {24, 257, 1394, L"Шлиссельбург"},
- {24, 257, 2207, L"Другое"},
- {24, 258, 1395, L"Апатиты"},
- {24, 258, 1959, L"Заполярный"},
- {24, 258, 1396, L"Зареченск"},
- {24, 258, 1397, L"Кандалакша"},
- {24, 258, 1398, L"Кировск"},
- {24, 258, 1399, L"Ковдор"},
- {24, 258, 1958, L"Кола"},
- {24, 258, 1400, L"Мончегорск"},
- {24, 258, 1401, L"Мурманск"},
- {24, 258, 1402, L"Мурмаши"},
- {24, 258, 1403, L"Оленегорск"},
- {24, 258, 1404, L"Полярные Зори"},
- {24, 258, 1956, L"Полярный"},
- {24, 258, 1957, L"Североморск"},
- {24, 258, 3288, L"Снежногорск"},
- {24, 258, 2206, L"Другое"},
- {24, 260, 1406, L"Батецкий"},
- {24, 260, 2001, L"Боровичи"},
- {24, 260, 2003, L"Валдай"},
- {24, 260, 1407, L"Великий Новгород"},
- {24, 260, 1408, L"Крестцы"},
- {24, 260, 2002, L"Малая Вишера"},
- {24, 260, 1409, L"Окуловка"},
- {24, 260, 2000, L"Пестово"},
- {24, 260, 1997, L"Сольцы"},
- {24, 260, 1410, L"Старая Русса"},
- {24, 260, 1998, L"Холм"},
- {24, 260, 1999, L"Чудово"},
- {24, 260, 2208, L"Другое"},
- {24, 261, 1412, L"Великие Луки"},
- {24, 261, 2004, L"Гдов"},
- {24, 261, 2009, L"Дно"},
- {24, 261, 2005, L"Невель"},
- {24, 261, 1413, L"Новоржев"},
- {24, 261, 2006, L"Опочка"},
- {24, 261, 2008, L"Остров"},
- {24, 261, 1414, L"Печоры"},
- {24, 261, 1415, L"Порхов"},
- {24, 261, 1411, L"Псков"},
- {24, 261, 1416, L"Пустошка"},
- {24, 261, 2007, L"Пыталово"},
- {24, 261, 1417, L"Себеж"},
- {24, 261, 2209, L"Другое"},
- {24, 259, 1405, L"Нарьян-Мар"},
- {24, 259, 2250, L"Другое"},
- {24, 265, 2764, L"Бабушкин"},
- {24, 265, 2760, L"Гусиноозерск"},
- {24, 265, 2762, L"Закаменск"},
- {24, 265, 2763, L"Кяхта"},
- {24, 265, 2761, L"Северобайкальск"},
- {24, 265, 1446, L"Улан-Удэ"},
- {24, 265, 2222, L"Другое"},
- {24, 263, 1439, L"Горно-Алтайск"},
- {24, 263, 2215, L"Другое"},
- {24, 273, 2766, L"Ак-Довурак"},
- {24, 273, 1494, L"Кызыл"},
- {24, 273, 2768, L"Новый Шагонар"},
- {24, 273, 2767, L"Туран"},
- {24, 273, 2765, L"Чадан"},
- {24, 273, 2275, L"Другое"},
- {24, 275, 2769, L"Абаза"},
- {24, 275, 1496, L"Абакан"},
- {24, 275, 1497, L"Саяногорск"},
- {24, 275, 2770, L"Сорск"},
- {24, 275, 2771, L"Черногорск"},
- {24, 275, 2281, L"Другое"},
- {24, 264, 1440, L"Алейск"},
- {24, 264, 1441, L"Барнаул"},
- {24, 264, 1442, L"Белокуриха"},
- {24, 264, 1443, L"Бийск"},
- {24, 264, 2728, L"Горняк"},
- {24, 264, 2731, L"Заринск"},
- {24, 264, 2729, L"Змеиногорск"},
- {24, 264, 2732, L"Камень-на-Оби"},
- {24, 264, 3292, L"Кулунда"},
- {24, 264, 2730, L"Новоалтайск"},
- {24, 264, 1444, L"Рубцовск"},
- {24, 264, 1445, L"Славгород"},
- {24, 264, 3231, L"Яровое"},
- {24, 264, 2216, L"Другое"},
- {24, 268, 2781, L"Артемовск"},
- {24, 268, 1469, L"Ачинск"},
- {24, 268, 2784, L"Боготол"},
- {24, 268, 2773, L"Бородино"},
- {24, 268, 2774, L"Дивногорск"},
- {24, 268, 3122, L"Емельяновск"},
- {24, 268, 2772, L"Енисейск"},
- {24, 268, 3294, L"Железногорск"},
- {24, 268, 2777, L"Заозерный"},
- {24, 268, 1470, L"Игарка"},
- {24, 268, 2778, L"Иланский"},
- {24, 268, 2782, L"Канск"},
- {24, 268, 2783, L"Кодинский"},
- {24, 268, 1471, L"Красноярск"},
- {24, 268, 1472, L"Лесосибирск"},
- {24, 268, 1473, L"Минусинск"},
- {24, 268, 2775, L"Назарово"},
- {24, 268, 2776, L"Сосновоборск"},
- {24, 268, 2780, L"Ужур"},
- {24, 268, 2779, L"Уяр"},
- {24, 268, 2785, L"Шарыпово"},
- {24, 268, 1474, L"Шушенское"},
- {24, 268, 2242, L"Другое"},
- {24, 266, 2792, L"Алзамай"},
- {24, 266, 1447, L"Ангарск"},
- {24, 266, 1448, L"Байкальск"},
- {24, 266, 2791, L"Бирюсинск"},
- {24, 266, 1450, L"Бодайбо"},
- {24, 266, 1451, L"Братск"},
- {24, 266, 2793, L"Вихоревка"},
- {24, 266, 2789, L"Железногорск-Илимский"},
- {24, 266, 2786, L"Зима"},
- {24, 266, 1452, L"Иркутск"},
- {24, 266, 2794, L"Киренск"},
- {24, 266, 2787, L"Нижнеудинск"},
- {24, 266, 1449, L"Саянск"},
- {24, 266, 2790, L"Свирск"},
- {24, 266, 1453, L"Слюдянка"},
- {24, 266, 2788, L"Тайшет"},
- {24, 266, 1454, L"Тулун"},
- {24, 266, 1455, L"Усолье-Сибирское"},
- {24, 266, 2908, L"Усольск"},
- {24, 266, 1456, L"Усть-Илимск"},
- {24, 266, 1457, L"Усть-Кут"},
- {24, 266, 1458, L"Хужир"},
- {24, 266, 1459, L"Черемхово"},
- {24, 266, 2795, L"Шелехов"},
- {24, 266, 2229, L"Другое"},
- {24, 267, 2737, L"Анжеро-Суджинск"},
- {24, 267, 2740, L"Белово"},
- {24, 267, 2746, L"Березовский"},
- {24, 267, 2739, L"Гурьевск"},
- {24, 267, 2742, L"Калтан"},
- {24, 267, 1460, L"Кемерово"},
- {24, 267, 1461, L"Киселевск"},
- {24, 267, 2738, L"Ленинск-Кузнецкий"},
- {24, 267, 2745, L"Мариинск"},
- {24, 267, 1462, L"Междуреченск"},
- {24, 267, 1463, L"Мыски"},
- {24, 267, 1464, L"Новокузнецк"},
- {24, 267, 2744, L"Осинники"},
- {24, 267, 3358, L"Полысаево"},
- {24, 267, 1465, L"Прокопьевск"},
- {24, 267, 1466, L"Салаир"},
- {24, 267, 2743, L"Тайга"},
- {24, 267, 2741, L"Таштагол"},
- {24, 267, 1467, L"Топки"},
- {24, 267, 1468, L"Юрга"},
- {24, 267, 2236, L"Другое"},
- {24, 269, 1475, L"Баган"},
- {24, 269, 1476, L"Барабинск"},
- {24, 269, 1477, L"Бердск"},
- {24, 269, 2750, L"Болотное"},
- {24, 269, 1478, L"Искитим"},
- {24, 269, 2752, L"Карасук"},
- {24, 269, 2751, L"Каргат"},
- {24, 269, 3107, L"Краснообск"},
- {24, 269, 2753, L"Куйбышев"},
- {24, 269, 2755, L"Купино"},
- {24, 269, 1479, L"Новосибирск"},
- {24, 269, 2759, L"Обь"},
- {24, 269, 2756, L"Татарск"},
- {24, 269, 2758, L"Тогучин"},
- {24, 269, 2757, L"Черепаново"},
- {24, 269, 2754, L"Чулым"},
- {24, 269, 2252, L"Другое"},
- {24, 270, 2733, L"Исилькуль"},
- {24, 270, 1480, L"Калачинск"},
- {24, 270, 1481, L"Марьяновка"},
- {24, 270, 2735, L"Называевск"},
- {24, 270, 1482, L"Омск"},
- {24, 270, 2734, L"Тара"},
- {24, 270, 2736, L"Тюкалинск"},
- {24, 270, 2253, L"Другое"},
- {24, 272, 1488, L"Асино"},
- {24, 272, 1489, L"Белый Яр"},
- {24, 272, 3295, L"Каргасок"},
- {24, 272, 1491, L"Колпашево"},
- {24, 272, 1492, L"Северск"},
- {24, 272, 1493, L"Стрежевой"},
- {24, 272, 1490, L"Томск"},
- {24, 272, 2273, L"Другое"},
- {24, 276, 2803, L"Балей"},
- {24, 276, 2799, L"Борзя"},
- {24, 276, 1499, L"Краснокаменск"},
- {24, 276, 2801, L"Могоча"},
- {24, 276, 2800, L"Нерчинск"},
- {24, 276, 2802, L"Петровск-Забайкальский"},
- {24, 276, 2798, L"Сретенск"},
- {24, 276, 2796, L"Хилок"},
- {24, 276, 1498, L"Чита"},
- {24, 276, 2797, L"Шилка"},
- {24, 276, 2285, L"Другое"},
- {24, 262, 1438, L"Агинское"},
- {24, 262, 2213, L"Другое"},
- {24, 271, 3233, L"Диксон"},
- {24, 271, 1485, L"Дудинка"},
- {24, 271, 1487, L"Кайеркан"},
- {24, 271, 1483, L"Норильск"},
- {24, 271, 1484, L"Талнах"},
- {24, 271, 1486, L"Хатанга"},
- {24, 271, 2269, L"Другое"},
- {24, 274, 1495, L"Усть-Ордынский"},
- {24, 274, 2279, L"Другое"},
- {24, 277, 1500, L"Тура"},
- {24, 277, 2288, L"Другое"},
- {24, 278, 2668, L"Далматово"},
- {24, 278, 2667, L"Катайск"},
- {24, 278, 1524, L"Курган"},
- {24, 278, 2669, L"Куртамыш"},
- {24, 278, 2666, L"Макушино"},
- {24, 278, 2671, L"Петухово"},
- {24, 278, 1525, L"Шадринск"},
- {24, 278, 2670, L"Шумиха"},
- {24, 278, 2672, L"Щучье"},
- {24, 278, 2243, L"Другое"},
- {24, 279, 1526, L"Алапаевск"},
- {24, 279, 1527, L"Арамиль"},
- {24, 279, 2691, L"Артемовский"},
- {24, 279, 1528, L"Асбест"},
- {24, 279, 2924, L"Белоярский"},
- {24, 279, 2707, L"Березовский"},
- {24, 279, 1529, L"Богданович"},
- {24, 279, 2698, L"Верхний Тагил"},
- {24, 279, 1530, L"Верхняя Пышма"},
- {24, 279, 1531, L"Верхняя Салда"},
- {24, 279, 1532, L"Верхняя Синячиха"},
- {24, 279, 2696, L"Верхняя Тура"},
- {24, 279, 2692, L"Верхотурье"},
- {24, 279, 2706, L"Волчанск"},
- {24, 279, 2709, L"Дегтярск"},
- {24, 279, 1533, L"Екатеринбург"},
- {24, 279, 1534, L"Заречный"},
- {24, 279, 1535, L"Ивдель"},
- {24, 279, 1536, L"Ирбит"},
- {24, 279, 1537, L"Каменск-Уральский"},
- {24, 279, 1538, L"Камышлов"},
- {24, 279, 2708, L"Карпинск"},
- {24, 279, 1539, L"Качканар"},
- {24, 279, 2712, L"Кировград"},
- {24, 279, 1540, L"Краснотурьинск"},
- {24, 279, 2694, L"Красноуральск"},
- {24, 279, 2693, L"Красноуфимск"},
- {24, 279, 1541, L"Кушва"},
- {24, 279, 2711, L"Михайловск"},
- {24, 279, 2713, L"Михайловск"},
- {24, 279, 1542, L"Невьянск"},
- {24, 279, 2702, L"Нижние Серги"},
- {24, 279, 1543, L"Нижний Тагил"},
- {24, 279, 2695, L"Нижняя Салда"},
- {24, 279, 2697, L"Нижняя Тура"},
- {24, 279, 2699, L"Новая Ляля"},
- {24, 279, 2909, L"Новоуральск"},
- {24, 279, 1544, L"Первоуральск"},
- {24, 279, 1545, L"Полевской"},
- {24, 279, 1546, L"Ревда"},
- {24, 279, 1547, L"Реж"},
- {24, 279, 3296, L"Рефтинский"},
- {24, 279, 2700, L"Североуральск"},
- {24, 279, 1548, L"Серов"},
- {24, 279, 2710, L"Среднеуральск"},
- {24, 279, 2701, L"Сухой Лог"},
- {24, 279, 2703, L"Сысерть"},
- {24, 279, 1549, L"Тавда"},
- {24, 279, 2704, L"Талица"},
- {24, 279, 2705, L"Туринск"},
- {24, 279, 2265, L"Другое"},
- {24, 280, 1550, L"Заводоуковск"},
- {24, 280, 1551, L"Ишим"},
- {24, 280, 3326, L"Сургут"},
- {24, 280, 1552, L"Тобольск"},
- {24, 280, 1553, L"Тюмень"},
- {24, 280, 2748, L"Ялуторовск"},
- {24, 280, 2276, L"Другое"},
- {24, 282, 1564, L"Аша"},
- {24, 282, 2723, L"Бакал"},
- {24, 282, 2724, L"Верхнеуральск"},
- {24, 282, 2716, L"Верхний Уфалей"},
- {24, 282, 3297, L"Всеволожск"},
- {24, 282, 2725, L"Еманжелинск"},
- {24, 282, 1565, L"Златоуст"},
- {24, 282, 2722, L"Карабаш"},
- {24, 282, 1566, L"Карталы"},
- {24, 282, 2718, L"Касли"},
- {24, 282, 2720, L"Катав-Ивановск"},
- {24, 282, 1567, L"Копейск"},
- {24, 282, 2721, L"Коркино"},
- {24, 282, 2715, L"Куса"},
- {24, 282, 1568, L"Кыштым"},
- {24, 282, 1569, L"Магнитогорск"},
- {24, 282, 1570, L"Миасс"},
- {24, 282, 2726, L"Миньяр"},
- {24, 282, 2717, L"Нязепетровск"},
- {24, 282, 3100, L"Озерск"},
- {24, 282, 1571, L"Пласт"},
- {24, 282, 2719, L"Сатка"},
- {24, 282, 2727, L"Сим"},
- {24, 282, 1572, L"Снежинск"},
- {24, 282, 3332, L"Трехгорный"},
- {24, 282, 1573, L"Троицк"},
- {24, 282, 1574, L"Усть-Катав"},
- {24, 282, 1575, L"Чебаркуль"},
- {24, 282, 1576, L"Челябинск"},
- {24, 282, 1577, L"Южноуральск"},
- {24, 282, 2714, L"Юрюзань"},
- {24, 282, 2283, L"Другое"},
- {24, 281, 2749, L"Белоярский"},
- {24, 281, 1554, L"Игрим"},
- {24, 281, 1555, L"Когалым"},
- {24, 281, 1556, L"Лангепас"},
- {24, 281, 1561, L"Мегион"},
- {24, 281, 1562, L"Нефтеюганск"},
- {24, 281, 1559, L"Нижневартовск"},
- {24, 281, 2852, L"Нягань"},
- {24, 281, 2853, L"Нягань"},
- {24, 281, 2854, L"Пыть-Ях"},
- {24, 281, 1560, L"Радужный"},
- {24, 281, 1563, L"Советский"},
- {24, 281, 2747, L"Сургут"},
- {24, 281, 1557, L"Урай"},
- {24, 281, 1558, L"Ханты-Мансийск"},
- {24, 281, 3344, L"Югорск"},
- {24, 281, 2282, L"Другое"},
- {24, 283, 3298, L"Губкинский"},
- {24, 283, 1578, L"Лабытнанги"},
- {24, 283, 2856, L"Муравленко"},
- {24, 283, 1579, L"Надым"},
- {24, 283, 1580, L"Новый Уренгой"},
- {24, 283, 1581, L"Ноябрьск"},
- {24, 283, 1582, L"Салехард"},
- {24, 283, 1583, L"Уренгой"},
- {24, 283, 2289, L"Другое"},
- {24, 284, 1625, L"Алексеевка"},
- {24, 284, 1626, L"Белгород"},
- {24, 284, 2172, L"Валуйки"},
- {24, 284, 2173, L"Грайворон"},
- {24, 284, 1627, L"Губкин"},
- {24, 284, 2174, L"Короча"},
- {24, 284, 2175, L"Новый Оскол"},
- {24, 284, 1628, L"Старый Оскол"},
- {24, 284, 1629, L"Шебекино"},
- {24, 284, 2221, L"Другое"},
- {24, 285, 1630, L"Брянск"},
- {24, 285, 3283, L"Дебрянск"},
- {24, 285, 1631, L"Дятьково"},
- {24, 285, 2013, L"Жуковка"},
- {24, 285, 2015, L"Злынка"},
- {24, 285, 1632, L"Карачев"},
- {24, 285, 1633, L"Клинцы"},
- {24, 285, 1634, L"Мглин"},
- {24, 285, 2016, L"Новозыбков"},
- {24, 285, 2018, L"Почеп"},
- {24, 285, 2017, L"Севск"},
- {24, 285, 2020, L"Сельцо"},
- {24, 285, 2014, L"Стародуб"},
- {24, 285, 2010, L"Сураж"},
- {24, 285, 2012, L"Трубчевск"},
- {24, 285, 2011, L"Унеча"},
- {24, 285, 2019, L"Фокино"},
- {24, 285, 2210, L"Другое"},
- {24, 286, 1635, L"Александров"},
- {24, 286, 1636, L"Владимир"},
- {24, 286, 2021, L"Вязники"},
- {24, 286, 1637, L"Головино"},
- {24, 286, 2022, L"Гороховец"},
- {24, 286, 1638, L"Гусь-Хрустальный"},
- {24, 286, 2023, L"Камешково"},
- {24, 286, 2031, L"Карабаново"},
- {24, 286, 2024, L"Киржач"},
- {24, 286, 1639, L"Ковров"},
- {24, 286, 1640, L"Кольчугино"},
- {24, 286, 2026, L"Костерево"},
- {24, 286, 3299, L"Красная Горбатка"},
- {24, 286, 2033, L"Лакинск"},
- {24, 286, 2025, L"Меленки"},
- {24, 286, 1641, L"Муром"},
- {24, 286, 1642, L"Петушки"},
- {24, 286, 2027, L"Покров"},
- {24, 286, 2211, L"Радужный"},
- {24, 286, 2028, L"Собинка"},
- {24, 286, 2032, L"Струнино"},
- {24, 286, 2029, L"Судогда"},
- {24, 286, 1643, L"Суздаль"},
- {24, 286, 2030, L"Юрьев-Польский"},
- {24, 286, 2212, L"Другое"},
- {24, 287, 1644, L"Бобров"},
- {24, 287, 1645, L"Богучар"},
- {24, 287, 1646, L"Борисоглебск"},
- {24, 287, 1647, L"Бутурлиновка"},
- {24, 287, 1648, L"Воронеж"},
- {24, 287, 2178, L"Калач"},
- {24, 287, 2176, L"Лиски"},
- {24, 287, 1649, L"Нововоронеж"},
- {24, 287, 2177, L"Новохоперск"},
- {24, 287, 2180, L"Острогожск"},
- {24, 287, 1650, L"Павловск"},
- {24, 287, 2181, L"Поворино"},
- {24, 287, 1651, L"Россошь"},
- {24, 287, 2179, L"Семилуки"},
- {24, 287, 2182, L"Эртиль"},
- {24, 287, 2224, L"Другое"},
- {24, 288, 1652, L"Вичуга"},
- {24, 288, 2036, L"Гаврилов Посад"},
- {24, 288, 1657, L"Заволжск"},
- {24, 288, 1653, L"Иваново"},
- {24, 288, 1656, L"Кинешма"},
- {24, 288, 2040, L"Комсомольск"},
- {24, 288, 2037, L"Кохма"},
- {24, 288, 2043, L"Наволоки"},
- {24, 288, 3300, L"Палех"},
- {24, 288, 2039, L"Плес"},
- {24, 288, 2038, L"Приволжск"},
- {24, 288, 2042, L"Пучеж"},
- {24, 288, 2044, L"Родники"},
- {24, 288, 1655, L"Тейково"},
- {24, 288, 2034, L"Фурманов"},
- {24, 288, 1654, L"Шуя"},
- {24, 288, 2041, L"Южа"},
- {24, 288, 2035, L"Юрьевец"},
- {24, 288, 2227, L"Другое"},
- {24, 289, 2050, L"Балабаново"},
- {24, 289, 2051, L"Боровск"},
- {24, 289, 3301, L"Воротынск"},
- {24, 289, 2052, L"Жиздра"},
- {24, 289, 1660, L"Жуковка"},
- {24, 289, 1658, L"Калуга"},
- {24, 289, 2046, L"Киров"},
- {24, 289, 1661, L"Козельск"},
- {24, 289, 2053, L"Кондрово"},
- {24, 289, 2049, L"Людиново"},
- {24, 289, 1659, L"Малоярославец"},
- {24, 289, 2054, L"Медынь"},
- {24, 289, 2055, L"Мещовск"},
- {24, 289, 2047, L"Мосальск"},
- {24, 289, 1662, L"Обнинск"},
- {24, 289, 2057, L"Сосенский"},
- {24, 289, 2056, L"Спас-Демянск"},
- {24, 289, 2045, L"Сухиничи"},
- {24, 289, 1663, L"Таруса"},
- {24, 289, 2131, L"Чекалин"},
- {24, 289, 2048, L"Юхнов"},
- {24, 289, 2233, L"Другое"},
- {24, 290, 1664, L"Буй"},
- {24, 290, 1665, L"Волгореченск"},
- {24, 290, 1666, L"Галич"},
- {24, 290, 2059, L"Кологрив"},
- {24, 290, 1667, L"Кострома"},
- {24, 290, 3302, L"Красное-на-Волге"},
- {24, 290, 1668, L"Макарьев"},
- {24, 290, 2060, L"Мантурово"},
- {24, 290, 1669, L"Нерехта"},
- {24, 290, 2061, L"Нея"},
- {24, 290, 2062, L"Солигалич"},
- {24, 290, 2058, L"Чухлома"},
- {24, 290, 1670, L"Шарья"},
- {24, 290, 2240, L"Другое"},
- {24, 291, 1671, L"Дмитриев-Льговский"},
- {24, 291, 1673, L"Железногорск"},
- {24, 291, 3279, L"Железногорск"},
- {24, 291, 1672, L"Курск"},
- {24, 291, 2187, L"Курчатов"},
- {24, 291, 2188, L"Льгов"},
- {24, 291, 2184, L"Обоянь"},
- {24, 291, 2185, L"Рыльск"},
- {24, 291, 2183, L"Суджа"},
- {24, 291, 2189, L"Фатеж"},
- {24, 291, 2186, L"Щигры"},
- {24, 291, 2244, L"Другое"},
- {24, 292, 2194, L"Грязи"},
- {24, 292, 2193, L"Данков"},
- {24, 292, 1674, L"Елец"},
- {24, 292, 2190, L"Задонск"},
- {24, 292, 2195, L"Лебедянь"},
- {24, 292, 1675, L"Липецк"},
- {24, 292, 2192, L"Усмань"},
- {24, 292, 2191, L"Чаплыгин"},
- {24, 292, 2245, L"Другое"},
- {24, 293, 1733, L"Апрелевка"},
- {24, 293, 1732, L"Балашиха"},
- {24, 293, 1731, L"Бронницы"},
- {24, 293, 1730, L"Верея"},
- {24, 293, 2063, L"Видное"},
- {24, 293, 2064, L"Волоколамск"},
- {24, 293, 1729, L"Воскресенск"},
- {24, 293, 1728, L"Высоковск"},
- {24, 293, 1727, L"Голицыно"},
- {24, 293, 2065, L"Дедовск"},
- {24, 293, 1726, L"Дзержинский"},
- {24, 293, 1725, L"Дмитров"},
- {24, 293, 1724, L"Долгопрудный"},
- {24, 293, 1723, L"Домодедово"},
- {24, 293, 2066, L"Дрезна"},
- {24, 293, 1722, L"Дубна"},
- {24, 293, 1721, L"Егорьевск"},
- {24, 293, 1720, L"Железнодорожный"},
- {24, 293, 1719, L"Жуковский"},
- {24, 293, 2067, L"Зарайск"},
- {24, 293, 1718, L"Звенигород"},
- {24, 293, 1715, L"Ивантеевка"},
- {24, 293, 1717, L"Истра"},
- {24, 293, 2068, L"Калининград"},
- {24, 293, 2069, L"Кашира"},
- {24, 293, 1716, L"Климовск"},
- {24, 293, 1714, L"Клин"},
- {24, 293, 1713, L"Коломна"},
- {24, 293, 1712, L"Королев"},
- {24, 293, 1711, L"Красноармейск"},
- {24, 293, 1710, L"Красногорск"},
- {24, 293, 2070, L"Краснозаводск"},
- {24, 293, 2071, L"Куровское"},
- {24, 293, 1709, L"Ликино-Дулево"},
- {24, 293, 1708, L"Лобня"},
- {24, 293, 2072, L"Лосино-Петровский"},
- {24, 293, 1707, L"Луховицы"},
- {24, 293, 1706, L"Лыткарино"},
- {24, 293, 1705, L"Люберцы"},
- {24, 293, 1704, L"Менделеево"},
- {24, 293, 1703, L"Можайск"},
- {24, 293, 1702, L"Мытищи"},
- {24, 293, 1701, L"Наро-Фоминск"},
- {24, 293, 1700, L"Ногинск"},
- {24, 293, 1698, L"Одинцово"},
- {24, 293, 2073, L"Ожерелье"},
- {24, 293, 2074, L"Озеры"},
- {24, 293, 1699, L"Орехово-Зуево"},
- {24, 293, 1697, L"Павловский Посад"},
- {24, 293, 1696, L"Подольск"},
- {24, 293, 1695, L"Протвино"},
- {24, 293, 1694, L"Пушкино"},
- {24, 293, 1693, L"Пущино"},
- {24, 293, 1692, L"Раменское"},
- {24, 293, 1691, L"Реутов"},
- {24, 293, 1690, L"Решетников"},
- {24, 293, 2075, L"Рошаль"},
- {24, 293, 2076, L"Руза"},
- {24, 293, 1689, L"Сергиев Посад"},
- {24, 293, 1688, L"Серпухов"},
- {24, 293, 1687, L"Солнечногорск"},
- {24, 293, 1686, L"Ступино"},
- {24, 293, 2077, L"Сходня"},
- {24, 293, 2078, L"Талдом"},
- {24, 293, 1685, L"Троицк"},
- {24, 293, 1684, L"Фрязино"},
- {24, 293, 1683, L"Химки"},
- {24, 293, 1682, L"Хотьково"},
- {24, 293, 1681, L"Черноголовка"},
- {24, 293, 1680, L"Чехов"},
- {24, 293, 1679, L"Шатура"},
- {24, 293, 1678, L"Щелково"},
- {24, 293, 2080, L"Щербинка"},
- {24, 293, 1677, L"Электрогорск"},
- {24, 293, 1676, L"Электросталь"},
- {24, 293, 2079, L"Электроугли"},
- {24, 293, 3031, L"Юбилейный"},
- {24, 293, 2081, L"Яхрома"},
- {24, 293, 2249, L"Другое"},
- {24, 294, 2083, L"Болхов"},
- {24, 294, 2082, L"Дмитровск-Орловский"},
- {24, 294, 3160, L"Залегощь"},
- {24, 294, 1736, L"Ливны"},
- {24, 294, 2084, L"Малоархангельск"},
- {24, 294, 1737, L"Мценск"},
- {24, 294, 2085, L"Новосиль"},
- {24, 294, 1735, L"Орел"},
- {24, 294, 2255, L"Другое"},
- {24, 295, 1740, L"Гусь-Железный"},
- {24, 295, 1741, L"Касимов"},
- {24, 295, 2086, L"Кораблино"},
- {24, 295, 2087, L"Михайлов"},
- {24, 295, 2089, L"Новомичуринск"},
- {24, 295, 2091, L"Рыбное"},
- {24, 295, 2093, L"Ряжск"},
- {24, 295, 1738, L"Рязань"},
- {24, 295, 3305, L"Сапожок"},
- {24, 295, 1739, L"Сасово"},
- {24, 295, 2090, L"Скопин"},
- {24, 295, 2088, L"Спас-Клепики"},
- {24, 295, 2092, L"Спасск-Рязанский"},
- {24, 295, 2094, L"Шацк"},
- {24, 295, 3320, L"Шилово"},
- {24, 295, 2260, L"Другое"},
- {24, 296, 2095, L"Велиж"},
- {24, 296, 1743, L"Вязьма"},
- {24, 296, 1744, L"Гагарин"},
- {24, 296, 2096, L"Демидов"},
- {24, 296, 1745, L"Десногорск"},
- {24, 296, 1746, L"Дорогубуж"},
- {24, 296, 2097, L"Духовщина"},
- {24, 296, 2098, L"Ельня"},
- {24, 296, 2099, L"Починок"},
- {24, 296, 2100, L"Рославль"},
- {24, 296, 2101, L"Рудня"},
- {24, 296, 1747, L"Сафоново"},
- {24, 296, 1742, L"Смоленск"},
- {24, 296, 2102, L"Сычевка"},
- {24, 296, 1748, L"Ярцево"},
- {24, 296, 2267, L"Другое"},
- {24, 297, 2198, L"Жердевка"},
- {24, 297, 2199, L"Кирсанов"},
- {24, 297, 1752, L"Котовск"},
- {24, 297, 1751, L"Мичуринск"},
- {24, 297, 2196, L"Моршанск"},
- {24, 297, 1750, L"Рассказово"},
- {24, 297, 3271, L"Сатинка"},
- {24, 297, 1749, L"Тамбов"},
- {24, 297, 3272, L"Тулиновка"},
- {24, 297, 2197, L"Уварово"},
- {24, 297, 2270, L"Другое"},
- {24, 298, 2103, L"Андреаполь"},
- {24, 298, 2104, L"Бежецк"},
- {24, 298, 2105, L"Белый"},
- {24, 298, 2106, L"Бологое"},
- {24, 298, 2107, L"Весьегонск"},
- {24, 298, 1753, L"Вышний Волочек"},
- {24, 298, 2108, L"Западная Двина"},
- {24, 298, 2109, L"Зубцов"},
- {24, 298, 2110, L"Калязин"},
- {24, 298, 2111, L"Кашин"},
- {24, 298, 1758, L"Кимры"},
- {24, 298, 1756, L"Конаково"},
- {24, 298, 2112, L"Красный Холм"},
- {24, 298, 1759, L"Кувшиново"},
- {24, 298, 1760, L"Лихославль"},
- {24, 298, 1761, L"Нелидово"},
- {24, 298, 2113, L"Осташков"},
- {24, 298, 1757, L"Ржев"},
- {24, 298, 2114, L"Старица"},
- {24, 298, 1754, L"Тверь"},
- {24, 298, 2115, L"Торжок"},
- {24, 298, 2116, L"Торопец"},
- {24, 298, 1755, L"Удомля"},
- {24, 298, 2272, L"Другое"},
- {24, 299, 2127, L"Алексин"},
- {24, 299, 2126, L"Белев"},
- {24, 299, 2118, L"Богородицк"},
- {24, 299, 2122, L"Болохово"},
- {24, 299, 2129, L"Венев"},
- {24, 299, 1762, L"Донской"},
- {24, 299, 2128, L"Ефремов"},
- {24, 299, 3354, L"Заокский"},
- {24, 299, 2124, L"Киреевск"},
- {24, 299, 1763, L"Климовск"},
- {24, 299, 2123, L"Липки"},
- {24, 299, 1764, L"Новомосковск"},
- {24, 299, 2117, L"Плавск"},
- {24, 299, 2130, L"Северо-Задонск"},
- {24, 299, 2120, L"Советск"},
- {24, 299, 2119, L"Сокольники"},
- {24, 299, 2125, L"Суворов"},
- {24, 299, 1765, L"Тула"},
- {24, 299, 1766, L"Узловая"},
- {24, 299, 2121, L"Щекино"},
- {24, 299, 1767, L"Ясногорск"},
- {24, 299, 2274, L"Другое"},
- {24, 300, 3053, L"Большое Село"},
- {24, 300, 3268, L"Брейтово"},
- {24, 300, 1773, L"Гаврилов-Ям"},
- {24, 300, 2132, L"Данилов"},
- {24, 300, 3269, L"Красные Ткачи"},
- {24, 300, 2133, L"Любим"},
- {24, 300, 3270, L"Мокеевское"},
- {24, 300, 1774, L"Мышкин"},
- {24, 300, 2994, L"Некоуз"},
- {24, 300, 1775, L"Переславль-Залесский"},
- {24, 300, 2134, L"Пошехонье"},
- {24, 300, 1769, L"Ростов"},
- {24, 300, 1771, L"Рыбинск"},
- {24, 300, 1772, L"Тутаев"},
- {24, 300, 1770, L"Углич"},
- {24, 300, 1768, L"Ярославль"},
- {24, 300, 2290, L"Другое"},
- {24, 301, 2849, L"Адыгейск"},
- {24, 301, 1776, L"Майкоп"},
- {24, 301, 2214, L"Другое"},
- {24, 304, 2617, L"Буйнакск"},
- {24, 304, 1791, L"Гуниб"},
- {24, 304, 1788, L"Дербент"},
- {24, 304, 2619, L"Избербаш"},
- {24, 304, 1789, L"Каспийск"},
- {24, 304, 2618, L"Кизилюрт"},
- {24, 304, 1790, L"Кизляр"},
- {24, 304, 1792, L"Махачкала"},
- {24, 304, 2620, L"Хасавюрт"},
- {24, 304, 2225, L"Другое"},
- {24, 305, 3052, L"Магас"},
- {24, 305, 1787, L"Назрань"},
- {24, 305, 2228, L"Другое"},
- {24, 306, 2621, L"Баксан"},
- {24, 306, 1794, L"Майский"},
- {24, 306, 1793, L"Нальчик"},
- {24, 306, 2622, L"Нарткала"},
- {24, 306, 1795, L"Прохладный"},
- {24, 306, 2623, L"Терек"},
- {24, 306, 2624, L"Тырныауз"},
- {24, 306, 3274, L"Чегем"},
- {24, 306, 2230, L"Другое"},
- {24, 307, 2567, L"Городовиково"},
- {24, 307, 2568, L"Лагань"},
- {24, 307, 3324, L"Троицкое"},
- {24, 307, 1796, L"Элиста"},
- {24, 307, 2232, L"Другое"},
- {24, 308, 1799, L"Домбай"},
- {24, 308, 1798, L"Карачаевск"},
- {24, 308, 2626, L"Теберда"},
- {24, 308, 2625, L"Усть-Джегута"},
- {24, 308, 1797, L"Черкесск"},
- {24, 308, 2235, L"Другое"},
- {24, 311, 2630, L"Алагир"},
- {24, 311, 2631, L"Ардон"},
- {24, 311, 2628, L"Беслан"},
- {24, 311, 1839, L"Владикавказ"},
- {24, 311, 2629, L"Дигора"},
- {24, 311, 2627, L"Моздок"},
- {24, 311, 2266, L"Другое"},
- {24, 313, 2632, L"Аргун"},
- {24, 313, 1853, L"Грозный"},
- {24, 313, 2633, L"Гудермес"},
- {24, 313, 2284, L"Другое"},
- {24, 309, 2636, L"Абинск"},
- {24, 309, 1800, L"Анапа"},
- {24, 309, 1801, L"Апшеронск"},
- {24, 309, 1802, L"Армавир"},
- {24, 309, 1803, L"Белореченск"},
- {24, 309, 1804, L"Геленджик"},
- {24, 309, 1805, L"Горячий Ключ"},
- {24, 309, 2637, L"Гулькевичи"},
- {24, 309, 1806, L"Динская"},
- {24, 309, 1807, L"Ейск"},
- {24, 309, 2638, L"Кореновск"},
- {24, 309, 1808, L"Краснодар"},
- {24, 309, 1809, L"Кропоткин"},
- {24, 309, 1810, L"Крымск"},
- {24, 309, 1811, L"Курганинск"},
- {24, 309, 3232, L"Лабинск"},
- {24, 309, 2639, L"Новокубанск"},
- {24, 309, 1812, L"Новороссийск"},
- {24, 309, 1813, L"Пластуновская"},
- {24, 309, 1814, L"Приморско-Ахтарск"},
- {24, 309, 3102, L"Северская"},
- {24, 309, 1815, L"Славянск-на-Кубани"},
- {24, 309, 1816, L"Сочи"},
- {24, 309, 3266, L"Староминская"},
- {24, 309, 3039, L"Тамань"},
- {24, 309, 1817, L"Темрюк"},
- {24, 309, 2635, L"Тимашевск"},
- {24, 309, 1818, L"Тихорецк"},
- {24, 309, 1819, L"Туапсе"},
- {24, 309, 1820, L"Усть-Лабинск"},
- {24, 309, 2634, L"Хадыженск"},
- {24, 309, 2241, L"Другое"},
- {24, 312, 1840, L"Александровское"},
- {24, 312, 2644, L"Благодарный"},
- {24, 312, 1841, L"Буденновск"},
- {24, 312, 1842, L"Георгиевск"},
- {24, 312, 1843, L"Ессентуки"},
- {24, 312, 1844, L"Железноводск"},
- {24, 312, 2647, L"Зеленокумск"},
- {24, 312, 2641, L"Изобильный"},
- {24, 312, 2642, L"Ипатово"},
- {24, 312, 1845, L"Кисловодск"},
- {24, 312, 1846, L"Кочубеевское"},
- {24, 312, 3367, L"Курсавка"},
- {24, 312, 3265, L"Левокумское"},
- {24, 312, 1847, L"Лермонтов"},
- {24, 312, 1848, L"Минеральные Воды"},
- {24, 312, 1849, L"Невинномысск"},
- {24, 312, 2645, L"Нефтекумск"},
- {24, 312, 2643, L"Новоалександровск"},
- {24, 312, 1850, L"Новопавловск"},
- {24, 312, 1851, L"Новоселицкое"},
- {24, 312, 1852, L"Пятигорск"},
- {24, 312, 2646, L"Светлоград"},
- {24, 312, 2640, L"Ставрополь"},
- {24, 312, 2268, L"Другое"},
- {24, 302, 1777, L"Астрахань"},
- {24, 302, 1778, L"Ахтубинск"},
- {24, 302, 3383, L"Знаменск"},
- {24, 302, 2578, L"Камызяк"},
- {24, 302, 2579, L"Нариманов"},
- {24, 302, 1786, L"Харабали"},
- {24, 302, 2219, L"Другое"},
- {24, 303, 1779, L"Волгоград"},
- {24, 303, 1780, L"Волжский"},
- {24, 303, 2584, L"Дубовка"},
- {24, 303, 1781, L"Жирновск"},
- {24, 303, 1782, L"Калач-на-Дону"},
- {24, 303, 1783, L"Камышин"},
- {24, 303, 2588, L"Котельниково"},
- {24, 303, 2591, L"Котово"},
- {24, 303, 2587, L"Краснослободск"},
- {24, 303, 2582, L"Ленинск"},
- {24, 303, 2590, L"Михайловка"},
- {24, 303, 1784, L"Николаевск"},
- {24, 303, 2581, L"Новоаннинский"},
- {24, 303, 2583, L"Палласовка"},
- {24, 303, 2580, L"Петров Вал"},
- {24, 303, 2589, L"Серафимович"},
- {24, 303, 2585, L"Суровикино"},
- {24, 303, 1785, L"Урюпинск"},
- {24, 303, 2586, L"Фролово"},
- {24, 303, 2223, L"Другое"},
- {24, 310, 1821, L"Азов"},
- {24, 310, 1822, L"Аксай"},
- {24, 310, 1823, L"Багаевская"},
- {24, 310, 1824, L"Батайск"},
- {24, 310, 1825, L"Белая Калитва"},
- {24, 310, 1826, L"Волгодонск"},
- {24, 310, 1827, L"Гуково"},
- {24, 310, 2651, L"Донецк"},
- {24, 310, 1828, L"Зерноград"},
- {24, 310, 3264, L"Каменоломни"},
- {24, 310, 2652, L"Каменск-Шахтинский"},
- {24, 310, 2649, L"Константиновск"},
- {24, 310, 2648, L"Красный Сулин"},
- {24, 310, 1829, L"Миллерово"},
- {24, 310, 2653, L"Морозовск"},
- {24, 310, 1830, L"Новочеркасск"},
- {24, 310, 1831, L"Новошахтинск"},
- {24, 310, 1832, L"Пролетарск"},
- {24, 310, 1833, L"Ростов-на-Дону"},
- {24, 310, 1834, L"Сальск"},
- {24, 310, 1835, L"Семикаракорск"},
- {24, 310, 1836, L"Таганрог"},
- {24, 310, 1837, L"Усть-Донецкий"},
- {24, 310, 3263, L"Целина"},
- {24, 310, 2650, L"Цимлянск"},
- {24, 310, 1838, L"Шахты"},
- {24, 310, 2259, L"Другое"},
- {139, 407, 407, L" столица"},
- {139, 426, 427, L"Бойсе"},
- {139, 426, 2354, L"Другое"},
- {139, 378, 3109, L"Айова Сити"},
- {139, 378, 379, L"Де-Мойн"},
- {139, 378, 2963, L"Декора"},
- {139, 378, 2355, L"Другое"},
- {139, 412, 3236, L"Бирмингем"},
- {139, 412, 413, L"Монтгомери"},
- {139, 412, 1181, L"Хантсвилл"},
- {139, 412, 2356, L"Другое"},
- {139, 446, 1182, L"Анкоридж"},
- {139, 446, 447, L"Джуно"},
- {139, 446, 1183, L"Фэрбенкс"},
- {139, 446, 2357, L"Другое"},
- {139, 434, 2917, L"Темпе"},
- {139, 434, 1184, L"Тусон"},
- {139, 434, 435, L"Финикс"},
- {139, 434, 3061, L"Чандлер"},
- {139, 434, 2358, L"Другое"},
- {139, 416, 417, L"Литл-Рок"},
- {139, 416, 2359, L"Другое"},
- {139, 428, 3017, L"Ларами"},
- {139, 428, 429, L"Шайенн"},
- {139, 428, 2360, L"Другое"},
- {139, 440, 2956, L"Беллевью"},
- {139, 440, 2967, L"Бремертон"},
- {139, 440, 3385, L"Ванкувер"},
- {139, 440, 2865, L"Линден"},
- {139, 440, 441, L"Олимпия"},
- {139, 440, 3352, L"Порт Орчард"},
- {139, 440, 2876, L"Редмонт"},
- {139, 440, 3003, L"Рентон"},
- {139, 440, 1185, L"Сиэтл"},
- {139, 440, 2983, L"Снохомиш"},
- {139, 440, 1186, L"Такома"},
- {139, 440, 3152, L"Фрайди Харбор"},
- {139, 440, 2886, L"Эверет"},
- {139, 440, 2361, L"Другое"},
- {139, 352, 353, L"Монтпильер"},
- {139, 352, 2861, L"Норвич"},
- {139, 352, 2362, L"Другое"},
- {139, 394, 1188, L"Александрия"},
- {139, 394, 1187, L"Арлингтон"},
- {139, 394, 2969, L"Даллес"},
- {139, 394, 1189, L"Манассас"},
- {139, 394, 3114, L"Норфолк"},
- {139, 394, 2885, L"Ньюпорт-Ньюс"},
- {139, 394, 2979, L"Раунд Хил"},
- {139, 394, 3338, L"Рестон"},
- {139, 394, 395, L"Ричмонд"},
- {139, 394, 3005, L"Уоррентон"},
- {139, 394, 2991, L"Херндон"},
- {139, 394, 2996, L"Центрвиль"},
- {139, 394, 3097, L"Чантилли"},
- {139, 394, 2981, L"Шарлотесвиль"},
- {139, 394, 2363, L"Другое"},
- {139, 374, 2995, L"Грин-Бей"},
- {139, 374, 375, L"Мадисон"},
- {139, 374, 2365, L"Другое"},
- {139, 448, 449, L"Гонолулу"},
- {139, 448, 1191, L"Хило"},
- {139, 448, 2367, L"Другое"},
- {139, 390, 3021, L"Вильмингтон"},
- {139, 390, 391, L"Довер"},
- {139, 390, 2973, L"Льюис"},
- {139, 390, 2369, L"Другое"},
- {139, 402, 403, L"Атланта"},
- {139, 402, 2370, L"Другое"},
- {139, 396, 397, L"Чарлстон"},
- {139, 396, 2371, L"Другое"},
- {139, 370, 2911, L"Вестмонт"},
- {139, 370, 3074, L"Гарвард"},
- {139, 370, 371, L"Спрингфилд"},
- {139, 370, 2930, L"Урбана"},
- {139, 370, 1194, L"Чикаго"},
- {139, 370, 2372, L"Другое"},
- {139, 368, 369, L"Индианаполис"},
- {139, 368, 1195, L"Эвансвил"},
- {139, 368, 2373, L"Другое"},
- {139, 444, 2959, L"Анахайм"},
- {139, 444, 2961, L"Аптос"},
- {139, 444, 2912, L"Артезия"},
- {139, 444, 2899, L"Беверли Хилз"},
- {139, 444, 1196, L"Беркли"},
- {139, 444, 3249, L"Бреа"},
- {139, 444, 3014, L"Брисбейн"},
- {139, 444, 3048, L"Венис"},
- {139, 444, 2901, L"Вест-Голливуд"},
- {139, 444, 2926, L"Вестлейк Вилладж"},
- {139, 444, 2922, L"Гардена"},
- {139, 444, 1203, L"Глендейл"},
- {139, 444, 2978, L"Денвиль"},
- {139, 444, 2990, L"Дублин"},
- {139, 444, 3077, L"Дэвис"},
- {139, 444, 2918, L"Ирвайн"},
- {139, 444, 2881, L"Карсон"},
- {139, 444, 3247, L"Кипресс"},
- {139, 444, 3092, L"Коста Меса"},
- {139, 444, 2948, L"Купертино"},
- {139, 444, 1197, L"Лонг-Бич"},
- {139, 444, 1198, L"Лос-Анджелес"},
- {139, 444, 3058, L"Лос-Гатос"},
- {139, 444, 3328, L"Марина-дель-Рей"},
- {139, 444, 2874, L"Маунтин-Вью"},
- {139, 444, 2998, L"Милпитас"},
- {139, 444, 3087, L"Монтерей"},
- {139, 444, 2947, L"Окленд"},
- {139, 444, 2900, L"Пало Альто"},
- {139, 444, 1199, L"Пасадена"},
- {139, 444, 3335, L"Редвуд"},
- {139, 444, 2966, L"Розамонд"},
- {139, 444, 445, L"Сакраменто"},
- {139, 444, 1200, L"Сан-Диего"},
- {139, 444, 3317, L"Сан-Мартин"},
- {139, 444, 1201, L"Сан-Франциско"},
- {139, 444, 1202, L"Сан-Хосе"},
- {139, 444, 2878, L"Саннивейл"},
- {139, 444, 2925, L"Санта-Барбара"},
- {139, 444, 2875, L"Санта-Клара"},
- {139, 444, 1204, L"Санта-Круз"},
- {139, 444, 2859, L"Санта-Моника"},
- {139, 444, 3157, L"Студио Сити"},
- {139, 444, 3146, L"Торранс"},
- {139, 444, 2970, L"Тысяча Дубов"},
- {139, 444, 2949, L"Универсал-Сити"},
- {139, 444, 3057, L"Форт Брэгг"},
- {139, 444, 3032, L"Фостер-Сити"},
- {139, 444, 3381, L"Фремонт"},
- {139, 444, 3028, L"Фуллертон"},
- {139, 444, 2858, L"Эмервиль"},
- {139, 444, 3040, L"Эскондидо"},
- {139, 444, 2374, L"Другое"},
- {139, 388, 3041, L"Лоуренс"},
- {139, 388, 389, L"Топика"},
- {139, 388, 2375, L"Другое"},
- {139, 408, 3004, L"Лексингтон"},
- {139, 408, 1205, L"Луисвилл"},
- {139, 408, 409, L"Франкфорт"},
- {139, 408, 2376, L"Другое"},
- {139, 430, 1206, L"Боулдер"},
- {139, 430, 3095, L"Грили"},
- {139, 430, 431, L"Денвер"},
- {139, 430, 1207, L"Колорадо-Спрингс"},
- {139, 430, 3046, L"Литлтон"},
- {139, 430, 2377, L"Другое"},
- {139, 358, 2968, L"Дариен"},
- {139, 358, 3018, L"Денбери"},
- {139, 358, 2882, L"Стэмфорд"},
- {139, 358, 359, L"Хартфорд"},
- {139, 358, 3047, L"Шелтон"},
- {139, 358, 2378, L"Другое"},
- {139, 418, 419, L"Батон-Руж"},
- {139, 418, 1208, L"Новый Орлеан"},
- {139, 418, 2408, L"Другое"},
- {139, 354, 2931, L"Аттлеборо"},
- {139, 354, 3334, L"Билерика"},
- {139, 354, 355, L"Бостон"},
- {139, 354, 3059, L"Вестгемптон"},
- {139, 354, 2919, L"Вобурн"},
- {139, 354, 2902, L"Дедхэм"},
- {139, 354, 1209, L"Кеймбридж"},
- {139, 354, 3336, L"Нидхем"},
- {139, 354, 2985, L"Ньютонвиль"},
- {139, 354, 3022, L"Уолтхэм"},
- {139, 354, 2407, L"Другое"},
- {139, 376, 1210, L"Миннеаполис"},
- {139, 376, 2980, L"Плимут"},
- {139, 376, 377, L"Сент-Пол"},
- {139, 376, 3035, L"Эден Прейри"},
- {139, 376, 2406, L"Другое"},
- {139, 414, 415, L"Джэксон"},
- {139, 414, 2405, L"Другое"},
- {139, 380, 381, L"Джефферсон-Сити"},
- {139, 380, 3062, L"Канзас Сити"},
- {139, 380, 3038, L"Ли Саммит"},
- {139, 380, 1211, L"Сент-Луис"},
- {139, 380, 2895, L"Эллисвил"},
- {139, 380, 2404, L"Другое"},
- {139, 372, 3357, L"Вест Блюмфельд"},
- {139, 372, 1212, L"Гранд-Рапидс"},
- {139, 372, 1213, L"Детройт"},
- {139, 372, 3103, L"Каламазу"},
- {139, 372, 373, L"Лансинг"},
- {139, 372, 2987, L"Новай"},
- {139, 372, 2887, L"Сагино"},
- {139, 372, 2403, L"Другое"},
- {139, 424, 1214, L"Грейт-Фолс"},
- {139, 424, 425, L"Хелина"},
- {139, 424, 2402, L"Другое"},
- {139, 348, 349, L"Огаста"},
- {139, 348, 3000, L"Ярмут"},
- {139, 348, 2401, L"Другое"},
- {139, 392, 393, L"Аннаполис"},
- {139, 392, 1215, L"Балтимор"},
- {139, 392, 3143, L"Гринбелт"},
- {139, 392, 3337, L"Колледж Парк"},
- {139, 392, 2904, L"Маунт Эйри"},
- {139, 392, 3329, L"Роквилль"},
- {139, 392, 2400, L"Другое"},
- {139, 386, 387, L"Линкольн"},
- {139, 386, 1216, L"Омаха"},
- {139, 386, 2399, L"Другое"},
- {139, 438, 439, L"Карсон-Сити"},
- {139, 438, 1217, L"Лас-Вегас"},
- {139, 438, 2890, L"Рено"},
- {139, 438, 2398, L"Другое"},
- {139, 362, 1219, L"Атлантик-Сити"},
- {139, 362, 1218, L"Ньюарк"},
- {139, 362, 3276, L"Оклин"},
- {139, 362, 3073, L"Принстон"},
- {139, 362, 2955, L"Рузерфорд"},
- {139, 362, 3349, L"Сомервиль"},
- {139, 362, 363, L"Трентон"},
- {139, 362, 3078, L"Хакеттстоун"},
- {139, 362, 3248, L"Черри Хилл"},
- {139, 362, 2397, L"Другое"},
- {139, 360, 3134, L"Баффало"},
- {139, 360, 3081, L"Бингхэмптон"},
- {139, 360, 2997, L"Бруклин"},
- {139, 360, 2999, L"Варвик"},
- {139, 360, 3139, L"Ирвингтон"},
- {139, 360, 3060, L"Итака"},
- {139, 360, 1220, L"Нью-Йорк"},
- {139, 360, 361, L"Олбани"},
- {139, 360, 2914, L"Погкипси"},
- {139, 360, 3056, L"Саратога Спрингс"},
- {139, 360, 2396, L"Другое"},
- {139, 432, 1222, L"Альбукерке"},
- {139, 432, 433, L"Санта-Фе"},
- {139, 432, 2395, L"Другое"},
- {139, 350, 2989, L"Амхерст"},
- {139, 350, 351, L"Конкорд"},
- {139, 350, 2950, L"Лондондерри"},
- {139, 350, 1221, L"Манчестер"},
- {139, 350, 3111, L"Рочестер"},
- {139, 350, 2898, L"Салем"},
- {139, 350, 2938, L"Хадсон"},
- {139, 350, 2394, L"Другое"},
- {139, 366, 2953, L"Варрен"},
- {139, 366, 3112, L"Гроув Сити"},
- {139, 366, 1223, L"Кливленд"},
- {139, 366, 367, L"Колумбус"},
- {139, 366, 2951, L"Лавленд"},
- {139, 366, 2862, L"Оберлин"},
- {139, 366, 3034, L"Рейнольдсбург"},
- {139, 366, 2860, L"Цинциннати"},
- {139, 366, 2393, L"Другое"},
- {139, 420, 421, L"Оклахома-Сити"},
- {139, 420, 1224, L"Талса"},
- {139, 420, 2392, L"Другое"},
- {139, 442, 2877, L"Кламат-Фолс"},
- {139, 442, 2945, L"Коттедж-Гроув"},
- {139, 442, 1225, L"Портленд"},
- {139, 442, 443, L"Сейлем"},
- {139, 442, 1226, L"Юджин"},
- {139, 442, 2391, L"Другое"},
- {139, 364, 3316, L"Вифлием"},
- {139, 364, 3282, L"Колледжвиль"},
- {139, 364, 2972, L"Нью Фридом"},
- {139, 364, 1227, L"Питтсбург"},
- {139, 364, 2893, L"Рандор"},
- {139, 364, 3110, L"Слиппери Рок"},
- {139, 364, 1228, L"Филадельфия"},
- {139, 364, 365, L"Харрисберг"},
- {139, 364, 2390, L"Другое"},
- {139, 450, 451, L"Понсе"},
- {139, 450, 3093, L"Сан-Хуан"},
- {139, 450, 2389, L"Другое"},
- {139, 356, 357, L"Провиденс"},
- {139, 356, 2388, L"Другое"},
- {139, 382, 383, L"Бисмарк"},
- {139, 382, 2387, L"Другое"},
- {139, 398, 2960, L"Вильмингтон"},
- {139, 398, 2915, L"Дурхам"},
- {139, 398, 399, L"Роли"},
- {139, 398, 2386, L"Другое"},
- {139, 410, 2863, L"Мемфис"},
- {139, 410, 411, L"Нашвилл"},
- {139, 410, 1229, L"Ноксвилл"},
- {139, 410, 2385, L"Другое"},
- {139, 422, 3085, L"Бедфорд"},
- {139, 422, 2913, L"Брейди"},
- {139, 422, 1233, L"Даллас"},
- {139, 422, 2916, L"Ирвинг"},
- {139, 422, 3123, L"Кингсвилл"},
- {139, 422, 2873, L"Конрой"},
- {139, 422, 3096, L"Корпус Кристи"},
- {139, 422, 423, L"Остин"},
- {139, 422, 1232, L"Сан-Антонио"},
- {139, 422, 3023, L"Уайли"},
- {139, 422, 1231, L"Хьюстон"},
- {139, 422, 1230, L"Эль-Пасо"},
- {139, 422, 2384, L"Другое"},
- {139, 406, 2383, L"Другое"},
- {139, 404, 2879, L"Бока-Рейтон"},
- {139, 404, 2880, L"Гейнсвил"},
- {139, 404, 3086, L"Джексонвиль"},
- {139, 404, 3002, L"Киссимми"},
- {139, 404, 3124, L"Корал Гейблс"},
- {139, 404, 2894, L"Корал-Спрингс"},
- {139, 404, 3290, L"Лейк-Ворт"},
- {139, 404, 1234, L"Майами"},
- {139, 404, 1236, L"Орландо"},
- {139, 404, 3372, L"Пинеллас Парк"},
- {139, 404, 2952, L"Пунта-Горда"},
- {139, 404, 3340, L"Сарасота"},
- {139, 404, 1235, L"Сент-Питерсберг"},
- {139, 404, 405, L"Таллахасси"},
- {139, 404, 2962, L"Форт Лаудердейл"},
- {139, 404, 2382, L"Другое"},
- {139, 384, 385, L"Пирр"},
- {139, 384, 2381, L"Другое"},
- {139, 400, 401, L"Колумбия"},
- {139, 400, 3090, L"Спартанбург"},
- {139, 400, 1237, L"Чарлстон"},
- {139, 400, 2380, L"Другое"},
- {139, 436, 3036, L"Кейсвилл"},
- {139, 436, 3024, L"Линдон"},
- {139, 436, 3108, L"Орем"},
- {139, 436, 2866, L"Сент-Джордж"},
- {139, 436, 437, L"Солт-Лейк-Сити"},
- {139, 436, 2379, L"Другое"},
- {39, 315, 614, L"Винница"},
- {39, 315, 615, L"Хмельник"},
- {39, 315, 2566, L"Другое"},
- {39, 316, 2940, L"Ковель"},
- {39, 316, 616, L"Луцк"},
- {39, 316, 2565, L"Другое"},
- {39, 317, 617, L"Днепродзержинск"},
- {39, 317, 618, L"Днепропетровск"},
- {39, 317, 619, L"Кривой Рог"},
- {39, 317, 620, L"Никополь"},
- {39, 317, 621, L"Новомосковск"},
- {39, 317, 622, L"Орджоникидзе"},
- {39, 317, 623, L"Павлоград"},
- {39, 317, 2564, L"Другое"},
- {39, 318, 624, L"Артемовск"},
- {39, 318, 625, L"Горловка"},
- {39, 318, 626, L"Донецк"},
- {39, 318, 627, L"Дружковка"},
- {39, 318, 628, L"Енакиево"},
- {39, 318, 629, L"Константиновка"},
- {39, 318, 630, L"Краматорск"},
- {39, 318, 2944, L"Красноармейск"},
- {39, 318, 631, L"Макеевка"},
- {39, 318, 632, L"Мариуполь"},
- {39, 318, 633, L"Николаевка"},
- {39, 318, 634, L"Славянск"},
- {39, 318, 635, L"Харцызск"},
- {39, 318, 2563, L"Другое"},
- {39, 319, 636, L"Бердичев"},
- {39, 319, 637, L"Житомир"},
- {39, 319, 2942, L"Коростень"},
- {39, 319, 638, L"Коростышев"},
- {39, 319, 2907, L"Малин"},
- {39, 319, 639, L"Новоград-Волынский"},
- {39, 319, 2562, L"Другое"},
- {39, 320, 640, L"Берегово"},
- {39, 320, 641, L"Воловец"},
- {39, 320, 3119, L"Мукачево"},
- {39, 320, 3162, L"Свалява"},
- {39, 320, 642, L"Ужгород"},
- {39, 320, 643, L"Хуст"},
- {39, 320, 2561, L"Другое"},
- {39, 321, 644, L"Бердянск"},
- {39, 321, 3128, L"Гуляйполе"},
- {39, 321, 645, L"Запорожье"},
- {39, 321, 646, L"Мелитополь"},
- {39, 321, 3121, L"Приморск"},
- {39, 321, 3378, L"Энергодар"},
- {39, 321, 2560, L"Другое"},
- {39, 322, 3379, L"Галич"},
- {39, 322, 647, L"Ивано-Франковск"},
- {39, 322, 3170, L"Яремче"},
- {39, 322, 2559, L"Другое"},
- {39, 323, 648, L"Белая Церковь"},
- {39, 323, 649, L"Борисполь"},
- {39, 323, 651, L"Бровары"},
- {39, 323, 650, L"Васильков"},
- {39, 323, 652, L"Ирпень"},
- {39, 323, 3341, L"Переяслав-Хмельницкий"},
- {39, 323, 653, L"Славутич"},
- {39, 323, 654, L"Фастов"},
- {39, 323, 655, L"Чернобыль"},
- {39, 323, 2558, L"Другое"},
- {39, 324, 656, L"Александрия"},
- {39, 324, 657, L"Кировоград"},
- {39, 324, 658, L"Светловодск"},
- {39, 324, 2557, L"Другое"},
- {39, 325, 659, L"Алушта"},
- {39, 325, 2984, L"Армянск"},
- {39, 325, 3042, L"Балаклава"},
- {39, 325, 660, L"Бахчисарай"},
- {39, 325, 662, L"Гурзуф"},
- {39, 325, 3382, L"Джанкой"},
- {39, 325, 663, L"Евпатория"},
- {39, 325, 667, L"Керчь"},
- {39, 325, 666, L"Коктебель"},
- {39, 325, 668, L"Мысовое"},
- {39, 325, 669, L"Саки"},
- {39, 325, 665, L"Севастополь"},
- {39, 325, 661, L"Симферополь"},
- {39, 325, 3370, L"Старый Крым"},
- {39, 325, 670, L"Судак"},
- {39, 325, 664, L"Феодосия"},
- {39, 325, 3148, L"Черноморское"},
- {39, 325, 671, L"Ялта"},
- {39, 325, 2556, L"Другое"},
- {39, 326, 672, L"Алчевск"},
- {39, 326, 673, L"Антрацит"},
- {39, 326, 674, L"Лисичанск"},
- {39, 326, 675, L"Луганск"},
- {39, 326, 3364, L"Молодогвардейск"},
- {39, 326, 676, L"Петровское"},
- {39, 326, 677, L"Ровеньки"},
- {39, 326, 678, L"Рубежное"},
- {39, 326, 679, L"Северодонецк"},
- {39, 326, 680, L"Стаханов"},
- {39, 326, 2555, L"Другое"},
- {39, 327, 3284, L"Дрогобыч"},
- {39, 327, 681, L"Львов"},
- {39, 327, 682, L"Трускавец"},
- {39, 327, 2554, L"Другое"},
- {39, 328, 3322, L"Вознесенск"},
- {39, 328, 2870, L"Жовтневое"},
- {39, 328, 683, L"Николаев"},
- {39, 328, 3118, L"Очаков"},
- {39, 328, 3325, L"Южноукраинск"},
- {39, 328, 2553, L"Другое"},
- {39, 329, 684, L"Белгород-Днестровский"},
- {39, 329, 685, L"Измаил"},
- {39, 329, 689, L"Ильичевск"},
- {39, 329, 686, L"Одесса"},
- {39, 329, 688, L"Рени"},
- {39, 329, 687, L"Слободка"},
- {39, 329, 2552, L"Другое"},
- {39, 330, 690, L"Гадяч"},
- {39, 330, 691, L"Комсомольск"},
- {39, 330, 693, L"Кременчуг"},
- {39, 330, 694, L"Лубны"},
- {39, 330, 695, L"Миргород"},
- {39, 330, 692, L"Полтава"},
- {39, 330, 2551, L"Другое"},
- {39, 331, 696, L"Здолбунов"},
- {39, 331, 697, L"Ровно"},
- {39, 331, 3361, L"Сарны"},
- {39, 331, 2550, L"Другое"},
- {39, 332, 3356, L"Бурынь"},
- {39, 332, 698, L"Конотоп"},
- {39, 332, 700, L"Ромны"},
- {39, 332, 699, L"Сумы"},
- {39, 332, 701, L"Шостка"},
- {39, 332, 2549, L"Другое"},
- {39, 333, 702, L"Бережаны"},
- {39, 333, 3171, L"Борщев"},
- {39, 333, 703, L"Тернополь"},
- {39, 333, 704, L"Чортков"},
- {39, 333, 2548, L"Другое"},
- {39, 334, 705, L"Изюм"},
- {39, 334, 3346, L"Купянск"},
- {39, 334, 3351, L"Купянск"},
- {39, 334, 706, L"Лозовая"},
- {39, 334, 708, L"Мерефа"},
- {39, 334, 707, L"Харьков"},
- {39, 334, 709, L"Чугуев"},
- {39, 334, 2547, L"Другое"},
- {39, 335, 710, L"Геническ"},
- {39, 335, 711, L"Каховка"},
- {39, 335, 712, L"Новая Каховка"},
- {39, 335, 3280, L"Скадовск"},
- {39, 335, 713, L"Херсон"},
- {39, 335, 2546, L"Другое"},
- {39, 336, 714, L"Каменец-Подольский"},
- {39, 336, 715, L"Красилов"},
- {39, 336, 2941, L"Нетишин"},
- {39, 336, 716, L"Полонное"},
- {39, 336, 3120, L"Сатанов"},
- {39, 336, 2943, L"Славута"},
- {39, 336, 717, L"Хмельницкий"},
- {39, 336, 3155, L"Чемировцы"},
- {39, 336, 2542, L"Другое"},
- {39, 337, 3169, L"Золотоноша"},
- {39, 337, 3016, L"Канев"},
- {39, 337, 3333, L"Полонное"},
- {39, 337, 718, L"Умань"},
- {39, 337, 719, L"Христиновка"},
- {39, 337, 720, L"Черкассы"},
- {39, 337, 2545, L"Другое"},
- {39, 338, 721, L"Нежин"},
- {39, 338, 722, L"Прилуки"},
- {39, 338, 723, L"Чернигов"},
- {39, 338, 2544, L"Другое"},
- {39, 339, 724, L"Черновцы"},
- {39, 339, 2543, L"Другое"},
- {340, 342, 725, L"Барановичи"},
- {340, 342, 726, L"Белоозерск"},
- {340, 342, 727, L"Береза"},
- {340, 342, 728, L"Брест"},
- {340, 342, 3172, L"Дрогичин"},
- {340, 342, 729, L"Кобрин"},
- {340, 342, 730, L"Ляховичи"},
- {340, 342, 731, L"Малорита"},
- {340, 342, 732, L"Пинск"},
- {340, 342, 2538, L"Другое"},
- {340, 343, 733, L"Браслав"},
- {340, 343, 735, L"Витебск"},
- {340, 343, 734, L"Новолукомоль"},
- {340, 343, 736, L"Новополоцк"},
- {340, 343, 737, L"Орша"},
- {340, 343, 738, L"Толочин"},
- {340, 343, 2537, L"Другое"},
- {340, 344, 739, L"Гомель"},
- {340, 344, 740, L"Жлобин"},
- {340, 344, 741, L"Мозырь"},
- {340, 344, 742, L"Речица"},
- {340, 344, 743, L"Рогачев"},
- {340, 344, 744, L"Светлогорск"},
- {340, 344, 2536, L"Другое"},
- {340, 345, 745, L"Волковыск"},
- {340, 345, 746, L"Гродно"},
- {340, 345, 747, L"Лида"},
- {340, 345, 3244, L"Слоним"},
- {340, 345, 748, L"Сморгонь"},
- {340, 345, 2535, L"Другое"},
- {340, 346, 3149, L"Березино"},
- {340, 346, 749, L"Борисов"},
- {340, 346, 750, L"Вилейка"},
- {340, 346, 751, L"Жодино"},
- {340, 346, 752, L"Марьина Горка"},
- {340, 346, 753, L"Молодечно"},
- {340, 346, 2896, L"Слуцк"},
- {340, 346, 754, L"Смолевичи"},
- {340, 346, 755, L"Солигорск"},
- {340, 346, 756, L"Червень"},
- {340, 346, 2534, L"Другое"},
- {340, 347, 757, L"Бобруйск"},
- {340, 347, 758, L"Могилев"},
- {340, 347, 759, L"Осиповичи"},
- {340, 347, 2533, L"Другое"},
- {0, 0, 0, NULL}
+ {24, 0, 0, L"Россия"},
+ {81, 0, 0, L"Азербайджан"},
+ {82, 0, 0, L"Армения"},
+ {97, 0, 0, L"Афганистан"},
+ {96, 0, 0, L"Бангладеш"},
+ {99, 0, 0, L"Бахрейн"},
+ {100, 0, 0, L"Бруней-Даруссалам"},
+ {101, 0, 0, L"Бутан"},
+ {102, 0, 0, L"Вьетнам"},
+ {83, 0, 0, L"Грузия"},
+ {86, 0, 0, L"Израиль"},
+ {95, 0, 0, L"Индия"},
+ {103, 0, 0, L"Индонезия"},
+ {79, 0, 0, L"Иордания"},
+ {85, 0, 0, L"Ирак"},
+ {87, 0, 0, L"Иран"},
+ {104, 0, 0, L"Йемен"},
+ {84, 0, 0, L"Казахстан"},
+ {105, 0, 0, L"Камбоджа"},
+ {106, 0, 0, L"Катар"},
+ {107, 0, 0, L"Кипр"},
+ {92, 0, 0, L"Киргизия (Кыргызстан)"},
+ {76, 0, 0, L"Китай"},
+ {3215, 0, 0, L"Кокосовые острова (Австр.)"},
+ {29, 0, 0, L"Корея (КНДР)"},
+ {108, 0, 0, L"Корея"},
+ {88, 0, 0, L"Кувейт"},
+ {109, 0, 0, L"Лаос"},
+ {110, 0, 0, L"Ливан"},
+ {111, 0, 0, L"Малайзия"},
+ {112, 0, 0, L"Мальдивы"},
+ {113, 0, 0, L"Монголия"},
+ {114, 0, 0, L"Мьянма"},
+ {115, 0, 0, L"Непал"},
+ {116, 0, 0, L"Объединенные Арабские Эмираты"},
+ {117, 0, 0, L"Оман"},
+ {3216, 0, 0, L"Остров Рождества (Австр.)"},
+ {122, 0, 0, L"Пакистан"},
+ {89, 0, 0, L"Палестина"},
+ {94, 0, 0, L"Саудовская Аравия"},
+ {118, 0, 0, L"Сингапур"},
+ {78, 0, 0, L"Сирия"},
+ {91, 0, 0, L"Таджикистан"},
+ {119, 0, 0, L"Таиланд"},
+ {120, 0, 0, L"Тайвань"},
+ {132, 0, 0, L"Тимор"},
+ {90, 0, 0, L"Туркмения"},
+ {77, 0, 0, L"Турция"},
+ {93, 0, 0, L"Узбекистан"},
+ {121, 0, 0, L"Филиппины"},
+ {98, 0, 0, L"Шри Ланка"},
+ {75, 0, 0, L"Япония"},
+ {123, 0, 0, L"Австралия"},
+ {454, 0, 0, L"Американское Самоа"},
+ {124, 0, 0, L"Вануату"},
+ {453, 0, 0, L"Гуам (США)"},
+ {126, 0, 0, L"Кирибати"},
+ {127, 0, 0, L"Маршалловы Острова"},
+ {128, 0, 0, L"Микронезия (Федеративные Штаты Микронезии)"},
+ {129, 0, 0, L"Науру"},
+ {3220, 0, 0, L"Ниуэ (Н.Зел.)"},
+ {130, 0, 0, L"Новая Зеландия"},
+ {3218, 0, 0, L"Новая Каледония (Фр.)"},
+ {3221, 0, 0, L"Острова Кука (Н.Зел.)"},
+ {3230, 0, 0, L"Острова Херд и Макдональд (Австр.)"},
+ {131, 0, 0, L"Палау"},
+ {133, 0, 0, L"Папуа - Новая Гвинея"},
+ {3222, 0, 0, L"Питкерн (Брит.)"},
+ {125, 0, 0, L"Самоа"},
+ {3219, 0, 0, L"Сев. Марианские острова (США)"},
+ {134, 0, 0, L"Соломоновы Острова"},
+ {3223, 0, 0, L"Токелау (Н.Зел.)"},
+ {135, 0, 0, L"Тонга"},
+ {136, 0, 0, L"Тувалу"},
+ {3224, 0, 0, L"Уоллис и Футуна острова (Фр.)"},
+ {137, 0, 0, L"Фиджи"},
+ {3226, 0, 0, L"Французская Полинезия"},
+ {3225, 0, 0, L"Французские Южные территории"},
+ {138, 0, 0, L"Канада"},
+ {139, 0, 0, L"США"},
+ {3200, 0, 0, L"Ангилья (Брит.)"},
+ {140, 0, 0, L"Антигуа и Барбуда"},
+ {141, 0, 0, L"Аргентина"},
+ {3202, 0, 0, L"Аруба (Нид.)"},
+ {142, 0, 0, L"Багамы"},
+ {143, 0, 0, L"Барбадос"},
+ {146, 0, 0, L"Белиз"},
+ {3203, 0, 0, L"Бермуды (Брит.)"},
+ {144, 0, 0, L"Боливия"},
+ {145, 0, 0, L"Бразилия"},
+ {147, 0, 0, L"Венесуэла"},
+ {3204, 0, 0, L"Виргинские острова (Брит.)"},
+ {452, 0, 0, L"Виргинские острова (США)"},
+ {149, 0, 0, L"Гаити"},
+ {148, 0, 0, L"Гайана"},
+ {3205, 0, 0, L"Гваделупа (Фр.)"},
+ {173, 0, 0, L"Гватемала"},
+ {150, 0, 0, L"Гондурас"},
+ {151, 0, 0, L"Гренада"},
+ {152, 0, 0, L"Гренландия (Дат.)"},
+ {153, 0, 0, L"Доминика"},
+ {154, 0, 0, L"Доминиканская Республика"},
+ {155, 0, 0, L"Колумбия"},
+ {156, 0, 0, L"Коста-Рика"},
+ {157, 0, 0, L"Куба"},
+ {3208, 0, 0, L"Мартиника (Фр.)"},
+ {158, 0, 0, L"Мексика"},
+ {3209, 0, 0, L"Монтсеррат (Брит)"},
+ {3201, 0, 0, L"Нидерландские Антилы"},
+ {159, 0, 0, L"Никарагуа"},
+ {3207, 0, 0, L"Остров Кайман (Брит.)"},
+ {3211, 0, 0, L"Острова Теркс и Кайкос (Брит.)"},
+ {160, 0, 0, L"Панама"},
+ {161, 0, 0, L"Парагвай"},
+ {162, 0, 0, L"Перу"},
+ {163, 0, 0, L"Сальвадор"},
+ {164, 0, 0, L"Сент-Винсент и Гренадины"},
+ {165, 0, 0, L"Сент-Китс и Невис"},
+ {166, 0, 0, L"Сент-Люсия"},
+ {3210, 0, 0, L"Сент-Пьер и Микелон (Фр.)"},
+ {167, 0, 0, L"Суринам"},
+ {168, 0, 0, L"Тринидат и Тобаго"},
+ {169, 0, 0, L"Уругвай"},
+ {3212, 0, 0, L"Фолклендские острова (Брит.)"},
+ {3206, 0, 0, L"Французская Гвиана"},
+ {170, 0, 0, L"Чили"},
+ {171, 0, 0, L"Эквадор"},
+ {3213, 0, 0, L"Юж. Джорджия и Юж. Сандвичевы о-ва (Брит.)"},
+ {172, 0, 0, L"Ямайка"},
+ {174, 0, 0, L"Алжир"},
+ {175, 0, 0, L"Ангола"},
+ {176, 0, 0, L"Бенин"},
+ {177, 0, 0, L"Ботсвана"},
+ {3228, 0, 0, L"Британская территория в Индийском океане"},
+ {178, 0, 0, L"Буркина-Фасо"},
+ {179, 0, 0, L"Бурунди"},
+ {180, 0, 0, L"Габон"},
+ {181, 0, 0, L"Гамбия"},
+ {182, 0, 0, L"Гана"},
+ {183, 0, 0, L"Гвинея"},
+ {184, 0, 0, L"Гвинея-Бисау"},
+ {185, 0, 0, L"Джибути"},
+ {186, 0, 0, L"Египет"},
+ {187, 0, 0, L"Замбия"},
+ {3198, 0, 0, L"Зап. Сахара"},
+ {23, 0, 0, L"Зимбабве"},
+ {188, 0, 0, L"Кабо-Верде"},
+ {189, 0, 0, L"Камерун"},
+ {190, 0, 0, L"Кения"},
+ {191, 0, 0, L"Коморы"},
+ {193, 0, 0, L"Конго (Заир)"},
+ {192, 0, 0, L"Конго"},
+ {194, 0, 0, L"Кот-д`Ивуар"},
+ {195, 0, 0, L"Лесото"},
+ {196, 0, 0, L"Либерия"},
+ {197, 0, 0, L"Ливия"},
+ {198, 0, 0, L"Маврикий"},
+ {199, 0, 0, L"Мавритания"},
+ {200, 0, 0, L"Мадагаскар"},
+ {3229, 0, 0, L"Майотт (Фр.)"},
+ {201, 0, 0, L"Малави"},
+ {202, 0, 0, L"Мали"},
+ {203, 0, 0, L"Марокко"},
+ {204, 0, 0, L"Мозамбик"},
+ {205, 0, 0, L"Намибия"},
+ {206, 0, 0, L"Нигер"},
+ {207, 0, 0, L"Нигерия"},
+ {3227, 0, 0, L"Остров Буве (Норв.)"},
+ {3197, 0, 0, L"Реюньон (Фр.)"},
+ {208, 0, 0, L"Руанда"},
+ {209, 0, 0, L"Сан-Томе и Принсипи"},
+ {210, 0, 0, L"Свазиленд"},
+ {3199, 0, 0, L"Святая Елена (Брит.)"},
+ {211, 0, 0, L"Сейшелы"},
+ {212, 0, 0, L"Сенегал"},
+ {213, 0, 0, L"Сомали"},
+ {214, 0, 0, L"Судан"},
+ {215, 0, 0, L"Сьерра-Леоне"},
+ {216, 0, 0, L"Танзания"},
+ {217, 0, 0, L"Того"},
+ {218, 0, 0, L"Тунис"},
+ {219, 0, 0, L"Уганда"},
+ {220, 0, 0, L"Центральноафриканская Республика"},
+ {222, 0, 0, L"Чад"},
+ {223, 0, 0, L"Экваториальная Гвинея"},
+ {221, 0, 0, L"Эритрея"},
+ {224, 0, 0, L"Эфиопия"},
+ {225, 0, 0, L"Южно-Африканская Республика (ЮАР)"},
+ {39, 0, 0, L"Украина"},
+ {40, 0, 0, L"Австрия"},
+ {32, 0, 0, L"Албания"},
+ {33, 0, 0, L"Андорра"},
+ {340, 0, 0, L"Белоруссия"},
+ {38, 0, 0, L"Бельгия"},
+ {41, 0, 0, L"Болгария"},
+ {42, 0, 0, L"Босния и Герцеговина"},
+ {43, 0, 0, L"Ватикан"},
+ {45, 0, 0, L"Великобритания"},
+ {44, 0, 0, L"Венгрия"},
+ {46, 0, 0, L"Германия"},
+ {3193, 0, 0, L"Гернси (Брит.)"},
+ {47, 0, 0, L"Гибралтар (Брит.)"},
+ {48, 0, 0, L"Греция"},
+ {49, 0, 0, L"Дания"},
+ {3194, 0, 0, L"Джерси (Брит.)"},
+ {50, 0, 0, L"Ирландия"},
+ {51, 0, 0, L"Исландия"},
+ {34, 0, 0, L"Испания"},
+ {52, 0, 0, L"Италия"},
+ {53, 0, 0, L"Латвия"},
+ {54, 0, 0, L"Литва"},
+ {55, 0, 0, L"Лихтенштейн"},
+ {56, 0, 0, L"Люксембург"},
+ {57, 0, 0, L"Македония"},
+ {58, 0, 0, L"Мальта"},
+ {59, 0, 0, L"Молдавия"},
+ {36, 0, 0, L"Монако"},
+ {60, 0, 0, L"Нидерланды"},
+ {61, 0, 0, L"Норвегия"},
+ {3195, 0, 0, L"Остров Мэн (Брит.)"},
+ {62, 0, 0, L"Польша"},
+ {35, 0, 0, L"Португалия"},
+ {63, 0, 0, L"Румыния"},
+ {64, 0, 0, L"Сан-Марино"},
+ {74, 0, 0, L"Сербия и Черногория"},
+ {65, 0, 0, L"Словакия"},
+ {66, 0, 0, L"Словения"},
+ {67, 0, 0, L"Фарерские о-ва (Дания)"},
+ {68, 0, 0, L"Финляндия"},
+ {37, 0, 0, L"Франция"},
+ {69, 0, 0, L"Хорватия"},
+ {70, 0, 0, L"Чехия"},
+ {71, 0, 0, L"Швейцария"},
+ {72, 0, 0, L"Швеция"},
+ {3196, 0, 0, L"Шпицберген (Норв.)"},
+ {73, 0, 0, L"Эстония"},
+ {24, 25, 0, L"Москва"},
+ {24, 226, 0, L"Санкт-Петербург"},
+ {24, 233, 0, L"Саха (Якутия)"},
+ {24, 232, 0, L"Приморский край"},
+ {24, 235, 0, L"Хабаровский край"},
+ {24, 227, 0, L"Амурская обл."},
+ {24, 229, 0, L"Камчатская обл."},
+ {24, 231, 0, L"Магаданская обл."},
+ {24, 234, 0, L"Сахалинская обл."},
+ {24, 228, 0, L"Еврейская АО"},
+ {24, 230, 0, L"Корякский АО"},
+ {24, 236, 0, L"Чукотский АО"},
+ {24, 237, 0, L"Башкортостан"},
+ {24, 240, 0, L"Марий-Эл"},
+ {24, 241, 0, L"Мордовия"},
+ {24, 248, 0, L"Татарстан"},
+ {24, 249, 0, L"Удмуртия"},
+ {24, 251, 0, L"Чувашия"},
+ {24, 238, 0, L"Кировская обл."},
+ {24, 242, 0, L"Нижегородская обл."},
+ {24, 243, 0, L"Оренбургская обл."},
+ {24, 244, 0, L"Пензенская обл."},
+ {24, 245, 0, L"Пермская обл."},
+ {24, 246, 0, L"Самарская обл."},
+ {24, 247, 0, L"Саратовская обл."},
+ {24, 250, 0, L"Ульяновская обл."},
+ {24, 239, 0, L"Коми-Пермяцкий АО"},
+ {24, 255, 0, L"Карелия"},
+ {24, 256, 0, L"Коми"},
+ {24, 252, 0, L"Архангельская обл."},
+ {24, 253, 0, L"Вологодская обл."},
+ {24, 254, 0, L"Калининградская обл."},
+ {24, 257, 0, L"Ленинградская обл."},
+ {24, 258, 0, L"Мурманская обл."},
+ {24, 260, 0, L"Новгородская обл."},
+ {24, 261, 0, L"Псковская обл."},
+ {24, 259, 0, L"Ненецкий АО"},
+ {24, 265, 0, L"Бурятия"},
+ {24, 263, 0, L"Республика Алтай"},
+ {24, 273, 0, L"Тыва"},
+ {24, 275, 0, L"Хакасия"},
+ {24, 264, 0, L"Алтайский край"},
+ {24, 268, 0, L"Красноярский край"},
+ {24, 266, 0, L"Иркутская обл."},
+ {24, 267, 0, L"Кемеровская обл."},
+ {24, 269, 0, L"Новосибирская обл."},
+ {24, 270, 0, L"Омская обл."},
+ {24, 272, 0, L"Томская обл."},
+ {24, 276, 0, L"Читинская обл."},
+ {24, 262, 0, L"Агинский Бурятский АО"},
+ {24, 271, 0, L"Таймырский АО"},
+ {24, 274, 0, L"Усть-Ордынский Бурятский АО"},
+ {24, 277, 0, L"Эвенкийский АО"},
+ {24, 278, 0, L"Курганская обл."},
+ {24, 279, 0, L"Свердловская обл."},
+ {24, 280, 0, L"Тюменская обл."},
+ {24, 282, 0, L"Челябинская обл."},
+ {24, 281, 0, L"Ханты-Мансийский АО - Югра"},
+ {24, 283, 0, L"Ямало-Ненецкий АО"},
+ {24, 284, 0, L"Белгородская обл."},
+ {24, 285, 0, L"Брянская обл."},
+ {24, 286, 0, L"Владимирская обл."},
+ {24, 287, 0, L"Воронежская обл."},
+ {24, 288, 0, L"Ивановская обл."},
+ {24, 289, 0, L"Калужская обл."},
+ {24, 290, 0, L"Костромская обл."},
+ {24, 291, 0, L"Курская обл."},
+ {24, 292, 0, L"Липецкая обл."},
+ {24, 293, 0, L"Московская обл."},
+ {24, 294, 0, L"Орловская обл."},
+ {24, 295, 0, L"Рязанская обл."},
+ {24, 296, 0, L"Смоленская обл."},
+ {24, 297, 0, L"Тамбовская обл."},
+ {24, 298, 0, L"Тверская обл."},
+ {24, 299, 0, L"Тульская обл."},
+ {24, 300, 0, L"Ярославская обл."},
+ {24, 301, 0, L"Адыгея"},
+ {24, 304, 0, L"Дагестан"},
+ {24, 305, 0, L"Ингушетия"},
+ {24, 306, 0, L"Кабардино-Балкария"},
+ {24, 307, 0, L"Калмыкия"},
+ {24, 308, 0, L"Карачаево-Черкессия"},
+ {24, 311, 0, L"Северная Осетия - Алания"},
+ {24, 313, 0, L"Чечня"},
+ {24, 309, 0, L"Краснодарский край"},
+ {24, 312, 0, L"Ставропольский край"},
+ {24, 302, 0, L"Астраханская обл."},
+ {24, 303, 0, L"Волгоградская обл."},
+ {24, 310, 0, L"Ростовская обл."},
+ {81, 1055, 0, L"Баку"},
+ {81, 1058, 0, L"Гянджа"},
+ {81, 1056, 0, L"Нахичевань"},
+ {81, 1057, 0, L"Ханкенди"},
+ {81, 3153, 0, L"Шеки"},
+ {81, 2291, 0, L"Другое"},
+ {82, 2932, 0, L"Абовян"},
+ {82, 1060, 0, L"Аштарак"},
+ {82, 3084, 0, L"Ванадзор"},
+ {82, 3011, 0, L"Гюмри"},
+ {82, 3306, 0, L"Дилижан"},
+ {82, 1059, 0, L"Ереван"},
+ {82, 3145, 0, L"Ханкенди"},
+ {82, 2292, 0, L"Другое"},
+ {97, 1061, 0, L"Кабул"},
+ {97, 2293, 0, L"Другое"},
+ {96, 1062, 0, L"Дакка"},
+ {96, 2294, 0, L"Другое"},
+ {99, 1063, 0, L"Манама"},
+ {99, 2295, 0, L"Другое"},
+ {100, 1064, 0, L"Бандар-Сери-Бегаван"},
+ {100, 2296, 0, L"Другое"},
+ {101, 1065, 0, L"Тхимпху"},
+ {101, 2297, 0, L"Другое"},
+ {102, 1066, 0, L"Ханой"},
+ {102, 2298, 0, L"Другое"},
+ {83, 1067, 0, L"Батуми"},
+ {83, 3158, 0, L"Боржоми"},
+ {83, 1068, 0, L"Поти"},
+ {83, 3129, 0, L"Рустави"},
+ {83, 1069, 0, L"Сухуми"},
+ {83, 1070, 0, L"Тбилиси"},
+ {83, 2299, 0, L"Другое"},
+ {86, 3345, 0, L"Ариэль"},
+ {86, 1071, 0, L"Афула"},
+ {86, 2992, 0, L"Ашдод"},
+ {86, 3175, 0, L"Ашкелон"},
+ {86, 3363, 0, L"Бат-Ям"},
+ {86, 2884, 0, L"Беер-Яков"},
+ {86, 3243, 0, L"Бейт-Шемеш"},
+ {86, 1074, 0, L"Беэр-Шева"},
+ {86, 3348, 0, L"Герцелия"},
+ {86, 3241, 0, L"Димона"},
+ {86, 1075, 0, L"Иерусалим"},
+ {86, 3350, 0, L"Йокнеам-Иллит"},
+ {86, 2982, 0, L"Кармиэль"},
+ {86, 2971, 0, L"Кфар-Саба"},
+ {86, 3136, 0, L"Назарет"},
+ {86, 1080, 0, L"Натания"},
+ {86, 3303, 0, L"Офаким"},
+ {86, 3050, 0, L"Раанана"},
+ {86, 3151, 0, L"Рамат Ган"},
+ {86, 3141, 0, L"Реховот"},
+ {86, 3012, 0, L"Ришон ле Цион"},
+ {86, 1081, 0, L"Тверия"},
+ {86, 1077, 0, L"Тель-Авив"},
+ {86, 1079, 0, L"Хадера"},
+ {86, 1078, 0, L"Хайфа"},
+ {86, 1076, 0, L"Хеврон"},
+ {86, 2929, 0, L"Цфат"},
+ {86, 2928, 0, L"Эйлат"},
+ {86, 2300, 0, L"Другое"},
+ {95, 3315, 0, L"Бангалор"},
+ {95, 1082, 0, L"Дели"},
+ {95, 1083, 0, L"Джайпур"},
+ {95, 3144, 0, L"Калькутта"},
+ {95, 3025, 0, L"Мумбаи"},
+ {95, 3277, 0, L"Панаджи"},
+ {95, 1084, 0, L"Ченнаи"},
+ {95, 2301, 0, L"Другое"},
+ {103, 1085, 0, L"Джакарта"},
+ {103, 2302, 0, L"Другое"},
+ {79, 1086, 0, L"Амман"},
+ {79, 2303, 0, L"Другое"},
+ {85, 1087, 0, L"Багдад"},
+ {85, 2304, 0, L"Другое"},
+ {87, 1088, 0, L"Тегеран"},
+ {87, 2305, 0, L"Другое"},
+ {104, 1089, 0, L"Сана"},
+ {104, 2306, 0, L"Другое"},
+ {84, 1090, 0, L"Актау"},
+ {84, 1091, 0, L"Актюбинск"},
+ {84, 1092, 0, L"Алма-Ата"},
+ {84, 3242, 0, L"Аршалы"},
+ {84, 1093, 0, L"Астана"},
+ {84, 1094, 0, L"Атырау (Гурьев)"},
+ {84, 1095, 0, L"Байконур"},
+ {84, 3245, 0, L"Балхаш"},
+ {84, 3083, 0, L"Жезказган"},
+ {84, 1096, 0, L"Капчагай"},
+ {84, 1097, 0, L"Караганда"},
+ {84, 1098, 0, L"Кокшетау"},
+ {84, 1099, 0, L"Кустанай"},
+ {84, 2868, 0, L"Лисаковск"},
+ {84, 1100, 0, L"Павлодар"},
+ {84, 1101, 0, L"Петропавловск (Сев.-Каз. обл.)"},
+ {84, 1102, 0, L"Рудный"},
+ {84, 1103, 0, L"Семипалатинск"},
+ {84, 1104, 0, L"Степногорск"},
+ {84, 3166, 0, L"Талгар"},
+ {84, 1105, 0, L"Талды-Курган"},
+ {84, 2927, 0, L"Тараз"},
+ {84, 1106, 0, L"Темиртау"},
+ {84, 1107, 0, L"Уральск"},
+ {84, 1108, 0, L"Усть-Каменогорск"},
+ {84, 1109, 0, L"Чимкент"},
+ {84, 1110, 0, L"Экибастуз"},
+ {84, 2307, 0, L"Другое"},
+ {105, 1111, 0, L"Пномпень"},
+ {105, 2308, 0, L"Другое"},
+ {106, 1112, 0, L"Доха"},
+ {106, 2309, 0, L"Другое"},
+ {107, 1113, 0, L"Ларнака"},
+ {107, 1114, 0, L"Лимассол"},
+ {107, 1115, 0, L"Никосия"},
+ {107, 2954, 0, L"Пафос"},
+ {107, 2310, 0, L"Другое"},
+ {92, 1116, 0, L"Бишкек"},
+ {92, 1117, 0, L"Джалал-Абад"},
+ {92, 3027, 0, L"Кара-Балта"},
+ {92, 1118, 0, L"Каракол"},
+ {92, 1119, 0, L"Ош"},
+ {92, 1120, 0, L"Талас"},
+ {92, 2933, 0, L"Хайдаркен"},
+ {92, 2311, 0, L"Другое"},
+ {76, 3214, 0, L"Аомынь (Макао)"},
+ {76, 1121, 0, L"Гонконг"},
+ {76, 2869, 0, L"Гуанчжоу"},
+ {76, 3262, 0, L"Далянь"},
+ {76, 1122, 0, L"Пекин"},
+ {76, 1123, 0, L"Харбин"},
+ {76, 1124, 0, L"Шанхай"},
+ {76, 3043, 0, L"Шеньян"},
+ {76, 2312, 0, L"Другое"},
+ {29, 1125, 0, L"Пхеньян"},
+ {29, 2313, 0, L"Другое"},
+ {108, 1126, 0, L"Сеул"},
+ {108, 3240, 0, L"Тейджон"},
+ {108, 2314, 0, L"Другое"},
+ {88, 1127, 0, L"Эль-Кувейт"},
+ {88, 2315, 0, L"Другое"},
+ {109, 1128, 0, L"Вьентьян"},
+ {109, 2316, 0, L"Другое"},
+ {110, 1129, 0, L"Бейрут"},
+ {110, 2317, 0, L"Другое"},
+ {111, 1130, 0, L"Джохор-Бару"},
+ {111, 1131, 0, L"Куала-Лумпур"},
+ {111, 2318, 0, L"Другое"},
+ {112, 1132, 0, L"Мале"},
+ {112, 2319, 0, L"Другое"},
+ {113, 1133, 0, L"Улан-Батор"},
+ {113, 1134, 0, L"Эрдэнэт"},
+ {113, 2320, 0, L"Другое"},
+ {114, 1135, 0, L"Янгон"},
+ {114, 2321, 0, L"Другое"},
+ {115, 1136, 0, L"Катманду"},
+ {115, 2322, 0, L"Другое"},
+ {116, 1137, 0, L"Абу-Даби"},
+ {116, 1138, 0, L"Дубай"},
+ {116, 1139, 0, L"Шарджа"},
+ {116, 2323, 0, L"Другое"},
+ {117, 1140, 0, L"Маскат"},
+ {117, 2324, 0, L"Другое"},
+ {122, 1141, 0, L"Исламабад"},
+ {122, 2325, 0, L"Другое"},
+ {89, 1072, 0, L"Ашдод"},
+ {89, 1073, 0, L"Ашкелон"},
+ {89, 1142, 0, L"Газа"},
+ {89, 2326, 0, L"Другое"},
+ {94, 3250, 0, L"Медина"},
+ {94, 1143, 0, L"Эр-Рияд"},
+ {94, 2327, 0, L"Другое"},
+ {78, 1144, 0, L"Дамаск"},
+ {78, 2328, 0, L"Другое"},
+ {91, 1145, 0, L"Душанбе"},
+ {91, 3307, 0, L"Кайраккум"},
+ {91, 3308, 0, L"Худжанд"},
+ {91, 2329, 0, L"Другое"},
+ {119, 1146, 0, L"Бангкок"},
+ {119, 1147, 0, L"Пхукет"},
+ {119, 2330, 0, L"Другое"},
+ {120, 1148, 0, L"Тайбэй"},
+ {120, 2331, 0, L"Другое"},
+ {132, 1149, 0, L"Дили"},
+ {132, 2332, 0, L"Другое"},
+ {90, 1150, 0, L"Ашхабад"},
+ {90, 3079, 0, L"Безмеин"},
+ {90, 2333, 0, L"Другое"},
+ {77, 1152, 0, L"Анкара"},
+ {77, 1153, 0, L"Анталия"},
+ {77, 3080, 0, L"Бурса"},
+ {77, 1151, 0, L"Мармарис"},
+ {77, 1154, 0, L"Стамбул"},
+ {77, 1155, 0, L"Трабзон"},
+ {77, 2334, 0, L"Другое"},
+ {93, 3362, 0, L"Алмалык"},
+ {93, 3137, 0, L"Андижан"},
+ {93, 3273, 0, L"Асака"},
+ {93, 1156, 0, L"Ахангаран"},
+ {93, 1157, 0, L"Бухара"},
+ {93, 3167, 0, L"Джизак"},
+ {93, 3347, 0, L"Кунград"},
+ {93, 1158, 0, L"Навои"},
+ {93, 1159, 0, L"Наманган"},
+ {93, 1160, 0, L"Самарканд"},
+ {93, 1161, 0, L"Ташкент"},
+ {93, 1162, 0, L"Ургенч"},
+ {93, 1163, 0, L"Фергана"},
+ {93, 1164, 0, L"Чирчик"},
+ {93, 2335, 0, L"Другое"},
+ {121, 1165, 0, L"Манила"},
+ {121, 3319, 0, L"Себу"},
+ {121, 2336, 0, L"Другое"},
+ {98, 1166, 0, L"Коломбо"},
+ {98, 2337, 0, L"Другое"},
+ {75, 3176, 0, L"Исесаки"},
+ {75, 3339, 0, L"Корияма"},
+ {75, 1167, 0, L"Саппоро"},
+ {75, 1168, 0, L"Токио"},
+ {75, 2338, 0, L"Другое"},
+ {123, 1914, 0, L"Аделаида"},
+ {123, 2957, 0, L"Блэк Рок"},
+ {123, 1915, 0, L"Брисбен"},
+ {123, 3331, 0, L"Горокан"},
+ {123, 1916, 0, L"Канберра"},
+ {123, 3001, 0, L"Лидкомб"},
+ {123, 1917, 0, L"Мельбурн"},
+ {123, 3217, 0, L"Норфолк"},
+ {123, 3064, 0, L"Перт"},
+ {123, 3020, 0, L"Санта Люсиа"},
+ {123, 1918, 0, L"Сидней"},
+ {123, 3238, 0, L"Энеабба"},
+ {123, 2339, 0, L"Другое"},
+ {454, 1192, 0, L"Паго-Паго"},
+ {454, 2366, 0, L"Другое"},
+ {124, 1919, 0, L"Порт-Вила"},
+ {124, 2340, 0, L"Другое"},
+ {453, 1193, 0, L"Аганья"},
+ {453, 2368, 0, L"Другое"},
+ {126, 1921, 0, L"Баирики"},
+ {126, 2342, 0, L"Другое"},
+ {127, 1922, 0, L"Маджуро"},
+ {127, 2343, 0, L"Другое"},
+ {128, 1923, 0, L"Паликир"},
+ {128, 2344, 0, L"Другое"},
+ {129, 1924, 0, L"Ярен"},
+ {129, 2345, 0, L"Другое"},
+ {130, 1925, 0, L"Веллингтон"},
+ {130, 1926, 0, L"Гамильтон"},
+ {130, 1928, 0, L"Данидин"},
+ {130, 1929, 0, L"Крайстчерч"},
+ {130, 3235, 0, L"Кромвель"},
+ {130, 1927, 0, L"Окленд"},
+ {130, 3323, 0, L"Тауранга"},
+ {130, 2346, 0, L"Другое"},
+ {131, 1930, 0, L"Корор"},
+ {131, 2347, 0, L"Другое"},
+ {133, 1931, 0, L"Порт-Морсби"},
+ {133, 2348, 0, L"Другое"},
+ {125, 1920, 0, L"Апиа"},
+ {125, 2341, 0, L"Другое"},
+ {134, 1932, 0, L"Хониара"},
+ {134, 2349, 0, L"Другое"},
+ {135, 1933, 0, L"Нукуалофа"},
+ {135, 2350, 0, L"Другое"},
+ {136, 1934, 0, L"Фунафути"},
+ {136, 2351, 0, L"Другое"},
+ {137, 1935, 0, L"Сува"},
+ {137, 2352, 0, L"Другое"},
+ {138, 3055, 0, L"Барлингтон"},
+ {138, 3049, 0, L"Броссард"},
+ {138, 3330, 0, L"Бурнаби"},
+ {138, 1169, 0, L"Ванкувер"},
+ {138, 3106, 0, L"Ватерлоо"},
+ {138, 1170, 0, L"Виннипег"},
+ {138, 1171, 0, L"Галифакс"},
+ {138, 1172, 0, L"Гамильтон"},
+ {138, 3365, 0, L"Денвер"},
+ {138, 1173, 0, L"Калгари"},
+ {138, 3104, 0, L"Камлупс"},
+ {138, 3366, 0, L"Каннингтон"},
+ {138, 1174, 0, L"Квебек"},
+ {138, 2964, 0, L"Кингстон"},
+ {138, 3113, 0, L"Коквитлам"},
+ {138, 1175, 0, L"Монреаль"},
+ {138, 2920, 0, L"Ниагара-Фолс"},
+ {138, 2889, 0, L"Норд-Йорк"},
+ {138, 1176, 0, L"Оттава"},
+ {138, 2903, 0, L"Порт Алберни"},
+ {138, 1177, 0, L"Ричмонд"},
+ {138, 1178, 0, L"Тимминс"},
+ {138, 2946, 0, L"Торнхилл"},
+ {138, 1179, 0, L"Торонто"},
+ {138, 1180, 0, L"Эдмонтон"},
+ {138, 2353, 0, L"Другое"},
+ {139, 407, 0, L"Вашингтон"},
+ {139, 426, 0, L"Айдахо"},
+ {139, 378, 0, L"Айова"},
+ {139, 412, 0, L"Алабама"},
+ {139, 446, 0, L"Аляска"},
+ {139, 434, 0, L"Аризона"},
+ {139, 416, 0, L"Арканзас"},
+ {139, 428, 0, L"Вайоминг"},
+ {139, 440, 0, L"Вашингтон"},
+ {139, 352, 0, L"Вермонт"},
+ {139, 394, 0, L"Виргиния"},
+ {139, 374, 0, L"Висконсин"},
+ {139, 448, 0, L"Гавайи"},
+ {139, 390, 0, L"Делавер"},
+ {139, 402, 0, L"Джорджия"},
+ {139, 396, 0, L"Западная Виргиния"},
+ {139, 370, 0, L"Иллинойс"},
+ {139, 368, 0, L"Индиана"},
+ {139, 444, 0, L"Калифорния"},
+ {139, 388, 0, L"Канзас"},
+ {139, 408, 0, L"Кентукки"},
+ {139, 430, 0, L"Колорадо"},
+ {139, 358, 0, L"Коннектикут"},
+ {139, 418, 0, L"Луизиана"},
+ {139, 354, 0, L"Массачусетс"},
+ {139, 376, 0, L"Миннесота"},
+ {139, 414, 0, L"Миссисипи"},
+ {139, 380, 0, L"Миссури"},
+ {139, 372, 0, L"Мичиган"},
+ {139, 424, 0, L"Монтана"},
+ {139, 348, 0, L"Мэн"},
+ {139, 392, 0, L"Мэриленд"},
+ {139, 386, 0, L"Небраска"},
+ {139, 438, 0, L"Невада"},
+ {139, 362, 0, L"Нью-Джерси"},
+ {139, 360, 0, L"Нью-Йорк"},
+ {139, 432, 0, L"Нью-Мексико"},
+ {139, 350, 0, L"Нью-Хэмпшир"},
+ {139, 366, 0, L"Огайо"},
+ {139, 420, 0, L"Оклахома"},
+ {139, 442, 0, L"Орегон"},
+ {139, 364, 0, L"Пенсильвания"},
+ {139, 450, 0, L"Пуэрто-Рико"},
+ {139, 356, 0, L"Род-Айленд"},
+ {139, 382, 0, L"Северная Дакота"},
+ {139, 398, 0, L"Северная Каролина"},
+ {139, 410, 0, L"Теннесси"},
+ {139, 422, 0, L"Техас"},
+ {139, 406, 0, L"Федеральный округ Колумбия"},
+ {139, 404, 0, L"Флорида"},
+ {139, 384, 0, L"Южная Дакота"},
+ {139, 400, 0, L"Южная Каролина"},
+ {139, 436, 0, L"Юта"},
+ {140, 1238, 0, L"Сент-Джонс"},
+ {140, 2442, 0, L"Другое"},
+ {141, 1239, 0, L"Буэнос-Айрес"},
+ {141, 2441, 0, L"Другое"},
+ {142, 1240, 0, L"Нассау"},
+ {142, 2440, 0, L"Другое"},
+ {143, 1241, 0, L"Бриджтаун"},
+ {143, 2439, 0, L"Другое"},
+ {146, 1242, 0, L"Бельмопан"},
+ {146, 2438, 0, L"Другое"},
+ {144, 1243, 0, L"Ла-Пас"},
+ {144, 2437, 0, L"Другое"},
+ {145, 1244, 0, L"Бразилиа"},
+ {145, 3094, 0, L"Пассо Фундо"},
+ {145, 1245, 0, L"Рио-де-Жанейро"},
+ {145, 1246, 0, L"Сан-Паулу"},
+ {145, 2436, 0, L"Другое"},
+ {147, 1247, 0, L"Каракас"},
+ {147, 2435, 0, L"Другое"},
+ {452, 1190, 0, L"Шарлотта-Амалия"},
+ {452, 2364, 0, L"Другое"},
+ {149, 1248, 0, L"Порт-о-Пренс"},
+ {149, 2434, 0, L"Другое"},
+ {148, 1249, 0, L"Джоржтаун"},
+ {148, 2433, 0, L"Другое"},
+ {173, 1250, 0, L"Гватемала"},
+ {173, 2432, 0, L"Другое"},
+ {150, 1251, 0, L"Тегусигальпа"},
+ {150, 2431, 0, L"Другое"},
+ {151, 1252, 0, L"Сент-Джорджес"},
+ {151, 2430, 0, L"Другое"},
+ {152, 1253, 0, L"Уманак"},
+ {152, 2429, 0, L"Другое"},
+ {153, 1254, 0, L"Розо"},
+ {153, 2428, 0, L"Другое"},
+ {154, 1255, 0, L"Санто-Доминго"},
+ {154, 2427, 0, L"Другое"},
+ {155, 1256, 0, L"Богота"},
+ {155, 2426, 0, L"Другое"},
+ {156, 1257, 0, L"Сан-Хосе"},
+ {156, 2425, 0, L"Другое"},
+ {157, 1258, 0, L"Гавана"},
+ {157, 2424, 0, L"Другое"},
+ {158, 1259, 0, L"Акапулько"},
+ {158, 1260, 0, L"Мехико"},
+ {158, 2423, 0, L"Другое"},
+ {159, 1261, 0, L"Манагуа"},
+ {159, 2422, 0, L"Другое"},
+ {160, 1262, 0, L"Панама"},
+ {160, 2421, 0, L"Другое"},
+ {161, 1263, 0, L"Асунсьон"},
+ {161, 2420, 0, L"Другое"},
+ {162, 1264, 0, L"Лима"},
+ {162, 2419, 0, L"Другое"},
+ {163, 1265, 0, L"Сан-Сальвадор"},
+ {163, 2418, 0, L"Другое"},
+ {164, 1266, 0, L"Кингстаун"},
+ {164, 2417, 0, L"Другое"},
+ {165, 1267, 0, L"Бастер"},
+ {165, 2416, 0, L"Другое"},
+ {166, 1268, 0, L"Кастри"},
+ {166, 2415, 0, L"Другое"},
+ {167, 1269, 0, L"Парамарибо"},
+ {167, 2414, 0, L"Другое"},
+ {168, 1270, 0, L"Порт-оф-Спейн"},
+ {168, 2413, 0, L"Другое"},
+ {169, 1271, 0, L"Монтевидео"},
+ {169, 2412, 0, L"Другое"},
+ {170, 1272, 0, L"Сантьяго"},
+ {170, 2411, 0, L"Другое"},
+ {171, 1273, 0, L"Гуаякиль"},
+ {171, 1274, 0, L"Кито"},
+ {171, 2410, 0, L"Другое"},
+ {172, 1275, 0, L"Кингстон"},
+ {172, 2409, 0, L"Другое"},
+ {174, 1854, 0, L"Алжир"},
+ {174, 2495, 0, L"Другое"},
+ {175, 1855, 0, L"Луанда"},
+ {175, 2494, 0, L"Другое"},
+ {176, 1856, 0, L"Котону"},
+ {176, 1857, 0, L"Порто-Ново"},
+ {176, 2493, 0, L"Другое"},
+ {177, 1858, 0, L"Габороне"},
+ {177, 2492, 0, L"Другое"},
+ {178, 1859, 0, L"Уагадугу"},
+ {178, 2491, 0, L"Другое"},
+ {179, 1860, 0, L"Бужумбуру"},
+ {179, 2490, 0, L"Другое"},
+ {180, 1861, 0, L"Либревиль"},
+ {180, 2489, 0, L"Другое"},
+ {181, 1862, 0, L"Банжул"},
+ {181, 2488, 0, L"Другое"},
+ {182, 1863, 0, L"Аккра"},
+ {182, 2487, 0, L"Другое"},
+ {183, 1864, 0, L"Конакри"},
+ {183, 2486, 0, L"Другое"},
+ {184, 1865, 0, L"Бисау"},
+ {184, 2485, 0, L"Другое"},
+ {185, 1866, 0, L"Джибути"},
+ {185, 2484, 0, L"Другое"},
+ {186, 3312, 0, L"Дахаб"},
+ {186, 1867, 0, L"Каир"},
+ {186, 1868, 0, L"Хургада"},
+ {186, 2483, 0, L"Другое"},
+ {187, 1869, 0, L"Лусака"},
+ {187, 2482, 0, L"Другое"},
+ {23, 1870, 0, L"Хараре"},
+ {23, 2481, 0, L"Другое"},
+ {188, 1871, 0, L"Прая"},
+ {188, 2480, 0, L"Другое"},
+ {189, 1872, 0, L"Яунде"},
+ {189, 2479, 0, L"Другое"},
+ {190, 1873, 0, L"Найроби"},
+ {190, 2478, 0, L"Другое"},
+ {191, 1874, 0, L"Морони"},
+ {191, 2477, 0, L"Другое"},
+ {193, 1875, 0, L"Киншаса"},
+ {193, 2476, 0, L"Другое"},
+ {192, 1876, 0, L"Браззавиль"},
+ {192, 2475, 0, L"Другое"},
+ {194, 1877, 0, L"Ямусукро"},
+ {194, 2474, 0, L"Другое"},
+ {195, 1878, 0, L"Масеру"},
+ {195, 2473, 0, L"Другое"},
+ {196, 1879, 0, L"Монровия"},
+ {196, 2472, 0, L"Другое"},
+ {197, 1880, 0, L"Триполи"},
+ {197, 2471, 0, L"Другое"},
+ {198, 1881, 0, L"Порт-Луи"},
+ {198, 2470, 0, L"Другое"},
+ {199, 1882, 0, L"Нуакшот"},
+ {199, 2469, 0, L"Другое"},
+ {200, 1883, 0, L"Антананариву"},
+ {200, 2468, 0, L"Другое"},
+ {201, 1884, 0, L"Лилонгве"},
+ {201, 2467, 0, L"Другое"},
+ {202, 1885, 0, L"Бамако"},
+ {202, 2466, 0, L"Другое"},
+ {203, 1886, 0, L"Агадир"},
+ {203, 1887, 0, L"Рабат"},
+ {203, 2465, 0, L"Другое"},
+ {204, 1888, 0, L"Мапуту"},
+ {204, 2464, 0, L"Другое"},
+ {205, 1889, 0, L"Виндхук"},
+ {205, 2463, 0, L"Другое"},
+ {206, 1890, 0, L"Ниамей"},
+ {206, 2462, 0, L"Другое"},
+ {207, 1891, 0, L"Абуджа"},
+ {207, 2461, 0, L"Другое"},
+ {208, 1892, 0, L"Кигали"},
+ {208, 2460, 0, L"Другое"},
+ {209, 1893, 0, L"Сан-Томе"},
+ {209, 2459, 0, L"Другое"},
+ {210, 1894, 0, L"Мбабане"},
+ {210, 2458, 0, L"Другое"},
+ {211, 1895, 0, L"Виктория"},
+ {211, 2457, 0, L"Другое"},
+ {212, 1896, 0, L"Дакар"},
+ {212, 2456, 0, L"Другое"},
+ {213, 1897, 0, L"Могадишо"},
+ {213, 2455, 0, L"Другое"},
+ {214, 1898, 0, L"Хартум"},
+ {214, 2454, 0, L"Другое"},
+ {215, 1899, 0, L"Фритаун"},
+ {215, 2453, 0, L"Другое"},
+ {216, 1900, 0, L"Дар-эс-Салам"},
+ {216, 1901, 0, L"Додома"},
+ {216, 2452, 0, L"Другое"},
+ {217, 1902, 0, L"Ломе"},
+ {217, 2451, 0, L"Другое"},
+ {218, 1903, 0, L"Тунис"},
+ {218, 2450, 0, L"Другое"},
+ {219, 1904, 0, L"Кампала"},
+ {219, 2449, 0, L"Другое"},
+ {220, 1905, 0, L"Банги"},
+ {220, 2448, 0, L"Другое"},
+ {222, 1906, 0, L"Нджамена"},
+ {222, 2447, 0, L"Другое"},
+ {223, 1907, 0, L"Малабо"},
+ {223, 2446, 0, L"Другое"},
+ {221, 1908, 0, L"Асмэра"},
+ {221, 2445, 0, L"Другое"},
+ {224, 1909, 0, L"Аддис-Абеба"},
+ {224, 2444, 0, L"Другое"},
+ {225, 1910, 0, L"Дурбан"},
+ {225, 1913, 0, L"Йоханнесбург"},
+ {225, 1912, 0, L"Кейптаун"},
+ {225, 3033, 0, L"Пайнтаун"},
+ {225, 1911, 0, L"Претория"},
+ {225, 2443, 0, L"Другое"},
+ {39, 314, 0, L"Киев"},
+ {39, 315, 0, L"Винницкая обл."},
+ {39, 316, 0, L"Волынская обл."},
+ {39, 317, 0, L"Днепропетровская обл."},
+ {39, 318, 0, L"Донецкая обл."},
+ {39, 319, 0, L"Житомирская обл."},
+ {39, 320, 0, L"Закарпатская обл."},
+ {39, 321, 0, L"Запорожская обл."},
+ {39, 322, 0, L"Ивано-Франковская обл."},
+ {39, 323, 0, L"Киевская обл."},
+ {39, 324, 0, L"Кировоградская обл."},
+ {39, 325, 0, L"Крым"},
+ {39, 326, 0, L"Луганская обл."},
+ {39, 327, 0, L"Львовская обл."},
+ {39, 328, 0, L"Николаевская обл."},
+ {39, 329, 0, L"Одесская обл."},
+ {39, 330, 0, L"Полтавская обл."},
+ {39, 331, 0, L"Ровенская обл."},
+ {39, 332, 0, L"Сумская обл."},
+ {39, 333, 0, L"Тернопольская обл."},
+ {39, 334, 0, L"Харьковская обл."},
+ {39, 335, 0, L"Херсонская обл."},
+ {39, 336, 0, L"Хмельницкая обл."},
+ {39, 337, 0, L"Черкасская обл."},
+ {39, 338, 0, L"Черниговская обл."},
+ {39, 339, 0, L"Черновицкая обл."},
+ {40, 602, 0, L"Бад Халл"},
+ {40, 604, 0, L"Брегенц"},
+ {40, 603, 0, L"Вена"},
+ {40, 608, 0, L"Грац"},
+ {40, 606, 0, L"Зальцбург"},
+ {40, 3099, 0, L"Зель-ам-Зее"},
+ {40, 605, 0, L"Инсбрук"},
+ {40, 3174, 0, L"Кирхберг"},
+ {40, 609, 0, L"Клагенфурт"},
+ {40, 607, 0, L"Линц"},
+ {40, 610, 0, L"Обдах"},
+ {40, 611, 0, L"Щтубайтал"},
+ {40, 2541, 0, L"Другое"},
+ {32, 612, 0, L"Тирана"},
+ {32, 2540, 0, L"Другое"},
+ {33, 613, 0, L"Андорра-ла-Велья"},
+ {33, 2539, 0, L"Другое"},
+ {340, 341, 0, L"Минск"},
+ {340, 342, 0, L"Брестская обл."},
+ {340, 343, 0, L"Витебская обл."},
+ {340, 344, 0, L"Гомельская обл."},
+ {340, 345, 0, L"Гродненская обл."},
+ {340, 346, 0, L"Минская обл."},
+ {340, 347, 0, L"Могилевская обл."},
+ {38, 760, 0, L"Антверпен"},
+ {38, 767, 0, L"Арлон"},
+ {38, 762, 0, L"Брюгге"},
+ {38, 761, 0, L"Брюссель"},
+ {38, 763, 0, L"Гент"},
+ {38, 769, 0, L"Лувен"},
+ {38, 765, 0, L"Льеж"},
+ {38, 764, 0, L"Монс"},
+ {38, 3117, 0, L"Мортсель"},
+ {38, 766, 0, L"Намюр"},
+ {38, 768, 0, L"Хасселт"},
+ {38, 2532, 0, L"Другое"},
+ {41, 3098, 0, L"Банско"},
+ {41, 792, 0, L"Благоевград"},
+ {41, 770, 0, L"Бургас"},
+ {41, 771, 0, L"Бяла"},
+ {41, 773, 0, L"Варна"},
+ {41, 776, 0, L"Велико-Тырново"},
+ {41, 788, 0, L"Видин"},
+ {41, 789, 0, L"Враца"},
+ {41, 796, 0, L"Габрово"},
+ {41, 777, 0, L"Димитровград"},
+ {41, 781, 0, L"Каварна"},
+ {41, 786, 0, L"Кырджали"},
+ {41, 791, 0, L"Кюстендил"},
+ {41, 793, 0, L"Лазарджик"},
+ {41, 795, 0, L"Ловеч"},
+ {41, 787, 0, L"Михайловград"},
+ {41, 790, 0, L"Перник"},
+ {41, 3133, 0, L"Пирдоп"},
+ {41, 794, 0, L"Плевен"},
+ {41, 782, 0, L"Пловдив"},
+ {41, 780, 0, L"Разград"},
+ {41, 779, 0, L"Русе"},
+ {41, 774, 0, L"Силистра"},
+ {41, 784, 0, L"Сливен"},
+ {41, 772, 0, L"София"},
+ {41, 775, 0, L"Толбухин"},
+ {41, 3116, 0, L"Тырново"},
+ {41, 785, 0, L"Хасково"},
+ {41, 778, 0, L"Шумен"},
+ {41, 783, 0, L"Ямбол"},
+ {41, 2531, 0, L"Другое"},
+ {42, 797, 0, L"Баня-Лука"},
+ {42, 799, 0, L"Зеница"},
+ {42, 798, 0, L"Сараево"},
+ {42, 800, 0, L"Тузла"},
+ {42, 2530, 0, L"Другое"},
+ {45, 802, 0, L"Абердин"},
+ {45, 3075, 0, L"Айслворт"},
+ {45, 801, 0, L"Алнвик"},
+ {45, 804, 0, L"Бидефорд"},
+ {45, 803, 0, L"Бирмингем"},
+ {45, 805, 0, L"Блоксвич"},
+ {45, 3168, 0, L"Бостон"},
+ {45, 806, 0, L"Брайтон"},
+ {45, 807, 0, L"Бредфорд"},
+ {45, 808, 0, L"Бристоль"},
+ {45, 809, 0, L"Вилленхолл"},
+ {45, 3131, 0, L"Воррингтон"},
+ {45, 810, 0, L"Вудбридж"},
+ {45, 3342, 0, L"Гилфорд"},
+ {45, 811, 0, L"Глазго"},
+ {45, 812, 0, L"Дадли"},
+ {45, 813, 0, L"Дарем"},
+ {45, 814, 0, L"Дуглас"},
+ {45, 3089, 0, L"Кардиф"},
+ {45, 815, 0, L"Кембридж"},
+ {45, 816, 0, L"Кентербери"},
+ {45, 817, 0, L"Ливерпуль"},
+ {45, 818, 0, L"Лидс"},
+ {45, 819, 0, L"Лондон"},
+ {45, 820, 0, L"Манчестер"},
+ {45, 2976, 0, L"Митчем"},
+ {45, 2988, 0, L"Мэйденхед"},
+ {45, 821, 0, L"Ноттингем"},
+ {45, 3088, 0, L"Ньюпорт"},
+ {45, 822, 0, L"Оксфорд"},
+ {45, 823, 0, L"Плимут"},
+ {45, 824, 0, L"Портсмут"},
+ {45, 825, 0, L"Престон"},
+ {45, 3343, 0, L"Райд"},
+ {45, 2867, 0, L"Ридинг"},
+ {45, 2986, 0, L"Сент-Албанс"},
+ {45, 826, 0, L"Стаффорд"},
+ {45, 3063, 0, L"Стокпорт"},
+ {45, 827, 0, L"Уэймут"},
+ {45, 3140, 0, L"Челтенхэм"},
+ {45, 828, 0, L"Честер"},
+ {45, 829, 0, L"Шеффилд"},
+ {45, 830, 0, L"Эдинбург"},
+ {45, 2529, 0, L"Другое"},
+ {44, 831, 0, L"Будапешт"},
+ {44, 832, 0, L"Геделле"},
+ {44, 836, 0, L"Дебрецен"},
+ {44, 835, 0, L"Мишкольц"},
+ {44, 834, 0, L"Сегед"},
+ {44, 833, 0, L"Шиофок"},
+ {44, 2528, 0, L"Другое"},
+ {46, 3007, 0, L"Аахен"},
+ {46, 837, 0, L"Аугсбург"},
+ {46, 838, 0, L"Баден-Баден"},
+ {46, 3371, 0, L"Бамберг"},
+ {46, 839, 0, L"Бергиш-Гладбах"},
+ {46, 840, 0, L"Берлин"},
+ {46, 841, 0, L"Билефельд"},
+ {46, 3163, 0, L"Бовенден"},
+ {46, 842, 0, L"Бонн"},
+ {46, 843, 0, L"Браденбург"},
+ {46, 3015, 0, L"Брауншвейг"},
+ {46, 844, 0, L"Бремен"},
+ {46, 2921, 0, L"Варштайн"},
+ {46, 845, 0, L"Веймар"},
+ {46, 846, 0, L"Вупперталь"},
+ {46, 847, 0, L"Гамбург"},
+ {46, 848, 0, L"Ганновер"},
+ {46, 849, 0, L"Гарделеген"},
+ {46, 3010, 0, L"Гейдельберг"},
+ {46, 850, 0, L"Гота"},
+ {46, 851, 0, L"Дармштадт"},
+ {46, 3072, 0, L"Дессау"},
+ {46, 852, 0, L"Детмольд"},
+ {46, 853, 0, L"Дортмунд"},
+ {46, 854, 0, L"Дрезден"},
+ {46, 855, 0, L"Дюссельдорф"},
+ {46, 3082, 0, L"Иффецхайм"},
+ {46, 3309, 0, L"Кассел"},
+ {46, 856, 0, L"Кельн"},
+ {46, 857, 0, L"Киль"},
+ {46, 3138, 0, L"Кобленц"},
+ {46, 858, 0, L"Крефельд"},
+ {46, 859, 0, L"Лейпциг"},
+ {46, 2872, 0, L"Лимбург"},
+ {46, 2965, 0, L"Линген"},
+ {46, 3135, 0, L"Любек"},
+ {46, 3156, 0, L"Мангейм"},
+ {46, 3192, 0, L"Меерсбург"},
+ {46, 860, 0, L"Мюнстер"},
+ {46, 861, 0, L"Мюнхен"},
+ {46, 2864, 0, L"Нойштадт"},
+ {46, 862, 0, L"Нюрнберг"},
+ {46, 3009, 0, L"Оффенбург"},
+ {46, 2993, 0, L"Падерборн"},
+ {46, 863, 0, L"Равенсбург"},
+ {46, 864, 0, L"Регенсбург"},
+ {46, 865, 0, L"Рейнен"},
+ {46, 866, 0, L"Росток"},
+ {46, 3191, 0, L"Саарбрюкен"},
+ {46, 2974, 0, L"Санкт-Августин"},
+ {46, 3127, 0, L"Тюринген"},
+ {46, 867, 0, L"Фрайберг"},
+ {46, 868, 0, L"Фрайбург"},
+ {46, 869, 0, L"Франкфурт-на-Майне"},
+ {46, 3373, 0, L"Хемнитц"},
+ {46, 3313, 0, L"Хильден"},
+ {46, 870, 0, L"Штутгарт"},
+ {46, 3045, 0, L"Эрланген"},
+ {46, 2906, 0, L"Эшборн"},
+ {46, 2527, 0, L"Другое"},
+ {48, 871, 0, L"Афины"},
+ {48, 873, 0, L"Ираклион"},
+ {48, 3147, 0, L"Корфу"},
+ {48, 872, 0, L"Салоники"},
+ {48, 3178, 0, L"Халкидики"},
+ {48, 2526, 0, L"Другое"},
+ {49, 3006, 0, L"Архус"},
+ {49, 874, 0, L"Копенгаген"},
+ {49, 875, 0, L"Оденсе"},
+ {49, 3285, 0, L"Ольборг"},
+ {49, 876, 0, L"Сванеке"},
+ {49, 3126, 0, L"Скиве"},
+ {49, 2525, 0, L"Другое"},
+ {50, 3377, 0, L"Виклоу"},
+ {50, 3067, 0, L"Голвей"},
+ {50, 877, 0, L"Дублин"},
+ {50, 3065, 0, L"Килларней"},
+ {50, 3066, 0, L"Корк"},
+ {50, 878, 0, L"Лимерик"},
+ {50, 3069, 0, L"Нейс"},
+ {50, 3068, 0, L"Типперэри"},
+ {50, 2524, 0, L"Другое"},
+ {51, 879, 0, L"Рейкьявик"},
+ {51, 2523, 0, L"Другое"},
+ {34, 880, 0, L"Аликанте"},
+ {34, 3125, 0, L"Альмерия"},
+ {34, 881, 0, L"Барселона"},
+ {34, 890, 0, L"Бильбао"},
+ {34, 3076, 0, L"Бланес"},
+ {34, 882, 0, L"Валенсия"},
+ {34, 3070, 0, L"Ибица"},
+ {34, 888, 0, L"Кадис"},
+ {34, 886, 0, L"Картахена"},
+ {34, 891, 0, L"Ла-Корунья"},
+ {34, 3310, 0, L"Лорет де Мар"},
+ {34, 883, 0, L"Мадрид"},
+ {34, 884, 0, L"Малага"},
+ {34, 885, 0, L"Марбелья"},
+ {34, 892, 0, L"Овьедо"},
+ {34, 3179, 0, L"Пальма де Майорка"},
+ {34, 3177, 0, L"Сан-Агустин"},
+ {34, 3289, 0, L"Санта-Крус-де-Тенерифе"},
+ {34, 889, 0, L"Сарагоса"},
+ {34, 887, 0, L"Севилья"},
+ {34, 893, 0, L"Хихон"},
+ {34, 2522, 0, L"Другое"},
+ {52, 3318, 0, L"Аоста"},
+ {52, 3278, 0, L"Беллариа"},
+ {52, 906, 0, L"Болонья"},
+ {52, 894, 0, L"Брешиа"},
+ {52, 895, 0, L"Венеция"},
+ {52, 905, 0, L"Верона"},
+ {52, 896, 0, L"Генуя"},
+ {52, 897, 0, L"Лекко"},
+ {52, 3369, 0, L"Ливорно"},
+ {52, 3327, 0, L"Марсала"},
+ {52, 898, 0, L"Милан"},
+ {52, 899, 0, L"Модена"},
+ {52, 907, 0, L"Неаполь"},
+ {52, 908, 0, L"Перуджа"},
+ {52, 900, 0, L"Пиза"},
+ {52, 901, 0, L"Рим"},
+ {52, 3368, 0, L"Сан-Ремо"},
+ {52, 3384, 0, L"Сиракуза"},
+ {52, 3252, 0, L"Терамо"},
+ {52, 902, 0, L"Триест"},
+ {52, 903, 0, L"Турин"},
+ {52, 3130, 0, L"Фано"},
+ {52, 904, 0, L"Флоренция"},
+ {52, 2521, 0, L"Другое"},
+ {53, 2939, 0, L"Айзкраукле"},
+ {53, 3054, 0, L"Валка"},
+ {53, 909, 0, L"Даугавпилс"},
+ {53, 2934, 0, L"Екабпилс"},
+ {53, 913, 0, L"Елгава"},
+ {53, 2935, 0, L"Кокнесе"},
+ {53, 912, 0, L"Лиепая"},
+ {53, 2905, 0, L"Резекне"},
+ {53, 911, 0, L"Рига"},
+ {53, 2936, 0, L"Саласпилс"},
+ {53, 2937, 0, L"Смилтене"},
+ {53, 910, 0, L"Юрмала"},
+ {53, 2520, 0, L"Другое"},
+ {54, 914, 0, L"Вильнюс"},
+ {54, 915, 0, L"Висагинас"},
+ {54, 916, 0, L"Каунас"},
+ {54, 918, 0, L"Клайпеда"},
+ {54, 919, 0, L"Паланга"},
+ {54, 3173, 0, L"Пеневежис"},
+ {54, 917, 0, L"Шауляй"},
+ {54, 2519, 0, L"Другое"},
+ {55, 920, 0, L"Вадуц"},
+ {55, 2518, 0, L"Другое"},
+ {56, 3376, 0, L"Бетцдорф"},
+ {56, 921, 0, L"Люксембург"},
+ {56, 2517, 0, L"Другое"},
+ {57, 3142, 0, L"Битола"},
+ {57, 922, 0, L"Скопье"},
+ {57, 2516, 0, L"Другое"},
+ {58, 923, 0, L"Валлетта"},
+ {58, 3154, 0, L"Мзида"},
+ {58, 924, 0, L"Слима"},
+ {58, 2515, 0, L"Другое"},
+ {59, 925, 0, L"Бельцы"},
+ {59, 926, 0, L"Бендеры"},
+ {59, 3234, 0, L"Дубоссары"},
+ {59, 3275, 0, L"Кахул"},
+ {59, 927, 0, L"Кишинев"},
+ {59, 3321, 0, L"Резина"},
+ {59, 928, 0, L"Рыбница"},
+ {59, 929, 0, L"Тирасполь"},
+ {59, 3281, 0, L"Чадыр-Лунга"},
+ {59, 2514, 0, L"Другое"},
+ {36, 930, 0, L"Монте-Карло"},
+ {36, 2513, 0, L"Другое"},
+ {60, 931, 0, L"Амстердам"},
+ {60, 933, 0, L"Бреда"},
+ {60, 932, 0, L"Гаага"},
+ {60, 934, 0, L"Гауда"},
+ {60, 935, 0, L"Делфт"},
+ {60, 2977, 0, L"Донген"},
+ {60, 3030, 0, L"Зволле"},
+ {60, 3091, 0, L"Ниймеген"},
+ {60, 936, 0, L"Роттердам"},
+ {60, 937, 0, L"Утрехт"},
+ {60, 3044, 0, L"Эйндховен"},
+ {60, 3380, 0, L"Эншеде"},
+ {60, 2512, 0, L"Другое"},
+ {61, 3190, 0, L"Кристиансанд"},
+ {61, 2857, 0, L"Лиллехаммер"},
+ {61, 938, 0, L"Осло"},
+ {61, 3355, 0, L"Ставангер"},
+ {61, 939, 0, L"Тронхейм"},
+ {61, 2511, 0, L"Другое"},
+ {62, 940, 0, L"Белосток"},
+ {62, 941, 0, L"Варшава"},
+ {62, 3164, 0, L"Вроцлав"},
+ {62, 942, 0, L"Гданьск"},
+ {62, 943, 0, L"Гливице"},
+ {62, 3237, 0, L"Закопане"},
+ {62, 3165, 0, L"Зелена Гура"},
+ {62, 944, 0, L"Катовице"},
+ {62, 945, 0, L"Краков"},
+ {62, 3008, 0, L"Лодзь"},
+ {62, 3150, 0, L"Ольштын"},
+ {62, 946, 0, L"Познань"},
+ {62, 947, 0, L"Радом"},
+ {62, 948, 0, L"Сопот"},
+ {62, 2958, 0, L"Тыхы"},
+ {62, 2510, 0, L"Другое"},
+ {35, 949, 0, L"Лиссабон"},
+ {35, 950, 0, L"Порто"},
+ {35, 2509, 0, L"Другое"},
+ {63, 952, 0, L"Брашов"},
+ {63, 951, 0, L"Бухарест"},
+ {63, 954, 0, L"Констанца"},
+ {63, 955, 0, L"Плоешти"},
+ {63, 953, 0, L"Яссы"},
+ {63, 2508, 0, L"Другое"},
+ {64, 956, 0, L"Сан-Марино"},
+ {64, 2507, 0, L"Другое"},
+ {74, 957, 0, L"Белград"},
+ {74, 960, 0, L"Ниш"},
+ {74, 958, 0, L"Нови-Сад"},
+ {74, 959, 0, L"Сараево"},
+ {74, 2506, 0, L"Другое"},
+ {65, 961, 0, L"Братислава"},
+ {65, 962, 0, L"Кошице"},
+ {65, 3101, 0, L"Липтов"},
+ {65, 963, 0, L"Попрад"},
+ {65, 964, 0, L"Прешов"},
+ {65, 965, 0, L"Ружемберок"},
+ {65, 966, 0, L"Тврдошин"},
+ {65, 2505, 0, L"Другое"},
+ {66, 968, 0, L"Копар"},
+ {66, 967, 0, L"Любляна"},
+ {66, 969, 0, L"Марибор"},
+ {66, 2504, 0, L"Другое"},
+ {67, 970, 0, L"Торсхавн"},
+ {67, 2503, 0, L"Другое"},
+ {68, 2888, 0, L"Вантаа"},
+ {68, 971, 0, L"Васа"},
+ {68, 979, 0, L"Котка"},
+ {68, 972, 0, L"Коувола"},
+ {68, 980, 0, L"Лахти"},
+ {68, 973, 0, L"Оулу"},
+ {68, 3375, 0, L"Риихимяки"},
+ {68, 3159, 0, L"Руовеси"},
+ {68, 974, 0, L"Тампере"},
+ {68, 975, 0, L"Турку"},
+ {68, 976, 0, L"Хельсинки"},
+ {68, 977, 0, L"Эспо"},
+ {68, 978, 0, L"Ювяскюля"},
+ {68, 2502, 0, L"Другое"},
+ {37, 996, 0, L"Авиньон"},
+ {37, 983, 0, L"Бержерак"},
+ {37, 997, 0, L"Блуа"},
+ {37, 984, 0, L"Бордо"},
+ {37, 998, 0, L"Дижон"},
+ {37, 987, 0, L"Канн"},
+ {37, 988, 0, L"Кастр"},
+ {37, 993, 0, L"Клермон-Ферран"},
+ {37, 3037, 0, L"Лилль"},
+ {37, 989, 0, L"Лион"},
+ {37, 985, 0, L"Марсель"},
+ {37, 991, 0, L"Мец"},
+ {37, 3161, 0, L"Мобеж"},
+ {37, 990, 0, L"Нанси"},
+ {37, 994, 0, L"Нант"},
+ {37, 995, 0, L"Ницца"},
+ {37, 999, 0, L"Орлеан"},
+ {37, 981, 0, L"Париж"},
+ {37, 3374, 0, L"Перпиньян"},
+ {37, 992, 0, L"Руан"},
+ {37, 982, 0, L"Страсбург"},
+ {37, 986, 0, L"Тулуза"},
+ {37, 3314, 0, L"Шамбери"},
+ {37, 2501, 0, L"Другое"},
+ {69, 1003, 0, L"Дубровник"},
+ {69, 1000, 0, L"Загреб"},
+ {69, 1001, 0, L"Задар"},
+ {69, 1004, 0, L"Риека"},
+ {69, 1002, 0, L"Сплит"},
+ {69, 2500, 0, L"Другое"},
+ {70, 1005, 0, L"Брно"},
+ {70, 3291, 0, L"Гавличкув-Брод"},
+ {70, 1007, 0, L"Градец-Кралове"},
+ {70, 1008, 0, L"Карлови-Вари"},
+ {70, 3019, 0, L"Кладрубы"},
+ {70, 1010, 0, L"Лоуни"},
+ {70, 1009, 0, L"Острава"},
+ {70, 1015, 0, L"Пльзень"},
+ {70, 3105, 0, L"Правчицка Брана"},
+ {70, 1006, 0, L"Прага"},
+ {70, 3246, 0, L"Тачов"},
+ {70, 1011, 0, L"Тршебич"},
+ {70, 1012, 0, L"Усти-над-Лабем"},
+ {70, 1014, 0, L"Ческе-Будеевице"},
+ {70, 1013, 0, L"Яблонец-над-Нисоу"},
+ {70, 2499, 0, L"Другое"},
+ {71, 1016, 0, L"Арау"},
+ {71, 1019, 0, L"Баден"},
+ {71, 1017, 0, L"Базель"},
+ {71, 1018, 0, L"Берн"},
+ {71, 1020, 0, L"Биль"},
+ {71, 1021, 0, L"Винтертур"},
+ {71, 1022, 0, L"Давос"},
+ {71, 3189, 0, L"Делемонт"},
+ {71, 1023, 0, L"Женева"},
+ {71, 1024, 0, L"Золотурн"},
+ {71, 1025, 0, L"Лозанна"},
+ {71, 1026, 0, L"Локарно"},
+ {71, 1027, 0, L"Лугано"},
+ {71, 1028, 0, L"Люцерн"},
+ {71, 1029, 0, L"Монтре"},
+ {71, 1030, 0, L"Цюрих"},
+ {71, 2498, 0, L"Другое"},
+ {72, 2883, 0, L"Арбога"},
+ {72, 1031, 0, L"Гетеборг"},
+ {72, 1032, 0, L"Кальмар"},
+ {72, 1037, 0, L"Лахольм"},
+ {72, 1036, 0, L"Лулео"},
+ {72, 1042, 0, L"Лунд"},
+ {72, 1033, 0, L"Мальме"},
+ {72, 1034, 0, L"Стокгольм"},
+ {72, 1041, 0, L"Умео"},
+ {72, 1039, 0, L"Фалун"},
+ {72, 1043, 0, L"Хельсинборг"},
+ {72, 1040, 0, L"Хернесанд"},
+ {72, 1038, 0, L"Эстерсунд"},
+ {72, 2497, 0, L"Другое"},
+ {73, 3013, 0, L"Валга"},
+ {73, 1044, 0, L"Кейла"},
+ {73, 1045, 0, L"Кохтла-Ярве"},
+ {73, 1046, 0, L"Маарду"},
+ {73, 1047, 0, L"Мыйзакюла"},
+ {73, 1048, 0, L"Нарва"},
+ {73, 1049, 0, L"Пярну"},
+ {73, 1050, 0, L"Раквере"},
+ {73, 1051, 0, L"Силламяэ"},
+ {73, 1052, 0, L"Таллин"},
+ {73, 1053, 0, L"Тарту"},
+ {73, 1054, 0, L"Хаапсалу"},
+ {24, 233, 474, L"Алдан"},
+ {24, 233, 2809, L"Верхоянск"},
+ {24, 233, 2804, L"Вилюйск"},
+ {24, 233, 475, L"Ленск"},
+ {24, 233, 477, L"Мирный"},
+ {24, 233, 476, L"Нерюнгри"},
+ {24, 233, 2806, L"Олекминск"},
+ {24, 233, 3115, L"Покровск"},
+ {24, 233, 2808, L"Среднеколымск"},
+ {24, 233, 2807, L"Томмот"},
+ {24, 233, 2805, L"Удачный"},
+ {24, 233, 478, L"Усть-Нера"},
+ {24, 233, 479, L"Якутск"},
+ {24, 233, 2263, L"Другое"},
+ {24, 232, 2819, L"Арсеньев"},
+ {24, 232, 464, L"Артем"},
+ {24, 232, 465, L"Большой Камень"},
+ {24, 232, 466, L"Владивосток"},
+ {24, 232, 2817, L"Дальнегорск"},
+ {24, 232, 2818, L"Дальнереченск"},
+ {24, 232, 3359, L"Кавалерово"},
+ {24, 232, 467, L"Камень-Рыболов"},
+ {24, 232, 468, L"Лесозаводск"},
+ {24, 232, 469, L"Лучегорск"},
+ {24, 232, 470, L"Находка"},
+ {24, 232, 471, L"Партизанск"},
+ {24, 232, 472, L"Пластун"},
+ {24, 232, 2816, L"Спасск-Дальний"},
+ {24, 232, 473, L"Уссурийск"},
+ {24, 232, 2258, L"Другое"},
+ {24, 235, 487, L"Амурск"},
+ {24, 235, 2821, L"Бикин"},
+ {24, 235, 488, L"Ванино"},
+ {24, 235, 2820, L"Вяземский"},
+ {24, 235, 489, L"Комсомольск-на-Амуре"},
+ {24, 235, 490, L"Николаевск-на-Амуре"},
+ {24, 235, 491, L"Советская Гавань"},
+ {24, 235, 3353, L"Солнечный"},
+ {24, 235, 492, L"Хабаровск"},
+ {24, 235, 2280, L"Другое"},
+ {24, 227, 455, L"Белогорск"},
+ {24, 227, 456, L"Благовещенск"},
+ {24, 227, 2814, L"Завитинск"},
+ {24, 227, 2813, L"Зея"},
+ {24, 227, 2815, L"Райчихинск"},
+ {24, 227, 2812, L"Свободный"},
+ {24, 227, 2811, L"Сковородино"},
+ {24, 227, 457, L"Тында"},
+ {24, 227, 2217, L"Шимановск"},
+ {24, 227, 2218, L"Другое"},
+ {24, 229, 460, L"Елизово"},
+ {24, 229, 2822, L"Ключи"},
+ {24, 229, 459, L"Петропавловск-Камч."},
+ {24, 229, 2234, L"Другое"},
+ {24, 231, 462, L"Магадан"},
+ {24, 231, 2823, L"Сусуман"},
+ {24, 231, 463, L"Ягодное"},
+ {24, 231, 2246, L"Другое"},
+ {24, 234, 480, L"Александровск-Сахалинский"},
+ {24, 234, 2829, L"Анива"},
+ {24, 234, 2833, L"Горнозаводск"},
+ {24, 234, 2825, L"Долинск"},
+ {24, 234, 481, L"Корсаков"},
+ {24, 234, 482, L"Красногорск"},
+ {24, 234, 2826, L"Курильск"},
+ {24, 234, 2832, L"Лесогорск"},
+ {24, 234, 2836, L"Макаров"},
+ {24, 234, 2830, L"Невельск"},
+ {24, 234, 483, L"Оха"},
+ {24, 234, 2828, L"Поронайск"},
+ {24, 234, 2824, L"Северо-Курильск"},
+ {24, 234, 2827, L"Томари"},
+ {24, 234, 2831, L"Углегорск"},
+ {24, 234, 484, L"Холмск"},
+ {24, 234, 2834, L"Чехов"},
+ {24, 234, 2835, L"Шахтерск"},
+ {24, 234, 485, L"Южно-Курильск"},
+ {24, 234, 486, L"Южно-Сахалинск"},
+ {24, 234, 2264, L"Другое"},
+ {24, 228, 458, L"Биробиджан"},
+ {24, 228, 2810, L"Облучье"},
+ {24, 228, 2226, L"Другое"},
+ {24, 230, 461, L"Полана"},
+ {24, 230, 2239, L"Другое"},
+ {24, 236, 493, L"Анадырь"},
+ {24, 236, 2287, L"Другое"},
+ {24, 237, 2850, L"Агидель"},
+ {24, 237, 2851, L"Агидель"},
+ {24, 237, 2657, L"Баймак"},
+ {24, 237, 2662, L"Белебей"},
+ {24, 237, 494, L"Белорецк"},
+ {24, 237, 2658, L"Бирск"},
+ {24, 237, 2660, L"Благовещенск"},
+ {24, 237, 2659, L"Давлеканово"},
+ {24, 237, 2663, L"Дюртюли"},
+ {24, 237, 495, L"Ишимбай"},
+ {24, 237, 496, L"Кумертау"},
+ {24, 237, 2655, L"Мелеуз"},
+ {24, 237, 497, L"Нефтекамск"},
+ {24, 237, 2654, L"Октябрьский"},
+ {24, 237, 499, L"Салават"},
+ {24, 237, 2656, L"Сибай"},
+ {24, 237, 498, L"Стерлитамак"},
+ {24, 237, 500, L"Туймазы"},
+ {24, 237, 2661, L"Туймазы"},
+ {24, 237, 501, L"Уфа"},
+ {24, 237, 502, L"Учалы"},
+ {24, 237, 2664, L"Янаул"},
+ {24, 237, 2220, L"Другое"},
+ {24, 240, 509, L"Волжск"},
+ {24, 240, 510, L"Звенигово"},
+ {24, 240, 511, L"Йошкар-Ола"},
+ {24, 240, 512, L"Козьмодемьянск"},
+ {24, 240, 2247, L"Другое"},
+ {24, 241, 513, L"Зубова Поляна"},
+ {24, 241, 2147, L"Инсар"},
+ {24, 241, 2150, L"Ковылкино"},
+ {24, 241, 2148, L"Краснослободск"},
+ {24, 241, 2910, L"Лямбирь"},
+ {24, 241, 515, L"Рузаевка"},
+ {24, 241, 514, L"Саранск"},
+ {24, 241, 2149, L"Темников"},
+ {24, 241, 2923, L"Чамзинка"},
+ {24, 241, 2248, L"Другое"},
+ {24, 248, 2569, L"Агрыз"},
+ {24, 248, 2575, L"Азнакаево"},
+ {24, 248, 569, L"Альметьевск"},
+ {24, 248, 570, L"Апастово"},
+ {24, 248, 2571, L"Болгар"},
+ {24, 248, 571, L"Бугульма"},
+ {24, 248, 2570, L"Буинск"},
+ {24, 248, 572, L"Джалиль"},
+ {24, 248, 573, L"Елабуга"},
+ {24, 248, 2576, L"Заинск"},
+ {24, 248, 574, L"Зеленодольск"},
+ {24, 248, 575, L"Казань"},
+ {24, 248, 2577, L"Лениногорск"},
+ {24, 248, 2572, L"Мамадыш"},
+ {24, 248, 576, L"Менделеевск"},
+ {24, 248, 2573, L"Мензелинск"},
+ {24, 248, 577, L"Набережные Челны"},
+ {24, 248, 578, L"Нижнекамск"},
+ {24, 248, 579, L"Нурлат"},
+ {24, 248, 2574, L"Тетюши"},
+ {24, 248, 580, L"Чистополь"},
+ {24, 248, 2271, L"Другое"},
+ {24, 249, 3311, L"Вавож"},
+ {24, 249, 581, L"Воткинск"},
+ {24, 249, 582, L"Глазов"},
+ {24, 249, 583, L"Игра"},
+ {24, 249, 584, L"Ижевск"},
+ {24, 249, 2665, L"Камбарка"},
+ {24, 249, 585, L"Можга"},
+ {24, 249, 586, L"Сарапул"},
+ {24, 249, 587, L"Ува"},
+ {24, 249, 2277, L"Другое"},
+ {24, 251, 2158, L"Алатырь"},
+ {24, 251, 2156, L"Канаш"},
+ {24, 251, 2151, L"Козловка"},
+ {24, 251, 2152, L"Марьинский Посад"},
+ {24, 251, 2155, L"Новочебоксарск"},
+ {24, 251, 2153, L"Цивильск"},
+ {24, 251, 592, L"Чебоксары"},
+ {24, 251, 2157, L"Шумерля"},
+ {24, 251, 2154, L"Ядрин"},
+ {24, 251, 2286, L"Другое"},
+ {24, 238, 2168, L"Белая Холуница"},
+ {24, 238, 503, L"Вятские Поляны"},
+ {24, 238, 2164, L"Зуевка"},
+ {24, 238, 504, L"Киров"},
+ {24, 238, 505, L"Кирово-Чепецк"},
+ {24, 238, 2160, L"Кирс"},
+ {24, 238, 506, L"Котельнич"},
+ {24, 238, 2167, L"Луза"},
+ {24, 238, 2159, L"Малмыж"},
+ {24, 238, 2169, L"Мураши"},
+ {24, 238, 2163, L"Нолинск"},
+ {24, 238, 2170, L"Омутнинск"},
+ {24, 238, 2166, L"Слободской"},
+ {24, 238, 2165, L"Советск"},
+ {24, 238, 2162, L"Сосновка"},
+ {24, 238, 2171, L"Уржум"},
+ {24, 238, 2161, L"Халтурин"},
+ {24, 238, 507, L"Яранск"},
+ {24, 238, 2237, L"Другое"},
+ {24, 242, 516, L"Арзамас"},
+ {24, 242, 517, L"Балахна"},
+ {24, 242, 2139, L"Богородск"},
+ {24, 242, 518, L"Бор"},
+ {24, 242, 519, L"Вахтан"},
+ {24, 242, 520, L"Ветлуга"},
+ {24, 242, 2140, L"Володарск"},
+ {24, 242, 2138, L"Ворсма"},
+ {24, 242, 521, L"Выкса"},
+ {24, 242, 2137, L"Горбатов"},
+ {24, 242, 522, L"Городец"},
+ {24, 242, 523, L"Дзержинск"},
+ {24, 242, 524, L"Заволжье"},
+ {24, 242, 2891, L"Ильиногорск"},
+ {24, 242, 525, L"Кстово"},
+ {24, 242, 2145, L"Кулебаки"},
+ {24, 242, 2143, L"Лукоянов"},
+ {24, 242, 2144, L"Лысково"},
+ {24, 242, 2146, L"Навашино"},
+ {24, 242, 526, L"Нижний Новгород"},
+ {24, 242, 527, L"Павлово"},
+ {24, 242, 2135, L"Первомайск"},
+ {24, 242, 528, L"Саров"},
+ {24, 242, 529, L"Семенов"},
+ {24, 242, 530, L"Сергач"},
+ {24, 242, 2141, L"Урень"},
+ {24, 242, 2136, L"Чкаловск"},
+ {24, 242, 2897, L"Шатки"},
+ {24, 242, 2142, L"Шахунья"},
+ {24, 242, 2251, L"Другое"},
+ {24, 243, 2678, L"Абдулино"},
+ {24, 243, 2673, L"Бугуруслан"},
+ {24, 243, 531, L"Бузулук"},
+ {24, 243, 532, L"Гай"},
+ {24, 243, 2674, L"Кувандык"},
+ {24, 243, 2675, L"Медногорск"},
+ {24, 243, 533, L"Новотроицк"},
+ {24, 243, 535, L"Оренбург"},
+ {24, 243, 536, L"Орск"},
+ {24, 243, 3360, L"Саракташ"},
+ {24, 243, 2677, L"Соль-Илецк"},
+ {24, 243, 2676, L"Сорочинск"},
+ {24, 243, 537, L"Тоцкое"},
+ {24, 243, 538, L"Ясный"},
+ {24, 243, 2254, L"Другое"},
+ {24, 244, 539, L"Беднодемьяновск"},
+ {24, 244, 2597, L"Белинский"},
+ {24, 244, 2595, L"Городище"},
+ {24, 244, 2593, L"Каменка"},
+ {24, 244, 540, L"Кузнецк"},
+ {24, 244, 2598, L"Нижний Ломов"},
+ {24, 244, 2592, L"Никольск"},
+ {24, 244, 541, L"Пенза"},
+ {24, 244, 3304, L"Русский Камешкир"},
+ {24, 244, 2596, L"Сердобск"},
+ {24, 244, 2594, L"Сурск"},
+ {24, 244, 2256, L"Другое"},
+ {24, 245, 2690, L"Александровск"},
+ {24, 245, 542, L"Березники"},
+ {24, 245, 2679, L"Верещагино"},
+ {24, 245, 2680, L"Горнозаводск"},
+ {24, 245, 2687, L"Гремячинск"},
+ {24, 245, 2686, L"Губаха"},
+ {24, 245, 543, L"Добрянка"},
+ {24, 245, 544, L"Кизел"},
+ {24, 245, 2681, L"Красновишерск"},
+ {24, 245, 545, L"Краснокамск"},
+ {24, 245, 546, L"Кунгур"},
+ {24, 245, 547, L"Лысьва"},
+ {24, 245, 548, L"Нытва"},
+ {24, 245, 2683, L"Оса"},
+ {24, 245, 2684, L"Оханск"},
+ {24, 245, 2682, L"Очер"},
+ {24, 245, 549, L"Пермь"},
+ {24, 245, 550, L"Соликамск"},
+ {24, 245, 2685, L"Усолье"},
+ {24, 245, 551, L"Чайковский"},
+ {24, 245, 2689, L"Чердынь"},
+ {24, 245, 2688, L"Чермоз"},
+ {24, 245, 552, L"Чернушка"},
+ {24, 245, 553, L"Чусовой"},
+ {24, 245, 2257, L"Другое"},
+ {24, 246, 554, L"Волжский"},
+ {24, 246, 555, L"Жигулевск"},
+ {24, 246, 2599, L"Кинель"},
+ {24, 246, 3293, L"Красный Яр"},
+ {24, 246, 2602, L"Нефтегорск"},
+ {24, 246, 556, L"Новокуйбышевск"},
+ {24, 246, 2600, L"Октябрьск"},
+ {24, 246, 557, L"Отрадный"},
+ {24, 246, 558, L"Похвистнево"},
+ {24, 246, 559, L"Самара"},
+ {24, 246, 560, L"Сызрань"},
+ {24, 246, 561, L"Тольятти"},
+ {24, 246, 2601, L"Чапаевск"},
+ {24, 246, 562, L"Шигоны"},
+ {24, 246, 2261, L"Другое"},
+ {24, 247, 2613, L"Аркадак"},
+ {24, 247, 2606, L"Аткарск"},
+ {24, 247, 563, L"Балаково"},
+ {24, 247, 564, L"Балашов"},
+ {24, 247, 565, L"Вольск"},
+ {24, 247, 2608, L"Ершов"},
+ {24, 247, 2607, L"Калининск"},
+ {24, 247, 2609, L"Красноармейск"},
+ {24, 247, 2610, L"Красный Кут"},
+ {24, 247, 2605, L"Маркс"},
+ {24, 247, 566, L"Новоузенск"},
+ {24, 247, 2603, L"Петровск"},
+ {24, 247, 2604, L"Пугачев"},
+ {24, 247, 2612, L"Ртищево"},
+ {24, 247, 567, L"Саратов"},
+ {24, 247, 2611, L"Хвалынск"},
+ {24, 247, 568, L"Энгельс"},
+ {24, 247, 3267, L"Энгельс-12"},
+ {24, 247, 2262, L"Другое"},
+ {24, 250, 2614, L"Барыш"},
+ {24, 250, 588, L"Димитровград"},
+ {24, 250, 2615, L"Инза"},
+ {24, 250, 589, L"Новоспасское"},
+ {24, 250, 2616, L"Новоульяновск"},
+ {24, 250, 590, L"Сенгилей"},
+ {24, 250, 591, L"Ульяновск"},
+ {24, 250, 2278, L"Другое"},
+ {24, 239, 508, L"Кудымкар"},
+ {24, 239, 2238, L"Другое"},
+ {24, 255, 1355, L"Беломорск"},
+ {24, 255, 1356, L"Кемь"},
+ {24, 255, 1357, L"Кондопога"},
+ {24, 255, 1358, L"Костомукша"},
+ {24, 255, 1359, L"Коткозеро"},
+ {24, 255, 1360, L"Лахденпохья"},
+ {24, 255, 1362, L"Лоухи"},
+ {24, 255, 1361, L"Медвежьегорск"},
+ {24, 255, 3286, L"Муезерский"},
+ {24, 255, 1937, L"Олонец"},
+ {24, 255, 1363, L"Петрозаводск"},
+ {24, 255, 1938, L"Питкяранта"},
+ {24, 255, 3287, L"Пряжа"},
+ {24, 255, 1936, L"Пудож"},
+ {24, 255, 1364, L"Сегежа"},
+ {24, 255, 1365, L"Сортавала"},
+ {24, 255, 1939, L"Суоярви"},
+ {24, 255, 2201, L"Другое"},
+ {24, 256, 1366, L"Воркута"},
+ {24, 256, 1367, L"Вуктыл"},
+ {24, 256, 2202, L"Емва"},
+ {24, 256, 1368, L"Инта"},
+ {24, 256, 1940, L"Микунь"},
+ {24, 256, 1369, L"Печора"},
+ {24, 256, 1941, L"Сосногорск"},
+ {24, 256, 1370, L"Сыктывкар"},
+ {24, 256, 1371, L"Усинск"},
+ {24, 256, 1372, L"Ухта"},
+ {24, 256, 2203, L"Другое"},
+ {24, 252, 593, L"Архангельск"},
+ {24, 252, 594, L"Вельск"},
+ {24, 252, 1945, L"Каргополь"},
+ {24, 252, 595, L"Коряжма"},
+ {24, 252, 596, L"Котлас"},
+ {24, 252, 1944, L"Мезень"},
+ {24, 252, 597, L"Мирный"},
+ {24, 252, 598, L"Новодвинск"},
+ {24, 252, 1946, L"Няндома"},
+ {24, 252, 599, L"Онега"},
+ {24, 252, 600, L"Пинега"},
+ {24, 252, 601, L"Северодвинск"},
+ {24, 252, 1942, L"Сольвычегодск"},
+ {24, 252, 3239, L"Холмогоры"},
+ {24, 252, 1943, L"Шенкурск"},
+ {24, 252, 2204, L"Другое"},
+ {24, 253, 1950, L"Бабаево"},
+ {24, 253, 1949, L"Белозерск"},
+ {24, 253, 1338, L"Великий Устюг"},
+ {24, 253, 1339, L"Вологда"},
+ {24, 253, 1951, L"Вытегра"},
+ {24, 253, 1340, L"Грязовец"},
+ {24, 253, 1952, L"Кадников"},
+ {24, 253, 2871, L"Кадуй"},
+ {24, 253, 1341, L"Кириллов"},
+ {24, 253, 1955, L"Красавино"},
+ {24, 253, 1342, L"Михайловка"},
+ {24, 253, 1947, L"Никольск"},
+ {24, 253, 1343, L"Сокол"},
+ {24, 253, 1953, L"Тотьма"},
+ {24, 253, 1954, L"Устюжна"},
+ {24, 253, 1948, L"Харовск"},
+ {24, 253, 1344, L"Череповец"},
+ {24, 253, 2205, L"Другое"},
+ {24, 254, 2838, L"Багратионовск"},
+ {24, 254, 1345, L"Балтийск"},
+ {24, 254, 2846, L"Гвардейск"},
+ {24, 254, 2843, L"Гурьевск"},
+ {24, 254, 1346, L"Гусев"},
+ {24, 254, 1347, L"Зеленоградск"},
+ {24, 254, 1348, L"Калининград"},
+ {24, 254, 2842, L"Краснознаменск"},
+ {24, 254, 2845, L"Ладушкин"},
+ {24, 254, 2848, L"Мамоново"},
+ {24, 254, 2837, L"Неман"},
+ {24, 254, 2844, L"Нестеров"},
+ {24, 254, 1349, L"Озерск"},
+ {24, 254, 2841, L"Полесск"},
+ {24, 254, 2839, L"Правдинск"},
+ {24, 254, 1350, L"Приморск"},
+ {24, 254, 1351, L"Светлогорск"},
+ {24, 254, 1352, L"Светлый"},
+ {24, 254, 2840, L"Славск"},
+ {24, 254, 1353, L"Советск"},
+ {24, 254, 1354, L"Черняховск"},
+ {24, 254, 2231, L"Другое"},
+ {24, 257, 1985, L"Бокситогорск"},
+ {24, 257, 1374, L"Волхов"},
+ {24, 257, 1373, L"Всеволожск"},
+ {24, 257, 1375, L"Выборг"},
+ {24, 257, 1995, L"Высоцк"},
+ {24, 257, 1376, L"Гатчина"},
+ {24, 257, 1378, L"Ивангород"},
+ {24, 257, 1993, L"Каменногорск"},
+ {24, 257, 1379, L"Кингисепп"},
+ {24, 257, 1380, L"Кириши"},
+ {24, 257, 1381, L"Кировск"},
+ {24, 257, 1384, L"Кузьмоловский"},
+ {24, 257, 1984, L"Лодейное Поле"},
+ {24, 257, 1990, L"Луга"},
+ {24, 257, 1994, L"Любань"},
+ {24, 257, 1386, L"Никольское"},
+ {24, 257, 1987, L"Новая Ладога"},
+ {24, 257, 1996, L"Отрадное"},
+ {24, 257, 1986, L"Пикалево"},
+ {24, 257, 1983, L"Подпорожье"},
+ {24, 257, 1992, L"Приморск"},
+ {24, 257, 1988, L"Приозерск"},
+ {24, 257, 3071, L"Пушкин"},
+ {24, 257, 1989, L"Светогорск"},
+ {24, 257, 1389, L"Сертолово"},
+ {24, 257, 1991, L"Сланцы"},
+ {24, 257, 1391, L"Сосновый Бор"},
+ {24, 257, 1392, L"Тихвин"},
+ {24, 257, 1393, L"Тосно"},
+ {24, 257, 1394, L"Шлиссельбург"},
+ {24, 257, 2207, L"Другое"},
+ {24, 258, 1395, L"Апатиты"},
+ {24, 258, 1959, L"Заполярный"},
+ {24, 258, 1396, L"Зареченск"},
+ {24, 258, 1397, L"Кандалакша"},
+ {24, 258, 1398, L"Кировск"},
+ {24, 258, 1399, L"Ковдор"},
+ {24, 258, 1958, L"Кола"},
+ {24, 258, 1400, L"Мончегорск"},
+ {24, 258, 1401, L"Мурманск"},
+ {24, 258, 1402, L"Мурмаши"},
+ {24, 258, 1403, L"Оленегорск"},
+ {24, 258, 1404, L"Полярные Зори"},
+ {24, 258, 1956, L"Полярный"},
+ {24, 258, 1957, L"Североморск"},
+ {24, 258, 3288, L"Снежногорск"},
+ {24, 258, 2206, L"Другое"},
+ {24, 260, 1406, L"Батецкий"},
+ {24, 260, 2001, L"Боровичи"},
+ {24, 260, 2003, L"Валдай"},
+ {24, 260, 1407, L"Великий Новгород"},
+ {24, 260, 1408, L"Крестцы"},
+ {24, 260, 2002, L"Малая Вишера"},
+ {24, 260, 1409, L"Окуловка"},
+ {24, 260, 2000, L"Пестово"},
+ {24, 260, 1997, L"Сольцы"},
+ {24, 260, 1410, L"Старая Русса"},
+ {24, 260, 1998, L"Холм"},
+ {24, 260, 1999, L"Чудово"},
+ {24, 260, 2208, L"Другое"},
+ {24, 261, 1412, L"Великие Луки"},
+ {24, 261, 2004, L"Гдов"},
+ {24, 261, 2009, L"Дно"},
+ {24, 261, 2005, L"Невель"},
+ {24, 261, 1413, L"Новоржев"},
+ {24, 261, 2006, L"Опочка"},
+ {24, 261, 2008, L"Остров"},
+ {24, 261, 1414, L"Печоры"},
+ {24, 261, 1415, L"Порхов"},
+ {24, 261, 1411, L"Псков"},
+ {24, 261, 1416, L"Пустошка"},
+ {24, 261, 2007, L"Пыталово"},
+ {24, 261, 1417, L"Себеж"},
+ {24, 261, 2209, L"Другое"},
+ {24, 259, 1405, L"Нарьян-Мар"},
+ {24, 259, 2250, L"Другое"},
+ {24, 265, 2764, L"Бабушкин"},
+ {24, 265, 2760, L"Гусиноозерск"},
+ {24, 265, 2762, L"Закаменск"},
+ {24, 265, 2763, L"Кяхта"},
+ {24, 265, 2761, L"Северобайкальск"},
+ {24, 265, 1446, L"Улан-Удэ"},
+ {24, 265, 2222, L"Другое"},
+ {24, 263, 1439, L"Горно-Алтайск"},
+ {24, 263, 2215, L"Другое"},
+ {24, 273, 2766, L"Ак-Довурак"},
+ {24, 273, 1494, L"Кызыл"},
+ {24, 273, 2768, L"Новый Шагонар"},
+ {24, 273, 2767, L"Туран"},
+ {24, 273, 2765, L"Чадан"},
+ {24, 273, 2275, L"Другое"},
+ {24, 275, 2769, L"Абаза"},
+ {24, 275, 1496, L"Абакан"},
+ {24, 275, 1497, L"Саяногорск"},
+ {24, 275, 2770, L"Сорск"},
+ {24, 275, 2771, L"Черногорск"},
+ {24, 275, 2281, L"Другое"},
+ {24, 264, 1440, L"Алейск"},
+ {24, 264, 1441, L"Барнаул"},
+ {24, 264, 1442, L"Белокуриха"},
+ {24, 264, 1443, L"Бийск"},
+ {24, 264, 2728, L"Горняк"},
+ {24, 264, 2731, L"Заринск"},
+ {24, 264, 2729, L"Змеиногорск"},
+ {24, 264, 2732, L"Камень-на-Оби"},
+ {24, 264, 3292, L"Кулунда"},
+ {24, 264, 2730, L"Новоалтайск"},
+ {24, 264, 1444, L"Рубцовск"},
+ {24, 264, 1445, L"Славгород"},
+ {24, 264, 3231, L"Яровое"},
+ {24, 264, 2216, L"Другое"},
+ {24, 268, 2781, L"Артемовск"},
+ {24, 268, 1469, L"Ачинск"},
+ {24, 268, 2784, L"Боготол"},
+ {24, 268, 2773, L"Бородино"},
+ {24, 268, 2774, L"Дивногорск"},
+ {24, 268, 3122, L"Емельяновск"},
+ {24, 268, 2772, L"Енисейск"},
+ {24, 268, 3294, L"Железногорск"},
+ {24, 268, 2777, L"Заозерный"},
+ {24, 268, 1470, L"Игарка"},
+ {24, 268, 2778, L"Иланский"},
+ {24, 268, 2782, L"Канск"},
+ {24, 268, 2783, L"Кодинский"},
+ {24, 268, 1471, L"Красноярск"},
+ {24, 268, 1472, L"Лесосибирск"},
+ {24, 268, 1473, L"Минусинск"},
+ {24, 268, 2775, L"Назарово"},
+ {24, 268, 2776, L"Сосновоборск"},
+ {24, 268, 2780, L"Ужур"},
+ {24, 268, 2779, L"Уяр"},
+ {24, 268, 2785, L"Шарыпово"},
+ {24, 268, 1474, L"Шушенское"},
+ {24, 268, 2242, L"Другое"},
+ {24, 266, 2792, L"Алзамай"},
+ {24, 266, 1447, L"Ангарск"},
+ {24, 266, 1448, L"Байкальск"},
+ {24, 266, 2791, L"Бирюсинск"},
+ {24, 266, 1450, L"Бодайбо"},
+ {24, 266, 1451, L"Братск"},
+ {24, 266, 2793, L"Вихоревка"},
+ {24, 266, 2789, L"Железногорск-Илимский"},
+ {24, 266, 2786, L"Зима"},
+ {24, 266, 1452, L"Иркутск"},
+ {24, 266, 2794, L"Киренск"},
+ {24, 266, 2787, L"Нижнеудинск"},
+ {24, 266, 1449, L"Саянск"},
+ {24, 266, 2790, L"Свирск"},
+ {24, 266, 1453, L"Слюдянка"},
+ {24, 266, 2788, L"Тайшет"},
+ {24, 266, 1454, L"Тулун"},
+ {24, 266, 1455, L"Усолье-Сибирское"},
+ {24, 266, 2908, L"Усольск"},
+ {24, 266, 1456, L"Усть-Илимск"},
+ {24, 266, 1457, L"Усть-Кут"},
+ {24, 266, 1458, L"Хужир"},
+ {24, 266, 1459, L"Черемхово"},
+ {24, 266, 2795, L"Шелехов"},
+ {24, 266, 2229, L"Другое"},
+ {24, 267, 2737, L"Анжеро-Суджинск"},
+ {24, 267, 2740, L"Белово"},
+ {24, 267, 2746, L"Березовский"},
+ {24, 267, 2739, L"Гурьевск"},
+ {24, 267, 2742, L"Калтан"},
+ {24, 267, 1460, L"Кемерово"},
+ {24, 267, 1461, L"Киселевск"},
+ {24, 267, 2738, L"Ленинск-Кузнецкий"},
+ {24, 267, 2745, L"Мариинск"},
+ {24, 267, 1462, L"Междуреченск"},
+ {24, 267, 1463, L"Мыски"},
+ {24, 267, 1464, L"Новокузнецк"},
+ {24, 267, 2744, L"Осинники"},
+ {24, 267, 3358, L"Полысаево"},
+ {24, 267, 1465, L"Прокопьевск"},
+ {24, 267, 1466, L"Салаир"},
+ {24, 267, 2743, L"Тайга"},
+ {24, 267, 2741, L"Таштагол"},
+ {24, 267, 1467, L"Топки"},
+ {24, 267, 1468, L"Юрга"},
+ {24, 267, 2236, L"Другое"},
+ {24, 269, 1475, L"Баган"},
+ {24, 269, 1476, L"Барабинск"},
+ {24, 269, 1477, L"Бердск"},
+ {24, 269, 2750, L"Болотное"},
+ {24, 269, 1478, L"Искитим"},
+ {24, 269, 2752, L"Карасук"},
+ {24, 269, 2751, L"Каргат"},
+ {24, 269, 3107, L"Краснообск"},
+ {24, 269, 2753, L"Куйбышев"},
+ {24, 269, 2755, L"Купино"},
+ {24, 269, 1479, L"Новосибирск"},
+ {24, 269, 2759, L"Обь"},
+ {24, 269, 2756, L"Татарск"},
+ {24, 269, 2758, L"Тогучин"},
+ {24, 269, 2757, L"Черепаново"},
+ {24, 269, 2754, L"Чулым"},
+ {24, 269, 2252, L"Другое"},
+ {24, 270, 2733, L"Исилькуль"},
+ {24, 270, 1480, L"Калачинск"},
+ {24, 270, 1481, L"Марьяновка"},
+ {24, 270, 2735, L"Называевск"},
+ {24, 270, 1482, L"Омск"},
+ {24, 270, 2734, L"Тара"},
+ {24, 270, 2736, L"Тюкалинск"},
+ {24, 270, 2253, L"Другое"},
+ {24, 272, 1488, L"Асино"},
+ {24, 272, 1489, L"Белый Яр"},
+ {24, 272, 3295, L"Каргасок"},
+ {24, 272, 1491, L"Колпашево"},
+ {24, 272, 1492, L"Северск"},
+ {24, 272, 1493, L"Стрежевой"},
+ {24, 272, 1490, L"Томск"},
+ {24, 272, 2273, L"Другое"},
+ {24, 276, 2803, L"Балей"},
+ {24, 276, 2799, L"Борзя"},
+ {24, 276, 1499, L"Краснокаменск"},
+ {24, 276, 2801, L"Могоча"},
+ {24, 276, 2800, L"Нерчинск"},
+ {24, 276, 2802, L"Петровск-Забайкальский"},
+ {24, 276, 2798, L"Сретенск"},
+ {24, 276, 2796, L"Хилок"},
+ {24, 276, 1498, L"Чита"},
+ {24, 276, 2797, L"Шилка"},
+ {24, 276, 2285, L"Другое"},
+ {24, 262, 1438, L"Агинское"},
+ {24, 262, 2213, L"Другое"},
+ {24, 271, 3233, L"Диксон"},
+ {24, 271, 1485, L"Дудинка"},
+ {24, 271, 1487, L"Кайеркан"},
+ {24, 271, 1483, L"Норильск"},
+ {24, 271, 1484, L"Талнах"},
+ {24, 271, 1486, L"Хатанга"},
+ {24, 271, 2269, L"Другое"},
+ {24, 274, 1495, L"Усть-Ордынский"},
+ {24, 274, 2279, L"Другое"},
+ {24, 277, 1500, L"Тура"},
+ {24, 277, 2288, L"Другое"},
+ {24, 278, 2668, L"Далматово"},
+ {24, 278, 2667, L"Катайск"},
+ {24, 278, 1524, L"Курган"},
+ {24, 278, 2669, L"Куртамыш"},
+ {24, 278, 2666, L"Макушино"},
+ {24, 278, 2671, L"Петухово"},
+ {24, 278, 1525, L"Шадринск"},
+ {24, 278, 2670, L"Шумиха"},
+ {24, 278, 2672, L"Щучье"},
+ {24, 278, 2243, L"Другое"},
+ {24, 279, 1526, L"Алапаевск"},
+ {24, 279, 1527, L"Арамиль"},
+ {24, 279, 2691, L"Артемовский"},
+ {24, 279, 1528, L"Асбест"},
+ {24, 279, 2924, L"Белоярский"},
+ {24, 279, 2707, L"Березовский"},
+ {24, 279, 1529, L"Богданович"},
+ {24, 279, 2698, L"Верхний Тагил"},
+ {24, 279, 1530, L"Верхняя Пышма"},
+ {24, 279, 1531, L"Верхняя Салда"},
+ {24, 279, 1532, L"Верхняя Синячиха"},
+ {24, 279, 2696, L"Верхняя Тура"},
+ {24, 279, 2692, L"Верхотурье"},
+ {24, 279, 2706, L"Волчанск"},
+ {24, 279, 2709, L"Дегтярск"},
+ {24, 279, 1533, L"Екатеринбург"},
+ {24, 279, 1534, L"Заречный"},
+ {24, 279, 1535, L"Ивдель"},
+ {24, 279, 1536, L"Ирбит"},
+ {24, 279, 1537, L"Каменск-Уральский"},
+ {24, 279, 1538, L"Камышлов"},
+ {24, 279, 2708, L"Карпинск"},
+ {24, 279, 1539, L"Качканар"},
+ {24, 279, 2712, L"Кировград"},
+ {24, 279, 1540, L"Краснотурьинск"},
+ {24, 279, 2694, L"Красноуральск"},
+ {24, 279, 2693, L"Красноуфимск"},
+ {24, 279, 1541, L"Кушва"},
+ {24, 279, 2711, L"Михайловск"},
+ {24, 279, 2713, L"Михайловск"},
+ {24, 279, 1542, L"Невьянск"},
+ {24, 279, 2702, L"Нижние Серги"},
+ {24, 279, 1543, L"Нижний Тагил"},
+ {24, 279, 2695, L"Нижняя Салда"},
+ {24, 279, 2697, L"Нижняя Тура"},
+ {24, 279, 2699, L"Новая Ляля"},
+ {24, 279, 2909, L"Новоуральск"},
+ {24, 279, 1544, L"Первоуральск"},
+ {24, 279, 1545, L"Полевской"},
+ {24, 279, 1546, L"Ревда"},
+ {24, 279, 1547, L"Реж"},
+ {24, 279, 3296, L"Рефтинский"},
+ {24, 279, 2700, L"Североуральск"},
+ {24, 279, 1548, L"Серов"},
+ {24, 279, 2710, L"Среднеуральск"},
+ {24, 279, 2701, L"Сухой Лог"},
+ {24, 279, 2703, L"Сысерть"},
+ {24, 279, 1549, L"Тавда"},
+ {24, 279, 2704, L"Талица"},
+ {24, 279, 2705, L"Туринск"},
+ {24, 279, 2265, L"Другое"},
+ {24, 280, 1550, L"Заводоуковск"},
+ {24, 280, 1551, L"Ишим"},
+ {24, 280, 3326, L"Сургут"},
+ {24, 280, 1552, L"Тобольск"},
+ {24, 280, 1553, L"Тюмень"},
+ {24, 280, 2748, L"Ялуторовск"},
+ {24, 280, 2276, L"Другое"},
+ {24, 282, 1564, L"Аша"},
+ {24, 282, 2723, L"Бакал"},
+ {24, 282, 2724, L"Верхнеуральск"},
+ {24, 282, 2716, L"Верхний Уфалей"},
+ {24, 282, 3297, L"Всеволожск"},
+ {24, 282, 2725, L"Еманжелинск"},
+ {24, 282, 1565, L"Златоуст"},
+ {24, 282, 2722, L"Карабаш"},
+ {24, 282, 1566, L"Карталы"},
+ {24, 282, 2718, L"Касли"},
+ {24, 282, 2720, L"Катав-Ивановск"},
+ {24, 282, 1567, L"Копейск"},
+ {24, 282, 2721, L"Коркино"},
+ {24, 282, 2715, L"Куса"},
+ {24, 282, 1568, L"Кыштым"},
+ {24, 282, 1569, L"Магнитогорск"},
+ {24, 282, 1570, L"Миасс"},
+ {24, 282, 2726, L"Миньяр"},
+ {24, 282, 2717, L"Нязепетровск"},
+ {24, 282, 3100, L"Озерск"},
+ {24, 282, 1571, L"Пласт"},
+ {24, 282, 2719, L"Сатка"},
+ {24, 282, 2727, L"Сим"},
+ {24, 282, 1572, L"Снежинск"},
+ {24, 282, 3332, L"Трехгорный"},
+ {24, 282, 1573, L"Троицк"},
+ {24, 282, 1574, L"Усть-Катав"},
+ {24, 282, 1575, L"Чебаркуль"},
+ {24, 282, 1576, L"Челябинск"},
+ {24, 282, 1577, L"Южноуральск"},
+ {24, 282, 2714, L"Юрюзань"},
+ {24, 282, 2283, L"Другое"},
+ {24, 281, 2749, L"Белоярский"},
+ {24, 281, 1554, L"Игрим"},
+ {24, 281, 1555, L"Когалым"},
+ {24, 281, 1556, L"Лангепас"},
+ {24, 281, 1561, L"Мегион"},
+ {24, 281, 1562, L"Нефтеюганск"},
+ {24, 281, 1559, L"Нижневартовск"},
+ {24, 281, 2852, L"Нягань"},
+ {24, 281, 2853, L"Нягань"},
+ {24, 281, 2854, L"Пыть-Ях"},
+ {24, 281, 1560, L"Радужный"},
+ {24, 281, 1563, L"Советский"},
+ {24, 281, 2747, L"Сургут"},
+ {24, 281, 1557, L"Урай"},
+ {24, 281, 1558, L"Ханты-Мансийск"},
+ {24, 281, 3344, L"Югорск"},
+ {24, 281, 2282, L"Другое"},
+ {24, 283, 3298, L"Губкинский"},
+ {24, 283, 1578, L"Лабытнанги"},
+ {24, 283, 2856, L"Муравленко"},
+ {24, 283, 1579, L"Надым"},
+ {24, 283, 1580, L"Новый Уренгой"},
+ {24, 283, 1581, L"Ноябрьск"},
+ {24, 283, 1582, L"Салехард"},
+ {24, 283, 1583, L"Уренгой"},
+ {24, 283, 2289, L"Другое"},
+ {24, 284, 1625, L"Алексеевка"},
+ {24, 284, 1626, L"Белгород"},
+ {24, 284, 2172, L"Валуйки"},
+ {24, 284, 2173, L"Грайворон"},
+ {24, 284, 1627, L"Губкин"},
+ {24, 284, 2174, L"Короча"},
+ {24, 284, 2175, L"Новый Оскол"},
+ {24, 284, 1628, L"Старый Оскол"},
+ {24, 284, 1629, L"Шебекино"},
+ {24, 284, 2221, L"Другое"},
+ {24, 285, 1630, L"Брянск"},
+ {24, 285, 3283, L"Дебрянск"},
+ {24, 285, 1631, L"Дятьково"},
+ {24, 285, 2013, L"Жуковка"},
+ {24, 285, 2015, L"Злынка"},
+ {24, 285, 1632, L"Карачев"},
+ {24, 285, 1633, L"Клинцы"},
+ {24, 285, 1634, L"Мглин"},
+ {24, 285, 2016, L"Новозыбков"},
+ {24, 285, 2018, L"Почеп"},
+ {24, 285, 2017, L"Севск"},
+ {24, 285, 2020, L"Сельцо"},
+ {24, 285, 2014, L"Стародуб"},
+ {24, 285, 2010, L"Сураж"},
+ {24, 285, 2012, L"Трубчевск"},
+ {24, 285, 2011, L"Унеча"},
+ {24, 285, 2019, L"Фокино"},
+ {24, 285, 2210, L"Другое"},
+ {24, 286, 1635, L"Александров"},
+ {24, 286, 1636, L"Владимир"},
+ {24, 286, 2021, L"Вязники"},
+ {24, 286, 1637, L"Головино"},
+ {24, 286, 2022, L"Гороховец"},
+ {24, 286, 1638, L"Гусь-Хрустальный"},
+ {24, 286, 2023, L"Камешково"},
+ {24, 286, 2031, L"Карабаново"},
+ {24, 286, 2024, L"Киржач"},
+ {24, 286, 1639, L"Ковров"},
+ {24, 286, 1640, L"Кольчугино"},
+ {24, 286, 2026, L"Костерево"},
+ {24, 286, 3299, L"Красная Горбатка"},
+ {24, 286, 2033, L"Лакинск"},
+ {24, 286, 2025, L"Меленки"},
+ {24, 286, 1641, L"Муром"},
+ {24, 286, 1642, L"Петушки"},
+ {24, 286, 2027, L"Покров"},
+ {24, 286, 2211, L"Радужный"},
+ {24, 286, 2028, L"Собинка"},
+ {24, 286, 2032, L"Струнино"},
+ {24, 286, 2029, L"Судогда"},
+ {24, 286, 1643, L"Суздаль"},
+ {24, 286, 2030, L"Юрьев-Польский"},
+ {24, 286, 2212, L"Другое"},
+ {24, 287, 1644, L"Бобров"},
+ {24, 287, 1645, L"Богучар"},
+ {24, 287, 1646, L"Борисоглебск"},
+ {24, 287, 1647, L"Бутурлиновка"},
+ {24, 287, 1648, L"Воронеж"},
+ {24, 287, 2178, L"Калач"},
+ {24, 287, 2176, L"Лиски"},
+ {24, 287, 1649, L"Нововоронеж"},
+ {24, 287, 2177, L"Новохоперск"},
+ {24, 287, 2180, L"Острогожск"},
+ {24, 287, 1650, L"Павловск"},
+ {24, 287, 2181, L"Поворино"},
+ {24, 287, 1651, L"Россошь"},
+ {24, 287, 2179, L"Семилуки"},
+ {24, 287, 2182, L"Эртиль"},
+ {24, 287, 2224, L"Другое"},
+ {24, 288, 1652, L"Вичуга"},
+ {24, 288, 2036, L"Гаврилов Посад"},
+ {24, 288, 1657, L"Заволжск"},
+ {24, 288, 1653, L"Иваново"},
+ {24, 288, 1656, L"Кинешма"},
+ {24, 288, 2040, L"Комсомольск"},
+ {24, 288, 2037, L"Кохма"},
+ {24, 288, 2043, L"Наволоки"},
+ {24, 288, 3300, L"Палех"},
+ {24, 288, 2039, L"Плес"},
+ {24, 288, 2038, L"Приволжск"},
+ {24, 288, 2042, L"Пучеж"},
+ {24, 288, 2044, L"Родники"},
+ {24, 288, 1655, L"Тейково"},
+ {24, 288, 2034, L"Фурманов"},
+ {24, 288, 1654, L"Шуя"},
+ {24, 288, 2041, L"Южа"},
+ {24, 288, 2035, L"Юрьевец"},
+ {24, 288, 2227, L"Другое"},
+ {24, 289, 2050, L"Балабаново"},
+ {24, 289, 2051, L"Боровск"},
+ {24, 289, 3301, L"Воротынск"},
+ {24, 289, 2052, L"Жиздра"},
+ {24, 289, 1660, L"Жуковка"},
+ {24, 289, 1658, L"Калуга"},
+ {24, 289, 2046, L"Киров"},
+ {24, 289, 1661, L"Козельск"},
+ {24, 289, 2053, L"Кондрово"},
+ {24, 289, 2049, L"Людиново"},
+ {24, 289, 1659, L"Малоярославец"},
+ {24, 289, 2054, L"Медынь"},
+ {24, 289, 2055, L"Мещовск"},
+ {24, 289, 2047, L"Мосальск"},
+ {24, 289, 1662, L"Обнинск"},
+ {24, 289, 2057, L"Сосенский"},
+ {24, 289, 2056, L"Спас-Демянск"},
+ {24, 289, 2045, L"Сухиничи"},
+ {24, 289, 1663, L"Таруса"},
+ {24, 289, 2131, L"Чекалин"},
+ {24, 289, 2048, L"Юхнов"},
+ {24, 289, 2233, L"Другое"},
+ {24, 290, 1664, L"Буй"},
+ {24, 290, 1665, L"Волгореченск"},
+ {24, 290, 1666, L"Галич"},
+ {24, 290, 2059, L"Кологрив"},
+ {24, 290, 1667, L"Кострома"},
+ {24, 290, 3302, L"Красное-на-Волге"},
+ {24, 290, 1668, L"Макарьев"},
+ {24, 290, 2060, L"Мантурово"},
+ {24, 290, 1669, L"Нерехта"},
+ {24, 290, 2061, L"Нея"},
+ {24, 290, 2062, L"Солигалич"},
+ {24, 290, 2058, L"Чухлома"},
+ {24, 290, 1670, L"Шарья"},
+ {24, 290, 2240, L"Другое"},
+ {24, 291, 1671, L"Дмитриев-Льговский"},
+ {24, 291, 1673, L"Железногорск"},
+ {24, 291, 3279, L"Железногорск"},
+ {24, 291, 1672, L"Курск"},
+ {24, 291, 2187, L"Курчатов"},
+ {24, 291, 2188, L"Льгов"},
+ {24, 291, 2184, L"Обоянь"},
+ {24, 291, 2185, L"Рыльск"},
+ {24, 291, 2183, L"Суджа"},
+ {24, 291, 2189, L"Фатеж"},
+ {24, 291, 2186, L"Щигры"},
+ {24, 291, 2244, L"Другое"},
+ {24, 292, 2194, L"Грязи"},
+ {24, 292, 2193, L"Данков"},
+ {24, 292, 1674, L"Елец"},
+ {24, 292, 2190, L"Задонск"},
+ {24, 292, 2195, L"Лебедянь"},
+ {24, 292, 1675, L"Липецк"},
+ {24, 292, 2192, L"Усмань"},
+ {24, 292, 2191, L"Чаплыгин"},
+ {24, 292, 2245, L"Другое"},
+ {24, 293, 1733, L"Апрелевка"},
+ {24, 293, 1732, L"Балашиха"},
+ {24, 293, 1731, L"Бронницы"},
+ {24, 293, 1730, L"Верея"},
+ {24, 293, 2063, L"Видное"},
+ {24, 293, 2064, L"Волоколамск"},
+ {24, 293, 1729, L"Воскресенск"},
+ {24, 293, 1728, L"Высоковск"},
+ {24, 293, 1727, L"Голицыно"},
+ {24, 293, 2065, L"Дедовск"},
+ {24, 293, 1726, L"Дзержинский"},
+ {24, 293, 1725, L"Дмитров"},
+ {24, 293, 1724, L"Долгопрудный"},
+ {24, 293, 1723, L"Домодедово"},
+ {24, 293, 2066, L"Дрезна"},
+ {24, 293, 1722, L"Дубна"},
+ {24, 293, 1721, L"Егорьевск"},
+ {24, 293, 1720, L"Железнодорожный"},
+ {24, 293, 1719, L"Жуковский"},
+ {24, 293, 2067, L"Зарайск"},
+ {24, 293, 1718, L"Звенигород"},
+ {24, 293, 1715, L"Ивантеевка"},
+ {24, 293, 1717, L"Истра"},
+ {24, 293, 2068, L"Калининград"},
+ {24, 293, 2069, L"Кашира"},
+ {24, 293, 1716, L"Климовск"},
+ {24, 293, 1714, L"Клин"},
+ {24, 293, 1713, L"Коломна"},
+ {24, 293, 1712, L"Королев"},
+ {24, 293, 1711, L"Красноармейск"},
+ {24, 293, 1710, L"Красногорск"},
+ {24, 293, 2070, L"Краснозаводск"},
+ {24, 293, 2071, L"Куровское"},
+ {24, 293, 1709, L"Ликино-Дулево"},
+ {24, 293, 1708, L"Лобня"},
+ {24, 293, 2072, L"Лосино-Петровский"},
+ {24, 293, 1707, L"Луховицы"},
+ {24, 293, 1706, L"Лыткарино"},
+ {24, 293, 1705, L"Люберцы"},
+ {24, 293, 1704, L"Менделеево"},
+ {24, 293, 1703, L"Можайск"},
+ {24, 293, 1702, L"Мытищи"},
+ {24, 293, 1701, L"Наро-Фоминск"},
+ {24, 293, 1700, L"Ногинск"},
+ {24, 293, 1698, L"Одинцово"},
+ {24, 293, 2073, L"Ожерелье"},
+ {24, 293, 2074, L"Озеры"},
+ {24, 293, 1699, L"Орехово-Зуево"},
+ {24, 293, 1697, L"Павловский Посад"},
+ {24, 293, 1696, L"Подольск"},
+ {24, 293, 1695, L"Протвино"},
+ {24, 293, 1694, L"Пушкино"},
+ {24, 293, 1693, L"Пущино"},
+ {24, 293, 1692, L"Раменское"},
+ {24, 293, 1691, L"Реутов"},
+ {24, 293, 1690, L"Решетников"},
+ {24, 293, 2075, L"Рошаль"},
+ {24, 293, 2076, L"Руза"},
+ {24, 293, 1689, L"Сергиев Посад"},
+ {24, 293, 1688, L"Серпухов"},
+ {24, 293, 1687, L"Солнечногорск"},
+ {24, 293, 1686, L"Ступино"},
+ {24, 293, 2077, L"Сходня"},
+ {24, 293, 2078, L"Талдом"},
+ {24, 293, 1685, L"Троицк"},
+ {24, 293, 1684, L"Фрязино"},
+ {24, 293, 1683, L"Химки"},
+ {24, 293, 1682, L"Хотьково"},
+ {24, 293, 1681, L"Черноголовка"},
+ {24, 293, 1680, L"Чехов"},
+ {24, 293, 1679, L"Шатура"},
+ {24, 293, 1678, L"Щелково"},
+ {24, 293, 2080, L"Щербинка"},
+ {24, 293, 1677, L"Электрогорск"},
+ {24, 293, 1676, L"Электросталь"},
+ {24, 293, 2079, L"Электроугли"},
+ {24, 293, 3031, L"Юбилейный"},
+ {24, 293, 2081, L"Яхрома"},
+ {24, 293, 2249, L"Другое"},
+ {24, 294, 2083, L"Болхов"},
+ {24, 294, 2082, L"Дмитровск-Орловский"},
+ {24, 294, 3160, L"Залегощь"},
+ {24, 294, 1736, L"Ливны"},
+ {24, 294, 2084, L"Малоархангельск"},
+ {24, 294, 1737, L"Мценск"},
+ {24, 294, 2085, L"Новосиль"},
+ {24, 294, 1735, L"Орел"},
+ {24, 294, 2255, L"Другое"},
+ {24, 295, 1740, L"Гусь-Железный"},
+ {24, 295, 1741, L"Касимов"},
+ {24, 295, 2086, L"Кораблино"},
+ {24, 295, 2087, L"Михайлов"},
+ {24, 295, 2089, L"Новомичуринск"},
+ {24, 295, 2091, L"Рыбное"},
+ {24, 295, 2093, L"Ряжск"},
+ {24, 295, 1738, L"Рязань"},
+ {24, 295, 3305, L"Сапожок"},
+ {24, 295, 1739, L"Сасово"},
+ {24, 295, 2090, L"Скопин"},
+ {24, 295, 2088, L"Спас-Клепики"},
+ {24, 295, 2092, L"Спасск-Рязанский"},
+ {24, 295, 2094, L"Шацк"},
+ {24, 295, 3320, L"Шилово"},
+ {24, 295, 2260, L"Другое"},
+ {24, 296, 2095, L"Велиж"},
+ {24, 296, 1743, L"Вязьма"},
+ {24, 296, 1744, L"Гагарин"},
+ {24, 296, 2096, L"Демидов"},
+ {24, 296, 1745, L"Десногорск"},
+ {24, 296, 1746, L"Дорогубуж"},
+ {24, 296, 2097, L"Духовщина"},
+ {24, 296, 2098, L"Ельня"},
+ {24, 296, 2099, L"Починок"},
+ {24, 296, 2100, L"Рославль"},
+ {24, 296, 2101, L"Рудня"},
+ {24, 296, 1747, L"Сафоново"},
+ {24, 296, 1742, L"Смоленск"},
+ {24, 296, 2102, L"Сычевка"},
+ {24, 296, 1748, L"Ярцево"},
+ {24, 296, 2267, L"Другое"},
+ {24, 297, 2198, L"Жердевка"},
+ {24, 297, 2199, L"Кирсанов"},
+ {24, 297, 1752, L"Котовск"},
+ {24, 297, 1751, L"Мичуринск"},
+ {24, 297, 2196, L"Моршанск"},
+ {24, 297, 1750, L"Рассказово"},
+ {24, 297, 3271, L"Сатинка"},
+ {24, 297, 1749, L"Тамбов"},
+ {24, 297, 3272, L"Тулиновка"},
+ {24, 297, 2197, L"Уварово"},
+ {24, 297, 2270, L"Другое"},
+ {24, 298, 2103, L"Андреаполь"},
+ {24, 298, 2104, L"Бежецк"},
+ {24, 298, 2105, L"Белый"},
+ {24, 298, 2106, L"Бологое"},
+ {24, 298, 2107, L"Весьегонск"},
+ {24, 298, 1753, L"Вышний Волочек"},
+ {24, 298, 2108, L"Западная Двина"},
+ {24, 298, 2109, L"Зубцов"},
+ {24, 298, 2110, L"Калязин"},
+ {24, 298, 2111, L"Кашин"},
+ {24, 298, 1758, L"Кимры"},
+ {24, 298, 1756, L"Конаково"},
+ {24, 298, 2112, L"Красный Холм"},
+ {24, 298, 1759, L"Кувшиново"},
+ {24, 298, 1760, L"Лихославль"},
+ {24, 298, 1761, L"Нелидово"},
+ {24, 298, 2113, L"Осташков"},
+ {24, 298, 1757, L"Ржев"},
+ {24, 298, 2114, L"Старица"},
+ {24, 298, 1754, L"Тверь"},
+ {24, 298, 2115, L"Торжок"},
+ {24, 298, 2116, L"Торопец"},
+ {24, 298, 1755, L"Удомля"},
+ {24, 298, 2272, L"Другое"},
+ {24, 299, 2127, L"Алексин"},
+ {24, 299, 2126, L"Белев"},
+ {24, 299, 2118, L"Богородицк"},
+ {24, 299, 2122, L"Болохово"},
+ {24, 299, 2129, L"Венев"},
+ {24, 299, 1762, L"Донской"},
+ {24, 299, 2128, L"Ефремов"},
+ {24, 299, 3354, L"Заокский"},
+ {24, 299, 2124, L"Киреевск"},
+ {24, 299, 1763, L"Климовск"},
+ {24, 299, 2123, L"Липки"},
+ {24, 299, 1764, L"Новомосковск"},
+ {24, 299, 2117, L"Плавск"},
+ {24, 299, 2130, L"Северо-Задонск"},
+ {24, 299, 2120, L"Советск"},
+ {24, 299, 2119, L"Сокольники"},
+ {24, 299, 2125, L"Суворов"},
+ {24, 299, 1765, L"Тула"},
+ {24, 299, 1766, L"Узловая"},
+ {24, 299, 2121, L"Щекино"},
+ {24, 299, 1767, L"Ясногорск"},
+ {24, 299, 2274, L"Другое"},
+ {24, 300, 3053, L"Большое Село"},
+ {24, 300, 3268, L"Брейтово"},
+ {24, 300, 1773, L"Гаврилов-Ям"},
+ {24, 300, 2132, L"Данилов"},
+ {24, 300, 3269, L"Красные Ткачи"},
+ {24, 300, 2133, L"Любим"},
+ {24, 300, 3270, L"Мокеевское"},
+ {24, 300, 1774, L"Мышкин"},
+ {24, 300, 2994, L"Некоуз"},
+ {24, 300, 1775, L"Переславль-Залесский"},
+ {24, 300, 2134, L"Пошехонье"},
+ {24, 300, 1769, L"Ростов"},
+ {24, 300, 1771, L"Рыбинск"},
+ {24, 300, 1772, L"Тутаев"},
+ {24, 300, 1770, L"Углич"},
+ {24, 300, 1768, L"Ярославль"},
+ {24, 300, 2290, L"Другое"},
+ {24, 301, 2849, L"Адыгейск"},
+ {24, 301, 1776, L"Майкоп"},
+ {24, 301, 2214, L"Другое"},
+ {24, 304, 2617, L"Буйнакск"},
+ {24, 304, 1791, L"Гуниб"},
+ {24, 304, 1788, L"Дербент"},
+ {24, 304, 2619, L"Избербаш"},
+ {24, 304, 1789, L"Каспийск"},
+ {24, 304, 2618, L"Кизилюрт"},
+ {24, 304, 1790, L"Кизляр"},
+ {24, 304, 1792, L"Махачкала"},
+ {24, 304, 2620, L"Хасавюрт"},
+ {24, 304, 2225, L"Другое"},
+ {24, 305, 3052, L"Магас"},
+ {24, 305, 1787, L"Назрань"},
+ {24, 305, 2228, L"Другое"},
+ {24, 306, 2621, L"Баксан"},
+ {24, 306, 1794, L"Майский"},
+ {24, 306, 1793, L"Нальчик"},
+ {24, 306, 2622, L"Нарткала"},
+ {24, 306, 1795, L"Прохладный"},
+ {24, 306, 2623, L"Терек"},
+ {24, 306, 2624, L"Тырныауз"},
+ {24, 306, 3274, L"Чегем"},
+ {24, 306, 2230, L"Другое"},
+ {24, 307, 2567, L"Городовиково"},
+ {24, 307, 2568, L"Лагань"},
+ {24, 307, 3324, L"Троицкое"},
+ {24, 307, 1796, L"Элиста"},
+ {24, 307, 2232, L"Другое"},
+ {24, 308, 1799, L"Домбай"},
+ {24, 308, 1798, L"Карачаевск"},
+ {24, 308, 2626, L"Теберда"},
+ {24, 308, 2625, L"Усть-Джегута"},
+ {24, 308, 1797, L"Черкесск"},
+ {24, 308, 2235, L"Другое"},
+ {24, 311, 2630, L"Алагир"},
+ {24, 311, 2631, L"Ардон"},
+ {24, 311, 2628, L"Беслан"},
+ {24, 311, 1839, L"Владикавказ"},
+ {24, 311, 2629, L"Дигора"},
+ {24, 311, 2627, L"Моздок"},
+ {24, 311, 2266, L"Другое"},
+ {24, 313, 2632, L"Аргун"},
+ {24, 313, 1853, L"Грозный"},
+ {24, 313, 2633, L"Гудермес"},
+ {24, 313, 2284, L"Другое"},
+ {24, 309, 2636, L"Абинск"},
+ {24, 309, 1800, L"Анапа"},
+ {24, 309, 1801, L"Апшеронск"},
+ {24, 309, 1802, L"Армавир"},
+ {24, 309, 1803, L"Белореченск"},
+ {24, 309, 1804, L"Геленджик"},
+ {24, 309, 1805, L"Горячий Ключ"},
+ {24, 309, 2637, L"Гулькевичи"},
+ {24, 309, 1806, L"Динская"},
+ {24, 309, 1807, L"Ейск"},
+ {24, 309, 2638, L"Кореновск"},
+ {24, 309, 1808, L"Краснодар"},
+ {24, 309, 1809, L"Кропоткин"},
+ {24, 309, 1810, L"Крымск"},
+ {24, 309, 1811, L"Курганинск"},
+ {24, 309, 3232, L"Лабинск"},
+ {24, 309, 2639, L"Новокубанск"},
+ {24, 309, 1812, L"Новороссийск"},
+ {24, 309, 1813, L"Пластуновская"},
+ {24, 309, 1814, L"Приморско-Ахтарск"},
+ {24, 309, 3102, L"Северская"},
+ {24, 309, 1815, L"Славянск-на-Кубани"},
+ {24, 309, 1816, L"Сочи"},
+ {24, 309, 3266, L"Староминская"},
+ {24, 309, 3039, L"Тамань"},
+ {24, 309, 1817, L"Темрюк"},
+ {24, 309, 2635, L"Тимашевск"},
+ {24, 309, 1818, L"Тихорецк"},
+ {24, 309, 1819, L"Туапсе"},
+ {24, 309, 1820, L"Усть-Лабинск"},
+ {24, 309, 2634, L"Хадыженск"},
+ {24, 309, 2241, L"Другое"},
+ {24, 312, 1840, L"Александровское"},
+ {24, 312, 2644, L"Благодарный"},
+ {24, 312, 1841, L"Буденновск"},
+ {24, 312, 1842, L"Георгиевск"},
+ {24, 312, 1843, L"Ессентуки"},
+ {24, 312, 1844, L"Железноводск"},
+ {24, 312, 2647, L"Зеленокумск"},
+ {24, 312, 2641, L"Изобильный"},
+ {24, 312, 2642, L"Ипатово"},
+ {24, 312, 1845, L"Кисловодск"},
+ {24, 312, 1846, L"Кочубеевское"},
+ {24, 312, 3367, L"Курсавка"},
+ {24, 312, 3265, L"Левокумское"},
+ {24, 312, 1847, L"Лермонтов"},
+ {24, 312, 1848, L"Минеральные Воды"},
+ {24, 312, 1849, L"Невинномысск"},
+ {24, 312, 2645, L"Нефтекумск"},
+ {24, 312, 2643, L"Новоалександровск"},
+ {24, 312, 1850, L"Новопавловск"},
+ {24, 312, 1851, L"Новоселицкое"},
+ {24, 312, 1852, L"Пятигорск"},
+ {24, 312, 2646, L"Светлоград"},
+ {24, 312, 2640, L"Ставрополь"},
+ {24, 312, 2268, L"Другое"},
+ {24, 302, 1777, L"Астрахань"},
+ {24, 302, 1778, L"Ахтубинск"},
+ {24, 302, 3383, L"Знаменск"},
+ {24, 302, 2578, L"Камызяк"},
+ {24, 302, 2579, L"Нариманов"},
+ {24, 302, 1786, L"Харабали"},
+ {24, 302, 2219, L"Другое"},
+ {24, 303, 1779, L"Волгоград"},
+ {24, 303, 1780, L"Волжский"},
+ {24, 303, 2584, L"Дубовка"},
+ {24, 303, 1781, L"Жирновск"},
+ {24, 303, 1782, L"Калач-на-Дону"},
+ {24, 303, 1783, L"Камышин"},
+ {24, 303, 2588, L"Котельниково"},
+ {24, 303, 2591, L"Котово"},
+ {24, 303, 2587, L"Краснослободск"},
+ {24, 303, 2582, L"Ленинск"},
+ {24, 303, 2590, L"Михайловка"},
+ {24, 303, 1784, L"Николаевск"},
+ {24, 303, 2581, L"Новоаннинский"},
+ {24, 303, 2583, L"Палласовка"},
+ {24, 303, 2580, L"Петров Вал"},
+ {24, 303, 2589, L"Серафимович"},
+ {24, 303, 2585, L"Суровикино"},
+ {24, 303, 1785, L"Урюпинск"},
+ {24, 303, 2586, L"Фролово"},
+ {24, 303, 2223, L"Другое"},
+ {24, 310, 1821, L"Азов"},
+ {24, 310, 1822, L"Аксай"},
+ {24, 310, 1823, L"Багаевская"},
+ {24, 310, 1824, L"Батайск"},
+ {24, 310, 1825, L"Белая Калитва"},
+ {24, 310, 1826, L"Волгодонск"},
+ {24, 310, 1827, L"Гуково"},
+ {24, 310, 2651, L"Донецк"},
+ {24, 310, 1828, L"Зерноград"},
+ {24, 310, 3264, L"Каменоломни"},
+ {24, 310, 2652, L"Каменск-Шахтинский"},
+ {24, 310, 2649, L"Константиновск"},
+ {24, 310, 2648, L"Красный Сулин"},
+ {24, 310, 1829, L"Миллерово"},
+ {24, 310, 2653, L"Морозовск"},
+ {24, 310, 1830, L"Новочеркасск"},
+ {24, 310, 1831, L"Новошахтинск"},
+ {24, 310, 1832, L"Пролетарск"},
+ {24, 310, 1833, L"Ростов-на-Дону"},
+ {24, 310, 1834, L"Сальск"},
+ {24, 310, 1835, L"Семикаракорск"},
+ {24, 310, 1836, L"Таганрог"},
+ {24, 310, 1837, L"Усть-Донецкий"},
+ {24, 310, 3263, L"Целина"},
+ {24, 310, 2650, L"Цимлянск"},
+ {24, 310, 1838, L"Шахты"},
+ {24, 310, 2259, L"Другое"},
+ {139, 407, 407, L" столица"},
+ {139, 426, 427, L"Бойсе"},
+ {139, 426, 2354, L"Другое"},
+ {139, 378, 3109, L"Айова Сити"},
+ {139, 378, 379, L"Де-Мойн"},
+ {139, 378, 2963, L"Декора"},
+ {139, 378, 2355, L"Другое"},
+ {139, 412, 3236, L"Бирмингем"},
+ {139, 412, 413, L"Монтгомери"},
+ {139, 412, 1181, L"Хантсвилл"},
+ {139, 412, 2356, L"Другое"},
+ {139, 446, 1182, L"Анкоридж"},
+ {139, 446, 447, L"Джуно"},
+ {139, 446, 1183, L"Фэрбенкс"},
+ {139, 446, 2357, L"Другое"},
+ {139, 434, 2917, L"Темпе"},
+ {139, 434, 1184, L"Тусон"},
+ {139, 434, 435, L"Финикс"},
+ {139, 434, 3061, L"Чандлер"},
+ {139, 434, 2358, L"Другое"},
+ {139, 416, 417, L"Литл-Рок"},
+ {139, 416, 2359, L"Другое"},
+ {139, 428, 3017, L"Ларами"},
+ {139, 428, 429, L"Шайенн"},
+ {139, 428, 2360, L"Другое"},
+ {139, 440, 2956, L"Беллевью"},
+ {139, 440, 2967, L"Бремертон"},
+ {139, 440, 3385, L"Ванкувер"},
+ {139, 440, 2865, L"Линден"},
+ {139, 440, 441, L"Олимпия"},
+ {139, 440, 3352, L"Порт Орчард"},
+ {139, 440, 2876, L"Редмонт"},
+ {139, 440, 3003, L"Рентон"},
+ {139, 440, 1185, L"Сиэтл"},
+ {139, 440, 2983, L"Снохомиш"},
+ {139, 440, 1186, L"Такома"},
+ {139, 440, 3152, L"Фрайди Харбор"},
+ {139, 440, 2886, L"Эверет"},
+ {139, 440, 2361, L"Другое"},
+ {139, 352, 353, L"Монтпильер"},
+ {139, 352, 2861, L"Норвич"},
+ {139, 352, 2362, L"Другое"},
+ {139, 394, 1188, L"Александрия"},
+ {139, 394, 1187, L"Арлингтон"},
+ {139, 394, 2969, L"Даллес"},
+ {139, 394, 1189, L"Манассас"},
+ {139, 394, 3114, L"Норфолк"},
+ {139, 394, 2885, L"Ньюпорт-Ньюс"},
+ {139, 394, 2979, L"Раунд Хил"},
+ {139, 394, 3338, L"Рестон"},
+ {139, 394, 395, L"Ричмонд"},
+ {139, 394, 3005, L"Уоррентон"},
+ {139, 394, 2991, L"Херндон"},
+ {139, 394, 2996, L"Центрвиль"},
+ {139, 394, 3097, L"Чантилли"},
+ {139, 394, 2981, L"Шарлотесвиль"},
+ {139, 394, 2363, L"Другое"},
+ {139, 374, 2995, L"Грин-Бей"},
+ {139, 374, 375, L"Мадисон"},
+ {139, 374, 2365, L"Другое"},
+ {139, 448, 449, L"Гонолулу"},
+ {139, 448, 1191, L"Хило"},
+ {139, 448, 2367, L"Другое"},
+ {139, 390, 3021, L"Вильмингтон"},
+ {139, 390, 391, L"Довер"},
+ {139, 390, 2973, L"Льюис"},
+ {139, 390, 2369, L"Другое"},
+ {139, 402, 403, L"Атланта"},
+ {139, 402, 2370, L"Другое"},
+ {139, 396, 397, L"Чарлстон"},
+ {139, 396, 2371, L"Другое"},
+ {139, 370, 2911, L"Вестмонт"},
+ {139, 370, 3074, L"Гарвард"},
+ {139, 370, 371, L"Спрингфилд"},
+ {139, 370, 2930, L"Урбана"},
+ {139, 370, 1194, L"Чикаго"},
+ {139, 370, 2372, L"Другое"},
+ {139, 368, 369, L"Индианаполис"},
+ {139, 368, 1195, L"Эвансвил"},
+ {139, 368, 2373, L"Другое"},
+ {139, 444, 2959, L"Анахайм"},
+ {139, 444, 2961, L"Аптос"},
+ {139, 444, 2912, L"Артезия"},
+ {139, 444, 2899, L"Беверли Хилз"},
+ {139, 444, 1196, L"Беркли"},
+ {139, 444, 3249, L"Бреа"},
+ {139, 444, 3014, L"Брисбейн"},
+ {139, 444, 3048, L"Венис"},
+ {139, 444, 2901, L"Вест-Голливуд"},
+ {139, 444, 2926, L"Вестлейк Вилладж"},
+ {139, 444, 2922, L"Гардена"},
+ {139, 444, 1203, L"Глендейл"},
+ {139, 444, 2978, L"Денвиль"},
+ {139, 444, 2990, L"Дублин"},
+ {139, 444, 3077, L"Дэвис"},
+ {139, 444, 2918, L"Ирвайн"},
+ {139, 444, 2881, L"Карсон"},
+ {139, 444, 3247, L"Кипресс"},
+ {139, 444, 3092, L"Коста Меса"},
+ {139, 444, 2948, L"Купертино"},
+ {139, 444, 1197, L"Лонг-Бич"},
+ {139, 444, 1198, L"Лос-Анджелес"},
+ {139, 444, 3058, L"Лос-Гатос"},
+ {139, 444, 3328, L"Марина-дель-Рей"},
+ {139, 444, 2874, L"Маунтин-Вью"},
+ {139, 444, 2998, L"Милпитас"},
+ {139, 444, 3087, L"Монтерей"},
+ {139, 444, 2947, L"Окленд"},
+ {139, 444, 2900, L"Пало Альто"},
+ {139, 444, 1199, L"Пасадена"},
+ {139, 444, 3335, L"Редвуд"},
+ {139, 444, 2966, L"Розамонд"},
+ {139, 444, 445, L"Сакраменто"},
+ {139, 444, 1200, L"Сан-Диего"},
+ {139, 444, 3317, L"Сан-Мартин"},
+ {139, 444, 1201, L"Сан-Франциско"},
+ {139, 444, 1202, L"Сан-Хосе"},
+ {139, 444, 2878, L"Саннивейл"},
+ {139, 444, 2925, L"Санта-Барбара"},
+ {139, 444, 2875, L"Санта-Клара"},
+ {139, 444, 1204, L"Санта-Круз"},
+ {139, 444, 2859, L"Санта-Моника"},
+ {139, 444, 3157, L"Студио Сити"},
+ {139, 444, 3146, L"Торранс"},
+ {139, 444, 2970, L"Тысяча Дубов"},
+ {139, 444, 2949, L"Универсал-Сити"},
+ {139, 444, 3057, L"Форт Брэгг"},
+ {139, 444, 3032, L"Фостер-Сити"},
+ {139, 444, 3381, L"Фремонт"},
+ {139, 444, 3028, L"Фуллертон"},
+ {139, 444, 2858, L"Эмервиль"},
+ {139, 444, 3040, L"Эскондидо"},
+ {139, 444, 2374, L"Другое"},
+ {139, 388, 3041, L"Лоуренс"},
+ {139, 388, 389, L"Топика"},
+ {139, 388, 2375, L"Другое"},
+ {139, 408, 3004, L"Лексингтон"},
+ {139, 408, 1205, L"Луисвилл"},
+ {139, 408, 409, L"Франкфорт"},
+ {139, 408, 2376, L"Другое"},
+ {139, 430, 1206, L"Боулдер"},
+ {139, 430, 3095, L"Грили"},
+ {139, 430, 431, L"Денвер"},
+ {139, 430, 1207, L"Колорадо-Спрингс"},
+ {139, 430, 3046, L"Литлтон"},
+ {139, 430, 2377, L"Другое"},
+ {139, 358, 2968, L"Дариен"},
+ {139, 358, 3018, L"Денбери"},
+ {139, 358, 2882, L"Стэмфорд"},
+ {139, 358, 359, L"Хартфорд"},
+ {139, 358, 3047, L"Шелтон"},
+ {139, 358, 2378, L"Другое"},
+ {139, 418, 419, L"Батон-Руж"},
+ {139, 418, 1208, L"Новый Орлеан"},
+ {139, 418, 2408, L"Другое"},
+ {139, 354, 2931, L"Аттлеборо"},
+ {139, 354, 3334, L"Билерика"},
+ {139, 354, 355, L"Бостон"},
+ {139, 354, 3059, L"Вестгемптон"},
+ {139, 354, 2919, L"Вобурн"},
+ {139, 354, 2902, L"Дедхэм"},
+ {139, 354, 1209, L"Кеймбридж"},
+ {139, 354, 3336, L"Нидхем"},
+ {139, 354, 2985, L"Ньютонвиль"},
+ {139, 354, 3022, L"Уолтхэм"},
+ {139, 354, 2407, L"Другое"},
+ {139, 376, 1210, L"Миннеаполис"},
+ {139, 376, 2980, L"Плимут"},
+ {139, 376, 377, L"Сент-Пол"},
+ {139, 376, 3035, L"Эден Прейри"},
+ {139, 376, 2406, L"Другое"},
+ {139, 414, 415, L"Джэксон"},
+ {139, 414, 2405, L"Другое"},
+ {139, 380, 381, L"Джефферсон-Сити"},
+ {139, 380, 3062, L"Канзас Сити"},
+ {139, 380, 3038, L"Ли Саммит"},
+ {139, 380, 1211, L"Сент-Луис"},
+ {139, 380, 2895, L"Эллисвил"},
+ {139, 380, 2404, L"Другое"},
+ {139, 372, 3357, L"Вест Блюмфельд"},
+ {139, 372, 1212, L"Гранд-Рапидс"},
+ {139, 372, 1213, L"Детройт"},
+ {139, 372, 3103, L"Каламазу"},
+ {139, 372, 373, L"Лансинг"},
+ {139, 372, 2987, L"Новай"},
+ {139, 372, 2887, L"Сагино"},
+ {139, 372, 2403, L"Другое"},
+ {139, 424, 1214, L"Грейт-Фолс"},
+ {139, 424, 425, L"Хелина"},
+ {139, 424, 2402, L"Другое"},
+ {139, 348, 349, L"Огаста"},
+ {139, 348, 3000, L"Ярмут"},
+ {139, 348, 2401, L"Другое"},
+ {139, 392, 393, L"Аннаполис"},
+ {139, 392, 1215, L"Балтимор"},
+ {139, 392, 3143, L"Гринбелт"},
+ {139, 392, 3337, L"Колледж Парк"},
+ {139, 392, 2904, L"Маунт Эйри"},
+ {139, 392, 3329, L"Роквилль"},
+ {139, 392, 2400, L"Другое"},
+ {139, 386, 387, L"Линкольн"},
+ {139, 386, 1216, L"Омаха"},
+ {139, 386, 2399, L"Другое"},
+ {139, 438, 439, L"Карсон-Сити"},
+ {139, 438, 1217, L"Лас-Вегас"},
+ {139, 438, 2890, L"Рено"},
+ {139, 438, 2398, L"Другое"},
+ {139, 362, 1219, L"Атлантик-Сити"},
+ {139, 362, 1218, L"Ньюарк"},
+ {139, 362, 3276, L"Оклин"},
+ {139, 362, 3073, L"Принстон"},
+ {139, 362, 2955, L"Рузерфорд"},
+ {139, 362, 3349, L"Сомервиль"},
+ {139, 362, 363, L"Трентон"},
+ {139, 362, 3078, L"Хакеттстоун"},
+ {139, 362, 3248, L"Черри Хилл"},
+ {139, 362, 2397, L"Другое"},
+ {139, 360, 3134, L"Баффало"},
+ {139, 360, 3081, L"Бингхэмптон"},
+ {139, 360, 2997, L"Бруклин"},
+ {139, 360, 2999, L"Варвик"},
+ {139, 360, 3139, L"Ирвингтон"},
+ {139, 360, 3060, L"Итака"},
+ {139, 360, 1220, L"Нью-Йорк"},
+ {139, 360, 361, L"Олбани"},
+ {139, 360, 2914, L"Погкипси"},
+ {139, 360, 3056, L"Саратога Спрингс"},
+ {139, 360, 2396, L"Другое"},
+ {139, 432, 1222, L"Альбукерке"},
+ {139, 432, 433, L"Санта-Фе"},
+ {139, 432, 2395, L"Другое"},
+ {139, 350, 2989, L"Амхерст"},
+ {139, 350, 351, L"Конкорд"},
+ {139, 350, 2950, L"Лондондерри"},
+ {139, 350, 1221, L"Манчестер"},
+ {139, 350, 3111, L"Рочестер"},
+ {139, 350, 2898, L"Салем"},
+ {139, 350, 2938, L"Хадсон"},
+ {139, 350, 2394, L"Другое"},
+ {139, 366, 2953, L"Варрен"},
+ {139, 366, 3112, L"Гроув Сити"},
+ {139, 366, 1223, L"Кливленд"},
+ {139, 366, 367, L"Колумбус"},
+ {139, 366, 2951, L"Лавленд"},
+ {139, 366, 2862, L"Оберлин"},
+ {139, 366, 3034, L"Рейнольдсбург"},
+ {139, 366, 2860, L"Цинциннати"},
+ {139, 366, 2393, L"Другое"},
+ {139, 420, 421, L"Оклахома-Сити"},
+ {139, 420, 1224, L"Талса"},
+ {139, 420, 2392, L"Другое"},
+ {139, 442, 2877, L"Кламат-Фолс"},
+ {139, 442, 2945, L"Коттедж-Гроув"},
+ {139, 442, 1225, L"Портленд"},
+ {139, 442, 443, L"Сейлем"},
+ {139, 442, 1226, L"Юджин"},
+ {139, 442, 2391, L"Другое"},
+ {139, 364, 3316, L"Вифлием"},
+ {139, 364, 3282, L"Колледжвиль"},
+ {139, 364, 2972, L"Нью Фридом"},
+ {139, 364, 1227, L"Питтсбург"},
+ {139, 364, 2893, L"Рандор"},
+ {139, 364, 3110, L"Слиппери Рок"},
+ {139, 364, 1228, L"Филадельфия"},
+ {139, 364, 365, L"Харрисберг"},
+ {139, 364, 2390, L"Другое"},
+ {139, 450, 451, L"Понсе"},
+ {139, 450, 3093, L"Сан-Хуан"},
+ {139, 450, 2389, L"Другое"},
+ {139, 356, 357, L"Провиденс"},
+ {139, 356, 2388, L"Другое"},
+ {139, 382, 383, L"Бисмарк"},
+ {139, 382, 2387, L"Другое"},
+ {139, 398, 2960, L"Вильмингтон"},
+ {139, 398, 2915, L"Дурхам"},
+ {139, 398, 399, L"Роли"},
+ {139, 398, 2386, L"Другое"},
+ {139, 410, 2863, L"Мемфис"},
+ {139, 410, 411, L"Нашвилл"},
+ {139, 410, 1229, L"Ноксвилл"},
+ {139, 410, 2385, L"Другое"},
+ {139, 422, 3085, L"Бедфорд"},
+ {139, 422, 2913, L"Брейди"},
+ {139, 422, 1233, L"Даллас"},
+ {139, 422, 2916, L"Ирвинг"},
+ {139, 422, 3123, L"Кингсвилл"},
+ {139, 422, 2873, L"Конрой"},
+ {139, 422, 3096, L"Корпус Кристи"},
+ {139, 422, 423, L"Остин"},
+ {139, 422, 1232, L"Сан-Антонио"},
+ {139, 422, 3023, L"Уайли"},
+ {139, 422, 1231, L"Хьюстон"},
+ {139, 422, 1230, L"Эль-Пасо"},
+ {139, 422, 2384, L"Другое"},
+ {139, 406, 2383, L"Другое"},
+ {139, 404, 2879, L"Бока-Рейтон"},
+ {139, 404, 2880, L"Гейнсвил"},
+ {139, 404, 3086, L"Джексонвиль"},
+ {139, 404, 3002, L"Киссимми"},
+ {139, 404, 3124, L"Корал Гейблс"},
+ {139, 404, 2894, L"Корал-Спрингс"},
+ {139, 404, 3290, L"Лейк-Ворт"},
+ {139, 404, 1234, L"Майами"},
+ {139, 404, 1236, L"Орландо"},
+ {139, 404, 3372, L"Пинеллас Парк"},
+ {139, 404, 2952, L"Пунта-Горда"},
+ {139, 404, 3340, L"Сарасота"},
+ {139, 404, 1235, L"Сент-Питерсберг"},
+ {139, 404, 405, L"Таллахасси"},
+ {139, 404, 2962, L"Форт Лаудердейл"},
+ {139, 404, 2382, L"Другое"},
+ {139, 384, 385, L"Пирр"},
+ {139, 384, 2381, L"Другое"},
+ {139, 400, 401, L"Колумбия"},
+ {139, 400, 3090, L"Спартанбург"},
+ {139, 400, 1237, L"Чарлстон"},
+ {139, 400, 2380, L"Другое"},
+ {139, 436, 3036, L"Кейсвилл"},
+ {139, 436, 3024, L"Линдон"},
+ {139, 436, 3108, L"Орем"},
+ {139, 436, 2866, L"Сент-Джордж"},
+ {139, 436, 437, L"Солт-Лейк-Сити"},
+ {139, 436, 2379, L"Другое"},
+ {39, 315, 614, L"Винница"},
+ {39, 315, 615, L"Хмельник"},
+ {39, 315, 2566, L"Другое"},
+ {39, 316, 2940, L"Ковель"},
+ {39, 316, 616, L"Луцк"},
+ {39, 316, 2565, L"Другое"},
+ {39, 317, 617, L"Днепродзержинск"},
+ {39, 317, 618, L"Днепропетровск"},
+ {39, 317, 619, L"Кривой Рог"},
+ {39, 317, 620, L"Никополь"},
+ {39, 317, 621, L"Новомосковск"},
+ {39, 317, 622, L"Орджоникидзе"},
+ {39, 317, 623, L"Павлоград"},
+ {39, 317, 2564, L"Другое"},
+ {39, 318, 624, L"Артемовск"},
+ {39, 318, 625, L"Горловка"},
+ {39, 318, 626, L"Донецк"},
+ {39, 318, 627, L"Дружковка"},
+ {39, 318, 628, L"Енакиево"},
+ {39, 318, 629, L"Константиновка"},
+ {39, 318, 630, L"Краматорск"},
+ {39, 318, 2944, L"Красноармейск"},
+ {39, 318, 631, L"Макеевка"},
+ {39, 318, 632, L"Мариуполь"},
+ {39, 318, 633, L"Николаевка"},
+ {39, 318, 634, L"Славянск"},
+ {39, 318, 635, L"Харцызск"},
+ {39, 318, 2563, L"Другое"},
+ {39, 319, 636, L"Бердичев"},
+ {39, 319, 637, L"Житомир"},
+ {39, 319, 2942, L"Коростень"},
+ {39, 319, 638, L"Коростышев"},
+ {39, 319, 2907, L"Малин"},
+ {39, 319, 639, L"Новоград-Волынский"},
+ {39, 319, 2562, L"Другое"},
+ {39, 320, 640, L"Берегово"},
+ {39, 320, 641, L"Воловец"},
+ {39, 320, 3119, L"Мукачево"},
+ {39, 320, 3162, L"Свалява"},
+ {39, 320, 642, L"Ужгород"},
+ {39, 320, 643, L"Хуст"},
+ {39, 320, 2561, L"Другое"},
+ {39, 321, 644, L"Бердянск"},
+ {39, 321, 3128, L"Гуляйполе"},
+ {39, 321, 645, L"Запорожье"},
+ {39, 321, 646, L"Мелитополь"},
+ {39, 321, 3121, L"Приморск"},
+ {39, 321, 3378, L"Энергодар"},
+ {39, 321, 2560, L"Другое"},
+ {39, 322, 3379, L"Галич"},
+ {39, 322, 647, L"Ивано-Франковск"},
+ {39, 322, 3170, L"Яремче"},
+ {39, 322, 2559, L"Другое"},
+ {39, 323, 648, L"Белая Церковь"},
+ {39, 323, 649, L"Борисполь"},
+ {39, 323, 651, L"Бровары"},
+ {39, 323, 650, L"Васильков"},
+ {39, 323, 652, L"Ирпень"},
+ {39, 323, 3341, L"Переяслав-Хмельницкий"},
+ {39, 323, 653, L"Славутич"},
+ {39, 323, 654, L"Фастов"},
+ {39, 323, 655, L"Чернобыль"},
+ {39, 323, 2558, L"Другое"},
+ {39, 324, 656, L"Александрия"},
+ {39, 324, 657, L"Кировоград"},
+ {39, 324, 658, L"Светловодск"},
+ {39, 324, 2557, L"Другое"},
+ {39, 325, 659, L"Алушта"},
+ {39, 325, 2984, L"Армянск"},
+ {39, 325, 3042, L"Балаклава"},
+ {39, 325, 660, L"Бахчисарай"},
+ {39, 325, 662, L"Гурзуф"},
+ {39, 325, 3382, L"Джанкой"},
+ {39, 325, 663, L"Евпатория"},
+ {39, 325, 667, L"Керчь"},
+ {39, 325, 666, L"Коктебель"},
+ {39, 325, 668, L"Мысовое"},
+ {39, 325, 669, L"Саки"},
+ {39, 325, 665, L"Севастополь"},
+ {39, 325, 661, L"Симферополь"},
+ {39, 325, 3370, L"Старый Крым"},
+ {39, 325, 670, L"Судак"},
+ {39, 325, 664, L"Феодосия"},
+ {39, 325, 3148, L"Черноморское"},
+ {39, 325, 671, L"Ялта"},
+ {39, 325, 2556, L"Другое"},
+ {39, 326, 672, L"Алчевск"},
+ {39, 326, 673, L"Антрацит"},
+ {39, 326, 674, L"Лисичанск"},
+ {39, 326, 675, L"Луганск"},
+ {39, 326, 3364, L"Молодогвардейск"},
+ {39, 326, 676, L"Петровское"},
+ {39, 326, 677, L"Ровеньки"},
+ {39, 326, 678, L"Рубежное"},
+ {39, 326, 679, L"Северодонецк"},
+ {39, 326, 680, L"Стаханов"},
+ {39, 326, 2555, L"Другое"},
+ {39, 327, 3284, L"Дрогобыч"},
+ {39, 327, 681, L"Львов"},
+ {39, 327, 682, L"Трускавец"},
+ {39, 327, 2554, L"Другое"},
+ {39, 328, 3322, L"Вознесенск"},
+ {39, 328, 2870, L"Жовтневое"},
+ {39, 328, 683, L"Николаев"},
+ {39, 328, 3118, L"Очаков"},
+ {39, 328, 3325, L"Южноукраинск"},
+ {39, 328, 2553, L"Другое"},
+ {39, 329, 684, L"Белгород-Днестровский"},
+ {39, 329, 685, L"Измаил"},
+ {39, 329, 689, L"Ильичевск"},
+ {39, 329, 686, L"Одесса"},
+ {39, 329, 688, L"Рени"},
+ {39, 329, 687, L"Слободка"},
+ {39, 329, 2552, L"Другое"},
+ {39, 330, 690, L"Гадяч"},
+ {39, 330, 691, L"Комсомольск"},
+ {39, 330, 693, L"Кременчуг"},
+ {39, 330, 694, L"Лубны"},
+ {39, 330, 695, L"Миргород"},
+ {39, 330, 692, L"Полтава"},
+ {39, 330, 2551, L"Другое"},
+ {39, 331, 696, L"Здолбунов"},
+ {39, 331, 697, L"Ровно"},
+ {39, 331, 3361, L"Сарны"},
+ {39, 331, 2550, L"Другое"},
+ {39, 332, 3356, L"Бурынь"},
+ {39, 332, 698, L"Конотоп"},
+ {39, 332, 700, L"Ромны"},
+ {39, 332, 699, L"Сумы"},
+ {39, 332, 701, L"Шостка"},
+ {39, 332, 2549, L"Другое"},
+ {39, 333, 702, L"Бережаны"},
+ {39, 333, 3171, L"Борщев"},
+ {39, 333, 703, L"Тернополь"},
+ {39, 333, 704, L"Чортков"},
+ {39, 333, 2548, L"Другое"},
+ {39, 334, 705, L"Изюм"},
+ {39, 334, 3346, L"Купянск"},
+ {39, 334, 3351, L"Купянск"},
+ {39, 334, 706, L"Лозовая"},
+ {39, 334, 708, L"Мерефа"},
+ {39, 334, 707, L"Харьков"},
+ {39, 334, 709, L"Чугуев"},
+ {39, 334, 2547, L"Другое"},
+ {39, 335, 710, L"Геническ"},
+ {39, 335, 711, L"Каховка"},
+ {39, 335, 712, L"Новая Каховка"},
+ {39, 335, 3280, L"Скадовск"},
+ {39, 335, 713, L"Херсон"},
+ {39, 335, 2546, L"Другое"},
+ {39, 336, 714, L"Каменец-Подольский"},
+ {39, 336, 715, L"Красилов"},
+ {39, 336, 2941, L"Нетишин"},
+ {39, 336, 716, L"Полонное"},
+ {39, 336, 3120, L"Сатанов"},
+ {39, 336, 2943, L"Славута"},
+ {39, 336, 717, L"Хмельницкий"},
+ {39, 336, 3155, L"Чемировцы"},
+ {39, 336, 2542, L"Другое"},
+ {39, 337, 3169, L"Золотоноша"},
+ {39, 337, 3016, L"Канев"},
+ {39, 337, 3333, L"Полонное"},
+ {39, 337, 718, L"Умань"},
+ {39, 337, 719, L"Христиновка"},
+ {39, 337, 720, L"Черкассы"},
+ {39, 337, 2545, L"Другое"},
+ {39, 338, 721, L"Нежин"},
+ {39, 338, 722, L"Прилуки"},
+ {39, 338, 723, L"Чернигов"},
+ {39, 338, 2544, L"Другое"},
+ {39, 339, 724, L"Черновцы"},
+ {39, 339, 2543, L"Другое"},
+ {340, 342, 725, L"Барановичи"},
+ {340, 342, 726, L"Белоозерск"},
+ {340, 342, 727, L"Береза"},
+ {340, 342, 728, L"Брест"},
+ {340, 342, 3172, L"Дрогичин"},
+ {340, 342, 729, L"Кобрин"},
+ {340, 342, 730, L"Ляховичи"},
+ {340, 342, 731, L"Малорита"},
+ {340, 342, 732, L"Пинск"},
+ {340, 342, 2538, L"Другое"},
+ {340, 343, 733, L"Браслав"},
+ {340, 343, 735, L"Витебск"},
+ {340, 343, 734, L"Новолукомоль"},
+ {340, 343, 736, L"Новополоцк"},
+ {340, 343, 737, L"Орша"},
+ {340, 343, 738, L"Толочин"},
+ {340, 343, 2537, L"Другое"},
+ {340, 344, 739, L"Гомель"},
+ {340, 344, 740, L"Жлобин"},
+ {340, 344, 741, L"Мозырь"},
+ {340, 344, 742, L"Речица"},
+ {340, 344, 743, L"Рогачев"},
+ {340, 344, 744, L"Светлогорск"},
+ {340, 344, 2536, L"Другое"},
+ {340, 345, 745, L"Волковыск"},
+ {340, 345, 746, L"Гродно"},
+ {340, 345, 747, L"Лида"},
+ {340, 345, 3244, L"Слоним"},
+ {340, 345, 748, L"Сморгонь"},
+ {340, 345, 2535, L"Другое"},
+ {340, 346, 3149, L"Березино"},
+ {340, 346, 749, L"Борисов"},
+ {340, 346, 750, L"Вилейка"},
+ {340, 346, 751, L"Жодино"},
+ {340, 346, 752, L"Марьина Горка"},
+ {340, 346, 753, L"Молодечно"},
+ {340, 346, 2896, L"Слуцк"},
+ {340, 346, 754, L"Смолевичи"},
+ {340, 346, 755, L"Солигорск"},
+ {340, 346, 756, L"Червень"},
+ {340, 346, 2534, L"Другое"},
+ {340, 347, 757, L"Бобруйск"},
+ {340, 347, 758, L"Могилев"},
+ {340, 347, 759, L"Осиповичи"},
+ {340, 347, 2533, L"Другое"},
+ {0, 0, 0, NULL}
};
diff --git a/protocols/MRA/MraPopUp.cpp b/protocols/MRA/MraPopUp.cpp
index 79a8664e01..9951776e82 100644
--- a/protocols/MRA/MraPopUp.cpp
+++ b/protocols/MRA/MraPopUp.cpp
@@ -1,110 +1,83 @@
#include "Mra.h"
#include "MraPopUp.h"
-
-INT_PTR CALLBACK MraPopupDlgProcOpts (HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-LRESULT CALLBACK MraPopupDlgProc (HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-
-
-
#define POPUPS_TYPES_COUNT 7
-static LPCWSTR lpcwszPopupsTypes[]=
+static LPCWSTR lpcwszPopupsTypes[] =
{
- L"None",
- L"Debug",
- L"Information",
- L"Question",
- L"Warning",
- L"Error",
- L"NewMail",
+ L"None",
+ L"Debug",
+ L"Information",
+ L"Question",
+ L"Warning",
+ L"Error",
+ L"NewMail",
NULL
};
-
-
-
-int MraPopupOptInit(WPARAM wParam,LPARAM lParam)
-{
- if (ServiceExists(MS_POPUP_ADDPOPUP)) {
- OPTIONSDIALOGPAGE odp = {0};
- odp.cbSize = sizeof(odp);
- odp.position = 100000000;
- odp.hInstance = masMraSettings.hInstance;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_POPUPS);
- odp.pszTitle = PROTOCOL_NAMEA;
- odp.pszGroup = LPGEN("Popups");
- odp.groupPosition = 900000000;
- odp.flags = ODPF_BOLDGROUPS;
- odp.nIDBottomSimpleControl = IDC_GROUPMAIN;
- odp.pfnDlgProc = MraPopupDlgProcOpts;
- Options_AddPage(wParam, &odp);
- }
-return(0);
-}
-
-
INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg){
+ CMraProto *ppro = (CMraProto*)GetWindowLongPtr(hWndDlg, GWLP_USERDATA);
+
+ switch (msg) {
case WM_INITDIALOG:
+ TranslateDialogDefault(hWndDlg);
+ SetWindowLongPtr(hWndDlg, GWLP_USERDATA, lParam);
{
HWND hWndCombo = GetDlgItem(hWndDlg, IDC_COMBO_POPUP_TYPE);
- DWORD dwItem;
-
SendMessage(hWndCombo, CB_RESETCONTENT, 0, 0);
- for (SIZE_T i = 0; i < POPUPS_TYPES_COUNT; i++) {
- dwItem=SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)TranslateW(lpcwszPopupsTypes[i]));
+
+ for (size_t i = 0; i < POPUPS_TYPES_COUNT; i++) {
+ DWORD dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)TranslateW(lpcwszPopupsTypes[i]));
SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, i);
}
SendMessage(hWndCombo, CB_SETCURSEL, 0, 0);
SendMessage(hWndDlg, WM_COMMAND, MAKELONG(IDC_COMBO_POPUP_TYPE, CBN_SELCHANGE), 0);
-
- TranslateDialogDefault(hWndDlg);
}
- return(TRUE);
+ return TRUE;
+
case WM_COMMAND:
- switch(LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
case IDC_COMBO_POPUP_TYPE:
if (HIWORD(wParam) == CBN_SELCHANGE) {
BOOL bEnabled, bUseWinColors;
char szBuff[MAX_PATH];
DWORD dwType = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_COMBO_POPUP_TYPE);
- bEnabled = GetBit(DB_Mra_GetDword(NULL, "PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER), dwType);
+ bEnabled = GetBit(ppro->mraGetDword(NULL, "PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER), dwType);
CHECK_DLG_BUTTON(hWndDlg, IDC_CHK_ENABLE, bEnabled);
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
- bUseWinColors = DB_Mra_GetByte(NULL, szBuff, MRA_DEFAULT_POPUP_USE_WIN_COLORS);
+ bUseWinColors = ppro->mraGetByte(NULL, szBuff, MRA_DEFAULT_POPUP_USE_WIN_COLORS);
CHECK_DLG_BUTTON(hWndDlg, IDC_CHK_USE_WIN_COLORS, bUseWinColors);
EnableWindow(GetDlgItem(hWndDlg, IDC_CHK_USE_WIN_COLORS), bEnabled);
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_SETCOLOUR, 0, DB_Mra_GetDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_BACK));
- EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_BACKCOLOR),(bEnabled && bUseWinColors == FALSE));
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_SETCOLOUR, 0, ppro->mraGetDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_BACK));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_BACKCOLOR), (bEnabled && bUseWinColors == FALSE));
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
- SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_SETCOLOUR, 0, DB_Mra_GetDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_TEXT));
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_SETCOLOUR, 0, ppro->mraGetDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_TEXT));
EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_TEXTCOLOR), (bEnabled && bUseWinColors == FALSE));
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
- SetDlgItemInt(hWndDlg, IDC_POPUP_TIMEOUT, DB_Mra_GetDword(NULL, szBuff, MRA_DEFAULT_POPUP_TIMEOUT), FALSE);
+ SetDlgItemInt(hWndDlg, IDC_POPUP_TIMEOUT, ppro->mraGetDword(NULL, szBuff, MRA_DEFAULT_POPUP_TIMEOUT), FALSE);
EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_TIMEOUT), bEnabled);
}
break;
+
case IDC_PREVIEW:
{
- for (SIZE_T i = 0; i < POPUPS_TYPES_COUNT; i++) {
- MraPopupShowFromAgentW(i, 0, TranslateW(lpcwszPopupsTypes[i]));
+ for (size_t i = 0; i < POPUPS_TYPES_COUNT; i++) {
+ ppro->MraPopupShowFromAgentW(i, 0, TranslateW(lpcwszPopupsTypes[i]));
}
}
break;
+
case IDC_CHK_ENABLE:
case IDC_CHK_USE_WIN_COLORS:
{
- BOOL bEnabled, bUseWinColors;
-
- bEnabled = IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_ENABLE);
- bUseWinColors = IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_USE_WIN_COLORS);
+ BOOL bEnabled = IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_ENABLE);
+ BOOL bUseWinColors = IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_USE_WIN_COLORS);
EnableWindow(GetDlgItem(hWndDlg, IDC_CHK_USE_WIN_COLORS), bEnabled);
EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_BACKCOLOR), (bEnabled && bUseWinColors == FALSE));
@@ -113,139 +86,169 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR
}
default:
if ((LOWORD(wParam) == IDC_POPUP_TIMEOUT) && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
- return(FALSE);
+ return FALSE;
SendMessage(GetParent(hWndDlg), PSM_CHANGED, 0, 0);
}
break;
+
case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->code){
+ switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
{
char szBuff[MAX_PATH];
- DWORD dwPopupsEventFilter, dwType = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_COMBO_POPUP_TYPE);
-
- dwPopupsEventFilter = DB_Mra_GetDword(NULL, "PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER);
- if (IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_CHK_ENABLE)) {
+ DWORD dwType = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_COMBO_POPUP_TYPE);
+ DWORD dwPopupsEventFilter = ppro->mraGetDword(NULL, "PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER);
+ if (IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_ENABLE))
dwPopupsEventFilter |= (1<<dwType);
- }else{
+ else
dwPopupsEventFilter &= ~(1<<dwType);
- }
- DB_Mra_SetDword(NULL, "PopupsEventFilter", dwPopupsEventFilter);
+
+ ppro->mraSetDword(NULL, "PopupsEventFilter", dwPopupsEventFilter);
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
- DB_Mra_SetByte(NULL, szBuff, IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_USE_WIN_COLORS));
+ ppro->mraSetByte(NULL, szBuff, IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_USE_WIN_COLORS));
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
- DB_Mra_SetDword(NULL, szBuff, SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_GETCOLOUR, 0, 0));
+ ppro->mraSetDword(NULL, szBuff, SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_GETCOLOUR, 0, 0));
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
- DB_Mra_SetDword(NULL, szBuff, SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_GETCOLOUR, 0, 0));
+ ppro->mraSetDword(NULL, szBuff, SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_GETCOLOUR, 0, 0));
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
- DB_Mra_SetDword(NULL, szBuff, GetDlgItemInt(hWndDlg, IDC_POPUP_TIMEOUT, NULL, FALSE));
+ ppro->mraSetDword(NULL, szBuff, GetDlgItemInt(hWndDlg, IDC_POPUP_TIMEOUT, NULL, FALSE));
}
- return(TRUE);
+ return TRUE;
}
break;
}
-return(FALSE);
+ return FALSE;
+}
+
+int CMraProto::OnPopupOptInit(WPARAM wParam, LPARAM lParam)
+{
+ if ( ServiceExists(MS_POPUP_ADDPOPUP)) {
+ OPTIONSDIALOGPAGE odp = {0};
+ odp.cbSize = sizeof(odp);
+ odp.dwInitParam = (LPARAM)this;
+ odp.position = 100000000;
+ odp.hInstance = masMraSettings.hInstance;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_POPUPS);
+ odp.pszTitle = m_szModuleName;
+ odp.pszGroup = LPGEN("Popups");
+ odp.groupPosition = 900000000;
+ odp.flags = ODPF_BOLDGROUPS;
+ odp.nIDBottomSimpleControl = IDC_GROUPMAIN;
+ odp.pfnDlgProc = MraPopupDlgProcOpts;
+ Options_AddPage(wParam, &odp);
+ }
+ return 0;
}
/////////////////////////////////////////////////////////////////////////////////////////
// ShowPopup - popup plugin support
+
+struct MraPopupData
+{
+ CMraProto *ppro;
+ int iPopupType;
+};
+
void CALLBACK MraPopupThreadMarandaCallback(ULONG_PTR dwParam)
{
if (dwParam == 0)
return;
- if ((SIZE_T)(((POPUPDATAW*)dwParam)->PluginData) == MRA_POPUP_TYPE_EMAIL_STATUS && masMraSettings.hWndEMailPopupStatus) {
+ MraPopupData* dat = (MraPopupData*)((POPUPDATAW*)dwParam)->PluginData;
+ if (dat->iPopupType == MRA_POPUP_TYPE_EMAIL_STATUS && dat->ppro->hWndEMailPopupStatus) {
// 1: PUDeletePopUp(hWndDlg);
// 1: PUAddPopUpW((POPUPDATAW*)dwParam);
- // 2: PUChangeW(masMraSettings.hWndEMailPopupStatus,(POPUPDATAW*)dwParam); //- crash :/
- PUChangeTextW(masMraSettings.hWndEMailPopupStatus,((POPUPDATAW*)dwParam)->lpwzText);
- }else{
- PUAddPopUpW((POPUPDATAW*)dwParam);
+ // 2: PUChangeW(hWndEMailPopupStatus, (POPUPDATAW*)dwParam); //- crash :/
+ PUChangeTextW(dat->ppro->hWndEMailPopupStatus, ((POPUPDATAW*)dwParam)->lpwzText);
}
+ else PUAddPopUpW((POPUPDATAW*)dwParam);
- MEMFREE(dwParam);
-
+ mir_free((void*)dwParam);
}
/////////////////////////////////////////////////////////////////////////////////////////
// Popup plugin window proc
+
LRESULT CALLBACK MraPopupDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg){
+ MraPopupData* dat = (MraPopupData*)PUGetPluginData(hWndDlg);
+
+ switch (msg) {
case UM_INITPOPUP:
- if ((SIZE_T)PUGetPluginData(hWndDlg) == MRA_POPUP_TYPE_EMAIL_STATUS) {
+ if (dat->iPopupType == MRA_POPUP_TYPE_EMAIL_STATUS) {
// update/load avatar
- MraAvatarsQueueGetAvatarSimple(masMraSettings.hAvatarsQueueHandle, GAIF_FORCE, PUGetContact(hWndDlg), 0);
-
+ dat->ppro->MraAvatarsQueueGetAvatarSimple(dat->ppro->hAvatarsQueueHandle, GAIF_FORCE, PUGetContact(hWndDlg), 0);
+
// delete old email popup
- if (masMraSettings.hWndEMailPopupStatus)
- PUDeletePopUp(masMraSettings.hWndEMailPopupStatus);
+ if (dat->ppro->hWndEMailPopupStatus)
+ PUDeletePopUp(dat->ppro->hWndEMailPopupStatus);
- masMraSettings.hWndEMailPopupStatus = hWndDlg;
+ dat->ppro->hWndEMailPopupStatus = hWndDlg;
}
break;
+
case WM_COMMAND:
if (HIWORD(wParam) == STN_CLICKED) { //It was a click on the Popup.
- if ((SIZE_T)PUGetPluginData(hWndDlg) == MRA_POPUP_TYPE_EMAIL_STATUS)
- {
- CallProtoService(PROTOCOL_NAMEA, MRA_GOTO_INBOX, 0, 0);
- masMraSettings.hWndEMailPopupStatus = NULL;
+ if (dat->iPopupType == MRA_POPUP_TYPE_EMAIL_STATUS) {
+ CallProtoService(dat->ppro->m_szModuleName, MRA_GOTO_INBOX, 0, 0);
+ dat->ppro->hWndEMailPopupStatus = NULL;
}
}
PUDeletePopUp(hWndDlg);
break;
+
case WM_CONTEXTMENU:
- if ((SIZE_T)PUGetPluginData(hWndDlg) == MRA_POPUP_TYPE_EMAIL_STATUS)
- masMraSettings.hWndEMailPopupStatus = NULL;
+ if (dat->iPopupType == MRA_POPUP_TYPE_EMAIL_STATUS)
+ dat->ppro->hWndEMailPopupStatus = NULL;
PUDeletePopUp(hWndDlg);
break;
+
case UM_FREEPLUGINDATA:
- if ((SIZE_T)PUGetPluginData(hWndDlg) == MRA_POPUP_TYPE_EMAIL_STATUS)
- masMraSettings.hWndEMailPopupStatus = NULL;
+ if (dat->iPopupType == MRA_POPUP_TYPE_EMAIL_STATUS)
+ dat->ppro->hWndEMailPopupStatus = NULL;
+ mir_free(dat);
break;
}
-return(DefWindowProc(hWndDlg, msg, wParam, lParam));
+ return DefWindowProc(hWndDlg, msg, wParam, lParam);
}
-
-void MraPopupShowFromContactW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszMessage)
+void CMraProto::MraPopupShowFromContactW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszMessage)
{
WCHAR szNick[MAX_EMAIL_LEN], szEMail[MAX_EMAIL_LEN], szTitle[MAX_CONTACTNAME];
- DB_Mra_GetStaticStringW(hContact, "Nick", szNick, SIZEOF(szNick), NULL);
- DB_Mra_GetStaticStringW(hContact, "e-mail", szEMail, SIZEOF(szEMail), NULL);
+ mraGetStaticStringW(hContact, "Nick", szNick, SIZEOF(szNick), NULL);
+ mraGetStaticStringW(hContact, "e-mail", szEMail, SIZEOF(szEMail), NULL);
if (hContact) {
- mir_sntprintf(szTitle, SIZEOF(szTitle), L"%s <%s>",szNick, szEMail);
- }else{
- mir_sntprintf(szTitle, SIZEOF(szTitle), L"%s: %s <%s>", PROTOCOL_DISPLAY_NAMEW, szNick, szEMail);
+ mir_sntprintf(szTitle, SIZEOF(szTitle), L"%s <%s>", szNick, szEMail);
+ }else {
+ mir_sntprintf(szTitle, SIZEOF(szTitle), L"%s: %s <%s>", m_tszUserName, szNick, szEMail);
}
MraPopupShowW(hContact, dwType, dwFlags, szTitle, lpszMessage);
}
-void MraPopupShowW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPWSTR lpszMessage)
+void CMraProto::MraPopupShowW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPWSTR lpszMessage)
{
- if (DB_Mra_GetByte(NULL,"PopupsEnabled", MRA_DEFAULT_POPUPS_ENABLED))
- if (GetBit(DB_Mra_GetDword(NULL,"PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER), dwType))
- if (ServiceExists(MS_POPUP_ADDPOPUPW))
- {
+ if (mraGetByte(NULL, "PopupsEnabled", MRA_DEFAULT_POPUPS_ENABLED))
+ if (GetBit(mraGetDword(NULL, "PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER), dwType))
+ if ( ServiceExists(MS_POPUP_ADDPOPUPW)) {
BOOL bUseWinColors;
char szBuff[MAX_PATH];
- POPUPDATAW *ppd = (POPUPDATAW*)MEMALLOC(sizeof(POPUPDATAW));
+ POPUPDATAW *ppd = (POPUPDATAW*)mir_calloc(sizeof(POPUPDATAW));
- //if (ServiceExists(MS_POPUP2_SHOW)==FALSE)// yapp used
- if (dwType == MRA_POPUP_TYPE_EMAIL_STATUS && masMraSettings.hWndEMailPopupStatus) {
+ //if ( ServiceExists(MS_POPUP2_SHOW) == FALSE)// yapp used
+ if (dwType == MRA_POPUP_TYPE_EMAIL_STATUS && hWndEMailPopupStatus) {
// delete old email popup
- PUDeletePopUp(masMraSettings.hWndEMailPopupStatus);
- masMraSettings.hWndEMailPopupStatus = NULL;
+ PUDeletePopUp(hWndEMailPopupStatus);
+ hWndEMailPopupStatus = NULL;
}
// load icon
- switch(dwType){
+ switch (dwType) {
case MRA_POPUP_TYPE_NONE:// proto icon
ppd->lchIcon = (HICON)LoadImage(masMraSettings.hInstance, MAKEINTRESOURCE(IDI_MRA), IMAGE_ICON, 0, 0, LR_SHARED);
break;
@@ -269,39 +272,37 @@ void MraPopupShowW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitl
break;
}
+ MraPopupData *dat = (MraPopupData*)mir_calloc( sizeof(MraPopupData));
+ dat->iPopupType = dwType;
+ dat->ppro = this;
+
ppd->lchContact = hContact;
if (lpszTitle)
lstrcpynW(ppd->lpwzContactName, lpszTitle, SIZEOF(ppd->lpwzContactName));
if (lpszMessage)
lstrcpynW(ppd->lpwzText, lpszMessage, SIZEOF(ppd->lpwzText));
ppd->PluginWindowProc = (WNDPROC)MraPopupDlgProc;
- ppd->PluginData = (LPVOID)dwType;
+ ppd->PluginData = dat;
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
- bUseWinColors = DB_Mra_GetByte(NULL, szBuff, MRA_DEFAULT_POPUP_USE_WIN_COLORS);
+ bUseWinColors = mraGetByte(NULL, szBuff, MRA_DEFAULT_POPUP_USE_WIN_COLORS);
if (bUseWinColors) {
ppd->colorBack = GetSysColor(COLOR_BTNFACE);
ppd->colorText = GetSysColor(COLOR_WINDOWTEXT);
- }else{
+ }
+ else {
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
- ppd->colorBack = DB_Mra_GetDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_BACK);
+ ppd->colorBack = mraGetDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_BACK);
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
- ppd->colorText = DB_Mra_GetDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_TEXT);
+ ppd->colorText = mraGetDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_TEXT);
}
mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
- ppd->iSeconds = DB_Mra_GetDword(NULL, szBuff, MRA_DEFAULT_POPUP_TIMEOUT);
+ ppd->iSeconds = mraGetDword(NULL, szBuff, MRA_DEFAULT_POPUP_TIMEOUT);
- //if (MraAPCQueueAdd(MraPopupThreadMarandaCallback,&masMraSettings.ffmtAPCQueue,(ULONG_PTR)ppd)!=NO_ERROR)
- {// sync call
- MraPopupThreadMarandaCallback((ULONG_PTR)ppd);
- }
- }else{
- if (dwFlags & MRA_POPUP_ALLOW_MSGBOX)
- MessageBox(NULL, lpszMessage, lpszTitle, MB_OK+(dwType == MRA_POPUP_TYPE_WARNING)?MB_ICONERROR:MB_ICONINFORMATION);
+ MraPopupThreadMarandaCallback((ULONG_PTR)ppd);
}
+ else if (dwFlags & MRA_POPUP_ALLOW_MSGBOX)
+ MessageBox(NULL, lpszMessage, lpszTitle, MB_OK+(dwType == MRA_POPUP_TYPE_WARNING)?MB_ICONERROR:MB_ICONINFORMATION);
}
-
-
-
diff --git a/protocols/MRA/MraPopUp.h b/protocols/MRA/MraPopUp.h
index 5b768cdc1a..722dac168c 100644
--- a/protocols/MRA/MraPopUp.h
+++ b/protocols/MRA/MraPopUp.h
@@ -19,16 +19,4 @@
#define MRA_POPUP_TYPE_ERROR 5 // IDI_ERROR
#define MRA_POPUP_TYPE_EMAIL_STATUS 6 //
-
-int MraPopupOptInit (WPARAM wParam,LPARAM lParam);
-
-void MraPopupShowFromContactW (HANDLE hContact,DWORD dwType,DWORD dwFlags,LPWSTR lpszMessage);
-#define MraPopupShowFromAgentW(dwType,dwFlags,lpszMessage) MraPopupShowFromContactW(NULL,dwType,dwFlags,lpszMessage)
-
-void MraPopupShowW (HANDLE hContact,DWORD dwType,DWORD dwFlags,LPWSTR lpszTitle,LPWSTR lpszMessage);
-
-
-
-
-
#endif // !defined(AFX_MRA_POPUP_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraProto.cpp b/protocols/MRA/MraProto.cpp
new file mode 100644
index 0000000000..3e36de7fd3
--- /dev/null
+++ b/protocols/MRA/MraProto.cpp
@@ -0,0 +1,814 @@
+#include "Mra.h"
+
+static int MraExtraIconsApplyAll(WPARAM, LPARAM)
+{
+ for (int i=0; i < g_Instances.getCount(); i++)
+ g_Instances[i]->MraExtraIconsApply(0, 0);
+ return 0;
+}
+
+static int MraExtraIconsRebuildAll(WPARAM, LPARAM)
+{
+ for (int i=0; i < g_Instances.getCount(); i++)
+ g_Instances[i]->MraExtraIconsRebuild(0, 0);
+ return 0;
+}
+
+CMraProto::CMraProto(const char* _module, const TCHAR* _displayName) :
+ m_bLoggedIn(false)
+{
+ m_iVersion = 2;
+ m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
+ m_szModuleName = mir_strdup(_module);
+ m_tszUserName = mir_tstrdup(_displayName);
+
+ InitializeCriticalSectionAndSpinCount(&csCriticalSectionSend, 0);
+ MraSendQueueInitialize(0, &hSendQueueHandle);
+ MraFilesQueueInitialize(0, &hFilesQueueHandle);
+ MraMPopSessionQueueInitialize(&hMPopSessionQueue);
+ MraAvatarsQueueInitialize(&hAvatarsQueueHandle);
+
+ CreateObjectSvc(PS_ICQ_SETCUSTOMSTATUS, &CMraProto::MraSetXStatus);
+ CreateObjectSvc(PS_ICQ_SETCUSTOMSTATUSEX, &CMraProto::MraSetXStatusEx);
+ CreateObjectSvc(PS_ICQ_GETCUSTOMSTATUS, &CMraProto::MraGetXStatus);
+ CreateObjectSvc(PS_ICQ_GETCUSTOMSTATUSEX, &CMraProto::MraGetXStatusEx);
+ CreateObjectSvc(PS_ICQ_GETCUSTOMSTATUSICON, &CMraProto::MraGetXStatusIcon);
+
+ CreateObjectSvc(PS_SET_LISTENINGTO, &CMraProto::MraSetListeningTo);
+
+ CreateObjectSvc(PS_GETAVATARCAPS, &CMraProto::MraGetAvatarCaps);
+ CreateObjectSvc(PS_GETAVATARINFOT, &CMraProto::MraGetAvatarInfo);
+ CreateObjectSvc(PS_GETMYAVATART, &CMraProto::MraGetMyAvatar);
+
+ CreateObjectSvc(MS_ICQ_SENDSMS, &CMraProto::MraSendSMS);
+ CreateObjectSvc(MRA_SEND_NUDGE, &CMraProto::MraSendNudge);
+
+ if ( ServiceExists(MS_NUDGE_SEND))
+ heNudgeReceived = CreateHookableEvent(MS_NUDGE);
+
+ FifoMTInitialize(&ffmtAPCQueue, 0);
+ hWaitEventThreadAPCHandle = CreateEvent(NULL, FALSE, FALSE, NULL);
+ InterlockedExchange((volatile LONG*)&dwAPCThreadRunning, TRUE);
+ hThreadAPC = ForkThreadEx(&CMraProto::MraUserAPCThreadProc, NULL);
+ if (hThreadAPC == NULL) {
+ MraAPCQueueDestroy(&ffmtAPCQueue);
+ CloseHandle(hWaitEventThreadAPCHandle);
+ hWaitEventThreadAPCHandle = NULL;
+ DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hThreadAPC, THREAD_SET_CONTEXT, FALSE, 0);
+ DebugPrintCRLFW(L"Fail on create event APC thread, using miranda main thread");
+ MessageBox(NULL, L"Fail on create event APC thread, using miranda main thread", m_tszUserName, MB_OK | MB_ICONINFORMATION);
+ }
+
+ TCHAR name[128];
+ mir_sntprintf( name, SIZEOF(name), TranslateT("%s connection"), m_tszUserName);
+
+ NETLIBUSER nlu = {0};
+ nlu.cbSize = sizeof(nlu);
+ nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
+ nlu.szSettingsModule = m_szModuleName;
+ nlu.ptszDescriptiveName = name;
+ hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, &CMraProto::OnPreShutdown);
+ HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, &CMraProto::MraExtraIconsRebuild);
+
+ IconsLoad();
+
+ // Main menu initialization
+ HICON hMainIcon = (HICON)LoadImage(masMraSettings.hInstance, MAKEINTRESOURCE(IDI_MRA), IMAGE_ICON, 0, 0, LR_SHARED);
+ CListCreateMenu(200001, 500085000, hMainIcon, NULL, TRUE, gdiMenuItems, hMainMenuIcons, gdiMenuItemsCount, hMainMenuItems);
+
+ // Contact menu initialization
+ CListCreateMenu(2000060000, -500050000, NULL, NULL, FALSE, gdiContactMenuItems, hContactMenuIcons, gdiContactMenuItemsCount, hContactMenuItems);
+
+ // xstatus menu
+ InitXStatusIcons();
+ for (size_t i = 0; i < MRA_XSTATUS_COUNT; i++) {
+ char szServiceName[100];
+ mir_snprintf(szServiceName, SIZEOF(szServiceName), "/menuXStatus%ld", i);
+ CreateObjectSvcParam(szServiceName, &CMraProto::MraXStatusMenu, i);
+ }
+
+ mir_snprintf(szNewMailSound, SIZEOF(szNewMailSound), "%s: %s", m_szModuleName, MRA_SOUND_NEW_EMAIL);
+ SkinAddNewSoundEx(szNewMailSound, m_szModuleName, MRA_SOUND_NEW_EMAIL);
+
+ HookEvent(ME_CLIST_PREBUILDSTATUSMENU, &CMraProto::MraRebuildStatusMenu);
+ MraRebuildStatusMenu(0, 0);
+ MraExtraIconsRebuild(0, 0);
+
+ hExtraXstatusIcon = ExtraIcon_Register("MRAXstatus", "Mail.ru Xstatus", "MRA_xstatus25", MraExtraIconsRebuildAll, MraExtraIconsApplyAll, NULL, NULL);
+ hExtraInfo = ExtraIcon_Register("MRAStatus", "Mail.ru extra info", "MRA_xstatus49", MraExtraIconsRebuildAll, MraExtraIconsApplyAll, NULL, NULL);
+
+ bHideXStatusUI = FALSE;
+ m_iXStatus = mraGetByte(NULL, DBSETTING_XSTATUSID, MRA_MIR_XSTATUS_NONE);
+ if ( !IsXStatusValid(m_iXStatus))
+ m_iXStatus = MRA_MIR_XSTATUS_NONE;
+
+ bChatExists = MraChatRegister();
+}
+
+CMraProto::~CMraProto()
+{
+ Netlib_CloseHandle(hNetlibUser);
+
+ DestroyXStatusIcons();
+ IconsUnLoad();
+
+ if (heNudgeReceived)
+ DestroyHookableEvent(heNudgeReceived);
+
+ MraMPopSessionQueueDestroy(hMPopSessionQueue);
+ MraFilesQueueDestroy(hFilesQueueHandle);
+ MraSendQueueDestroy(hSendQueueHandle);
+ DeleteCriticalSection(&csCriticalSectionSend);
+}
+
+int CMraProto::OnModulesLoaded(WPARAM, LPARAM)
+{
+ hHookExtraIconsApply = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, &CMraProto::MraExtraIconsApply);
+ HookEvent(ME_OPT_INITIALISE, &CMraProto::OnOptionsInit);
+ HookEvent(ME_DB_CONTACT_DELETED, &CMraProto::MraContactDeleted);
+ HookEvent(ME_DB_CONTACT_SETTINGCHANGED, &CMraProto::MraDbSettingChanged);
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU, &CMraProto::MraRebuildContactMenu);
+ HookEvent(ME_WAT_NEWSTATUS, &CMraProto::MraMusicChanged);
+
+ // всех в offline // тк unsaved values сохраняются их нужно инициализировать
+ for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact != NULL; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS), -1, -1, 0, 0, ID_STATUS_OFFLINE, NULL, 0, NULL, 0, NULL, 0);
+
+ // unsaved values
+ DB_MraCreateResidentSetting("Status");// NOTE: XStatus cannot be temporary
+ DB_MraCreateResidentSetting("LogonTS");
+ DB_MraCreateResidentSetting("ContactID");
+ DB_MraCreateResidentSetting("GroupID");
+ DB_MraCreateResidentSetting("ContactFlags");
+ DB_MraCreateResidentSetting("ContactSeverFlags");
+ DB_MraCreateResidentSetting("HooksLocked");
+ DB_MraCreateResidentSetting(DBSETTING_CAPABILITIES);
+ DB_MraCreateResidentSetting(DBSETTING_XSTATUSNAME);
+ DB_MraCreateResidentSetting(DBSETTING_XSTATUSMSG);
+ DB_MraCreateResidentSetting(DBSETTING_BLOGSTATUSTIME);
+ DB_MraCreateResidentSetting(DBSETTING_BLOGSTATUSID);
+ DB_MraCreateResidentSetting(DBSETTING_BLOGSTATUS);
+ DB_MraCreateResidentSetting(DBSETTING_BLOGSTATUSMUSIC);
+
+ // destroy all chat sessions
+ if (bChatExists)
+ MraChatSessionDestroy(NULL);
+
+ return 0;
+}
+
+int CMraProto::OnPreShutdown(WPARAM, LPARAM)
+{
+ SetStatus(ID_STATUS_OFFLINE);
+ MraAvatarsQueueDestroy(hAvatarsQueueHandle); hAvatarsQueueHandle = NULL;
+
+ if (hThreadWorker) {
+ if (IsThreadAlive(hThreadWorker))
+ WaitForSingleObjectEx(hThreadWorker, (WAIT_FOR_THREAD_TIMEOUT*1000), FALSE);
+ hThreadWorker = NULL;
+ }
+
+ InterlockedExchange((volatile LONG*)&dwAPCThreadRunning, FALSE);
+ if (hWaitEventThreadAPCHandle)
+ if (IsThreadAlive(hThreadAPC))
+ SetEvent(hWaitEventThreadAPCHandle);
+ else {
+ CloseHandle(hWaitEventThreadAPCHandle);
+ hWaitEventThreadAPCHandle = NULL;
+ hThreadAPC = NULL;
+ }
+
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+void CMraProto::CreateObjectSvc(const char *szService, ServiceFunc serviceProc)
+{
+ char str[ MAXMODULELABELLENGTH ];
+ strcpy( str, m_szModuleName );
+ strcat( str, szService );
+ ::CreateServiceFunctionObj( str, ( MIRANDASERVICEOBJ )*( void** )&serviceProc, this );
+}
+
+void CMraProto::CreateObjectSvcParam( const char *szService, ServiceFuncParam serviceProc, LPARAM lParam )
+{
+ char str[ MAXMODULELABELLENGTH ];
+ strcpy( str, m_szModuleName );
+ strcat( str, szService );
+ ::CreateServiceFunctionObjParam( str, ( MIRANDASERVICEOBJPARAM )*( void** )&serviceProc, this, lParam );
+}
+
+HANDLE CMraProto::HookEvent(const char* szEvent, EventFunc handler)
+{
+ return ::HookEventObj( szEvent, ( MIRANDAHOOKOBJ )*( void** )&handler, this );
+}
+
+HANDLE CMraProto::CreateHookableEvent(const char *szService)
+{
+ char str[ MAXMODULELABELLENGTH ];
+ strcpy( str, m_szModuleName );
+ strcat( str, szService );
+ return ::CreateHookableEvent( str );
+}
+
+void CMraProto::ForkThread(ThreadFunc pFunc, void *param)
+{
+ UINT threadID;
+ CloseHandle(( HANDLE )::mir_forkthreadowner(( pThreadFuncOwner ) *( void** )&pFunc, this, param, &threadID ));
+}
+
+HANDLE CMraProto::ForkThreadEx(ThreadFunc pFunc, void *param, UINT* threadID)
+{
+ UINT lthreadID;
+ return ( HANDLE )::mir_forkthreadowner(( pThreadFuncOwner ) *( void** )&pFunc, this, param, threadID ? threadID : &lthreadID);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+HANDLE CMraProto::AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR plpsFirstName, LPCTSTR plpsLastName, DWORD dwFlags)
+{
+ if (!plpsEMail)
+ return NULL;
+
+ BOOL bAdded;
+ HANDLE hContact = MraHContactFromEmail( _T2A(plpsEMail), lstrlen(plpsEMail), TRUE, TRUE, &bAdded);
+ if (hContact) {
+ if (plpsNick)
+ mraSetStringW(hContact, "Nick", plpsNick);
+ if (plpsFirstName)
+ mraSetStringW(hContact, "FirstName", plpsFirstName);
+ if (plpsLastName)
+ mraSetStringW(hContact, "LastName", plpsLastName);
+
+ if (dwFlags & PALF_TEMPORARY)
+ DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
+ else
+ DBDeleteContactSetting(hContact, "CList", "NotOnList");
+
+ if (bAdded)
+ MraUpdateContactInfo(hContact);
+ }
+
+ return hContact;
+}
+
+HANDLE CMraProto::AddToList(int flags, PROTOSEARCHRESULT *psr)
+{
+ if (psr->cbSize != sizeof(PROTOSEARCHRESULT))
+ return 0;
+
+ return AddToListByEmail(psr->email, psr->nick, psr->firstName, psr->lastName, flags);
+}
+
+HANDLE CMraProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
+{
+ DBEVENTINFO dbei = {0};
+ dbei.cbSize = sizeof(dbei);
+ if ((dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0)) != -1) {
+ dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
+ if ( CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei) == 0 &&
+ !strcmp(dbei.szModule, m_szModuleName) &&
+ (dbei.eventType == EVENTTYPE_AUTHREQUEST || dbei.eventType == EVENTTYPE_CONTACTS)) {
+
+ char *nick = (char*)(dbei.pBlob + sizeof(DWORD)+ sizeof(HANDLE));
+ char *firstName = nick + strlen(nick) + 1;
+ char *lastName = firstName + strlen(firstName) + 1;
+ char *email = lastName + strlen(lastName) + 1;
+ return AddToListByEmail( _A2T(email), _A2T(nick), _A2T(firstName), _A2T(lastName), 0);
+ }
+ }
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Stubs
+
+HANDLE CMraProto::ChangeInfo(int, void*) { return NULL; }
+int CMraProto::FileResume(HANDLE, int*, const TCHAR**) { return 1; }
+int CMraProto::RecvAwayMsg(HANDLE, int, PROTORECVEVENT*) { return 1; }
+int CMraProto::RecvUrl(HANDLE, PROTORECVEVENT*) { return 1; }
+int CMraProto::SendAwayMsg(HANDLE, HANDLE, const char* ) { return 1; }
+int CMraProto::SendUrl(HANDLE, int, const char*) { return 1; }
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+int CMraProto::Authorize(HANDLE hDBEvent)
+{
+ if (!m_bLoggedIn) return 1;
+
+ DBEVENTINFO dbei = {0};
+ dbei.cbSize = sizeof(dbei);
+ if ((dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDBEvent, 0)) == -1)
+ return 1;
+
+ dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
+ if ( CallService(MS_DB_EVENT_GET, (WPARAM)hDBEvent, (LPARAM)&dbei)) return 1;
+ if (dbei.eventType != EVENTTYPE_AUTHREQUEST) return 1;
+ if ( strcmp(dbei.szModule, m_szModuleName)) return 1;
+
+ LPSTR lpszNick = (LPSTR)(dbei.pBlob + sizeof(DWORD)*2);
+ LPSTR lpszFirstName = lpszNick + lstrlenA(lpszNick) + 1;
+ LPSTR lpszLastName = lpszFirstName + lstrlenA(lpszFirstName) + 1;
+ LPSTR lpszEMail = lpszLastName + lstrlenA(lpszLastName) + 1;
+ MraAuthorize(lpszEMail, lstrlenA(lpszEMail));
+ return 0;
+}
+
+int CMraProto::AuthDeny(HANDLE hDBEvent, const TCHAR* szReason)
+{
+ if (!m_bLoggedIn) return 1;
+
+ DBEVENTINFO dbei = {0};
+ dbei.cbSize = sizeof(dbei);
+ if ((dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDBEvent, 0)) != -1)
+ return 1;
+
+ dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
+ if ( CallService(MS_DB_EVENT_GET, (WPARAM)hDBEvent, (LPARAM)&dbei)) return 1;
+ if (dbei.eventType != EVENTTYPE_AUTHREQUEST) return 1;
+ if ( strcmp(dbei.szModule, m_szModuleName)) return 1;
+
+ LPSTR lpszNick = (LPSTR)(dbei.pBlob + sizeof(DWORD)*2);
+ LPSTR lpszFirstName = lpszNick + lstrlenA(lpszNick) + 1;
+ LPSTR lpszLastName = lpszFirstName + lstrlenA(lpszFirstName) + 1;
+ LPSTR lpszEMail = lpszLastName + lstrlenA(lpszLastName) + 1;
+
+ MraMessageW(FALSE, NULL, 0, 0, lpszEMail, lstrlenA(lpszEMail), szReason, lstrlen(szReason), NULL, 0);
+ return 0;
+}
+
+int CMraProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* pre)
+{
+ DBEVENTINFO dbei = {0};
+ dbei.cbSize = sizeof(dbei);
+ dbei.szModule = m_szModuleName;
+ dbei.timestamp = pre->timestamp;
+ dbei.flags = (pre->flags & PREF_CREATEREAD) ? DBEF_READ : 0;
+ dbei.eventType = EVENTTYPE_AUTHREQUEST;
+ dbei.cbBlob = pre->lParam;
+ dbei.pBlob = (PBYTE)pre->szMessage;
+ CallService(MS_DB_EVENT_ADD, (WPARAM)NULL, (LPARAM)&dbei);
+ return 0;
+}
+
+int CMraProto::AuthRequest(HANDLE hContact, const TCHAR *lptszMessage)
+{
+ if (!m_bLoggedIn )
+ return 1;
+
+ CHAR szEMail[MAX_EMAIL_LEN];
+ size_t dwEMailSize, dwMessageSize;
+
+ dwMessageSize = lstrlen(lptszMessage);
+ if (dwMessageSize) {
+ if (mraGetStaticStringA(hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize)) {
+ BOOL bSlowSend = mraGetByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND);
+ int iRet = MraMessageW(bSlowSend, hContact, ACKTYPE_AUTHREQ, MESSAGE_FLAG_AUTHORIZE, szEMail, dwEMailSize, lptszMessage, dwMessageSize, NULL, 0);
+ if (bSlowSend == FALSE)
+ ProtoBroadcastAckAsynchEx(hContact, ACKTYPE_AUTHREQ, ACKRESULT_SUCCESS, (HANDLE)iRet, (LPARAM)NULL, 0);
+
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+HANDLE CMraProto::FileAllow(HANDLE hContact, HANDLE hTransfer, const TCHAR *szPath)
+{
+ if (szPath != NULL)
+ if ( MraFilesQueueAccept(hFilesQueueHandle, (DWORD)hTransfer, szPath, lstrlen(szPath)) == NO_ERROR)
+ return hTransfer; // Success
+
+ return NULL;
+}
+
+int CMraProto::FileCancel(HANDLE hContact, HANDLE hTransfer)
+{
+ if (hContact && hTransfer) {
+ MraFilesQueueCancel(hFilesQueueHandle, (DWORD)hTransfer, TRUE);
+ return 0; // Success
+ }
+
+ return 1;
+}
+
+int CMraProto::FileDeny(HANDLE hContact, HANDLE hTransfer, const TCHAR*)
+{
+ return FileCancel(hContact, hTransfer);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+DWORD_PTR CMraProto::GetCaps(int type, HANDLE hContact)
+{
+ switch ( type ) {
+ case PFLAGNUM_1:
+ return PF1_IM | PF1_FILE | PF1_MODEMSG | PF1_SERVERCLIST | PF1_AUTHREQ | PF1_ADDED | PF1_VISLIST | PF1_INVISLIST |
+ PF1_INDIVSTATUS | PF1_PEER2PEER | PF1_CHAT | PF1_BASICSEARCH | PF1_EXTSEARCH | PF1_CANRENAMEFILE | PF1_FILERESUME |
+ PF1_ADDSEARCHRES | PF1_CONTACT | PF1_SEARCHBYEMAIL | PF1_USERIDISEMAIL | PF1_SEARCHBYNAME | PF1_EXTSEARCHUI;
+
+ case PFLAGNUM_2:
+ return PF2_ONLINE | PF2_INVISIBLE | PF2_SHORTAWAY | PF2_HEAVYDND | PF2_FREECHAT;
+
+ case PFLAGNUM_3:
+ return PF2_ONLINE | PF2_INVISIBLE | PF2_SHORTAWAY | PF2_HEAVYDND | PF2_FREECHAT;
+
+ case PFLAGNUM_4:
+ return PF4_FORCEAUTH | PF4_FORCEADDED | PF4_SUPPORTTYPING | PF4_AVATARS | PF4_IMSENDUTF;
+
+ case PFLAG_UNIQUEIDTEXT:
+ return (INT_PTR)Translate("E-mail address");
+
+ case PFLAG_MAXCONTACTSPERPACKET:
+ return MRA_MAXCONTACTSPERPACKET;
+
+ case PFLAG_UNIQUEIDSETTING:
+ return (INT_PTR)"e-mail";
+
+ case PFLAG_MAXLENOFMESSAGE:
+ return MRA_MAXLENOFMESSAGE;
+
+ default:
+ return 0;
+ }
+}
+
+HICON CMraProto::GetIcon(int iconIndex)
+{
+ UINT id;
+
+ switch ( iconIndex ) {
+ case PLI_PROTOCOL: id = IDI_MRA; break; // IDI_TM is the main icon for the protocol
+ default: return NULL;
+ }
+
+ return (HICON)LoadImage(masMraSettings.hInstance, MAKEINTRESOURCE(id), IMAGE_ICON,
+ GetSystemMetrics((iconIndex & PLIF_SMALL) ? SM_CXSMICON : SM_CXICON),
+ GetSystemMetrics((iconIndex & PLIF_SMALL) ? SM_CYSMICON : SM_CYICON), 0);
+}
+
+int CMraProto::GetInfo(HANDLE hContact, int infoType)
+{
+ return MraUpdateContactInfo(hContact) != 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+HANDLE CMraProto::SearchBasic(const TCHAR *id)
+{
+ return SearchByEmail(id);
+}
+
+HANDLE CMraProto::SearchByEmail(const TCHAR *email)
+{
+ if (m_bLoggedIn && email)
+ return MraWPRequestByEMail(NULL, ACKTYPE_SEARCH, _T2A(email), lstrlen(email));
+
+ return NULL;
+}
+
+HANDLE CMraProto::SearchByName(const TCHAR *pszNick, const TCHAR *pszFirstName, const TCHAR *pszLastName)
+{
+ INT_PTR iRet = 0;
+
+ if (m_bLoggedIn && (pszNick || pszFirstName || pszLastName)) {
+ DWORD dwRequestFlags = 0;
+ if (pszNick) dwRequestFlags |= MRIM_CS_WP_REQUEST_PARAM_NICKNAME;
+ if (pszFirstName) dwRequestFlags |= MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME;
+ if (pszLastName) dwRequestFlags |= MRIM_CS_WP_REQUEST_PARAM_LASTNAME;
+ return MraWPRequestW(NULL, ACKTYPE_SEARCH, dwRequestFlags, NULL, 0, NULL, 0,
+ pszNick, lstrlen(pszNick), pszFirstName, lstrlen(pszFirstName), pszLastName, lstrlen(pszLastName), 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ }
+
+ return NULL;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+int CMraProto::RecvContacts(HANDLE hContact, PROTORECVEVENT* pre)
+{
+ DBEVENTINFO dbei = {0};
+ dbei.cbSize = sizeof(dbei);
+ dbei.szModule = m_szModuleName;
+ dbei.timestamp = pre->timestamp;
+ dbei.flags = (pre->flags & PREF_CREATEREAD) ? DBEF_READ : 0;
+ dbei.eventType = EVENTTYPE_CONTACTS;
+ dbei.cbBlob = pre->lParam;
+ dbei.pBlob = (PBYTE)pre->szMessage;
+ CallService(MS_DB_EVENT_ADD, (WPARAM)hContact, (LPARAM)&dbei);
+ return 0;
+}
+
+int CMraProto::RecvFile(HANDLE hContact, PROTORECVFILET *pre)
+{
+ CallService(MS_PROTO_RECVFILET, 0, (LPARAM)pre);
+ return 0;
+}
+
+int CMraProto::RecvMsg(HANDLE hContact, PROTORECVEVENT *pre)
+{
+ CallService(MS_PROTO_RECVMSG, 0, (LPARAM)pre);
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+int CMraProto::SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList)
+{
+ INT_PTR iRet = 0;
+
+ if (m_bLoggedIn && hContact) {
+ BOOL bSlowSend;
+ CHAR szEMail[MAX_EMAIL_LEN];
+ LPWSTR lpwszData, lpwszDataCurrent, lpwszNick;
+ size_t dwDataBuffSize, dwEMailSize, dwStringSize, dwNickSize;
+
+ dwDataBuffSize = (nContacts*(MAX_EMAIL_LEN*2));
+ lpwszData = (LPWSTR)mir_calloc((dwDataBuffSize*sizeof(WCHAR)));
+ if (lpwszData) {
+ lpwszDataCurrent = lpwszData;
+ if ( mraGetStaticStringA(hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize)) {
+ for (int i = 0; i < nContacts; i++) {
+ if ( IsContactMra( hContactsList[i] ))
+ if ( mraGetStaticStringW(hContactsList[i], "e-mail", lpwszDataCurrent, dwDataBuffSize-(lpwszDataCurrent-lpwszData), &dwStringSize)) {
+ lpwszDataCurrent += dwStringSize;
+ *lpwszDataCurrent++ = ';';
+
+ lpwszNick = GetContactNameW(hContactsList[i]);
+ dwNickSize = lstrlenW(lpwszNick);
+ memmove(lpwszDataCurrent, lpwszNick, dwNickSize*sizeof(WCHAR));
+ lpwszDataCurrent += dwNickSize;
+ *lpwszDataCurrent++ = ';';
+ }
+ }
+
+ bSlowSend = mraGetByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND);
+ iRet = MraMessageW(bSlowSend, hContact, ACKTYPE_CONTACTS, MESSAGE_FLAG_CONTACT, szEMail, dwEMailSize, lpwszData, (lpwszDataCurrent-lpwszData), NULL, 0);
+ if (bSlowSend == FALSE)
+ ProtoBroadcastAckAsynchEx(hContact, ACKTYPE_CONTACTS, ACKRESULT_SUCCESS, (HANDLE)iRet, (LPARAM)NULL, 0);
+ }
+ mir_free(lpwszData);
+ }
+ }
+ else ProtoBroadcastAckAsynchEx(hContact, ACKTYPE_CONTACTS, ACKRESULT_FAILED, NULL, (LPARAM)"You cannot send when you are offline.", -1);
+
+ return iRet;
+}
+
+HANDLE CMraProto::SendFile(HANDLE hContact, const TCHAR* szDescription, TCHAR** ppszFiles)
+{
+ INT_PTR iRet = 0;
+
+ if (m_bLoggedIn && hContact && ppszFiles) {
+ size_t dwFilesCount;
+ for (dwFilesCount = 0; ppszFiles[dwFilesCount]; dwFilesCount++);
+ MraFilesQueueAddSend(hFilesQueueHandle, 0, hContact, ppszFiles, dwFilesCount, (DWORD*)&iRet);
+ }
+ return (HANDLE)iRet;
+}
+
+int CMraProto::SendMsg(HANDLE hContact, int flags, const char *lpszMessage)
+{
+ if (!m_bLoggedIn) {
+ ProtoBroadcastAckAsynchEx(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)"You cannot send when you are offline.", -1);
+ return 0;
+ }
+
+ BOOL bMemAllocated = FALSE;
+ CHAR szEMail[MAX_EMAIL_LEN];
+ DWORD dwFlags = 0;
+ LPWSTR lpwszMessage = NULL;
+ size_t dwEMailSize, dwMessageSize = 0;
+ int iRet = 0;
+
+ dwMessageSize = lstrlenA(lpszMessage);
+ if (flags & PREF_UNICODE)
+ lpwszMessage = (LPWSTR)(lpszMessage+dwMessageSize+1);
+ else if (flags & PREF_UTF)
+ lpwszMessage = mir_utf8decodeT(lpszMessage);
+ else
+ lpwszMessage = mir_a2t(lpszMessage);
+
+ if ( !lpwszMessage) {
+ ProtoBroadcastAckAsynchEx(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)"Cant allocate buffer for convert to unicode.", -1);
+ return 0;
+ }
+
+ if ( mraGetStaticStringA(hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize)) {
+ BOOL bSlowSend = mraGetByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND);
+ if ( mraGetByte(NULL, "RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE) && (MraContactCapabilitiesGet(hContact) & FEATURE_FLAG_RTF_MESSAGE))
+ dwFlags |= MESSAGE_FLAG_RTF;
+
+ iRet = MraMessageW(bSlowSend, hContact, ACKTYPE_MESSAGE, dwFlags, szEMail, dwEMailSize, lpwszMessage, dwMessageSize, NULL, 0);
+ if (bSlowSend == FALSE)
+ ProtoBroadcastAckAsynchEx(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)iRet, (LPARAM)NULL, 0);
+ }
+
+ mir_free(lpwszMessage);
+ return iRet;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+int CMraProto::SetApparentMode(HANDLE hContact, int mode)
+{
+ if (!m_bLoggedIn || !hContact)
+ return 1;
+
+ // Only 3 modes are supported
+ if (hContact && (mode == 0 || mode == ID_STATUS_ONLINE || mode == ID_STATUS_OFFLINE)) {
+ DWORD dwOldMode = mraGetWord(hContact, "ApparentMode", 0);
+
+ // Dont send redundant updates
+ if (mode != dwOldMode) {
+ CHAR szEMail[MAX_EMAIL_LEN], szPhones[MAX_EMAIL_LEN];
+ WCHAR wszNick[MAX_EMAIL_LEN];
+ DWORD dwID, dwGroupID, dwContactFlag = 0;
+ size_t dwEMailSize, dwNickSize, dwPhonesSize;
+
+ GetContactBasicInfoW(hContact, &dwID, &dwGroupID, &dwContactFlag, NULL, NULL, szEMail, SIZEOF(szEMail), &dwEMailSize, wszNick, SIZEOF(wszNick), &dwNickSize, szPhones, SIZEOF(szPhones), &dwPhonesSize);
+
+ dwContactFlag &= ~(CONTACT_FLAG_INVISIBLE | CONTACT_FLAG_VISIBLE);
+ switch (mode) {
+ case ID_STATUS_OFFLINE:
+ dwContactFlag |= CONTACT_FLAG_INVISIBLE;
+ break;
+ case ID_STATUS_ONLINE:
+ dwContactFlag |= CONTACT_FLAG_VISIBLE;
+ break;
+ }
+
+ if (MraModifyContactW(hContact, dwID, dwContactFlag, dwGroupID, szEMail, dwEMailSize, wszNick, dwNickSize, szPhones, dwPhonesSize)) {
+ SetContactBasicInfoW(hContact, 0, SCBIF_FLAG, 0, 0, dwContactFlag, 0, 0, NULL, 0, NULL, 0, NULL, 0);
+ return 0; // Success
+ }
+ }
+ }
+
+ return 1;
+}
+
+int CMraProto::SetStatus(int iNewStatus)
+{
+ // remap global statuses to local supported
+ switch (iNewStatus) {
+ case ID_STATUS_OFFLINE:
+ iNewStatus = ID_STATUS_OFFLINE;
+ break;
+ case ID_STATUS_ONLINE:
+ iNewStatus = ID_STATUS_ONLINE;
+ break;
+ case ID_STATUS_AWAY:
+ iNewStatus = ID_STATUS_AWAY;
+ break;
+ case ID_STATUS_DND:
+ case ID_STATUS_OCCUPIED:
+ iNewStatus = ID_STATUS_DND;
+ break;
+ case ID_STATUS_FREECHAT:
+ iNewStatus = ID_STATUS_FREECHAT;
+ break;
+ case ID_STATUS_INVISIBLE:
+ iNewStatus = ID_STATUS_INVISIBLE;
+ break;
+ case ID_STATUS_NA:
+ case ID_STATUS_ONTHEPHONE:
+ case ID_STATUS_OUTTOLUNCH:
+ iNewStatus = ID_STATUS_AWAY;
+ break;
+ default:
+ iNewStatus = ID_STATUS_OFFLINE;
+ break;
+ }
+
+ // nothing to change
+ if (InterlockedExchangeAdd((volatile LONG*)&m_iStatus, 0) == iNewStatus && iNewStatus != m_iDesiredStatus)
+ ProtoBroadcastAckAsynchEx(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)iNewStatus, iNewStatus, 0);
+ else {
+ DWORD dwOldStatusMode;
+
+ //set all contacts to offline
+ if ((m_iDesiredStatus = iNewStatus) == ID_STATUS_OFFLINE) {
+ m_bLoggedIn = FALSE;
+ dwOldStatusMode = InterlockedExchange((volatile LONG*)&m_iStatus, m_iDesiredStatus);
+
+ // всех в offline, только если мы бывали подключены
+ if (dwOldStatusMode > ID_STATUS_OFFLINE) {
+ // функция сама проверяет принадлежность контакта к MRA
+ for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS), -1, -1, 0, 0, ID_STATUS_OFFLINE, NULL, 0, NULL, 0, NULL, 0);
+ }
+ Netlib_CloseHandle(hConnection);
+ }
+ else {
+ // если offline то сразу ставим connecting, но обработка как offline
+ dwOldStatusMode = InterlockedCompareExchange((volatile LONG*)&m_iStatus, ID_STATUS_CONNECTING, ID_STATUS_OFFLINE);
+
+ switch (dwOldStatusMode) {
+ case ID_STATUS_OFFLINE: // offline, connecting
+ if (StartConnect() != NO_ERROR) {
+ m_bLoggedIn = FALSE;
+ m_iDesiredStatus = ID_STATUS_OFFLINE;
+ dwOldStatusMode = InterlockedExchange((volatile LONG*)&m_iStatus, m_iDesiredStatus);
+ }
+ break;
+ case ID_STATUS_ONLINE:// connected, change status
+ case ID_STATUS_AWAY:
+ case ID_STATUS_DND:
+ case ID_STATUS_FREECHAT:
+ case ID_STATUS_INVISIBLE:
+ MraSendNewStatus(m_iDesiredStatus, m_iXStatus, NULL, 0, NULL, 0);
+ case ID_STATUS_CONNECTING:
+ // предотвращаем переход в любой статус (кроме offline) из статуса connecting, если он не вызван самим плагином
+ if (dwOldStatusMode == ID_STATUS_CONNECTING && iNewStatus != m_iDesiredStatus)
+ break;
+
+ default:
+ dwOldStatusMode = InterlockedExchange((volatile LONG*)&m_iStatus, m_iDesiredStatus);
+ break;
+ }
+ }
+ MraSetContactStatus(NULL, m_iStatus);
+ ProtoBroadcastAckAsynchEx(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)dwOldStatusMode, m_iStatus, 0);
+ }
+
+ return 0;
+}
+
+HANDLE CMraProto::GetAwayMsg(HANDLE hContact)
+{
+ if (!m_bLoggedIn || ! hContact)
+ return 0;
+
+ CHAR szStatusDesc[MICBLOG_STATUS_MAX+MICBLOG_STATUS_MAX+MAX_PATH], szBlogStatus[MICBLOG_STATUS_MAX+4], szTime[64];
+ DWORD dwTime;
+ size_t dwStatusDescSize;
+ int iRet = 0;
+ SYSTEMTIME stBlogStatusTime = {0};
+
+ if ( mraGetStaticStringA(hContact, DBSETTING_BLOGSTATUS, szBlogStatus, SIZEOF(szBlogStatus), NULL)) {
+ dwTime = mraGetDword(hContact, DBSETTING_BLOGSTATUSTIME, 0);
+ if (dwTime && MakeLocalSystemTimeFromTime32(dwTime, &stBlogStatusTime))
+ mir_snprintf(szTime, SIZEOF(szTime), "%04ld.%02ld.%02ld %02ld:%02ld: ", stBlogStatusTime.wYear, stBlogStatusTime.wMonth, stBlogStatusTime.wDay, stBlogStatusTime.wHour, stBlogStatusTime.wMinute);
+ else
+ szTime[0] = 0;
+
+ dwStatusDescSize = mir_snprintf(szStatusDesc, SIZEOF(szStatusDesc), "%s%s", szTime, szBlogStatus);
+ iRet = GetTickCount();
+ ProtoBroadcastAckAsynchEx(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)iRet, (LPARAM)szStatusDesc, dwStatusDescSize);
+ }
+ return (HANDLE)iRet;
+}
+
+int CMraProto::SetAwayMsg(int m_iStatus, const TCHAR* msg)
+{
+ if (!m_bLoggedIn)
+ return 1;
+
+ size_t dwStatusDescSize = lstrlen(msg);
+ DWORD dwStatus = m_iStatus;
+ DWORD dwXStatus = m_iXStatus;
+
+ // не отправляем новый статусный текст для хстатусов, для хстатусов только эвей сообщения
+ if (dwStatus != ID_STATUS_ONLINE || IsXStatusValid(dwXStatus) == FALSE) {
+ dwStatusDescSize = min(dwStatusDescSize, STATUS_DESC_MAX);
+ MraSendNewStatus(dwStatus, dwXStatus, NULL, 0, msg, dwStatusDescSize);
+ }
+ return 0;
+}
+
+int CMraProto::UserIsTyping(HANDLE hContact, int type)
+{
+ if (!m_bLoggedIn || !hContact || type == PROTOTYPE_SELFTYPING_OFF)
+ return 1;
+
+ CHAR szEMail[MAX_EMAIL_LEN];
+ size_t dwEMailSize;
+
+ if ( MraGetContactStatus(hContact) != ID_STATUS_OFFLINE && m_iStatus != ID_STATUS_INVISIBLE)
+ if ( mraGetStaticStringA(hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize))
+ if ( MraMessageW(FALSE, hContact, 0, MESSAGE_FLAG_NOTIFY, szEMail, dwEMailSize, L" ", 1, NULL, 0))
+ return 0;
+
+ return 1;
+}
+
+int CMraProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
+{
+ switch ( eventType ) {
+ case EV_PROTO_ONLOAD: return OnModulesLoaded( 0, 0 );
+ case EV_PROTO_ONEXIT: return OnPreShutdown( 0, 0 );
+// case EV_PROTO_ONOPTIONS: return OnOptionsInit( wParam, lParam );
+
+ case EV_PROTO_ONMENU:
+// MenuInit();
+ break;
+ }
+ return 1;
+}
diff --git a/protocols/MRA/MraProto.h b/protocols/MRA/MraProto.h
new file mode 100644
index 0000000000..4b575955e6
--- /dev/null
+++ b/protocols/MRA/MraProto.h
@@ -0,0 +1,396 @@
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define SCBIFSI_LOCK_CHANGES_EVENTS 1
+#define SCBIF_ID 1
+#define SCBIF_GROUP_ID 2
+#define SCBIF_FLAG 4
+#define SCBIF_SERVER_FLAG 8
+#define SCBIF_STATUS 16
+#define SCBIF_EMAIL 32
+#define SCBIF_NICK 64
+#define SCBIF_PHONES 128
+
+#define MAIN_MENU_ITEMS_COUNT 15
+#define CONTACT_MENU_ITEMS_COUNT 10
+#define ADV_ICON_MAX 5
+
+struct MRA_FILES_QUEUE_ITEM;
+
+struct CMraProto;
+typedef void (__cdecl CMraProto::*ThreadFunc)(void*);
+typedef int (__cdecl CMraProto::*EventFunc)(WPARAM, LPARAM);
+typedef INT_PTR (__cdecl CMraProto::*ServiceFunc)(WPARAM, LPARAM);
+typedef INT_PTR (__cdecl CMraProto::*ServiceFuncParam)(WPARAM, LPARAM, LPARAM);
+
+BOOL DB_GetStaticStringA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize);
+BOOL DB_GetStaticStringW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPWSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize);
+
+BOOL DB_SetStringExA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPCSTR lpszValue, size_t dwValueSize);
+BOOL DB_SetStringExW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPCWSTR lpwszValue, size_t dwValueSize);
+
+int DB_WriteContactSettingBlob(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPVOID lpValue, size_t dwValueSize);
+BOOL DB_GetContactSettingBlob(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPVOID lpRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize);
+
+struct CMraProto : public PROTO_INTERFACE, public MZeroedObject
+{
+ CMraProto(const char*, const TCHAR*);
+ ~CMraProto();
+
+ // ====================================================================================
+ // PROTO_INTERFACE
+ // ====================================================================================
+
+ virtual HANDLE __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
+ virtual HANDLE __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent);
+
+ virtual int __cdecl Authorize(HANDLE hDBEvent);
+ virtual int __cdecl AuthDeny(HANDLE hContact, const TCHAR* szReason);
+ virtual int __cdecl AuthRecv(HANDLE hContact, PROTORECVEVENT*);
+ virtual int __cdecl AuthRequest(HANDLE hContact, const TCHAR* szMessage);
+
+ virtual HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData);
+
+ virtual HANDLE __cdecl FileAllow(HANDLE hContact, HANDLE hTransfer, const TCHAR* szPath);
+ virtual int __cdecl FileCancel(HANDLE hContact, HANDLE hTransfer);
+ virtual int __cdecl FileDeny(HANDLE hContact, HANDLE hTransfer, const TCHAR* szReason);
+ virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename);
+
+ virtual DWORD_PTR __cdecl GetCaps(int type, HANDLE hContact = NULL);
+ virtual HICON __cdecl GetIcon(int iconIndex);
+ virtual int __cdecl GetInfo(HANDLE hContact, int infoType);
+
+ virtual HANDLE __cdecl SearchBasic(const TCHAR* id);
+ virtual HANDLE __cdecl SearchByEmail(const TCHAR* email);
+ virtual HANDLE __cdecl SearchByName(const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName);
+ virtual HWND __cdecl SearchAdvanced(HWND owner);
+ virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
+
+ virtual int __cdecl RecvContacts(HANDLE hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvFile(HANDLE hContact, PROTORECVFILET*);
+ virtual int __cdecl RecvMsg(HANDLE hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvUrl(HANDLE hContact, PROTORECVEVENT*);
+
+ virtual int __cdecl SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList);
+ virtual HANDLE __cdecl SendFile(HANDLE hContact, const TCHAR* szDescription, TCHAR** ppszFiles);
+ virtual int __cdecl SendMsg(HANDLE hContact, int flags, const char* msg);
+ virtual int __cdecl SendUrl(HANDLE hContact, int flags, const char* url);
+
+ virtual int __cdecl SetApparentMode(HANDLE hContact, int mode);
+ virtual int __cdecl SetStatus(int iNewStatus);
+
+ virtual HANDLE __cdecl GetAwayMsg(HANDLE hContact);
+ virtual int __cdecl RecvAwayMsg(HANDLE hContact, int mode, PROTORECVEVENT* evt);
+ virtual int __cdecl SendAwayMsg(HANDLE hContact, HANDLE hProcess, const char* msg);
+ virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR* msg);
+
+ virtual int __cdecl UserIsTyping(HANDLE hContact, int type);
+
+ virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
+
+ void CreateObjectSvc(const char* szService, ServiceFunc serviceProc);
+ void CreateObjectSvcParam(const char* szService, ServiceFuncParam serviceProc, LPARAM lParam);
+ HANDLE CreateHookableEvent(const char* szService);
+ void ForkThread(ThreadFunc, void*);
+ HANDLE ForkThreadEx(ThreadFunc, void*, UINT* threadID = NULL);
+ HANDLE HookEvent(const char*, EventFunc);
+ void AddIcoLibItems(LPWSTR lpwszRootSectionName, LPWSTR lpwszSubSectionName, const struct GUI_DISPLAY_ITEM *pgdiItems, size_t dwCount, HANDLE *hResult);
+
+ void ShowFormattedErrorMessage(LPWSTR lpwszErrText, DWORD dwErrorCode);
+ void MraPopupShowW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPWSTR lpszMessage);
+ void MraPopupShowFromContactW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszMessage);
+ __forceinline void MraPopupShowFromAgentW(DWORD dwType, DWORD dwFlags, LPWSTR lpszMessage) {
+ MraPopupShowFromContactW(NULL, dwType, dwFlags, lpszMessage); }
+
+ __forceinline void mraDelValue(HANDLE Contact, const char *valueName) {
+ db_unset(Contact, m_szModuleName, valueName); }
+
+ __forceinline DWORD mraGetDword(HANDLE Contact, const char *valueName, DWORD parDefltValue) {
+ return db_get_dw(Contact, m_szModuleName, valueName, parDefltValue); }
+ __forceinline void mraSetDword(HANDLE Contact, const char *valueName, DWORD parValue) {
+ db_set_dw(Contact, m_szModuleName, valueName, parValue); }
+
+ __forceinline WORD mraGetWord(HANDLE Contact, const char *valueName, WORD parDefltValue) {
+ return db_get_w(Contact, m_szModuleName, valueName, parDefltValue); }
+ __forceinline void mraSetWord(HANDLE Contact, const char *valueName, WORD parValue) {
+ db_set_w(Contact, m_szModuleName, valueName, parValue); }
+
+ __forceinline BYTE mraGetByte(HANDLE Contact, const char *valueName, BYTE parDefltValue) {
+ return db_get_b(Contact, m_szModuleName, valueName, parDefltValue); }
+ __forceinline void mraSetByte(HANDLE Contact, const char *valueName, BYTE parValue) {
+ db_set_b(Contact, m_szModuleName, valueName, parValue); }
+
+ __forceinline BOOL mraGetStaticStringA(HANDLE Contact, const char *ValueName, char *Ret, size_t RetBuffSize, size_t *pRetBuffSize) {
+ return DB_GetStaticStringA(Contact, m_szModuleName, ValueName, Ret, RetBuffSize, pRetBuffSize); }
+ __forceinline BOOL mraGetStaticStringW(HANDLE Contact, const char *ValueName, WCHAR *Ret, size_t RetBuffSize, size_t *pRetBuffSize) {
+ return DB_GetStaticStringW(Contact, m_szModuleName, ValueName, Ret, RetBuffSize, pRetBuffSize); }
+
+ __forceinline BOOL mraSetStringA(HANDLE Contact, const char *valueName, const char *parValue) {
+ return DB_SetStringExA(Contact, m_szModuleName, valueName, parValue, lstrlenA(parValue)); }
+ __forceinline BOOL mraSetStringW(HANDLE Contact, const char *valueName, const WCHAR *parValue) {
+ return DBWriteContactSettingWString(Contact, m_szModuleName, valueName, parValue); }
+
+ __forceinline BOOL mraSetLPSStringA(HANDLE Contact, const char *valueName, MRA_LPS *parValue) {
+ return DB_SetStringExA(Contact, m_szModuleName, valueName, parValue->lpszData, parValue->dwSize); }
+ __forceinline BOOL mraSetLPSStringW(HANDLE Contact, const char *valueName, MRA_LPS *parValue) {
+ return DB_SetStringExW(Contact, m_szModuleName, valueName, parValue->lpwszData, parValue->dwSize/sizeof(WCHAR)); }
+
+ __forceinline BOOL mraSetStringExA(HANDLE Contact, const char *valueName, const char *parValue, size_t parValueSize) {
+ return DB_SetStringExA(Contact, m_szModuleName, valueName, parValue, parValueSize); }
+ __forceinline BOOL mraSetStringExW(HANDLE Contact, const char *valueName, const WCHAR *parValue, size_t parValueSize) {
+ return DB_SetStringExW(Contact, m_szModuleName, valueName, parValue, parValueSize); }
+
+ __forceinline BOOL mraWriteContactSettingBlob(HANDLE hContact, const char *lpszValueName, LPVOID lpbValue, size_t dwValueSize) {
+ return DB_WriteContactSettingBlob(hContact, m_szModuleName, lpszValueName, lpbValue, dwValueSize); }
+ __forceinline BOOL mraGetContactSettingBlob(HANDLE hContact, const char *lpszValueName, LPVOID lpbRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize) {
+ return DB_GetContactSettingBlob(hContact, m_szModuleName, lpszValueName, lpbRet, dwRetBuffSize, pdwRetBuffSize); }
+
+ // ====| Services |====================================================================
+ INT_PTR __cdecl MraSetXStatus(WPARAM, LPARAM);
+ INT_PTR __cdecl MraSetXStatusEx(WPARAM, LPARAM);
+ INT_PTR __cdecl MraGetXStatus(WPARAM, LPARAM);
+ INT_PTR __cdecl MraGetXStatusEx(WPARAM, LPARAM);
+ INT_PTR __cdecl MraGetXStatusIcon(WPARAM, LPARAM);
+ INT_PTR __cdecl MraXStatusMenu(WPARAM, LPARAM, LPARAM param);
+
+ INT_PTR __cdecl MraSetListeningTo(WPARAM, LPARAM);
+
+ INT_PTR __cdecl MraSendNudge(WPARAM, LPARAM);
+
+ INT_PTR __cdecl MraGetAvatarCaps(WPARAM, LPARAM);
+ INT_PTR __cdecl MraGetAvatarInfo(WPARAM, LPARAM);
+ INT_PTR __cdecl MraGetMyAvatar(WPARAM, LPARAM);
+
+ INT_PTR __cdecl MraSendSMS(WPARAM, LPARAM);
+
+ INT_PTR __cdecl MraGotoInbox(WPARAM, LPARAM);
+ INT_PTR __cdecl MraShowInboxStatus(WPARAM, LPARAM);
+ INT_PTR __cdecl MraEditProfile(WPARAM, LPARAM);
+ INT_PTR __cdecl MyAlbum(WPARAM, LPARAM);
+ INT_PTR __cdecl MyBlog(WPARAM, LPARAM);
+ INT_PTR __cdecl MyBlogStatus(WPARAM, LPARAM);
+ INT_PTR __cdecl MyVideo(WPARAM, LPARAM);
+ INT_PTR __cdecl MyAnswers(WPARAM, LPARAM);
+ INT_PTR __cdecl MyWorld(WPARAM, LPARAM);
+ INT_PTR __cdecl MraZhuki(WPARAM, LPARAM);
+ INT_PTR __cdecl MraChat(WPARAM, LPARAM);
+ INT_PTR __cdecl MraWebSearch(WPARAM, LPARAM);
+ INT_PTR __cdecl MraUpdateAllUsersInfo(WPARAM, LPARAM);
+ INT_PTR __cdecl MraCheckUpdatesUsersAvt(WPARAM, LPARAM);
+ INT_PTR __cdecl MraRequestAuthForAll(WPARAM, LPARAM);
+
+ INT_PTR __cdecl MraRequestAuthorization(WPARAM, LPARAM);
+ INT_PTR __cdecl MraGrantAuthorization(WPARAM, LPARAM);
+ INT_PTR __cdecl MraSendPostcard(WPARAM, LPARAM);
+ INT_PTR __cdecl MraViewAlbum(WPARAM, LPARAM);
+ INT_PTR __cdecl MraReadBlog(WPARAM, LPARAM);
+ INT_PTR __cdecl MraReplyBlogStatus(WPARAM, LPARAM);
+ INT_PTR __cdecl MraViewVideo(WPARAM, LPARAM);
+ INT_PTR __cdecl MraAnswers(WPARAM, LPARAM);
+ INT_PTR __cdecl MraWorld(WPARAM, LPARAM);
+
+ // ====| Events |======================================================================
+ int __cdecl OnModulesLoaded(WPARAM, LPARAM);
+ int __cdecl OnPreShutdown(WPARAM, LPARAM);
+ int __cdecl OnOptionsInit(WPARAM, LPARAM);
+ int __cdecl OnPopupOptInit(WPARAM, LPARAM);
+
+ int __cdecl MraChatGcEventHook(WPARAM, LPARAM);
+
+ int __cdecl MraExtraIconsApply(WPARAM, LPARAM);
+ int __cdecl MraExtraIconsRebuild(WPARAM, LPARAM);
+
+ int __cdecl MraContactDeleted(WPARAM, LPARAM);
+ int __cdecl MraDbSettingChanged(WPARAM, LPARAM);
+ int __cdecl MraRebuildContactMenu(WPARAM, LPARAM);
+ int __cdecl MraRebuildStatusMenu(WPARAM, LPARAM);
+ int __cdecl MraMusicChanged(WPARAM, LPARAM);
+
+ // ====| Data |========================================================================
+ bool m_bLoggedIn;
+
+ HANDLE hSendQueueHandle, hFilesQueueHandle, hMPopSessionQueue;
+ FIFO_MT ffmtAPCQueue;
+
+ HANDLE hNetlibUser, heNudgeReceived, hHookExtraIconsApply;
+ HANDLE hThreadWorker;
+ HANDLE hConnection;
+ DWORD dwThreadWorkerLastPingTime;
+ DWORD dwThreadWorkerRunning;
+ DWORD dwCMDNum;
+
+ HANDLE hThreadAPC; // APC thread, for queue tasks
+ HANDLE hWaitEventThreadAPCHandle;
+ DWORD dwAPCThreadRunning;
+ HANDLE hAvatarsQueueHandle;
+
+ HANDLE hMainMenuIcons[MAIN_MENU_ITEMS_COUNT+4];
+ HANDLE hMainMenuItems[MAIN_MENU_ITEMS_COUNT+4];
+
+ HANDLE hContactMenuIcons[CONTACT_MENU_ITEMS_COUNT+4];
+ HANDLE hContactMenuItems[CONTACT_MENU_ITEMS_COUNT+4];
+
+ HANDLE hAdvancedStatusIcons[ADV_ICON_MAX+4];
+ HANDLE hAdvancedStatusItems[ADV_ICON_MAX+4];
+
+ HWND hWndEMailPopupStatus;
+ DWORD dwEmailMessagesTotal, dwEmailMessagesUnread;
+
+ BOOL bHideXStatusUI;
+ HANDLE hXStatusMenuItems[MRA_XSTATUS_COUNT+4];
+ HANDLE hXStatusAdvancedStatusIcons[MRA_XSTATUS_COUNT+4];
+ HANDLE hXStatusAdvancedStatusItems[MRA_XSTATUS_COUNT+4];
+ HANDLE hExtraXstatusIcon;
+ HANDLE hExtraInfo;
+
+ char szNewMailSound[MAX_PATH];
+
+ CRITICAL_SECTION csCriticalSectionSend;
+
+ HANDLE AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR plpsFirstName, LPCTSTR plpsLastName, DWORD dwFlags);
+
+ DWORD MraMessageW(BOOL bAddToQueue, HANDLE hContact, DWORD dwAckType, DWORD dwFlags, LPSTR lpszEMail, size_t dwEMailSize, LPCWSTR lpwszMessage, size_t dwMessageSize, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize);
+ DWORD MraMessageAskW(DWORD dwMsgID, DWORD dwFlags, LPSTR lpszEMail, size_t dwEMailSize, LPWSTR lpwszMessage, size_t dwMessageSize, LPSTR lpwszMessageRTF, size_t dwMessageRTFSize);
+ DWORD MraMessageRecv(LPSTR lpszFrom, size_t dwFromSize, DWORD dwMsgID);
+ DWORD MraAddContactW(HANDLE hContact, DWORD dwContactFlag, DWORD dwGroupID, LPSTR lpszEMail, size_t dwEMailSize, LPWSTR lpwszCustomName, size_t dwCustomNameSize, LPSTR lpszPhones, size_t dwPhonesSize, LPWSTR lpwszAuthMessage, size_t dwAuthMessageSize, DWORD dwActions);
+ DWORD MraModifyContactW(HANDLE hContact, DWORD dwID, DWORD dwContactFlag, DWORD dwGroupID, LPSTR lpszEMail, size_t dwEMailSize, LPWSTR lpwszCustomName, size_t dwCustomNameSize, LPSTR lpszPhones, size_t dwPhonesSize);
+ DWORD MraOfflineMessageDel(DWORDLONG dwMsgUIDL);
+ DWORD MraAuthorize(LPSTR lpszEMail, size_t dwEMailSize);
+ DWORD MraChangeStatusW(DWORD dwStatus, LPSTR lpszStatusUri, size_t dwStatusUriSize, LPCWSTR lpwszStatusTitle, size_t dwStatusTitleSize, LPCWSTR lpwszStatusDesc, size_t dwStatusDescSize, DWORD dwFutureFlags);
+ DWORD MraFileTransfer(LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIdRequest, DWORD dwFilesTotalSize, LPWSTR lpwszFiles, size_t dwFilesSize, LPSTR lpszAddreses, size_t dwAddresesSize);
+ DWORD MraFileTransferAck(DWORD dwStatus, LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIdRequest, LPBYTE lpbDescription, size_t dwDescriptionSize);
+ HANDLE MraWPRequestW(HANDLE hContact, DWORD dwAckType, DWORD dwRequestFlags, LPSTR lpszUser, size_t dwUserSize, LPSTR lpszDomain, size_t dwDomainSize, LPCWSTR lpwszNickName, size_t dwNickNameSize, LPCWSTR lpwszFirstName, size_t dwFirstNameSize, LPCWSTR lpwszLastName, size_t dwLastNameSize, DWORD dwSex, DWORD dwDate1, DWORD dwDate2, DWORD dwCityID, DWORD dwZodiak, DWORD dwBirthdayMonth, DWORD dwBirthdayDay, DWORD dwCountryID, DWORD dwOnline);
+ HANDLE MraWPRequestA(HANDLE hContact, DWORD dwAckType, DWORD dwRequestFlags, LPSTR lpszUser, size_t dwUserSize, LPSTR lpszDomain, size_t dwDomainSize, LPSTR lpszNickName, size_t dwNickNameSize, LPSTR lpszFirstName, size_t dwFirstNameSize, LPSTR lpszLastName, size_t dwLastNameSize, DWORD dwSex, DWORD dwDate1, DWORD dwDate2, DWORD dwCityID, DWORD dwZodiak, DWORD dwBirthdayMonth, DWORD dwBirthdayDay, DWORD dwCountryID, DWORD dwOnline);
+ HANDLE MraWPRequestByEMail(HANDLE hContact, DWORD dwAckType, LPCSTR lpszEMail, size_t dwEMailSize);
+ DWORD MraGame(LPSTR lpszEMail, size_t dwEMailSize, DWORD dwGameSessionID, DWORD dwGameMsg, DWORD dwGameMsgID, LPSTR lpszData, size_t dwDataSize);
+ DWORD MraLogin2W(LPSTR lpszLogin, size_t dwLoginSize, LPSTR lpszPassword, size_t dwPasswordSize, DWORD dwStatus, LPSTR lpszStatusUri, size_t dwStatusUriSize, LPWSTR lpwszStatusTitle, size_t dwStatusTitleSize, LPWSTR lpwszStatusDesc, size_t dwStatusDescSize, DWORD dwFutureFlags, LPSTR lpszUserAgentFormated, size_t dwUserAgentFormatedSize, LPSTR lpszUserAgent, size_t dwUserAgentSize);
+ DWORD MraSMSW(HANDLE hContact, LPSTR lpszPhone, size_t dwPhoneSize, LPWSTR lpwszMessage, size_t dwMessageSize);
+ DWORD MraProxy(LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIDRequest, DWORD dwDataType, LPSTR lpszData, size_t dwDataSize, LPSTR lpszAddreses, size_t dwAddresesSize, MRA_GUID mguidSessionID);
+ DWORD MraProxyAck(DWORD dwStatus, LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIDRequest, DWORD dwDataType, LPSTR lpszData, size_t dwDataSize, LPSTR lpszAddreses, size_t dwAddresesSize, MRA_GUID mguidSessionID);
+ DWORD MraChangeUserBlogStatus(DWORD dwFlags, LPWSTR lpwszText, size_t dwTextSize, DWORDLONG dwBlogStatusID);
+
+ DWORD MraSendPacket(HANDLE hConnection, DWORD dwCMDNum, DWORD dwType, LPVOID lpData, size_t dwDataSize);
+ DWORD MraSendCMD(DWORD dwType, LPVOID lpData, size_t dwDataSize);
+ DWORD MraSendQueueCMD(HANDLE hSendQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD dwAckType, LPBYTE lpbDataQueue, size_t dwDataQueueSize, DWORD dwType, LPVOID lpData, size_t dwDataSize);
+
+ DWORD MraSendNewStatus(DWORD dwStatusMir, DWORD dwXStatusMir, LPCWSTR lpwszStatusTitle, size_t dwStatusTitleSize, LPCWSTR lpwszStatusDesc, size_t dwStatusDescSize);
+
+ void MraAddrListStoreToContact(HANDLE hContact, MRA_ADDR_LIST *pmalAddrList);
+
+ void DB_MraCreateResidentSetting(LPSTR lpszValueName);
+
+ DWORD GetContactFlags(HANDLE hContact);
+ DWORD SetContactFlags(HANDLE hContact, DWORD dwContactFlag);
+ DWORD GetContactBasicInfoW(HANDLE hContact, DWORD *pdwID, DWORD *pdwGroupID, DWORD *pdwContactFlag, DWORD *pdwContactSeverFlags, DWORD *pdwStatus, LPSTR lpszEMail, size_t dwEMailSize, size_t *pdwEMailSize, LPWSTR lpwszNick, size_t dwNickSize, size_t *pdwNickSize, LPSTR lpszPhones, size_t dwPhonesSize, size_t *pdwPhonesSize);
+ DWORD SetContactBasicInfoW(HANDLE hContact, DWORD dwSetInfoFlags, DWORD dwFlags, DWORD dwID, DWORD dwGroupID, DWORD dwContactFlag, DWORD dwContactSeverFlags, DWORD dwStatus, LPSTR lpszEMail, size_t dwEMailSize, LPWSTR lpwszNick, size_t dwNickSize, LPSTR lpszPhones, size_t dwPhonesSize);
+
+ DWORD GetContactEMailCount(HANDLE hContact, BOOL bMRAOnly);
+ BOOL GetContactFirstEMail(HANDLE hContact, BOOL bMRAOnly, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize);
+
+ BOOL IsContactMra(HANDLE hContact);
+ BOOL IsEMailMy(LPSTR lpszEMail, size_t dwEMailSize);
+ BOOL IsEMailChatAgent(LPSTR lpszEMail, size_t dwEMailSize);
+ BOOL IsContactChatAgent(HANDLE hContact);
+
+ HANDLE MraHContactFromEmail(LPSTR lpszEMail, size_t dwEMailSize, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded);
+ BOOL MraUpdateContactInfo(HANDLE hContact);
+ DWORD MraSetXStatusInternal(DWORD dwXStatus);
+ DWORD MraGetContactStatus(HANDLE hContact);
+ DWORD MraSetContactStatus(HANDLE hContact, DWORD dwNewStatus);
+ DWORD MraContactCapabilitiesGet(HANDLE hContact);
+ void MraContactCapabilitiesSet(HANDLE hContact, DWORD dwFutureFlags);
+ void MraUpdateEmailStatus(LPSTR lpszFrom, size_t dwFromSize, LPSTR lpszSubject, size_t dwSubjectSize, DWORD dwDate, DWORD dwUIDL);
+ DWORD MraConvertToRTFW(LPCWSTR lpwszMessage, size_t dwMessageSize, LPSTR lpszMessageRTF, size_t dwMessageRTFBuffSize, size_t *pdwMessageRTFSize);
+
+ void MraThreadClean();
+ DWORD StartConnect();
+ void __cdecl MraThreadProc(LPVOID lpParameter);
+ DWORD MraGetNLBData(LPSTR lpszHost, size_t dwHostBuffSize, WORD *pwPort);
+ DWORD MraNetworkDispatcher();
+ DWORD MraCommandDispatcher(struct mrim_packet_header_t *pmaHeader, DWORD *pdwPingPeriod, DWORD *pdwNextPingSendTickTime, BOOL *pbContinue);
+
+ DWORD MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, MRA_LPS *plpsFrom, MRA_LPS *plpsText, MRA_LPS *plpsRFTText, MRA_LPS *plpsMultiChatData);
+
+ void IconsLoad();
+ void IconsUnLoad();
+ void InitXStatusIcons();
+ void DestroyXStatusIcons();
+ void SetExtraIcons(HANDLE hContact);
+
+ #define MESSAGE_NOT_SPAM 1
+ #define MESSAGE_SPAM 2
+
+ DWORD MraAntiSpamReceivedMessageW(LPSTR lpszEMail, size_t dwEMailSize, DWORD dwMessageFlags, LPWSTR lpwszMessage, size_t dwMessageSize);
+ BOOL MraAntiSpamHasMessageBadWordsW(LPWSTR lpwszMessage, size_t dwMessageSize);
+
+ DWORD MraAPCQueueAdd(PAPCFUNC pfnAPC, PFIFO_MT pffmtAPCQueue, ULONG_PTR dwData);
+ void MraAPCQueueDestroy(PFIFO_MT pffmtAPCQueue);
+ void __cdecl MraUserAPCThreadProc(LPVOID lpParameter);
+
+ void CListCreateMenu(LONG lPosition, LONG lPopupPosition, HICON hMainIcon, LPSTR pszContactOwner, BOOL bIsStatus, const struct GUI_DISPLAY_ITEM *pgdiItems, HANDLE *hIcoLibIcons, size_t dwCount, HANDLE *hResult);
+ void CListShowMenuItem(HANDLE hMenuItem, BOOL bShow);
+
+ DWORD ProtoBroadcastAckAsynchEx(HANDLE hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam, size_t dwLparamSize);
+ DWORD CreateBlobFromContact(HANDLE hContact, LPWSTR lpwszRequestReason, size_t dwRequestReasonSize, LPBYTE lpbBuff, size_t dwBuffSize, size_t *pdwBuffSizeRet);
+
+ BOOL SetPassDB(LPSTR lpszBuff, size_t dwBuffSize);
+ BOOL GetPassDB(LPSTR lpszBuff, size_t dwBuffSize, size_t *pdwBuffSize);
+ BOOL GetPassDB_v1(LPSTR lpszBuff, size_t dwBuffSize, size_t *pdwBuffSize);
+ BOOL GetPassDB_v2(LPSTR lpszBuff, size_t dwBuffSize, size_t *pdwBuffSize);
+
+ BOOL MraRequestXStatusDetails(DWORD dwXStatus);
+ BOOL MraSendReplyBlogStatus(HANDLE hContact);
+ DWORD MraSelectEMailDlgShow(HANDLE hContact, DWORD dwType);
+
+ DWORD MraMrimProxyConnect(HANDLE hMraMrimProxyData, HANDLE *phConnection);
+
+ DWORD MraMPopSessionQueueAddUrl(HANDLE hMPopSessionQueue, LPSTR lpszUrl, size_t dwUrlSize);
+ DWORD MraMPopSessionQueueAddUrlAndEMail(HANDLE hMPopSessionQueue, LPSTR lpszUrl, size_t dwUrlSize, LPSTR lpszEMail, size_t dwEMailSize);
+ DWORD MraMPopSessionQueueStart(HANDLE hMPopSessionQueue);
+ void MraMPopSessionQueueFlush(HANDLE hMPopSessionQueue);
+
+ size_t MraFilesQueueGetLocalAddressesList(LPSTR lpszBuff, size_t dwBuffSize, DWORD dwPort);
+ DWORD MraFilesQueueAddReceive(HANDLE hFilesQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD dwIDRequest, LPWSTR lpwszFiles, size_t dwFilesSize, LPSTR lpszAddreses, size_t dwAddresesSize);
+ DWORD MraFilesQueueAddSend(HANDLE hFilesQueueHandle, DWORD dwFlags, HANDLE hContact, LPWSTR *plpwszFiles, size_t dwFilesCount, DWORD *pdwIDRequest);
+ DWORD MraFilesQueueCancel(HANDLE hFilesQueueHandle, DWORD dwIDRequest, BOOL bSendDecline);
+ DWORD MraFilesQueueStartMrimProxy(HANDLE hFilesQueueHandle, DWORD dwIDRequest);
+ DWORD MraFilesQueueSendMirror(HANDLE hFilesQueueHandle, DWORD dwIDRequest, LPSTR lpszAddreses, size_t dwAddresesSize);
+ BOOL MraFilesQueueHandCheck(HANDLE hConnection, MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem);
+ HANDLE MraFilesQueueConnectOut(MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem);
+ HANDLE MraFilesQueueConnectIn(MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem);
+ DWORD MraFilesQueueAccept(HANDLE hFilesQueueHandle, DWORD dwIDRequest, LPCWSTR lpwszPath, size_t dwPathSize);
+
+ void __cdecl MraFilesQueueRecvThreadProc(LPVOID lpParameter);
+ void __cdecl MraFilesQueueSendThreadProc(LPVOID lpParameter);
+
+ BOOL bChatExists;
+ void MraChatDllError();
+ BOOL MraChatRegister();
+ INT_PTR MraChatSessionNew(HANDLE hContactChatSession);
+ void MraChatSessionDestroy(HANDLE hContactChatSession);
+ void MraChatSendPrivateMessage(LPWSTR lpwszEMail);
+
+ INT_PTR MraChatSessionEventSendByHandle(HANDLE hContactChatSession, DWORD dwType, DWORD dwFlags, LPSTR lpszUID, size_t dwUIDSize, LPWSTR lpwszStatus, LPWSTR lpwszMessage, DWORD_PTR dwItemData, DWORD dwTime);
+ INT_PTR MraChatSessionInvite(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize, DWORD dwTime);
+ INT_PTR MraChatSessionMembersAdd(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize, DWORD dwTime);
+ INT_PTR MraChatSessionJoinUser(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize, DWORD dwTime);
+ INT_PTR MraChatSessionLeftUser(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize, DWORD dwTime);
+ INT_PTR MraChatSessionSetIviter(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize);
+ INT_PTR MraChatSessionSetOwner(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize);
+ INT_PTR MraChatSessionMessageAdd(HANDLE hContactChatSession, LPSTR lpszEMailInMultiChat, size_t dwEMailInMultiChatSize, LPWSTR lpwszMessage, size_t dwMessageSize, DWORD dwTime);
+
+ DWORD MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle);
+ void MraAvatarsQueueClear(HANDLE hAvatarsQueueHandle);
+ void MraAvatarsQueueDestroy(HANDLE hAvatarsQueueHandle);
+ DWORD MraAvatarsQueueAdd(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD *pdwAvatarsQueueID);
+ BOOL MraAvatarsGetContactTime (HANDLE hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime);
+ void MraAvatarsSetContactTime (HANDLE hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime);
+ DWORD MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle, HANDLE hContact, DWORD dwFormat, LPTSTR lpszPath, size_t dwPathSize, size_t *pdwPathSizeRet);
+ DWORD MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD *pdwAvatarsQueueID, DWORD *pdwFormat, LPTSTR lpszPath);
+ DWORD MraAvatarsQueueGetAvatarSimple(HANDLE hAvatarsQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD dwSourceID);
+ DWORD MraAvatarsDeleteContactAvatarFile(HANDLE hAvatarsQueueHandle, HANDLE hContact);
+
+ void __cdecl MraAvatarsThreadProc(LPVOID lpParameter);
+
+};
diff --git a/protocols/MRA/MraRTFMsg.cpp b/protocols/MRA/MraRTFMsg.cpp
index e0c3a1d67f..02e3a371e4 100644
--- a/protocols/MRA/MraRTFMsg.cpp
+++ b/protocols/MRA/MraRTFMsg.cpp
@@ -2,339 +2,257 @@
#include "MraRTFMsg.h"
-
#define COLORTABLE_COUNT 8
#define RTF_COLORTBLCOLOURS "\\red255\\green0\\blue0;\\red0\\green255\\blue0;\\red0\\green0\\blue255;\\red255\\green0\\blue255;\\red255\\green255\\blue0;\\red0\\green255\\blue255;\\red0\\green0\\blue0;\\red255\\green255\\blue255;"
-static const LPSTR lpszColours[COLORTABLE_COUNT]=
+static const LPSTR lpszColours[COLORTABLE_COUNT] =
{
- "red",
- "green",
- "blue",
- "magenta",
- "yellow",
- "cyan",
- "black",
+ "red",
+ "green",
+ "blue",
+ "magenta",
+ "yellow",
+ "cyan",
+ "black",
"white"
};
-
-
#define CRLF "\r\n"
#define PAR "\\par "
-#define BB_COLOR_TAG "[color="
-#define SIMBOLS_COUNT 19
-static const LPSTR lpszSimbols[SIMBOLS_COUNT]=
+#define BB_COLOR_TAG "[color = "
+#define SYMBOLS_COUNT 19
+static const LPSTR lpszSimbols[SYMBOLS_COUNT] =
{
- "\r\n",
- "\\",
- "{",
- "}",
- "[b]",
- "[/b]",
- "[u]",
- "[/u]",
- "[i]",
- "[/i]",
- "[/color]",
- "[color=red]",
- "[color=green]",
- "[color=blue]",
- "[color=magenta]",
- "[color=yellow]",
- "[color=cyan]",
- "[color=black]",
- "[color=white]",
+ "\r\n",
+ "\\",
+ "{",
+ "}",
+ "[b]",
+ "[/b]",
+ "[u]",
+ "[/u]",
+ "[i]",
+ "[/i]",
+ "[/color]",
+ "[color = red]",
+ "[color = green]",
+ "[color = blue]",
+ "[color = magenta]",
+ "[color = yellow]",
+ "[color = cyan]",
+ "[color = black]",
+ "[color = white]",
};
-static const SIZE_T dwcSimbolsCount[SIMBOLS_COUNT]=
+static const size_t dwcSimbolsCount[SYMBOLS_COUNT] =
{
- 2,
- 1,
- 1,
- 1,
- 3,
- 4,
- 3,
- 4,
- 3,
- 4,
- 8,
- 11,
- 13,
- 12,
- 15,
- 14,
- 12,
- 13,
- 13,
+ 2,
+ 1,
+ 1,
+ 1,
+ 3,
+ 4,
+ 3,
+ 4,
+ 3,
+ 4,
+ 8,
+ 11,
+ 13,
+ 12,
+ 15,
+ 14,
+ 12,
+ 13,
+ 13,
};
-static const LPSTR lpszRTFTags[SIMBOLS_COUNT]=
+static const LPSTR lpszRTFTags[SYMBOLS_COUNT] =
{
- "\\par",
- "\\\\",
- "\\{",
- "\\}",
- "{\\b ",
- "}",
- "{\\ul ",
- "}",
- "{\\i ",
- "}",
- "}",
- "{\\cf2 ",
- "{\\cf3 ",
- "{\\cf4 ",
- "{\\cf5 ",
- "{\\cf6 ",
- "{\\cf7 ",
- "{\\cf8 ",
- "{\\cf9 ",
+ "\\par",
+ "\\\\",
+ "\\{",
+ "\\}",
+ "{\\b ",
+ "}",
+ "{\\ul ",
+ "}",
+ "{\\i ",
+ "}",
+ "}",
+ "{\\cf2 ",
+ "{\\cf3 ",
+ "{\\cf4 ",
+ "{\\cf5 ",
+ "{\\cf6 ",
+ "{\\cf7 ",
+ "{\\cf8 ",
+ "{\\cf9 ",
};
-static const SIZE_T dwcRTFTagsCount[SIMBOLS_COUNT]=
+static const size_t dwcRTFTagsCount[SYMBOLS_COUNT] =
{
- 4,
- 2,
- 2,
- 2,
- 4,
- 1,
- 5,
- 1,
- 4,
- 1,
- 1,
- 6,
- 6,
- 6,
- 6,
- 6,
- 6,
- 6,
- 6,
+ 4, 2, 2, 2, 4, 1, 5, 1, 4, 1, 1, 6, 6, 6, 6, 6, 6, 6, 6
};
+DWORD MraTextToRTFData(LPSTR lpszMessage, size_t dwMessageSize, LPSTR lpszMessageConverted, size_t dwMessageConvertedBuffSize, size_t *pdwMessageConvertedSize);
-DWORD MraTextToRTFData(LPSTR lpszMessage,SIZE_T dwMessageSize,LPSTR lpszMessageConverted,SIZE_T dwMessageConvertedBuffSize,SIZE_T *pdwMessageConvertedSize);
-
-
-BOOL MraIsMessageFlashAnimation(LPWSTR lpwszMessage,SIZE_T dwMessageSize)
+BOOL MraIsMessageFlashAnimation(LPCWSTR lpwszMessage, size_t dwMessageSize)
{
- BOOL bRet=FALSE;
- LPWSTR lpwszFounded;
-
- dwMessageSize*=sizeof(WCHAR);
- lpwszFounded=(LPWSTR)MemoryFind(0,lpwszMessage,dwMessageSize,L"<SMILE>id=flas",28);
- if (lpwszFounded)
- {
- if (MemoryFind(((lpwszFounded-lpwszMessage)+32),lpwszMessage,dwMessageSize,L"'</SMILE>",18)) bRet=TRUE;
- }
-return(bRet);
-}
-
+ dwMessageSize *= sizeof(WCHAR);
+ LPWSTR lpwszFound = (LPWSTR)MemoryFind(0, lpwszMessage, dwMessageSize, L"<SMILE>id = flas", 28);
+ if (lpwszFound)
+ if (MemoryFind(((lpwszFound-lpwszMessage)+32), lpwszMessage, dwMessageSize, L"'</SMILE>", 18))
+ return TRUE;
+ return FALSE;
+}
-DWORD MraTextToRTFData(LPSTR lpszMessage,SIZE_T dwMessageSize,LPSTR lpszMessageConverted,SIZE_T dwMessageConvertedBuffSize,SIZE_T *pdwMessageConvertedSize)
+DWORD MraTextToRTFData(LPSTR lpszMessage, size_t dwMessageSize, LPSTR lpszMessageConverted, size_t dwMessageConvertedBuffSize, size_t *pdwMessageConvertedSize)
{
- DWORD dwRetErrorCode=NO_ERROR;
-
- if (lpszMessage && dwMessageSize && lpszMessageConverted && dwMessageConvertedBuffSize)
- {
- BYTE tm,bCurByte;
- LPSTR lpszMessageConvertedCur,lpszMessageConvertedMax;
- SIZE_T i;
-
- lpszMessageConvertedCur=lpszMessageConverted;
- lpszMessageConvertedMax=(lpszMessageConverted+dwMessageConvertedBuffSize);
- for(i=0;(i<dwMessageSize && (lpszMessageConvertedMax-lpszMessageConvertedCur)>3);i++)
- {
- //lpszMessageConvertedCur+=mir_snprintf(lpszMessageConvertedCur,8,"\\'%x",(*((BYTE*)lpszMessage+i)));
-
- (*((WORD*)lpszMessageConvertedCur))=(*((WORD*)"\\'"));
- bCurByte=(*((BYTE*)lpszMessage+i));
- tm=(bCurByte>>4)&0xf;
- lpszMessageConvertedCur[2]=(tm>9)? ('a'+tm-10):('0'+tm);
-
- tm=bCurByte&0xf;
- lpszMessageConvertedCur[3]=(tm>9)? ('a'+tm-10):('0'+tm);
- lpszMessageConvertedCur+=4;
- (*((BYTE*)lpszMessageConvertedCur))=0;
+ if (lpszMessage && dwMessageSize && lpszMessageConverted && dwMessageConvertedBuffSize) {
+ BYTE tm, bCurByte;
+ LPSTR lpszMessageConvertedCur, lpszMessageConvertedMax;
+ size_t i;
+
+ lpszMessageConvertedCur = lpszMessageConverted;
+ lpszMessageConvertedMax = (lpszMessageConverted+dwMessageConvertedBuffSize);
+ for (i = 0; i < dwMessageSize && lpszMessageConvertedMax-lpszMessageConvertedCur > 3; i++) {
+ *((WORD*)lpszMessageConvertedCur) = *((WORD*)"\\'");
+ bCurByte = (*((BYTE*)lpszMessage+i));
+ tm = (bCurByte>>4)&0xf;
+ lpszMessageConvertedCur[2] = (tm>9)? ('a'+tm-10):('0'+tm);
+
+ tm = bCurByte&0xf;
+ lpszMessageConvertedCur[3] = (tm>9)? ('a'+tm-10):('0'+tm);
+ lpszMessageConvertedCur += 4;
+ (*((BYTE*)lpszMessageConvertedCur)) = 0;
}
- if (pdwMessageConvertedSize) (*pdwMessageConvertedSize)=(lpszMessageConvertedCur-lpszMessageConverted);
- }else{
- if (pdwMessageConvertedSize) (*pdwMessageConvertedSize)=0;
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ if (pdwMessageConvertedSize)
+ *pdwMessageConvertedSize = lpszMessageConvertedCur - lpszMessageConverted;
+ return NO_ERROR;
}
-return(dwRetErrorCode);
+
+ if (pdwMessageConvertedSize)
+ *pdwMessageConvertedSize = 0;
+ return ERROR_INVALID_HANDLE;
}
-
-DWORD MraSybolsToRTFTags(DWORD dwFlags,LPSTR lpszMessage,SIZE_T dwMessageSize,LPSTR lpszMessageConverted,SIZE_T dwMessageConvertedBuffSize,SIZE_T *pdwMessageConvertedSize)
+DWORD MraSymbolsToRTFTags(DWORD dwFlags, LPSTR lpszMessage, size_t dwMessageSize, LPSTR lpszMessageConverted, size_t dwMessageConvertedBuffSize, size_t *pdwMessageConvertedSize)
{
- DWORD dwRetErrorCode=NO_ERROR;
- LPSTR lpszFounded[SIMBOLS_COUNT],lpszMessageConvertedCur,lpszMessageCur,lpszMessageCurPrev,lpszMessageConvertedMax;
- SIZE_T i,dwFirstFoundedIndex=0,dwFoundedCount=0,dwMemPartToCopy;
-
-#ifdef _DEBUG //check table
- for(i=0;i<SIMBOLS_COUNT;i++)
- {
- if (lstrlenA(lpszSimbols[i])!=dwcSimbolsCount[i]) DebugBreak();
- if (lstrlenA(lpszRTFTags[i])!=dwcRTFTagsCount[i]) DebugBreak();
- }
-#endif
-
- lpszMessageCurPrev=lpszMessage;
- lpszMessageConvertedCur=lpszMessageConverted;
- lpszMessageConvertedMax=(lpszMessageConverted+dwMessageConvertedBuffSize);
- for(i=0;i<SIMBOLS_COUNT;i++)
- {// loking for first time
- lpszFounded[i]=(LPSTR)MemoryFind((lpszMessageCurPrev-lpszMessage),lpszMessage,dwMessageSize,lpszSimbols[i],dwcSimbolsCount[i]);
- if (lpszFounded[i]) dwFoundedCount++;
+ DWORD dwRetErrorCode = NO_ERROR;
+ LPSTR lpszFounded[SYMBOLS_COUNT], lpszMessageConvertedCur, lpszMessageCur, lpszMessageCurPrev, lpszMessageConvertedMax;
+ size_t i, dwFirstFoundIndex = 0, dwFoundCount = 0, dwMemPartToCopy;
+
+ lpszMessageCurPrev = lpszMessage;
+ lpszMessageConvertedCur = lpszMessageConverted;
+ lpszMessageConvertedMax = (lpszMessageConverted+dwMessageConvertedBuffSize);
+ for (i = 0; i < SYMBOLS_COUNT; i++) { // loking for first time
+ lpszFounded[i] = (LPSTR)MemoryFind((lpszMessageCurPrev-lpszMessage), lpszMessage, dwMessageSize, lpszSimbols[i], dwcSimbolsCount[i]);
+ if (lpszFounded[i]) dwFoundCount++;
}
- while(dwFoundedCount)
- {
- for(i=0;i<SIMBOLS_COUNT;i++)
- {// looking for first to replace
- if (lpszFounded[i] && (lpszFounded[i]<lpszFounded[dwFirstFoundedIndex] || lpszFounded[dwFirstFoundedIndex]==NULL)) dwFirstFoundedIndex=i;
- }
-
- if (lpszFounded[dwFirstFoundedIndex])
- {// founded
- dwMemPartToCopy=(lpszFounded[dwFirstFoundedIndex]-lpszMessageCurPrev);
- if (lpszMessageConvertedMax>(lpszMessageConvertedCur+(dwMemPartToCopy+dwcRTFTagsCount[dwFirstFoundedIndex])))
- {
- //memmove(lpszMessageConvertedCur,lpszMessageCurPrev,dwMemPartToCopy);lpszMessageConvertedCur+=dwMemPartToCopy;
- MraTextToRTFData(lpszMessageCurPrev,dwMemPartToCopy,lpszMessageConvertedCur,(lpszMessageConvertedMax-lpszMessageConvertedCur),&i);lpszMessageConvertedCur+=i;
- memmove(lpszMessageConvertedCur,lpszRTFTags[dwFirstFoundedIndex],dwcRTFTagsCount[dwFirstFoundedIndex]);lpszMessageConvertedCur+=dwcRTFTagsCount[dwFirstFoundedIndex];
- lpszMessageCurPrev=(lpszFounded[dwFirstFoundedIndex]+dwcSimbolsCount[dwFirstFoundedIndex]);
-
- for(i=0;i<SIMBOLS_COUNT;i++)
- {// loking for next time
- if (lpszFounded[i] && lpszFounded[i]<lpszMessageCurPrev)
- {
- dwFoundedCount--;// вычитаем тут, чтобы учесть схожие смайлы: "):-(" и ":-("
- lpszFounded[i]=(LPSTR)MemoryFind((lpszMessageCurPrev-lpszMessage),lpszMessage,dwMessageSize,lpszSimbols[i],dwcSimbolsCount[i]);
- if (lpszFounded[i]) dwFoundedCount++;
+ while(dwFoundCount) {
+ for (i = 0;i<SYMBOLS_COUNT;i++)
+ if (lpszFounded[i] && (lpszFounded[i]<lpszFounded[dwFirstFoundIndex] || lpszFounded[dwFirstFoundIndex] == NULL))
+ dwFirstFoundIndex = i;
+
+ if (lpszFounded[dwFirstFoundIndex]) { // found
+ dwMemPartToCopy = (lpszFounded[dwFirstFoundIndex]-lpszMessageCurPrev);
+ if (lpszMessageConvertedMax > (lpszMessageConvertedCur+(dwMemPartToCopy+dwcRTFTagsCount[dwFirstFoundIndex]))) {
+ MraTextToRTFData(lpszMessageCurPrev, dwMemPartToCopy, lpszMessageConvertedCur, (lpszMessageConvertedMax-lpszMessageConvertedCur), &i);lpszMessageConvertedCur += i;
+ memmove(lpszMessageConvertedCur, lpszRTFTags[dwFirstFoundIndex], dwcRTFTagsCount[dwFirstFoundIndex]);lpszMessageConvertedCur += dwcRTFTagsCount[dwFirstFoundIndex];
+ lpszMessageCurPrev = (lpszFounded[dwFirstFoundIndex]+dwcSimbolsCount[dwFirstFoundIndex]);
+
+ for (i = 0;i<SYMBOLS_COUNT;i++) { // looking for the next time
+ if (lpszFounded[i] && lpszFounded[i] < lpszMessageCurPrev) {
+ dwFoundCount--;// вычитаем тут, чтобы учесть схожие смайлы: "):-(" и ":-("
+ lpszFounded[i] = (LPSTR)MemoryFind((lpszMessageCurPrev-lpszMessage), lpszMessage, dwMessageSize, lpszSimbols[i], dwcSimbolsCount[i]);
+ if (lpszFounded[i]) dwFoundCount++;
}
}
- }else{
- dwRetErrorCode=ERROR_BUFFER_OVERFLOW;
+ }
+ else {
+ dwRetErrorCode = ERROR_BUFFER_OVERFLOW;
DebugBreak();
break;
}
- }else{// сюда по идее никогда не попадём, на всякий случай.
- DebugBreak();
- break;
}
}
- lpszMessageCur=(lpszMessage+dwMessageSize);
- //memmove(lpszMessageConvertedCur,lpszMessageCurPrev,(lpszMessageCur-lpszMessageCurPrev));lpszMessageConvertedCur+=(lpszMessageCur-lpszMessageCurPrev);
- MraTextToRTFData(lpszMessageCurPrev,(lpszMessageCur-lpszMessageCurPrev),lpszMessageConvertedCur,(lpszMessageConvertedMax-lpszMessageConvertedCur),&i);lpszMessageConvertedCur+=i;
- (*((WORD*)lpszMessageConvertedCur))=0;
- if (pdwMessageConvertedSize) (*pdwMessageConvertedSize)=(lpszMessageConvertedCur-lpszMessageConverted);
+ lpszMessageCur = (lpszMessage+dwMessageSize);
+ MraTextToRTFData(lpszMessageCurPrev, (lpszMessageCur-lpszMessageCurPrev), lpszMessageConvertedCur, (lpszMessageConvertedMax-lpszMessageConvertedCur), &i);lpszMessageConvertedCur += i;
+ *((WORD*)lpszMessageConvertedCur) = 0;
-return(dwRetErrorCode);
-}
+ if (pdwMessageConvertedSize)
+ *pdwMessageConvertedSize = lpszMessageConvertedCur - lpszMessageConverted;
+ return(dwRetErrorCode);
+}
-DWORD MraConvertToRTFW(LPWSTR lpwszMessage,SIZE_T dwMessageSize,LPSTR lpszMessageRTF,SIZE_T dwMessageRTFBuffSize,SIZE_T *pdwMessageRTFSize)
+DWORD CMraProto::MraConvertToRTFW(LPCWSTR lpwszMessage, size_t dwMessageSize, LPSTR lpszMessageRTF, size_t dwMessageRTFBuffSize, size_t *pdwMessageRTFSize)
{
- DWORD dwRetErrorCode;
-
- if (lpwszMessage && lpszMessageRTF)
- {
- if ((dwMessageSize+1024)<=dwMessageRTFBuffSize)
- {
- LPSTR lpszMessage;
-
- lpszMessage=(LPSTR)MEMALLOC(dwMessageSize+32);
- if (lpszMessage)
- {
- LPSTR lpszMessageRTFCur=lpszMessageRTF;
- SIZE_T dwtm;
- DWORD dwRTFFontColour,dwFontSize;
- LOGFONT lf={0};
-
- WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszMessage,dwMessageSize,lpszMessage,(dwMessageSize+32),NULL,NULL);
-
- dwRTFFontColour=DB_Mra_GetDword(NULL,"RTFFontColour",MRA_DEFAULT_RTF_FONT_COLOUR);
- if (DB_Mra_GetContactSettingBlob(NULL,"RTFFont",&lf,sizeof(LOGFONT),NULL))
- {
- /*HDC hDC=GetDC(NULL);// kegl
- dwFontSize=-MulDiv(lf.lfHeight,72,GetDeviceCaps(hDC,LOGPIXELSY));
- ReleaseDC(NULL,hDC);*/
- }else{
- HDC hDC=GetDC(NULL);// kegl
- lf.lfCharSet=MRA_DEFAULT_RTF_FONT_CHARSET;
- lf.lfHeight=-MulDiv(MRA_DEFAULT_RTF_FONT_SIZE,GetDeviceCaps(hDC,LOGPIXELSY),72);
- lstrcpynW(lf.lfFaceName,MRA_DEFAULT_RTF_FONT_NAME,LF_FACESIZE);
- ReleaseDC(NULL,hDC);
- }
- dwFontSize=((-lf.lfHeight)+(((-lf.lfHeight)+4)/8));
-/* mail agent: привет
-{\rtf1\ansi\ansicpg1251\deff0\deflang1049{\fonttbl{\f0\fnil\fcharset204 Tahoma;}}
-{\colortbl ;\red255\green0\blue0;}
-\viewkind4\uc1\pard\cf1\f0\fs18\'ef\'f0\'e8\'e2\'e5\'f2\par
-}
+ if (!lpwszMessage || !lpszMessageRTF)
+ return ERROR_INVALID_HANDLE;
-{\rtf1\ansi\ansicpg1251\deff0\deflang1049{\fonttbl{\f0\fnil\fcharset204 Tahoma;}}
-{\colortbl ;\red255\green0\blue0;}
-\viewkind4\uc1\pard\cf1\f0\fs18 1\par
-2\par
-3\par
-}
-*/
- lpszMessageRTFCur+=mir_snprintf(lpszMessageRTFCur,(dwMessageRTFBuffSize-((SIZE_T)lpszMessageRTFCur-(SIZE_T)lpszMessageRTF)),"{\\rtf1\\ansi\\ansicpg1251\\deff0\\deflang1049{\\fonttbl{\\f0\\fnil\\fcharset%lu %s;}}\r\n",lf.lfCharSet,lf.lfFaceName);
-
- if (MemoryFind(0,lpszMessage,dwMessageSize,BB_COLOR_TAG,(sizeof(BB_COLOR_TAG)-1)))
- {//BB_COLOR_TAG// добавляем таблицу с цветами, только если текст подкрашен
- lpszMessageRTFCur+=mir_snprintf(lpszMessageRTFCur,(dwMessageRTFBuffSize-((SIZE_T)lpszMessageRTFCur-(SIZE_T)lpszMessageRTF)),"{\\colortbl;\\red%lu\\green%lu\\blue%lu;%s}\r\n",(*((RGBTRIPLE*)&dwRTFFontColour)).rgbtBlue,(*((RGBTRIPLE*)&dwRTFFontColour)).rgbtGreen,(*((RGBTRIPLE*)&dwRTFFontColour)).rgbtRed,RTF_COLORTBLCOLOURS);
- }else{
- lpszMessageRTFCur+=mir_snprintf(lpszMessageRTFCur,(dwMessageRTFBuffSize-((SIZE_T)lpszMessageRTFCur-(SIZE_T)lpszMessageRTF)),"{\\colortbl;\\red%lu\\green%lu\\blue%lu;}\r\n",(*((RGBTRIPLE*)&dwRTFFontColour)).rgbtBlue,(*((RGBTRIPLE*)&dwRTFFontColour)).rgbtGreen,(*((RGBTRIPLE*)&dwRTFFontColour)).rgbtRed);
- }
+ if ((dwMessageSize+1024) > dwMessageRTFBuffSize) {
+ if (pdwMessageRTFSize)
+ *pdwMessageRTFSize = dwMessageSize;
+ return ERROR_BUFFER_OVERFLOW;
+ }
- {
- LPSTR lpszNotfink="",
- lpszBold=((lf.lfWeight==FW_BOLD)? "\\b1":lpszNotfink),
- lpszItalic=(lf.lfItalic? "\\i1":lpszNotfink),
- lpszUnderline=(lf.lfUnderline? "\\ul1":lpszNotfink),
- lpszStrikeOut=(lf.lfStrikeOut? "\\strike1":lpszNotfink);
- lpszMessageRTFCur+=mir_snprintf(lpszMessageRTFCur,(dwMessageRTFBuffSize-((SIZE_T)lpszMessageRTFCur-(SIZE_T)lpszMessageRTF)),"\\viewkind4\\uc1\\pard\\cf1\\f0\\fs%lu%s%s%s%s",dwFontSize,lpszBold,lpszItalic,lpszUnderline,lpszStrikeOut);
- }
+ mir_ptr<CHAR> lpszMessage((LPSTR)mir_calloc(dwMessageSize+32));
+ if (!lpszMessage)
+ return GetLastError();
- if ((dwRetErrorCode=MraSybolsToRTFTags(0,lpszMessage,dwMessageSize,lpszMessageRTFCur,(dwMessageRTFBuffSize-(lpszMessageRTFCur-lpszMessageRTF)),&dwtm))==NO_ERROR)
- {
- lpszMessageRTFCur+=dwtm;
- if ((lpszMessageRTF+dwMessageRTFBuffSize)>=(lpszMessageRTFCur+sizeof(PAR)+sizeof(CRLF)+2))
- {
- memmove(lpszMessageRTFCur,PAR,sizeof(PAR));lpszMessageRTFCur+=(sizeof(PAR)-1);
- memmove(lpszMessageRTFCur,CRLF,sizeof(CRLF));lpszMessageRTFCur+=(sizeof(CRLF)-1);
- memmove(lpszMessageRTFCur,"}",2);lpszMessageRTFCur+=2;
- if (pdwMessageRTFSize) (*pdwMessageRTFSize)=(lpszMessageRTFCur-lpszMessageRTF);
- DebugPrintCRLFA(lpszMessageRTF);
- dwRetErrorCode=NO_ERROR;
- }else{
- if (pdwMessageRTFSize) (*pdwMessageRTFSize)=dwMessageRTFBuffSize+1024;
- dwRetErrorCode=ERROR_BUFFER_OVERFLOW;
- DebugBreak();
- }
- }
- MEMFREE(lpszMessage);
- }
- }else{
- if (pdwMessageRTFSize) (*pdwMessageRTFSize)=dwMessageSize;
- dwRetErrorCode=ERROR_BUFFER_OVERFLOW;
- DebugBreak();
+ LPSTR lpszMessageRTFCur = lpszMessageRTF;
+ size_t dwtm;
+ DWORD dwRTFFontColour, dwFontSize;
+ LOGFONT lf = {0};
+
+ WideCharToMultiByte(MRA_CODE_PAGE, 0, lpwszMessage, dwMessageSize, lpszMessage, (dwMessageSize+32), NULL, NULL);
+
+ dwRTFFontColour = mraGetDword(NULL, "RTFFontColour", MRA_DEFAULT_RTF_FONT_COLOUR);
+ if ( !mraGetContactSettingBlob(NULL, "RTFFont", &lf, sizeof(LOGFONT), NULL)) {
+ HDC hDC = GetDC(NULL);// kegl
+ lf.lfCharSet = MRA_DEFAULT_RTF_FONT_CHARSET;
+ lf.lfHeight = -MulDiv(MRA_DEFAULT_RTF_FONT_SIZE, GetDeviceCaps(hDC, LOGPIXELSY), 72);
+ lstrcpynW(lf.lfFaceName, MRA_DEFAULT_RTF_FONT_NAME, LF_FACESIZE);
+ ReleaseDC(NULL, hDC);
+ }
+ dwFontSize = ((-lf.lfHeight)+(((-lf.lfHeight)+4)/8));
+
+ lpszMessageRTFCur += mir_snprintf(lpszMessageRTFCur, (dwMessageRTFBuffSize-((size_t)lpszMessageRTFCur-(size_t)lpszMessageRTF)), "{\\rtf1\\ansi\\ansicpg1251\\deff0\\deflang1049{\\fonttbl{\\f0\\fnil\\fcharset%lu %s;}}\r\n", lf.lfCharSet, lf.lfFaceName);
+
+ if (MemoryFind(0, lpszMessage, dwMessageSize, BB_COLOR_TAG, (sizeof(BB_COLOR_TAG)-1)))
+ lpszMessageRTFCur += mir_snprintf(lpszMessageRTFCur, (dwMessageRTFBuffSize-((size_t)lpszMessageRTFCur-(size_t)lpszMessageRTF)), "{\\colortbl;\\red%lu\\green%lu\\blue%lu;%s}\r\n", (*((RGBTRIPLE*)&dwRTFFontColour)).rgbtBlue, (*((RGBTRIPLE*)&dwRTFFontColour)).rgbtGreen, (*((RGBTRIPLE*)&dwRTFFontColour)).rgbtRed, RTF_COLORTBLCOLOURS);
+ else
+ lpszMessageRTFCur += mir_snprintf(lpszMessageRTFCur, (dwMessageRTFBuffSize-((size_t)lpszMessageRTFCur-(size_t)lpszMessageRTF)), "{\\colortbl;\\red%lu\\green%lu\\blue%lu;}\r\n", (*((RGBTRIPLE*)&dwRTFFontColour)).rgbtBlue, (*((RGBTRIPLE*)&dwRTFFontColour)).rgbtGreen, (*((RGBTRIPLE*)&dwRTFFontColour)).rgbtRed);
+
+ LPSTR lpszNotfink = "",
+ lpszBold = ((lf.lfWeight == FW_BOLD)? "\\b1":lpszNotfink),
+ lpszItalic = (lf.lfItalic? "\\i1":lpszNotfink),
+ lpszUnderline = (lf.lfUnderline? "\\ul1":lpszNotfink),
+ lpszStrikeOut = (lf.lfStrikeOut? "\\strike1":lpszNotfink);
+ lpszMessageRTFCur += mir_snprintf(lpszMessageRTFCur, (dwMessageRTFBuffSize-((size_t)lpszMessageRTFCur-(size_t)lpszMessageRTF)), "\\viewkind4\\uc1\\pard\\cf1\\f0\\fs%lu%s%s%s%s", dwFontSize, lpszBold, lpszItalic, lpszUnderline, lpszStrikeOut);
+
+ if ( !MraSymbolsToRTFTags(0, lpszMessage, dwMessageSize, lpszMessageRTFCur, (dwMessageRTFBuffSize-(lpszMessageRTFCur-lpszMessageRTF)), &dwtm)) {
+ lpszMessageRTFCur += dwtm;
+ if ((lpszMessageRTF+dwMessageRTFBuffSize) >= (lpszMessageRTFCur+sizeof(PAR)+sizeof(CRLF)+2)) {
+ memmove(lpszMessageRTFCur, PAR, sizeof(PAR));lpszMessageRTFCur += (sizeof(PAR)-1);
+ memmove(lpszMessageRTFCur, CRLF, sizeof(CRLF));lpszMessageRTFCur += (sizeof(CRLF)-1);
+ memmove(lpszMessageRTFCur, "}", 2);lpszMessageRTFCur += 2;
+ if (pdwMessageRTFSize) (*pdwMessageRTFSize) = (lpszMessageRTFCur-lpszMessageRTF);
+ DebugPrintCRLFA(lpszMessageRTF);
+ return NO_ERROR;
}
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+
+ if (pdwMessageRTFSize) *pdwMessageRTFSize = dwMessageRTFBuffSize+1024;
+ return ERROR_BUFFER_OVERFLOW;
}
-return(dwRetErrorCode);
+
+ return 0;
}
diff --git a/protocols/MRA/MraRTFMsg.h b/protocols/MRA/MraRTFMsg.h
index 80d198981e..1dadb5a801 100644
--- a/protocols/MRA/MraRTFMsg.h
+++ b/protocols/MRA/MraRTFMsg.h
@@ -6,14 +6,6 @@
#pragma once
#endif // _MSC_VER > 1000
-
-
-
-
-BOOL MraIsMessageFlashAnimation (LPWSTR lpwszMessage,SIZE_T dwMessageSize);
-DWORD MraConvertToRTFW (LPWSTR lpwszMessage,SIZE_T dwMessageSize,LPSTR lpszMessageRTF,SIZE_T dwMessageRTFBuffSize,SIZE_T *pdwMessageRTFSize);
-
-
-
+BOOL MraIsMessageFlashAnimation (LPCWSTR lpwszMessage, size_t dwMessageSize);
#endif // !defined(AFX_MRA_RTFMSG_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraSelectEMail.cpp b/protocols/MRA/MraSelectEMail.cpp
index 038073362e..a3c9bfd313 100644
--- a/protocols/MRA/MraSelectEMail.cpp
+++ b/protocols/MRA/MraSelectEMail.cpp
@@ -2,186 +2,157 @@
#include "MraSelectEMail.h"
#include "BuffToLowerCase.h"
-
-
struct MraSelectEMailDlgData
{
+ CMraProto *ppro;
HANDLE hContact;
DWORD dwType;
};
-
-
-
-void AddContactEMailToListParam(HANDLE hContact,BOOL bMRAOnly,LPSTR lpszModule,LPSTR lpszValueName,HWND hWndList)
+void AddContactEMailToListParam(HANDLE hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName, HWND hWndList)
{
- CHAR szBuff[MAX_PATH],szEMail[MAX_EMAIL_LEN];
+ CHAR szBuff[MAX_PATH], szEMail[MAX_EMAIL_LEN];
WCHAR wszBuff[MAX_PATH];
- SIZE_T i,dwEMailSize;
+ size_t i, dwEMailSize;
- if(DB_GetStaticStringA(hContact,lpszModule,lpszValueName,szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- if (bMRAOnly==FALSE || IsEMailMR(szEMail,dwEMailSize))
- {
- MultiByteToWideChar(MRA_CODE_PAGE,0,szEMail,(dwEMailSize+1),wszBuff,SIZEOF(wszBuff));
- if (SendMessage(hWndList,LB_FINDSTRING,-1,(LPARAM)wszBuff)==LB_ERR) SendMessage(hWndList,LB_ADDSTRING,0,(LPARAM)wszBuff);
+ if (DB_GetStaticStringA(hContact, lpszModule, lpszValueName, szEMail, SIZEOF(szEMail), &dwEMailSize)) {
+ if (bMRAOnly == FALSE || IsEMailMR(szEMail, dwEMailSize)) {
+ MultiByteToWideChar(MRA_CODE_PAGE, 0, szEMail, (dwEMailSize+1), wszBuff, SIZEOF(wszBuff));
+ if (SendMessage(hWndList, LB_FINDSTRING, -1, (LPARAM)wszBuff) == LB_ERR) SendMessage(hWndList, LB_ADDSTRING, 0, (LPARAM)wszBuff);
}
}
- for (i=0;TRUE;i++)
- {
- mir_snprintf(szBuff,SIZEOF(szBuff),"%s%lu",lpszValueName,i);
- if(DB_GetStaticStringA(hContact,lpszModule,szBuff,szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- if (bMRAOnly==FALSE || IsEMailMR(szEMail,dwEMailSize))
- {
- MultiByteToWideChar(MRA_CODE_PAGE,0,szEMail,(dwEMailSize+1),wszBuff,SIZEOF(wszBuff));
- if (SendMessage(hWndList,LB_FINDSTRING,-1,(LPARAM)wszBuff)==LB_ERR) SendMessage(hWndList,LB_ADDSTRING,0,(LPARAM)wszBuff);
+ for (i = 0;TRUE;i++) {
+ mir_snprintf(szBuff, SIZEOF(szBuff), "%s%lu", lpszValueName, i);
+ if (DB_GetStaticStringA(hContact, lpszModule, szBuff, szEMail, SIZEOF(szEMail), &dwEMailSize)) {
+ if (bMRAOnly == FALSE || IsEMailMR(szEMail, dwEMailSize)) {
+ MultiByteToWideChar(MRA_CODE_PAGE, 0, szEMail, (dwEMailSize+1), wszBuff, SIZEOF(wszBuff));
+ if (SendMessage(hWndList, LB_FINDSTRING, -1, (LPARAM)wszBuff) == LB_ERR) SendMessage(hWndList, LB_ADDSTRING, 0, (LPARAM)wszBuff);
}
- }else{
- if (i>EMAILS_MIN_COUNT) break;
}
+ else if (i > EMAILS_MIN_COUNT)
+ break;
}
}
-
-INT_PTR CALLBACK MraSelectEMailDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK MraSelectEMailDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
- MraSelectEMailDlgData *pmrasemddDlgData=(MraSelectEMailDlgData*)GetWindowLongPtr(hWndDlg,GWLP_USERDATA);
-
- if (pmrasemddDlgData)
- {
- switch(message){
- case WM_CLOSE:
- DestroyWindow(hWndDlg);
- break;
- case WM_DESTROY:
- SetWindowLongPtr(hWndDlg,GWLP_USERDATA,(LONG_PTR)0);
- MEMFREE(pmrasemddDlgData);
- EndDialog(hWndDlg,NO_ERROR);
- break;
- case WM_COMMAND:
- switch(LOWORD(wParam)) {
- case IDC_LIST_EMAILS:
- if (HIWORD(wParam)==LBN_DBLCLK)
- {
- //switch(pmrasemddDlgData->dwType){
- //case MRA_SELECT_EMAIL_TYPE_SEND_POSTCARD:
- // break;
- //case MRA_SELECT_EMAIL_TYPE_VIEW_ALBUM:
- //case MRA_SELECT_EMAIL_TYPE_READ_BLOG:
- SendMessage(hWndDlg,WM_COMMAND,MAKEWPARAM(IDOK,BN_CLICKED),(LPARAM)GetDlgItem(hWndDlg,IDOK));
- // break;
- //}
- }
- break;
- case IDOK:
- {
- CHAR szEMail[MAX_EMAIL_LEN];
- WCHAR wszBuff[MAX_PATH];
- SIZE_T dwEMailSize;
-
- dwEMailSize=SendMessage(GetDlgItem(hWndDlg,IDC_LIST_EMAILS),LB_GETTEXT,SendMessage(GetDlgItem(hWndDlg,IDC_LIST_EMAILS),LB_GETCURSEL,0,0),(LPARAM)wszBuff);
- WideCharToMultiByte(MRA_CODE_PAGE,0,wszBuff,(dwEMailSize+1),szEMail,SIZEOF(szEMail),NULL,NULL);
- BuffToLowerCase(szEMail,szEMail,dwEMailSize);
-
- switch(pmrasemddDlgData->dwType){
- case MRA_SELECT_EMAIL_TYPE_SEND_POSTCARD:
- {
- SIZE_T dwUrlSize;
- CHAR szUrl[BUFF_SIZE_URL];
- dwUrlSize=mir_snprintf(szUrl,SIZEOF(szUrl),"http://cards.mail.ru/event.html?rcptname=%s&rcptemail=%s",GetContactNameA(pmrasemddDlgData->hContact),szEMail);
- MraMPopSessionQueueAddUrl(masMraSettings.hMPopSessionQueue,szUrl,dwUrlSize);
- }
- break;
- case MRA_SELECT_EMAIL_TYPE_VIEW_ALBUM:
- MraMPopSessionQueueAddUrlAndEMail(masMraSettings.hMPopSessionQueue,MRA_FOTO_URL,sizeof(MRA_FOTO_URL),szEMail,dwEMailSize);
- break;
- case MRA_SELECT_EMAIL_TYPE_READ_BLOG:
- MraMPopSessionQueueAddUrlAndEMail(masMraSettings.hMPopSessionQueue,MRA_BLOGS_URL,sizeof(MRA_BLOGS_URL),szEMail,dwEMailSize);
- break;
- case MRA_SELECT_EMAIL_TYPE_VIEW_VIDEO:
- MraMPopSessionQueueAddUrlAndEMail(masMraSettings.hMPopSessionQueue,MRA_VIDEO_URL,sizeof(MRA_VIDEO_URL),szEMail,dwEMailSize);
- break;
- case MRA_SELECT_EMAIL_TYPE_ANSWERS:
- MraMPopSessionQueueAddUrlAndEMail(masMraSettings.hMPopSessionQueue,MRA_ANSWERS_URL,sizeof(MRA_ANSWERS_URL),szEMail,dwEMailSize);
- break;
- case MRA_SELECT_EMAIL_TYPE_WORLD:
- MraMPopSessionQueueAddUrlAndEMail(masMraSettings.hMPopSessionQueue,MRA_WORLD_URL,sizeof(MRA_WORLD_URL),szEMail,dwEMailSize);
- break;
- }
- }
- //break;
- case IDCANCEL:
- DestroyWindow(hWndDlg);
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- }else{
- pmrasemddDlgData=(MraSelectEMailDlgData*)lParam;
+ MraSelectEMailDlgData *dat = (MraSelectEMailDlgData*)GetWindowLongPtr(hWndDlg, GWLP_USERDATA);
- if (message==WM_INITDIALOG)
+ switch (message) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hWndDlg);
+ dat = (MraSelectEMailDlgData*)lParam;
{
HWND hWndList;
BOOL bMRAOnly;
LPSTR lpszProto;
- SetWindowLongPtr(hWndDlg,GWLP_USERDATA,(LONG_PTR)lParam);
- hWndList=GetDlgItem(hWndDlg,IDC_LIST_EMAILS);
- //SendMessage(hWndList,CB_RESETCONTENT,0,0);
+ SetWindowLongPtr(hWndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
+ hWndList = GetDlgItem(hWndDlg, IDC_LIST_EMAILS);
- switch(pmrasemddDlgData->dwType){
+ switch (dat->dwType) {
case MRA_SELECT_EMAIL_TYPE_SEND_POSTCARD:
- // SetWindowLongPtr(hWndList,GWL_STYLE,(GetWindowLongPtr(hWndList,GWL_STYLE)|LBS_MULTIPLESEL));
- // SetWindowLongPtr(hWndList,GWL_STYLE,(GetWindowLongPtr(hWndList,GWL_STYLE)&~LBS_SORT));
- bMRAOnly=FALSE;
+ bMRAOnly = FALSE;
break;
case MRA_SELECT_EMAIL_TYPE_VIEW_ALBUM:
case MRA_SELECT_EMAIL_TYPE_READ_BLOG:
- // SetWindowLongPtr(hWndList,GWL_STYLE,(LONG)(GetWindowLongPtr(hWndList,GWL_STYLE)|LBS_NOSEL));
- bMRAOnly=TRUE;
+ bMRAOnly = TRUE;
break;
default:
- bMRAOnly=FALSE;
+ bMRAOnly = FALSE;
break;
}
- if (pmrasemddDlgData->hContact)
- {
- lpszProto=(LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)pmrasemddDlgData->hContact,0);
- }else{
- lpszProto=PROTOCOL_NAMEA;
- }
- AddContactEMailToListParam(pmrasemddDlgData->hContact,bMRAOnly,lpszProto,"e-mail",hWndList);
- AddContactEMailToListParam(pmrasemddDlgData->hContact,bMRAOnly,"UserInfo","e-mail",hWndList);
- AddContactEMailToListParam(pmrasemddDlgData->hContact,bMRAOnly,"UserInfo","Mye-mail",hWndList);
- AddContactEMailToListParam(pmrasemddDlgData->hContact,bMRAOnly,"UserInfo","Companye-mail",hWndList);
- AddContactEMailToListParam(pmrasemddDlgData->hContact,bMRAOnly,"UserInfo","MyCompanye-mail",hWndList);
+ if (dat->hContact)
+ lpszProto = (LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ else
+ lpszProto = dat->ppro->m_szModuleName;
- TranslateDialogDefault(hWndDlg);
+ AddContactEMailToListParam(dat->hContact, bMRAOnly, lpszProto, "e-mail", hWndList);
+ AddContactEMailToListParam(dat->hContact, bMRAOnly, "UserInfo", "e-mail", hWndList);
+ AddContactEMailToListParam(dat->hContact, bMRAOnly, "UserInfo", "Mye-mail", hWndList);
+ AddContactEMailToListParam(dat->hContact, bMRAOnly, "UserInfo", "Companye-mail", hWndList);
+ AddContactEMailToListParam(dat->hContact, bMRAOnly, "UserInfo", "MyCompanye-mail", hWndList);
}
+ return TRUE;
+
+ case WM_CLOSE:
+ DestroyWindow(hWndDlg);
+ break;
+
+ case WM_DESTROY:
+ SetWindowLongPtr(hWndDlg, GWLP_USERDATA, (LONG_PTR)0);
+ mir_free(dat);
+ EndDialog(hWndDlg, NO_ERROR);
+ break;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDC_LIST_EMAILS:
+ if (HIWORD(wParam) == LBN_DBLCLK)
+ SendMessage(hWndDlg, WM_COMMAND, MAKEWPARAM(IDOK, BN_CLICKED), (LPARAM)GetDlgItem(hWndDlg, IDOK));
+ break;
- //return(DefWindowProc(hWndDlg,message,wParam,lParam));
+ case IDOK:
+ {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ WCHAR wszBuff[MAX_PATH];
+ size_t dwEMailSize;
+
+ dwEMailSize = SendMessage(GetDlgItem(hWndDlg, IDC_LIST_EMAILS), LB_GETTEXT, SendMessage(GetDlgItem(hWndDlg, IDC_LIST_EMAILS), LB_GETCURSEL, 0, 0), (LPARAM)wszBuff);
+ WideCharToMultiByte(MRA_CODE_PAGE, 0, wszBuff, (dwEMailSize+1), szEMail, SIZEOF(szEMail), NULL, NULL);
+ BuffToLowerCase(szEMail, szEMail, dwEMailSize);
+
+ switch (dat->dwType) {
+ case MRA_SELECT_EMAIL_TYPE_SEND_POSTCARD:
+ {
+ size_t dwUrlSize;
+ CHAR szUrl[BUFF_SIZE_URL];
+ dwUrlSize = mir_snprintf(szUrl, SIZEOF(szUrl), "http://cards.mail.ru/event.html?rcptname = %s&rcptemail = %s", GetContactNameA(dat->hContact), szEMail);
+ dat->ppro->MraMPopSessionQueueAddUrl(dat->ppro->hMPopSessionQueue, szUrl, dwUrlSize);
+ }
+ break;
+ case MRA_SELECT_EMAIL_TYPE_VIEW_ALBUM:
+ dat->ppro->MraMPopSessionQueueAddUrlAndEMail(dat->ppro->hMPopSessionQueue, MRA_FOTO_URL, sizeof(MRA_FOTO_URL), szEMail, dwEMailSize);
+ break;
+ case MRA_SELECT_EMAIL_TYPE_READ_BLOG:
+ dat->ppro->MraMPopSessionQueueAddUrlAndEMail(dat->ppro->hMPopSessionQueue, MRA_BLOGS_URL, sizeof(MRA_BLOGS_URL), szEMail, dwEMailSize);
+ break;
+ case MRA_SELECT_EMAIL_TYPE_VIEW_VIDEO:
+ dat->ppro->MraMPopSessionQueueAddUrlAndEMail(dat->ppro->hMPopSessionQueue, MRA_VIDEO_URL, sizeof(MRA_VIDEO_URL), szEMail, dwEMailSize);
+ break;
+ case MRA_SELECT_EMAIL_TYPE_ANSWERS:
+ dat->ppro->MraMPopSessionQueueAddUrlAndEMail(dat->ppro->hMPopSessionQueue, MRA_ANSWERS_URL, sizeof(MRA_ANSWERS_URL), szEMail, dwEMailSize);
+ break;
+ case MRA_SELECT_EMAIL_TYPE_WORLD:
+ dat->ppro->MraMPopSessionQueueAddUrlAndEMail(dat->ppro->hMPopSessionQueue, MRA_WORLD_URL, sizeof(MRA_WORLD_URL), szEMail, dwEMailSize);
+ break;
+ }
+ }
+ //break;
+ case IDCANCEL:
+ DestroyWindow(hWndDlg);
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
}
-return(FALSE);
-}
+ return FALSE;
+}
-DWORD MraSelectEMailDlgShow(HANDLE hContact,DWORD dwType)
+DWORD CMraProto::MraSelectEMailDlgShow(HANDLE hContact, DWORD dwType)
{
- MraSelectEMailDlgData *pmrasemddDlgData;
-
- pmrasemddDlgData=(MraSelectEMailDlgData*)MEMALLOC(sizeof(MraSelectEMailDlgData));
- if (pmrasemddDlgData)
- {
- pmrasemddDlgData->hContact=hContact;
- pmrasemddDlgData->dwType=dwType;
- DialogBoxParam(masMraSettings.hInstance,MAKEINTRESOURCE(IDD_DIALOG_SELECT_EMAIL),NULL,MraSelectEMailDlgProc,(LPARAM)pmrasemddDlgData);
+ MraSelectEMailDlgData *dat = (MraSelectEMailDlgData*)mir_calloc(sizeof(MraSelectEMailDlgData));
+ if (dat) {
+ dat->ppro = this;
+ dat->hContact = hContact;
+ dat->dwType = dwType;
+ DialogBoxParam(masMraSettings.hInstance, MAKEINTRESOURCE(IDD_DIALOG_SELECT_EMAIL), NULL, MraSelectEMailDlgProc, (LPARAM)dat);
}
-return(0);
-} \ No newline at end of file
+ return 0;
+}
diff --git a/protocols/MRA/MraSelectEMail.h b/protocols/MRA/MraSelectEMail.h
index d1ad657dc1..c031ee72ab 100644
--- a/protocols/MRA/MraSelectEMail.h
+++ b/protocols/MRA/MraSelectEMail.h
@@ -16,10 +16,4 @@
#define MRA_SELECT_EMAIL_TYPE_WORLD 6
-DWORD MraSelectEMailDlgShow(HANDLE hContact,DWORD dwType);
-
-
-
-
-
#endif // !defined(AFX_MRA_SELECT_EMAIL_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraSendCommand.cpp b/protocols/MRA/MraSendCommand.cpp
index f27ef57860..f192afe889 100644
--- a/protocols/MRA/MraSendCommand.cpp
+++ b/protocols/MRA/MraSendCommand.cpp
@@ -3,876 +3,689 @@
#include "MraRTFMsg.h"
#include "proto.h"
+static void SetUL(LPBYTE *plpBuff, DWORD dwData)
+{
+ (*(DWORD*)(*plpBuff)) = dwData;
+ (*plpBuff) += sizeof(DWORD);
+}
+static void SetUIDL(LPBYTE *plpBuff, DWORDLONG dwData)
+{
+ (*(DWORDLONG*)(*plpBuff)) = dwData;
+ (*plpBuff) += sizeof(DWORDLONG);
+}
+static void SetGUID(LPBYTE *plpBuff, MRA_GUID guidData)
+{
+ (*(MRA_GUID*)(*plpBuff)) = guidData;
+ (*plpBuff) += sizeof(MRA_GUID);
+}
+static void SetLPS(LPBYTE *plpBuff, LPCSTR lpszData, DWORD dwSize)
+{
+ (*(DWORD*)(*plpBuff)) = dwSize;
+ (*plpBuff) += sizeof(DWORD);
+ memmove((*plpBuff), lpszData, dwSize);
+ (*plpBuff) += dwSize;
+}
-void SetUL (LPBYTE *plpBuff,DWORD dwData);
-void SetUIDL (LPBYTE *plpBuff,DWORDLONG dwData);
-void SetGUID (LPBYTE *plpBuff,MRA_GUID guidData);
-void SetLPS (LPBYTE *plpBuff,LPSTR lpszData,DWORD dwSize);
-void SetLPSW (LPBYTE *plpBuff,LPWSTR lpwszData,DWORD dwSize);
-void SetLPSWtoA (LPBYTE *plpBuff,LPWSTR lpwszData,DWORD dwSize);
-void SetLPSLowerCase (LPBYTE *plpBuff,LPSTR lpszData,DWORD dwSize);
-void SetLPSLowerCaseW (LPBYTE *plpBuff,LPWSTR lpwszData,DWORD dwSize);
-
-
+static void SetLPSW(LPBYTE *plpBuff, LPCWSTR lpwszData, DWORD dwSize)
+{
+ dwSize *= sizeof(WCHAR);
+ (*(DWORD*)(*plpBuff)) = dwSize;
+ (*plpBuff) += sizeof(DWORD);
+ memmove((*plpBuff), lpwszData, dwSize);
+ (*plpBuff) += dwSize;
+}
+static void SetLPSWtoA(LPBYTE *plpBuff, LPCWSTR lpwszData, DWORD dwSize)
+{
+ dwSize = WideCharToMultiByte(MRA_CODE_PAGE, 0, lpwszData, dwSize, (LPSTR)((*plpBuff)+sizeof(DWORD)), (dwSize*sizeof(WCHAR)), NULL, NULL);
+ (*(DWORD*)(*plpBuff)) = dwSize;
+ (*plpBuff) += (sizeof(DWORD)+dwSize);
+}
+static void SetLPSLowerCase(LPBYTE *plpBuff, LPCSTR lpszData, DWORD dwSize)
+{
+ (*(DWORD*)(*plpBuff)) = dwSize;
+ (*plpBuff) += sizeof(DWORD);
+ BuffToLowerCase((*plpBuff), lpszData, dwSize);
+ (*plpBuff) += dwSize;
+}
+static void SetLPSLowerCaseW(LPBYTE *plpBuff, LPCWSTR lpwszData, DWORD dwSize)
+{
+ dwSize *= sizeof(WCHAR);
+ (*(DWORD*)(*plpBuff)) = dwSize;
+ (*plpBuff) += sizeof(DWORD);
+ memmove((*plpBuff), lpwszData, dwSize);
+ CharLowerBuff((LPWSTR)(*plpBuff), (dwSize/sizeof(WCHAR)));
+ (*plpBuff) += dwSize;
+}
-DWORD MraSendCommand_MessageW(BOOL bAddToQueue,HANDLE hContact,DWORD dwAckType,DWORD dwFlags,LPSTR lpszEMail,SIZE_T dwEMailSize,LPWSTR lpwszMessage,SIZE_T dwMessageSize,LPBYTE lpbMultiChatData,SIZE_T dwMultiChatDataSize)
-{// Сообщение
- DWORD dwRet=0;
- LPBYTE lpbData,lpbDataCurrent;
- LPSTR lpszMessageConverted=(LPSTR)lpwszMessage;
- LPSTR lpszMessageRTF=NULL;
- SIZE_T dwMessageConvertedSize=(dwMessageSize*sizeof(WCHAR)),dwMessageRTFSize=0;
+/////////////////////////////////////////////////////////////////////////////////////////
+DWORD CMraProto::MraMessageW(BOOL bAddToQueue, HANDLE hContact, DWORD dwAckType, DWORD dwFlags, LPSTR lpszEMail, size_t dwEMailSize, LPCWSTR lpwszMessage, size_t dwMessageSize, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize)
+{
+ DWORD dwRet = 0;
+ LPBYTE lpbData, lpbDataCurrent;
+ LPSTR lpszMessageConverted = (LPSTR)lpwszMessage;
+ LPSTR lpszMessageRTF = NULL;
+ size_t dwMessageConvertedSize = (dwMessageSize*sizeof(WCHAR)), dwMessageRTFSize = 0;
- if (MraIsMessageFlashAnimation(lpwszMessage,dwMessageSize)) dwFlags|=MESSAGE_FLAG_FLASH;
+ if ( MraIsMessageFlashAnimation(lpwszMessage, dwMessageSize))
+ dwFlags |= MESSAGE_FLAG_FLASH;
- if (dwFlags&MESSAGE_FLAG_AUTHORIZE)
- {// pack auth message
+ // pack auth message
+ if (dwFlags & MESSAGE_FLAG_AUTHORIZE) {
LPBYTE lpbAuthMsgBuff;
- SIZE_T dwMessageConvertedBuffSize=(((((dwMessageSize*sizeof(WCHAR))+1024)+2)/3)*4);
+ size_t dwMessageConvertedBuffSize = (((((dwMessageSize*sizeof(WCHAR))+1024)+2)/3)*4);
- lpszMessageConverted=(LPSTR)MEMALLOC(dwMessageConvertedBuffSize);
- lpbAuthMsgBuff=(LPBYTE)MEMALLOC(((dwMessageSize*sizeof(WCHAR))+1024));
- if (lpszMessageConverted && lpbAuthMsgBuff)
- {
- lpbDataCurrent=lpbAuthMsgBuff;
- SetUL(&lpbDataCurrent,2);
- SetLPSW(&lpbDataCurrent,NULL,0);//***deb possible nick here
- SetLPSW(&lpbDataCurrent,lpwszMessage,dwMessageSize);
-
- BASE64EncodeUnSafe(lpbAuthMsgBuff,(lpbDataCurrent-lpbAuthMsgBuff),lpszMessageConverted,dwMessageConvertedBuffSize,&dwMessageConvertedSize);
- }else{
- MEMFREE(lpszMessageConverted);
- lpszMessageConverted=(LPSTR)lpwszMessage;
+ lpszMessageConverted = (LPSTR)mir_calloc(dwMessageConvertedBuffSize);
+ lpbAuthMsgBuff = (LPBYTE)mir_calloc(((dwMessageSize*sizeof(WCHAR))+1024));
+ if (lpszMessageConverted && lpbAuthMsgBuff) {
+ lpbDataCurrent = lpbAuthMsgBuff;
+ SetUL(&lpbDataCurrent, 2);
+ SetLPSW(&lpbDataCurrent, NULL, 0);//***deb possible nick here
+ SetLPSW(&lpbDataCurrent, (LPWSTR)lpwszMessage, dwMessageSize);
+
+ BASE64EncodeUnSafe(lpbAuthMsgBuff, (lpbDataCurrent-lpbAuthMsgBuff), lpszMessageConverted, dwMessageConvertedBuffSize, &dwMessageConvertedSize);
}
- MEMFREE(lpbAuthMsgBuff);
- }else
- if (dwFlags&MESSAGE_FLAG_FLASH)
- {// особая упаковка для флеша
- if (masMraSettings.lpfnCompress2)// only if func exist
- {
- SIZE_T dwRFTBuffSize=(((dwMessageSize*sizeof(WCHAR))*4)+8192),dwRTFDataSize;
+ else {
+ mir_free(lpszMessageConverted);
+ lpszMessageConverted = (LPSTR)lpwszMessage;
+ }
+ mir_free(lpbAuthMsgBuff);
+ }
+ // messages with Flash
+ else if (dwFlags & MESSAGE_FLAG_FLASH) {
+ if (masMraSettings.lpfnCompress2) { // only if func exist
+ size_t dwRFTBuffSize = (((dwMessageSize*sizeof(WCHAR))*4)+8192), dwRTFDataSize;
LPBYTE lpbRTFData;
- dwFlags|=MESSAGE_FLAG_RTF;
- lpszMessageRTF=(LPSTR)MEMALLOC(dwRFTBuffSize);
- lpbRTFData=(LPBYTE)MEMALLOC(dwRFTBuffSize);
- if (lpszMessageRTF && lpbRTFData)
- {
- DWORD dwBackColour;
+ dwFlags |= MESSAGE_FLAG_RTF;
+ lpszMessageRTF = (LPSTR)mir_calloc(dwRFTBuffSize);
+ lpbRTFData = (LPBYTE)mir_calloc(dwRFTBuffSize);
+ if (lpszMessageRTF && lpbRTFData) {
+ DWORD dwBackColour = mraGetDword(NULL, "RTFBackgroundColour", MRA_DEFAULT_RTF_BACKGROUND_COLOUR);
+ lpbDataCurrent = (LPBYTE)lpszMessageRTF;
- dwBackColour=DB_Mra_GetDword(NULL,"RTFBackgroundColour",MRA_DEFAULT_RTF_BACKGROUND_COLOUR);
- lpbDataCurrent=(LPBYTE)lpszMessageRTF;
+ WideCharToMultiByte(MRA_CODE_PAGE, 0, lpwszMessage, dwMessageSize, (LPSTR)lpbRTFData, dwRFTBuffSize, NULL, NULL);
- WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszMessage,dwMessageSize,(LPSTR)lpbRTFData,dwRFTBuffSize,NULL,NULL);
+ SetUL(&lpbDataCurrent, 4);
+ SetLPS(&lpbDataCurrent, (LPSTR)lpbRTFData, dwMessageSize);// сообщение что у собеседника плохая версия :)
+ SetLPS(&lpbDataCurrent, (LPSTR)&dwBackColour, sizeof(DWORD));// цвет фона
+ SetLPS(&lpbDataCurrent, (LPSTR)lpbRTFData, dwMessageSize);// сам мульт ANSI
+ SetLPSW(&lpbDataCurrent, lpwszMessage, dwMessageSize);// сам мульт UNICODE
- SetUL(&lpbDataCurrent,4);
- SetLPS(&lpbDataCurrent,(LPSTR)lpbRTFData,dwMessageSize);// сообщение что у собеседника плохая версия :)
- SetLPS(&lpbDataCurrent,(LPSTR)&dwBackColour,sizeof(DWORD));// цвет фона
- SetLPS(&lpbDataCurrent,(LPSTR)lpbRTFData,dwMessageSize);// сам мульт ANSI
- SetLPSW(&lpbDataCurrent,lpwszMessage,dwMessageSize);// сам мульт UNICODE
-
- dwRTFDataSize=dwRFTBuffSize;
- if ((PCOMPRESS2(masMraSettings.lpfnCompress2))(lpbRTFData,(DWORD*)&dwRTFDataSize,(LPBYTE)lpszMessageRTF,(lpbDataCurrent-(LPBYTE)lpszMessageRTF),Z_BEST_COMPRESSION)==Z_OK)
- {
- BASE64EncodeUnSafe(lpbRTFData,dwRTFDataSize,lpszMessageRTF,dwRFTBuffSize,&dwMessageRTFSize);
- }
+ dwRTFDataSize = dwRFTBuffSize;
+ if ((PCOMPRESS2(masMraSettings.lpfnCompress2))(lpbRTFData, (DWORD*)&dwRTFDataSize, (LPBYTE)lpszMessageRTF, (lpbDataCurrent-(LPBYTE)lpszMessageRTF), Z_BEST_COMPRESSION) == Z_OK)
+ BASE64EncodeUnSafe(lpbRTFData, dwRTFDataSize, lpszMessageRTF, dwRFTBuffSize, &dwMessageRTFSize);
}
- MEMFREE(lpbRTFData);
+ mir_free(lpbRTFData);
}
- }else// standart message
- if ((dwFlags&(MESSAGE_FLAG_CONTACT|MESSAGE_FLAG_NOTIFY|MESSAGE_FLAG_SMS))==0)
- {// Only if message is simple text message or RTF or ALARM
- if (dwFlags&MESSAGE_FLAG_RTF)// add RFT part
- if (masMraSettings.lpfnCompress2)// only if func exist
- {// обычный ртф
- SIZE_T dwRFTBuffSize=(((dwMessageSize*sizeof(WCHAR))*16)+8192),dwRTFDataSize;
+ }
+ // standart message
+ else if ((dwFlags & (MESSAGE_FLAG_CONTACT | MESSAGE_FLAG_NOTIFY | MESSAGE_FLAG_SMS)) == 0) {
+ // Only if message is simple text message or RTF or ALARM
+ if (dwFlags & MESSAGE_FLAG_RTF)// add RFT part
+ if (masMraSettings.lpfnCompress2) { // обычный ртф
+ size_t dwRFTBuffSize = (((dwMessageSize*sizeof(WCHAR))*16)+8192), dwRTFDataSize;
LPBYTE lpbRTFData;
- lpszMessageRTF=(LPSTR)MEMALLOC(dwRFTBuffSize);
- lpbRTFData=(LPBYTE)MEMALLOC(dwRFTBuffSize);
- if (lpszMessageRTF && lpbRTFData)
- {
- if (MraConvertToRTFW(lpwszMessage,dwMessageSize,(LPSTR)lpbRTFData,dwRFTBuffSize,&dwRTFDataSize)==NO_ERROR)
- {
- DWORD dwBackColour;
-
- dwBackColour=DB_Mra_GetDword(NULL,"RTFBackgroundColour",MRA_DEFAULT_RTF_BACKGROUND_COLOUR);
- lpbDataCurrent=(LPBYTE)lpszMessageRTF;
-
- SetUL(&lpbDataCurrent,2);
- SetLPS(&lpbDataCurrent,(LPSTR)lpbRTFData,dwRTFDataSize);
- SetLPS(&lpbDataCurrent,(LPSTR)&dwBackColour,sizeof(DWORD));
-
- dwRTFDataSize=dwRFTBuffSize;
- if ((PCOMPRESS2(masMraSettings.lpfnCompress2))(lpbRTFData,(DWORD*)&dwRTFDataSize,(LPBYTE)lpszMessageRTF,(lpbDataCurrent-(LPBYTE)lpszMessageRTF),Z_BEST_COMPRESSION)==Z_OK)
- {
- BASE64EncodeUnSafe(lpbRTFData,dwRTFDataSize,lpszMessageRTF,dwRFTBuffSize,&dwMessageRTFSize);
- }
+ lpszMessageRTF = (LPSTR)mir_calloc(dwRFTBuffSize);
+ lpbRTFData = (LPBYTE)mir_calloc(dwRFTBuffSize);
+ if (lpszMessageRTF && lpbRTFData) {
+ if ( !MraConvertToRTFW(lpwszMessage, dwMessageSize, (LPSTR)lpbRTFData, dwRFTBuffSize, &dwRTFDataSize)) {
+ DWORD dwBackColour = mraGetDword(NULL, "RTFBackgroundColour", MRA_DEFAULT_RTF_BACKGROUND_COLOUR);
+ lpbDataCurrent = (LPBYTE)lpszMessageRTF;
+
+ SetUL(&lpbDataCurrent, 2);
+ SetLPS(&lpbDataCurrent, (LPSTR)lpbRTFData, dwRTFDataSize);
+ SetLPS(&lpbDataCurrent, (LPSTR)&dwBackColour, sizeof(DWORD));
+
+ dwRTFDataSize = dwRFTBuffSize;
+ if ((PCOMPRESS2(masMraSettings.lpfnCompress2))(lpbRTFData, (DWORD*)&dwRTFDataSize, (LPBYTE)lpszMessageRTF, (lpbDataCurrent-(LPBYTE)lpszMessageRTF), Z_BEST_COMPRESSION) == Z_OK)
+ BASE64EncodeUnSafe(lpbRTFData, dwRTFDataSize, lpszMessageRTF, dwRFTBuffSize, &dwMessageRTFSize);
}
}
- MEMFREE(lpbRTFData);
+ mir_free(lpbRTFData);
}
- }//*/
- if (lpszMessageRTF==NULL || dwMessageRTFSize==0) dwFlags&=~(MESSAGE_FLAG_RTF|MESSAGE_FLAG_FLASH);
- if (lpbMultiChatData==NULL || dwMultiChatDataSize==0) dwFlags&=~MESSAGE_FLAG_MULTICHAT;
-
- lpbData=(LPBYTE)MEMALLOC((sizeof(DWORD)+dwEMailSize+dwMessageConvertedSize+dwMessageRTFSize+dwMultiChatDataSize+128));
- if (lpbData)
- {
- lpbDataCurrent=lpbData;
- SetUL(&lpbDataCurrent,dwFlags);
- SetLPSLowerCase(&lpbDataCurrent,lpszEMail,dwEMailSize);
- SetLPS(&lpbDataCurrent,lpszMessageConverted,dwMessageConvertedSize);
- SetLPS(&lpbDataCurrent,lpszMessageRTF,dwMessageRTFSize);
- if (dwFlags&MESSAGE_FLAG_MULTICHAT) SetLPS(&lpbDataCurrent,(LPSTR)lpbMultiChatData,dwMultiChatDataSize);
+ }
+
+ if (lpszMessageRTF == NULL || dwMessageRTFSize == 0) dwFlags &= ~(MESSAGE_FLAG_RTF|MESSAGE_FLAG_FLASH);
+ if (lpbMultiChatData == NULL || dwMultiChatDataSize == 0) dwFlags &= ~MESSAGE_FLAG_MULTICHAT;
+
+ lpbData = (LPBYTE)mir_calloc((sizeof(DWORD)+dwEMailSize+dwMessageConvertedSize+dwMessageRTFSize+dwMultiChatDataSize+128));
+ if (lpbData) {
+ lpbDataCurrent = lpbData;
+ SetUL(&lpbDataCurrent, dwFlags);
+ SetLPSLowerCase(&lpbDataCurrent, lpszEMail, dwEMailSize);
+ SetLPS(&lpbDataCurrent, lpszMessageConverted, dwMessageConvertedSize);
+ SetLPS(&lpbDataCurrent, lpszMessageRTF, dwMessageRTFSize);
+ if (dwFlags&MESSAGE_FLAG_MULTICHAT) SetLPS(&lpbDataCurrent, (LPSTR)lpbMultiChatData, dwMultiChatDataSize);
if (bAddToQueue)
- {
- dwRet=MraSendQueueCMD(masMraSettings.hSendQueueHandle,0,hContact,dwAckType,(LPBYTE)lpwszMessage,(dwMessageSize*sizeof(WCHAR)),MRIM_CS_MESSAGE,lpbData,(lpbDataCurrent-lpbData));
- }else{
- dwRet=MraSendCMD(MRIM_CS_MESSAGE,lpbData,(lpbDataCurrent-lpbData));
- }
- MEMFREE(lpbData);
+ dwRet = MraSendQueueCMD(hSendQueueHandle, 0, hContact, dwAckType, (LPBYTE)lpwszMessage, (dwMessageSize*sizeof(WCHAR)), MRIM_CS_MESSAGE, lpbData, (lpbDataCurrent-lpbData));
+ else
+ dwRet = MraSendCMD(MRIM_CS_MESSAGE, lpbData, (lpbDataCurrent-lpbData));
+ mir_free(lpbData);
}
- if (lpszMessageConverted!=(LPSTR)lpwszMessage) MEMFREE(lpszMessageConverted);
- MEMFREE(lpszMessageRTF);
-
-return(dwRet);
-}
-
-DWORD MraSendCommand_MessageAskW(DWORD dwMsgID,DWORD dwFlags,LPSTR lpszEMail,SIZE_T dwEMailSize,LPWSTR lpwszMessage,SIZE_T dwMessageSize,LPSTR lpwszMessageRTF,SIZE_T dwMessageRTFSize)
-{// Подтверждение получения сообщения
- DWORD dwRet=0;
+ if (lpszMessageConverted != (LPSTR)lpwszMessage)
+ mir_free(lpszMessageConverted);
+ mir_free(lpszMessageRTF);
- if (lpszEMail && dwEMailSize>4 && lpwszMessage && dwMessageSize)
- {
- LPBYTE lpbData,lpbDataCurrent;
+ return dwRet;
+}
- lpbData=(LPBYTE)MEMALLOC((sizeof(DWORD)+sizeof(DWORD)+dwEMailSize+dwMessageSize+dwMessageRTFSize+32));
- if (lpbData)
- {
- lpbDataCurrent=lpbData;
- SetUL(&lpbDataCurrent,dwMsgID);//UL msg_id
- SetUL(&lpbDataCurrent,dwFlags);//UL flags
- SetLPSLowerCase(&lpbDataCurrent,lpszEMail,dwEMailSize);// LPS from e-mail ANSI
- SetLPS(&lpbDataCurrent,(LPSTR)lpwszMessage,dwMessageSize);// LPS message UNICODE
+// Send confirmation
+DWORD CMraProto::MraMessageAskW(DWORD dwMsgID, DWORD dwFlags, LPSTR lpszEMail, size_t dwEMailSize, LPWSTR lpwszMessage, size_t dwMessageSize, LPSTR lpwszMessageRTF, size_t dwMessageRTFSize)
+{
+ DWORD dwRet = 0;
+
+ if (lpszEMail && dwEMailSize>4 && lpwszMessage && dwMessageSize) {
+ LPBYTE lpbData, lpbDataCurrent;
+ lpbData = (LPBYTE)mir_calloc((sizeof(DWORD)+sizeof(DWORD)+dwEMailSize+dwMessageSize+dwMessageRTFSize+32));
+ if (lpbData) {
+ lpbDataCurrent = lpbData;
+ SetUL(&lpbDataCurrent, dwMsgID);//UL msg_id
+ SetUL(&lpbDataCurrent, dwFlags);//UL flags
+ SetLPSLowerCase(&lpbDataCurrent, lpszEMail, dwEMailSize);// LPS from e-mail ANSI
+ SetLPS(&lpbDataCurrent, (LPSTR)lpwszMessage, dwMessageSize);// LPS message UNICODE
if (dwFlags&MESSAGE_FLAG_RTF)
- SetLPS(&lpbDataCurrent,(LPSTR)lpwszMessageRTF,dwMessageRTFSize);// LPS //rtf-formatted message (>=1.1) - MESSAGE_FLAG_RTF
+ SetLPS(&lpbDataCurrent, (LPSTR)lpwszMessageRTF, dwMessageRTFSize);// LPS //rtf-formatted message ( >= 1.1) - MESSAGE_FLAG_RTF
- dwRet=MraSendCMD(MRIM_CS_MESSAGE_ACK,lpbData,(lpbDataCurrent-lpbData));
- //dwRet=MraSendCMD(MRIM_CS_MESSAGE,lpbData,(lpbDataCurrent-lpbData));
- MEMFREE(lpbData);
+ dwRet = MraSendCMD(MRIM_CS_MESSAGE_ACK, lpbData, (lpbDataCurrent-lpbData));
+ mir_free(lpbData);
}
- }else{
- DebugBreak();
}
-return(dwRet);
-}
-
-DWORD MraSendCommand_MessageRecv(LPSTR lpszFrom,SIZE_T dwFromSize,DWORD dwMsgID)
-{// Подтверждение получения сообщения
- DWORD dwRet=0;
-
- if (lpszFrom && dwFromSize>4)
- {
- LPBYTE lpbData,lpbDataCurrent;
-
- lpbData=(LPBYTE)MEMALLOC((dwFromSize+sizeof(DWORD)+32));
- if (lpbData)
- {
- lpbDataCurrent=lpbData;
- SetLPSLowerCase(&lpbDataCurrent,lpszFrom,dwFromSize);
- SetUL(&lpbDataCurrent,dwMsgID);
+ return dwRet;
+}
- dwRet=MraSendCMD(MRIM_CS_MESSAGE_RECV,lpbData,(lpbDataCurrent-lpbData));
- MEMFREE(lpbData);
+DWORD CMraProto::MraMessageRecv(LPSTR lpszFrom, size_t dwFromSize, DWORD dwMsgID)
+{
+ DWORD dwRet = 0;
+
+ if (lpszFrom && dwFromSize>4) {
+ LPBYTE lpbData, lpbDataCurrent;
+ lpbData = (LPBYTE)mir_calloc((dwFromSize+sizeof(DWORD)+32));
+ if (lpbData) {
+ lpbDataCurrent = lpbData;
+ SetLPSLowerCase(&lpbDataCurrent, lpszFrom, dwFromSize);
+ SetUL(&lpbDataCurrent, dwMsgID);
+
+ dwRet = MraSendCMD(MRIM_CS_MESSAGE_RECV, lpbData, (lpbDataCurrent-lpbData));
+ mir_free(lpbData);
}
- }else{
- DebugBreak();
}
-return(dwRet);
+ return dwRet;
}
-
-DWORD MraSendCommand_AddContactW(HANDLE hContact,DWORD dwContactFlag,DWORD dwGroupID,LPSTR lpszEMail,SIZE_T dwEMailSize,LPWSTR lpwszCustomName,SIZE_T dwCustomNameSize,LPSTR lpszPhones,SIZE_T dwPhonesSize,LPWSTR lpwszAuthMessage,SIZE_T dwAuthMessageSize,DWORD dwActions)
-{// Добавление нового контакта
- DWORD dwRet=0;
-
- if (lpszEMail && dwEMailSize>4)
- {
- LPBYTE lpbData,lpbDataCurrent;
-
- lpbData=(LPBYTE)MEMALLOC((sizeof(DWORD)+sizeof(DWORD)+dwEMailSize+(dwCustomNameSize*sizeof(WCHAR))+dwPhonesSize+(((((dwAuthMessageSize*sizeof(WCHAR))+1024)+2)/3)*4)+32)+sizeof(DWORD));
- if (lpbData)
- {
- dwContactFlag|=CONTACT_FLAG_UNICODE_NAME;
-
- lpbDataCurrent=lpbData;
- SetUL(&lpbDataCurrent,dwContactFlag);
- SetUL(&lpbDataCurrent,dwGroupID);
- SetLPSLowerCase(&lpbDataCurrent,lpszEMail,dwEMailSize);
- SetLPSW(&lpbDataCurrent,lpwszCustomName,dwCustomNameSize);
- SetLPS(&lpbDataCurrent,lpszPhones,dwPhonesSize);
- {// pack auth message
- LPBYTE lpbAuthMsgBuff,lpbAuthMessageConverted,lpbAuthDataCurrent;
- SIZE_T dwAuthMessageConvertedBuffSize=(((((dwAuthMessageSize*sizeof(WCHAR))+1024)+2)/3)*4),dwAuthMessageConvertedSize=0;
+// Adds new contact
+DWORD CMraProto::MraAddContactW(HANDLE hContact, DWORD dwContactFlag, DWORD dwGroupID, LPSTR lpszEMail, size_t dwEMailSize, LPWSTR lpwszCustomName, size_t dwCustomNameSize, LPSTR lpszPhones, size_t dwPhonesSize, LPWSTR lpwszAuthMessage, size_t dwAuthMessageSize, DWORD dwActions)
+{
+ DWORD dwRet = 0;
+
+ if (lpszEMail && dwEMailSize>4) {
+ LPBYTE lpbData = (LPBYTE)mir_calloc((sizeof(DWORD)+sizeof(DWORD)+dwEMailSize+(dwCustomNameSize*sizeof(WCHAR))+dwPhonesSize+(((((dwAuthMessageSize*sizeof(WCHAR))+1024)+2)/3)*4)+32)+sizeof(DWORD));
+ if (lpbData) {
+ dwContactFlag |= CONTACT_FLAG_UNICODE_NAME;
+
+ LPBYTE lpbDataCurrent = lpbData;
+ SetUL(&lpbDataCurrent, dwContactFlag);
+ SetUL(&lpbDataCurrent, dwGroupID);
+ SetLPSLowerCase(&lpbDataCurrent, lpszEMail, dwEMailSize);
+ SetLPSW(&lpbDataCurrent, lpwszCustomName, dwCustomNameSize);
+ SetLPS(&lpbDataCurrent, lpszPhones, dwPhonesSize);
+
+ // pack auth message
+ LPBYTE lpbAuthMsgBuff, lpbAuthMessageConverted, lpbAuthDataCurrent;
+ size_t dwAuthMessageConvertedBuffSize = (((((dwAuthMessageSize*sizeof(WCHAR))+1024)+2)/3)*4), dwAuthMessageConvertedSize = 0;
- lpbAuthMessageConverted=(LPBYTE)MEMALLOC(dwAuthMessageConvertedBuffSize);
- lpbAuthMsgBuff=(LPBYTE)MEMALLOC(((dwAuthMessageSize*sizeof(WCHAR))+1024));
- if (lpbAuthMessageConverted && lpbAuthMsgBuff)
- {
- lpbAuthDataCurrent=lpbAuthMsgBuff;
- SetUL(&lpbAuthDataCurrent,2);
- SetLPSW(&lpbAuthDataCurrent,NULL,0);//***deb possible nick here
- SetLPSW(&lpbAuthDataCurrent,lpwszAuthMessage,dwAuthMessageSize);
-
- BASE64EncodeUnSafe(lpbAuthMsgBuff,(lpbAuthDataCurrent-lpbAuthMsgBuff),lpbAuthMessageConverted,dwAuthMessageConvertedBuffSize,&dwAuthMessageConvertedSize);
- }
- SetLPS(&lpbDataCurrent,(LPSTR)lpbAuthMessageConverted,dwAuthMessageConvertedSize);
- MEMFREE(lpbAuthMsgBuff);
- MEMFREE(lpbAuthMessageConverted);
+ lpbAuthMessageConverted = (LPBYTE)mir_calloc(dwAuthMessageConvertedBuffSize);
+ lpbAuthMsgBuff = (LPBYTE)mir_calloc(((dwAuthMessageSize*sizeof(WCHAR))+1024));
+ if (lpbAuthMessageConverted && lpbAuthMsgBuff) {
+ lpbAuthDataCurrent = lpbAuthMsgBuff;
+ SetUL(&lpbAuthDataCurrent, 2);
+ SetLPSW(&lpbAuthDataCurrent, NULL, 0);//***deb possible nick here
+ SetLPSW(&lpbAuthDataCurrent, lpwszAuthMessage, dwAuthMessageSize);
+
+ BASE64EncodeUnSafe(lpbAuthMsgBuff, (lpbAuthDataCurrent-lpbAuthMsgBuff), lpbAuthMessageConverted, dwAuthMessageConvertedBuffSize, &dwAuthMessageConvertedSize);
}
- SetUL(&lpbDataCurrent,dwActions);
+ SetLPS(&lpbDataCurrent, (LPSTR)lpbAuthMessageConverted, dwAuthMessageConvertedSize);
+ mir_free(lpbAuthMsgBuff);
+ mir_free(lpbAuthMessageConverted);
+
+ SetUL(&lpbDataCurrent, dwActions);
- dwRet=MraSendQueueCMD(masMraSettings.hSendQueueHandle,0,hContact,ACKTYPE_ADDED,NULL,0,MRIM_CS_ADD_CONTACT,lpbData,(lpbDataCurrent-lpbData));
- MEMFREE(lpbData);
+ dwRet = MraSendQueueCMD(hSendQueueHandle, 0, hContact, ACKTYPE_ADDED, NULL, 0, MRIM_CS_ADD_CONTACT, lpbData, (lpbDataCurrent-lpbData));
+ mir_free(lpbData);
}
- }else{
- //DebugBreak();
}
-return(dwRet);
+ return dwRet;
}
-
-DWORD MraSendCommand_ModifyContactW(HANDLE hContact,DWORD dwID,DWORD dwContactFlag,DWORD dwGroupID,LPSTR lpszEMail,SIZE_T dwEMailSize,LPWSTR lpwszCustomName,SIZE_T dwCustomNameSize,LPSTR lpszPhones,SIZE_T dwPhonesSize)
-{// Изменение контакта
- DWORD dwRet=0;
-
- LPBYTE lpbData,lpbDataCurrent;
-
- if (dwID!=-1)
- {
- lpbData=(LPBYTE)MEMALLOC((sizeof(DWORD)+sizeof(DWORD)+sizeof(DWORD)+dwEMailSize+(dwCustomNameSize*sizeof(WCHAR))+dwPhonesSize+32));
+// change contact
+DWORD CMraProto::MraModifyContactW(HANDLE hContact, DWORD dwID, DWORD dwContactFlag, DWORD dwGroupID, LPSTR lpszEMail, size_t dwEMailSize, LPWSTR lpwszCustomName, size_t dwCustomNameSize, LPSTR lpszPhones, size_t dwPhonesSize)
+{
+ DWORD dwRet = 0;
+ if (dwID != -1) {
+ LPBYTE lpbData = (LPBYTE)mir_calloc((sizeof(DWORD)+sizeof(DWORD)+sizeof(DWORD)+dwEMailSize+(dwCustomNameSize*sizeof(WCHAR))+dwPhonesSize+32));
if (lpbData)
{
- dwContactFlag|=CONTACT_FLAG_UNICODE_NAME;
-
- lpbDataCurrent=lpbData;
- SetUL(&lpbDataCurrent,dwID);
- SetUL(&lpbDataCurrent,dwContactFlag);
- SetUL(&lpbDataCurrent,dwGroupID);
- SetLPSLowerCase(&lpbDataCurrent,lpszEMail,dwEMailSize);
- SetLPSW(&lpbDataCurrent,lpwszCustomName,dwCustomNameSize);
- SetLPS(&lpbDataCurrent,lpszPhones,dwPhonesSize);
-
- dwRet=MraSendQueueCMD(masMraSettings.hSendQueueHandle,0,hContact,ACKTYPE_ADDED,NULL,0,MRIM_CS_MODIFY_CONTACT,lpbData,(lpbDataCurrent-lpbData));
- MEMFREE(lpbData);
+ dwContactFlag |= CONTACT_FLAG_UNICODE_NAME;
+
+ LPBYTE lpbDataCurrent = lpbData;
+ SetUL(&lpbDataCurrent, dwID);
+ SetUL(&lpbDataCurrent, dwContactFlag);
+ SetUL(&lpbDataCurrent, dwGroupID);
+ SetLPSLowerCase(&lpbDataCurrent, lpszEMail, dwEMailSize);
+ SetLPSW(&lpbDataCurrent, lpwszCustomName, dwCustomNameSize);
+ SetLPS(&lpbDataCurrent, lpszPhones, dwPhonesSize);
+
+ dwRet = MraSendQueueCMD(hSendQueueHandle, 0, hContact, ACKTYPE_ADDED, NULL, 0, MRIM_CS_MODIFY_CONTACT, lpbData, (lpbDataCurrent-lpbData));
+ mir_free(lpbData);
}
- }else{
- DebugBreak();
}
-return(dwRet);
+ return dwRet;
}
-
-DWORD MraSendCommand_OfflineMessageDel(DWORDLONG dwMsgUIDL)
-{// Удаление сохраненного сообщения
-return(MraSendCMD(MRIM_CS_DELETE_OFFLINE_MESSAGE,&dwMsgUIDL,sizeof(DWORDLONG)));
+// remove stored message
+DWORD CMraProto::MraOfflineMessageDel(DWORDLONG dwMsgUIDL)
+{
+ return MraSendCMD(MRIM_CS_DELETE_OFFLINE_MESSAGE, &dwMsgUIDL, sizeof(DWORDLONG));
}
-
-DWORD MraSendCommand_Authorize(LPSTR lpszEMail,SIZE_T dwEMailSize)
-{// Авторизация пользователя на добавление в контакт-лист
- DWORD dwRet=0;
-
- if (lpszEMail && dwEMailSize>4)
- {
- LPBYTE lpbData,lpbDataCurrent;
-
- lpbData=(LPBYTE)MEMALLOC((dwEMailSize+32));
- if (lpbData)
- {
- lpbDataCurrent=lpbData;
- SetLPSLowerCase(&lpbDataCurrent,lpszEMail,dwEMailSize);
-
- dwRet=MraSendCMD(MRIM_CS_AUTHORIZE,lpbData,(lpbDataCurrent-lpbData));
- MEMFREE(lpbData);
+// autorize a user & add him to a roster
+DWORD CMraProto::MraAuthorize(LPSTR lpszEMail, size_t dwEMailSize)
+{
+ DWORD dwRet = 0;
+
+ if (lpszEMail && dwEMailSize>4) {
+ LPBYTE lpbData;
+ lpbData = (LPBYTE)mir_calloc((dwEMailSize+32));
+ if (lpbData) {
+ LPBYTE lpbDataCurrent = lpbData;
+ SetLPSLowerCase(&lpbDataCurrent, lpszEMail, dwEMailSize);
+ dwRet = MraSendCMD(MRIM_CS_AUTHORIZE, lpbData, (lpbDataCurrent-lpbData));
+ mir_free(lpbData);
}
- }else{
- DebugBreak();
}
-return(dwRet);
+ return dwRet;
}
-
-DWORD MraSendCommand_ChangeStatusW(DWORD dwStatus,LPSTR lpszStatusUri,SIZE_T dwStatusUriSize,LPWSTR lpwszStatusTitle,SIZE_T dwStatusTitleSize,LPWSTR lpwszStatusDesc,SIZE_T dwStatusDescSize,DWORD dwFutureFlags)
-{// Изменение статуса
- DWORD dwRet=0;
- LPBYTE lpbData,lpbDataCurrent;
-
- if (dwStatusUriSize>SPEC_STATUS_URI_MAX) dwStatusUriSize=SPEC_STATUS_URI_MAX;
- if (dwStatusTitleSize>STATUS_TITLE_MAX) dwStatusTitleSize=STATUS_TITLE_MAX;
- if (dwStatusDescSize>STATUS_DESC_MAX) dwStatusDescSize=STATUS_DESC_MAX;
-
- lpbData=(LPBYTE)MEMALLOC((sizeof(DWORD)+dwStatusUriSize+(dwStatusTitleSize*sizeof(WCHAR))+(dwStatusDescSize*sizeof(WCHAR))+sizeof(DWORD)+32));
- if (lpbData)
- {
- lpbDataCurrent=lpbData;
- SetUL(&lpbDataCurrent,dwStatus);
- SetLPS(&lpbDataCurrent,lpszStatusUri,dwStatusUriSize);
- SetLPSW(&lpbDataCurrent,lpwszStatusTitle,dwStatusTitleSize);
- SetLPSW(&lpbDataCurrent,lpwszStatusDesc,dwStatusDescSize);
- SetUL(&lpbDataCurrent,dwFutureFlags);
-
- dwRet=MraSendCMD(MRIM_CS_CHANGE_STATUS,lpbData,(lpbDataCurrent-lpbData));
- MEMFREE(lpbData);
+// change status
+DWORD CMraProto::MraChangeStatusW(DWORD dwStatus, LPSTR lpszStatusUri, size_t dwStatusUriSize, LPCWSTR lpwszStatusTitle, size_t dwStatusTitleSize, LPCWSTR lpwszStatusDesc, size_t dwStatusDescSize, DWORD dwFutureFlags)
+{
+ DWORD dwRet = 0;
+
+ if (dwStatusUriSize > SPEC_STATUS_URI_MAX) dwStatusUriSize = SPEC_STATUS_URI_MAX;
+ if (dwStatusTitleSize > STATUS_TITLE_MAX) dwStatusTitleSize = STATUS_TITLE_MAX;
+ if (dwStatusDescSize > STATUS_DESC_MAX) dwStatusDescSize = STATUS_DESC_MAX;
+
+ LPBYTE lpbData = (LPBYTE)mir_calloc((sizeof(DWORD)+dwStatusUriSize+(dwStatusTitleSize*sizeof(WCHAR))+(dwStatusDescSize*sizeof(WCHAR))+sizeof(DWORD)+32));
+ if (lpbData) {
+ LPBYTE lpbDataCurrent = lpbData;
+ SetUL(&lpbDataCurrent, dwStatus);
+ SetLPS(&lpbDataCurrent, lpszStatusUri, dwStatusUriSize);
+ SetLPSW(&lpbDataCurrent, lpwszStatusTitle, dwStatusTitleSize);
+ SetLPSW(&lpbDataCurrent, lpwszStatusDesc, dwStatusDescSize);
+ SetUL(&lpbDataCurrent, dwFutureFlags);
+
+ dwRet = MraSendCMD(MRIM_CS_CHANGE_STATUS, lpbData, (lpbDataCurrent-lpbData));
+ mir_free(lpbData);
}
-return(dwRet);
+ return dwRet;
}
+// Отправка файлов
+DWORD CMraProto::MraFileTransfer(LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIDRequest, DWORD dwFilesTotalSize, LPWSTR lpwszFiles, size_t dwFilesSize, LPSTR lpszAddreses, size_t dwAddresesSize)
+{
+ DWORD dwRet = 0;
-DWORD MraSendCommand_FileTransfer(LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwIDRequest,DWORD dwFilesTotalSize,LPWSTR lpwszFiles,SIZE_T dwFilesSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize)
-{// Отправка файлов
- DWORD dwRet=0;
+ if (lpszEMail && dwEMailSize>4) {
+ int dwFilesSizeA = WideCharToMultiByte(MRA_CODE_PAGE, 0, lpwszFiles, dwFilesSize, NULL, 0, NULL, NULL);
+ LPBYTE lpbData = (LPBYTE)mir_calloc((dwEMailSize+dwFilesSizeA+(dwFilesSize*sizeof(WCHAR))+dwAddresesSize+MAX_PATH));
+ if (lpbData) {
+ LPBYTE lpbDataCurrent = lpbData;
+ SetLPSLowerCase(&lpbDataCurrent, lpszEMail, dwEMailSize);
+ SetUL(&lpbDataCurrent, dwIDRequest);
+ SetUL(&lpbDataCurrent, dwFilesTotalSize);
+ SetUL(&lpbDataCurrent, (sizeof(DWORD)+dwFilesSizeA + sizeof(DWORD)+(sizeof(DWORD)+sizeof(DWORD)+(dwFilesSize*sizeof(WCHAR))) + sizeof(DWORD)+(DWORD)dwAddresesSize));
- if (lpszEMail && dwEMailSize>4)
- {
- SIZE_T dwFilesSizeA;
- LPBYTE lpbData,lpbDataCurrent;
+ SetLPSWtoA(&lpbDataCurrent, lpwszFiles, dwFilesSize);
+ SetUL(&lpbDataCurrent, (sizeof(DWORD)+sizeof(DWORD)+(dwFilesSize*sizeof(WCHAR))));
- dwFilesSizeA=WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszFiles,dwFilesSize,NULL,0,NULL,NULL);
- lpbData=(LPBYTE)MEMALLOC((dwEMailSize+dwFilesSizeA+(dwFilesSize*sizeof(WCHAR))+dwAddresesSize+MAX_PATH));
- if (lpbData)
- {
- lpbDataCurrent=lpbData;
- SetLPSLowerCase(&lpbDataCurrent,lpszEMail,dwEMailSize);
- SetUL(&lpbDataCurrent,dwIDRequest);
- SetUL(&lpbDataCurrent,dwFilesTotalSize);
- SetUL(&lpbDataCurrent,(sizeof(DWORD)+dwFilesSizeA + sizeof(DWORD)+(sizeof(DWORD)+sizeof(DWORD)+(dwFilesSize*sizeof(WCHAR))) + sizeof(DWORD)+dwAddresesSize));//SetLPS(&lpbDataCurrent,(LPSTR)lpbDataEx,dwDataExSize);
- {
- SetLPSWtoA(&lpbDataCurrent,lpwszFiles,dwFilesSize);
- SetUL(&lpbDataCurrent,(sizeof(DWORD)+sizeof(DWORD)+(dwFilesSize*sizeof(WCHAR))));//SetLPS(&lpbDataCurrent,lpbDescription,dwDescriptionSize);
- {
- SetUL(&lpbDataCurrent,1);
- SetLPSW(&lpbDataCurrent,lpwszFiles,dwFilesSize);
- }
- SetLPS(&lpbDataCurrent,lpszAddreses,dwAddresesSize);
- }
+ SetUL(&lpbDataCurrent, 1);
+ SetLPSW(&lpbDataCurrent, lpwszFiles, dwFilesSize);
+
+ SetLPS(&lpbDataCurrent, lpszAddreses, dwAddresesSize);
- dwRet=MraSendCMD(MRIM_CS_FILE_TRANSFER,lpbData,(lpbDataCurrent-lpbData));
- MEMFREE(lpbData);
+ dwRet = MraSendCMD(MRIM_CS_FILE_TRANSFER, lpbData, lpbDataCurrent-lpbData);
+ mir_free(lpbData);
}
- }else{
- DebugBreak();
}
-return(dwRet);
+ return dwRet;
}
-
-DWORD MraSendCommand_FileTransferAck(DWORD dwStatus,LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwIDRequest,LPBYTE lpbDescription,SIZE_T dwDescriptionSize)
-{// Ответ на отправку файлов
- DWORD dwRet=0;
-
- if (lpszEMail && dwEMailSize>4)
- {
- LPBYTE lpbData,lpbDataCurrent;
-
- lpbData=(LPBYTE)MEMALLOC((dwEMailSize+dwDescriptionSize+32));
- if (lpbData)
- {
- lpbDataCurrent=lpbData;
- SetUL(&lpbDataCurrent,dwStatus);
- SetLPSLowerCase(&lpbDataCurrent,lpszEMail,dwEMailSize);
- SetUL(&lpbDataCurrent,dwIDRequest);
- SetLPS(&lpbDataCurrent,(LPSTR)lpbDescription,dwDescriptionSize);
-
- dwRet=MraSendCMD(MRIM_CS_FILE_TRANSFER_ACK,lpbData,(lpbDataCurrent-lpbData));
- MEMFREE(lpbData);
+// Ответ на отправку файлов
+DWORD CMraProto::MraFileTransferAck(DWORD dwStatus, LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIDRequest, LPBYTE lpbDescription, size_t dwDescriptionSize)
+{
+ DWORD dwRet = 0;
+
+ if (lpszEMail && dwEMailSize>4) {
+ LPBYTE lpbData = (LPBYTE)mir_calloc((dwEMailSize+dwDescriptionSize+32));
+ if (lpbData) {
+ LPBYTE lpbDataCurrent = lpbData;
+ SetUL(&lpbDataCurrent, dwStatus);
+ SetLPSLowerCase(&lpbDataCurrent, lpszEMail, dwEMailSize);
+ SetUL(&lpbDataCurrent, dwIDRequest);
+ SetLPS(&lpbDataCurrent, (LPSTR)lpbDescription, dwDescriptionSize);
+
+ dwRet = MraSendCMD(MRIM_CS_FILE_TRANSFER_ACK, lpbData, (lpbDataCurrent-lpbData));
+ mir_free(lpbData);
}
- }else{
- DebugBreak();
}
-return(dwRet);
+ return dwRet;
}
-
-/*DWORD MraSendCommand_WPRequestA(HANDLE hContact,DWORD dwAckType,DWORD dwRequestFlags,LPSTR lpszUser,SIZE_T dwUserSize,LPSTR lpszDomain,SIZE_T dwDomainSize,LPSTR lpszNickName,SIZE_T dwNickNameSize,LPSTR lpszFirstName,SIZE_T dwFirstNameSize,LPSTR lpszLastName,SIZE_T dwLastNameSize,DWORD dwSex,DWORD dwDate1,DWORD dwDate2,DWORD dwCityID,DWORD dwZodiak,DWORD dwBirthdayMonth,DWORD dwBirthdayDay,DWORD dwCountryID,DWORD dwOnline)
-{// Поиск контакта
- //WCHAR wszUser[MAX_PATH],wszDomain[MAX_PATH];
- WCHAR wszNickName[MAX_PATH],wszFirstName[MAX_PATH],wszLastName[MAX_PATH];
-
- //if (lpszUser && dwUserSize) dwUserSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpszUser,dwUserSize,wszUser,SIZEOF(wszUser));
- //if (lpszDomain && dwDomainSize) dwDomainSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpszDomain,dwDomainSize,wszDomain,SIZEOF(wszDomain));
- if (lpszNickName && dwNickNameSize) dwNickNameSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpszNickName,dwNickNameSize,wszNickName,SIZEOF(wszNickName));
- if (lpszFirstName && dwFirstNameSize) dwFirstNameSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpszFirstName,dwFirstNameSize,wszFirstName,SIZEOF(wszFirstName));
- if (lpszLastName && dwLastNameSize) dwLastNameSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpszLastName,dwLastNameSize,wszLastName,SIZEOF(wszLastName));
-
-return(MraSendCommand_WPRequestW(hContact,dwAckType,dwRequestFlags,lpszUser,dwUserSize,lpszDomain,dwDomainSize,wszNickName,dwNickNameSize,wszFirstName,dwFirstNameSize,wszLastName,dwLastNameSize,dwSex,dwDate1,dwDate2,dwCityID,dwZodiak,dwBirthdayMonth,dwBirthdayDay,dwCountryID,dwOnline));
-}//*/
-
-DWORD MraSendCommand_WPRequestW(HANDLE hContact,DWORD dwAckType,DWORD dwRequestFlags,LPSTR lpszUser,SIZE_T dwUserSize,LPSTR lpszDomain,SIZE_T dwDomainSize,LPWSTR lpwszNickName,SIZE_T dwNickNameSize,LPWSTR lpwszFirstName,SIZE_T dwFirstNameSize,LPWSTR lpwszLastName,SIZE_T dwLastNameSize,DWORD dwSex,DWORD dwDate1,DWORD dwDate2,DWORD dwCityID,DWORD dwZodiak,DWORD dwBirthdayMonth,DWORD dwBirthdayDay,DWORD dwCountryID,DWORD dwOnline)
-{// Поиск контакта
- DWORD dwRet=0;
- LPBYTE lpbData,lpbDataCurrent;
-
- lpbData=(LPBYTE)MEMALLOC(((dwUserSize+dwDomainSize+dwNickNameSize+dwFirstNameSize+dwLastNameSize)*sizeof(WCHAR))+4096);
- if (lpbData)
- {
+// Поиск контакта
+HANDLE CMraProto::MraWPRequestW(HANDLE hContact, DWORD dwAckType, DWORD dwRequestFlags, LPSTR lpszUser, size_t dwUserSize, LPSTR lpszDomain, size_t dwDomainSize, LPCWSTR lpwszNickName, size_t dwNickNameSize, LPCWSTR lpwszFirstName, size_t dwFirstNameSize, LPCWSTR lpwszLastName, size_t dwLastNameSize, DWORD dwSex, DWORD dwDate1, DWORD dwDate2, DWORD dwCityID, DWORD dwZodiak, DWORD dwBirthdayMonth, DWORD dwBirthdayDay, DWORD dwCountryID, DWORD dwOnline)
+{
+ DWORD dwRet = 0;
+ LPBYTE lpbData = (LPBYTE)mir_calloc(((dwUserSize+dwDomainSize+dwNickNameSize+dwFirstNameSize+dwLastNameSize)*sizeof(WCHAR))+4096);
+ if (lpbData) {
CHAR szBuff[MAX_PATH];
- SIZE_T dwBuffSize;
+ size_t dwBuffSize;
- lpbDataCurrent=lpbData;
+ LPBYTE lpbDataCurrent = lpbData;
- if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_USER)) {SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_USER);SetLPSLowerCase(&lpbDataCurrent,lpszUser,dwUserSize);}
- if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_DOMAIN)) {SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_DOMAIN);SetLPSLowerCase(&lpbDataCurrent,lpszDomain,dwDomainSize);}
- if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_NICKNAME)) {SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_NICKNAME);SetLPSW(&lpbDataCurrent,lpwszNickName,dwNickNameSize);}
- if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME)) {SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME);SetLPSW(&lpbDataCurrent,lpwszFirstName,dwFirstNameSize);}
- if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_LASTNAME)) {SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_LASTNAME);SetLPSW(&lpbDataCurrent,lpwszLastName,dwLastNameSize);}
+ if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_USER)) { SetUL(&lpbDataCurrent, MRIM_CS_WP_REQUEST_PARAM_USER);SetLPSLowerCase(&lpbDataCurrent, lpszUser, dwUserSize); }
+ if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_DOMAIN)) { SetUL(&lpbDataCurrent, MRIM_CS_WP_REQUEST_PARAM_DOMAIN);SetLPSLowerCase(&lpbDataCurrent, lpszDomain, dwDomainSize); }
+ if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_NICKNAME)) { SetUL(&lpbDataCurrent, MRIM_CS_WP_REQUEST_PARAM_NICKNAME);SetLPSW(&lpbDataCurrent, lpwszNickName, dwNickNameSize); }
+ if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME)) { SetUL(&lpbDataCurrent, MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME);SetLPSW(&lpbDataCurrent, lpwszFirstName, dwFirstNameSize); }
+ if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_LASTNAME)) { SetUL(&lpbDataCurrent, MRIM_CS_WP_REQUEST_PARAM_LASTNAME);SetLPSW(&lpbDataCurrent, lpwszLastName, dwLastNameSize); }
- if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_SEX))
- {
- dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"%lu",dwSex);
- SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_SEX);
- SetLPS(&lpbDataCurrent,szBuff,dwBuffSize);
+ if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_SEX)) {
+ dwBuffSize = mir_snprintf(szBuff, SIZEOF(szBuff), "%lu", dwSex);
+ SetUL(&lpbDataCurrent, MRIM_CS_WP_REQUEST_PARAM_SEX);
+ SetLPS(&lpbDataCurrent, szBuff, dwBuffSize);
}
- /*if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY))
- {
- dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"%lu",dwSex);
- SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY);
- SetLPS(&lpbDataCurrent,szBuff,dwBuffSize);
- }*/
-
- if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_DATE1))
- {
- dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"%lu",dwDate1);
- SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_DATE1);
- SetLPS(&lpbDataCurrent,szBuff,dwBuffSize);
+ if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_DATE1)) {
+ dwBuffSize = mir_snprintf(szBuff, SIZEOF(szBuff), "%lu", dwDate1);
+ SetUL(&lpbDataCurrent, MRIM_CS_WP_REQUEST_PARAM_DATE1);
+ SetLPS(&lpbDataCurrent, szBuff, dwBuffSize);
}
- if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_DATE2))
- {
- dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"%lu",dwDate2);
- SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_DATE2);
- SetLPS(&lpbDataCurrent,szBuff,dwBuffSize);
+ if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_DATE2)) {
+ dwBuffSize = mir_snprintf(szBuff, SIZEOF(szBuff), "%lu", dwDate2);
+ SetUL(&lpbDataCurrent, MRIM_CS_WP_REQUEST_PARAM_DATE2);
+ SetLPS(&lpbDataCurrent, szBuff, dwBuffSize);
}
- if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_CITY_ID))
- {
- dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"%lu",dwCityID);
- SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_CITY_ID);
- SetLPS(&lpbDataCurrent,szBuff,dwBuffSize);
+ if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_CITY_ID)) {
+ dwBuffSize = mir_snprintf(szBuff, SIZEOF(szBuff), "%lu", dwCityID);
+ SetUL(&lpbDataCurrent, MRIM_CS_WP_REQUEST_PARAM_CITY_ID);
+ SetLPS(&lpbDataCurrent, szBuff, dwBuffSize);
}
- if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_ZODIAC))
- {
- dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"%lu",dwZodiak);
- SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_ZODIAC);
- SetLPS(&lpbDataCurrent,szBuff,dwBuffSize);
+ if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_ZODIAC)) {
+ dwBuffSize = mir_snprintf(szBuff, SIZEOF(szBuff), "%lu", dwZodiak);
+ SetUL(&lpbDataCurrent, MRIM_CS_WP_REQUEST_PARAM_ZODIAC);
+ SetLPS(&lpbDataCurrent, szBuff, dwBuffSize);
}
- if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH))
- {
- dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"%lu",dwBirthdayMonth);
- SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH);
- SetLPS(&lpbDataCurrent,szBuff,dwBuffSize);
+ if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH)) {
+ dwBuffSize = mir_snprintf(szBuff, SIZEOF(szBuff), "%lu", dwBirthdayMonth);
+ SetUL(&lpbDataCurrent, MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH);
+ SetLPS(&lpbDataCurrent, szBuff, dwBuffSize);
}
- if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY))
- {
- dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"%lu",dwBirthdayDay);
- SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY);
- SetLPS(&lpbDataCurrent,szBuff,dwBuffSize);
+ if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY)) {
+ dwBuffSize = mir_snprintf(szBuff, SIZEOF(szBuff), "%lu", dwBirthdayDay);
+ SetUL(&lpbDataCurrent, MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY);
+ SetLPS(&lpbDataCurrent, szBuff, dwBuffSize);
}
- if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID))
- {
- dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"%lu",dwCountryID);
- SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID);
- SetLPS(&lpbDataCurrent,szBuff,dwBuffSize);
+ if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID)) {
+ dwBuffSize = mir_snprintf(szBuff, SIZEOF(szBuff), "%lu", dwCountryID);
+ SetUL(&lpbDataCurrent, MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID);
+ SetLPS(&lpbDataCurrent, szBuff, dwBuffSize);
}
- if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_ONLINE))
- {
- dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"%lu",dwOnline);
- SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_ONLINE);
- SetLPS(&lpbDataCurrent,szBuff,dwBuffSize);
+ if (GetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_ONLINE)) {
+ dwBuffSize = mir_snprintf(szBuff, SIZEOF(szBuff), "%lu", dwOnline);
+ SetUL(&lpbDataCurrent, MRIM_CS_WP_REQUEST_PARAM_ONLINE);
+ SetLPS(&lpbDataCurrent, szBuff, dwBuffSize);
}
- dwRet=MraSendQueueCMD(masMraSettings.hSendQueueHandle,0,hContact,dwAckType,NULL,0,MRIM_CS_WP_REQUEST,lpbData,(lpbDataCurrent-lpbData));
- MEMFREE(lpbData);
+ dwRet = MraSendQueueCMD(hSendQueueHandle, 0, hContact, dwAckType, NULL, 0, MRIM_CS_WP_REQUEST, lpbData, (lpbDataCurrent-lpbData));
+ mir_free(lpbData);
}
-return(dwRet);
+ return (HANDLE)dwRet;
}
-
-DWORD MraSendCommand_WPRequestByEMail(HANDLE hContact,DWORD dwAckType,LPSTR lpszEMail,SIZE_T dwEMailSize)
-{// Поиск контакта по EMail
- DWORD dwRet=0,dwRequestFlags=0;
+// Поиск контакта по EMail
+HANDLE CMraProto::MraWPRequestByEMail(HANDLE hContact, DWORD dwAckType, LPCSTR lpszEMail, size_t dwEMailSize)
+{
+ HANDLE dwRet = 0;
- if (lpszEMail && dwEMailSize>4)
- {
- LPSTR lpszUser,lpszDomain;
- SIZE_T dwUserSize,dwDomainSize;
-
- lpszDomain=(LPSTR)MemoryFindByte(0,lpszEMail,dwEMailSize,'@');
- if (lpszDomain)
- {
- lpszUser=lpszEMail;
- dwUserSize=(lpszDomain-lpszEMail);
+ if (lpszEMail && dwEMailSize>4) {
+ size_t dwUserSize, dwDomainSize;
+ LPSTR lpszDomain = (LPSTR)MemoryFindByte(0, lpszEMail, dwEMailSize, '@');
+ if (lpszDomain) {
+ LPSTR lpszUser = (LPSTR)lpszEMail;
+ dwUserSize = (lpszDomain-lpszEMail);
lpszDomain++;
- dwDomainSize=(dwEMailSize-(dwUserSize+1));
+ dwDomainSize = (dwEMailSize-(dwUserSize+1));
- SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_USER);
- SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_DOMAIN);
+ DWORD dwRequestFlags = 0;
+ SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_USER);
+ SetBit(dwRequestFlags, MRIM_CS_WP_REQUEST_PARAM_DOMAIN);
- dwRet=MraSendCommand_WPRequestW(hContact,dwAckType,dwRequestFlags,lpszUser,dwUserSize,lpszDomain,dwDomainSize,NULL,0,NULL,0,NULL,0,0,0,0,0,0,0,0,0,0);
+ dwRet = MraWPRequestW(hContact, dwAckType, dwRequestFlags, lpszUser, dwUserSize, lpszDomain, dwDomainSize, NULL, 0, NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
}
-return(dwRet);
+ return dwRet;
}
-
-DWORD MraSendCommand_Game(LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwGameSessionID,DWORD dwGameMsg,DWORD dwGameMsgID,LPSTR lpszData,SIZE_T dwDataSize)
-{// Отправка файлов
- DWORD dwRet=0;
-
- if (lpszEMail && dwEMailSize>4)
- {
- LPBYTE lpbData,lpbDataCurrent;
-
- lpbData=(LPBYTE)MEMALLOC((dwEMailSize+(sizeof(DWORD)*4)+dwDataSize+32));
- if (lpbData)
- {
- lpbDataCurrent=lpbData;
- SetLPSLowerCase(&lpbDataCurrent,lpszEMail,dwEMailSize);
- SetUL(&lpbDataCurrent,dwGameSessionID);
- SetUL(&lpbDataCurrent,dwGameMsg);
- SetUL(&lpbDataCurrent,dwGameMsgID);
- SetUL(&lpbDataCurrent,_time32(NULL));
- SetLPS(&lpbDataCurrent,lpszData,dwDataSize);
-
- dwRet=MraSendCMD(MRIM_CS_GAME,lpbData,(lpbDataCurrent-lpbData));
- MEMFREE(lpbData);
+// Отправка файлов
+DWORD CMraProto::MraGame(LPSTR lpszEMail, size_t dwEMailSize, DWORD dwGameSessionID, DWORD dwGameMsg, DWORD dwGameMsgID, LPSTR lpszData, size_t dwDataSize)
+{
+ DWORD dwRet = 0;
+
+ if (lpszEMail && dwEMailSize>4) {
+ LPBYTE lpbData = (LPBYTE)mir_calloc((dwEMailSize+(sizeof(DWORD)*4)+dwDataSize+32));
+ if (lpbData) {
+ LPBYTE lpbDataCurrent = lpbData;
+ SetLPSLowerCase(&lpbDataCurrent, lpszEMail, dwEMailSize);
+ SetUL(&lpbDataCurrent, dwGameSessionID);
+ SetUL(&lpbDataCurrent, dwGameMsg);
+ SetUL(&lpbDataCurrent, dwGameMsgID);
+ SetUL(&lpbDataCurrent, _time32(NULL));
+ SetLPS(&lpbDataCurrent, lpszData, dwDataSize);
+
+ dwRet = MraSendCMD(MRIM_CS_GAME, lpbData, (lpbDataCurrent-lpbData));
+ mir_free(lpbData);
}
- }else{
- DebugBreak();
}
-return(dwRet);
+ return dwRet;
}
-
-DWORD MraSendCommand_Login2W(LPSTR lpszLogin,SIZE_T dwLoginSize,LPSTR lpszPassword,SIZE_T dwPasswordSize,DWORD dwStatus,LPSTR lpszStatusUri,SIZE_T dwStatusUriSize,LPWSTR lpwszStatusTitle,SIZE_T dwStatusTitleSize,LPWSTR lpwszStatusDesc,SIZE_T dwStatusDescSize,DWORD dwFutureFlags,LPSTR lpszUserAgentFormated,SIZE_T dwUserAgentFormatedSize,LPSTR lpszUserAgent,SIZE_T dwUserAgentSize)
-{// Авторизация
- DWORD dwRet=0;
- LPBYTE lpbData,lpbDataCurrent;
-
- if (dwStatusUriSize>SPEC_STATUS_URI_MAX) dwStatusUriSize=SPEC_STATUS_URI_MAX;
- if (dwStatusTitleSize>STATUS_TITLE_MAX) dwStatusTitleSize=STATUS_TITLE_MAX;
- if (dwStatusDescSize>STATUS_DESC_MAX) dwStatusDescSize=STATUS_DESC_MAX;
- if (dwUserAgentFormatedSize>USER_AGENT_MAX) dwUserAgentFormatedSize=USER_AGENT_MAX;
- if (dwUserAgentSize>MAX_CLIENT_DESCRIPTION) dwUserAgentSize=MAX_CLIENT_DESCRIPTION;
-
- lpbData=(LPBYTE)MEMALLOC((dwLoginSize+dwPasswordSize+sizeof(DWORD)+dwStatusUriSize+(dwStatusTitleSize*sizeof(WCHAR))+(dwStatusDescSize*sizeof(WCHAR))+2+sizeof(DWORD)+(sizeof(DWORD)*2)+dwUserAgentFormatedSize+dwUserAgentSize+32));
- if (lpbData)
- {
- lpbDataCurrent=lpbData;
- SetLPS(&lpbDataCurrent,lpszLogin,dwLoginSize);
- SetLPS(&lpbDataCurrent,lpszPassword,dwPasswordSize);
- SetUL(&lpbDataCurrent,dwStatus);
- SetLPS(&lpbDataCurrent,lpszStatusUri,dwStatusUriSize);
- SetLPSW(&lpbDataCurrent,lpwszStatusTitle,dwStatusTitleSize);
- SetLPSW(&lpbDataCurrent,lpwszStatusDesc,dwStatusDescSize);
- SetUL(&lpbDataCurrent,dwFutureFlags);
- SetLPS(&lpbDataCurrent,lpszUserAgentFormated,dwUserAgentFormatedSize);
- SetLPS(&lpbDataCurrent,"ru",2);
- SetLPS(&lpbDataCurrent,NULL,0);
- SetLPS(&lpbDataCurrent,NULL,0);
- SetLPS(&lpbDataCurrent,lpszUserAgent,dwUserAgentSize);// LPS client description /max 256
-
- dwRet=MraSendCMD(MRIM_CS_LOGIN2,lpbData,(lpbDataCurrent-lpbData));
- MEMFREE(lpbData);
+// Авторизация
+DWORD CMraProto::MraLogin2W(LPSTR lpszLogin, size_t dwLoginSize, LPSTR lpszPassword, size_t dwPasswordSize, DWORD dwStatus, LPSTR lpszStatusUri, size_t dwStatusUriSize, LPWSTR lpwszStatusTitle, size_t dwStatusTitleSize, LPWSTR lpwszStatusDesc, size_t dwStatusDescSize, DWORD dwFutureFlags, LPSTR lpszUserAgentFormated, size_t dwUserAgentFormatedSize, LPSTR lpszUserAgent, size_t dwUserAgentSize)
+{
+ DWORD dwRet = 0;
+
+ if (dwStatusUriSize>SPEC_STATUS_URI_MAX) dwStatusUriSize = SPEC_STATUS_URI_MAX;
+ if (dwStatusTitleSize>STATUS_TITLE_MAX) dwStatusTitleSize = STATUS_TITLE_MAX;
+ if (dwStatusDescSize>STATUS_DESC_MAX) dwStatusDescSize = STATUS_DESC_MAX;
+ if (dwUserAgentFormatedSize>USER_AGENT_MAX) dwUserAgentFormatedSize = USER_AGENT_MAX;
+ if (dwUserAgentSize>MAX_CLIENT_DESCRIPTION) dwUserAgentSize = MAX_CLIENT_DESCRIPTION;
+
+ LPBYTE lpbData = (LPBYTE)mir_calloc((dwLoginSize+dwPasswordSize+sizeof(DWORD)+dwStatusUriSize+(dwStatusTitleSize*sizeof(WCHAR))+(dwStatusDescSize*sizeof(WCHAR))+2+sizeof(DWORD)+(sizeof(DWORD)*2)+dwUserAgentFormatedSize+dwUserAgentSize+32));
+ if (lpbData) {
+ LPBYTE lpbDataCurrent = lpbData;
+ SetLPS(&lpbDataCurrent, lpszLogin, dwLoginSize);
+ SetLPS(&lpbDataCurrent, lpszPassword, dwPasswordSize);
+ SetUL(&lpbDataCurrent, dwStatus);
+ SetLPS(&lpbDataCurrent, lpszStatusUri, dwStatusUriSize);
+ SetLPSW(&lpbDataCurrent, lpwszStatusTitle, dwStatusTitleSize);
+ SetLPSW(&lpbDataCurrent, lpwszStatusDesc, dwStatusDescSize);
+ SetUL(&lpbDataCurrent, dwFutureFlags);
+ SetLPS(&lpbDataCurrent, lpszUserAgentFormated, dwUserAgentFormatedSize);
+ SetLPS(&lpbDataCurrent, "ru", 2);
+ SetLPS(&lpbDataCurrent, NULL, 0);
+ SetLPS(&lpbDataCurrent, NULL, 0);
+ SetLPS(&lpbDataCurrent, lpszUserAgent, dwUserAgentSize);// LPS client description /max 256
+
+ dwRet = MraSendCMD(MRIM_CS_LOGIN2, lpbData, (lpbDataCurrent-lpbData));
+ mir_free(lpbData);
}
-return(dwRet);
+ return dwRet;
}
-
-DWORD MraSendCommand_SMSW(HANDLE hContact,LPSTR lpszPhone,SIZE_T dwPhoneSize,LPWSTR lpwszMessage,SIZE_T dwMessageSize)
-{// Отправка SMS
- DWORD dwRet=0;
- LPBYTE lpbData,lpbDataCurrent,lpbDataQueue;
- LPSTR lpszPhoneLocal;
-
- lpbData=(LPBYTE)MEMALLOC((dwPhoneSize+(dwMessageSize*sizeof(WCHAR))+32));
- lpbDataQueue=(LPBYTE)MEMALLOC((dwPhoneSize+(dwMessageSize*sizeof(WCHAR))+32));
- lpszPhoneLocal=(LPSTR)MEMALLOC((dwPhoneSize+32));
- if (lpbData && lpbDataQueue && lpszPhoneLocal)
- {
- lpszPhoneLocal[0]='+';
- dwPhoneSize=1+CopyNumber((lpszPhoneLocal+1),lpszPhone,dwPhoneSize);
-
- lpbDataCurrent=lpbData;
- SetUL(&lpbDataCurrent,0);
- SetLPS(&lpbDataCurrent,lpszPhoneLocal,dwPhoneSize);
- SetLPSW(&lpbDataCurrent,lpwszMessage,dwMessageSize);
-
- (*(DWORD*)lpbDataQueue)=dwPhoneSize;
- memmove((lpbDataQueue+sizeof(DWORD)),lpszPhoneLocal,(dwPhoneSize+1));
- memmove((lpbDataQueue+sizeof(DWORD)+dwPhoneSize+1),lpwszMessage,((dwMessageSize*sizeof(WCHAR))+1));
-
- dwRet=MraSendQueueCMD(masMraSettings.hSendQueueHandle,0,hContact,ICQACKTYPE_SMS,lpbDataQueue,(dwPhoneSize+(dwMessageSize*sizeof(WCHAR))+sizeof(DWORD)+2),MRIM_CS_SMS,lpbData,(lpbDataCurrent-lpbData));
- MEMFREE(lpbData);
- MEMFREE(lpszPhoneLocal);
- }else{
- MEMFREE(lpbData);
- MEMFREE(lpbDataQueue);
- MEMFREE(lpszPhoneLocal);
+// Отправка SMS
+DWORD CMraProto::MraSMSW(HANDLE hContact, LPSTR lpszPhone, size_t dwPhoneSize, LPWSTR lpwszMessage, size_t dwMessageSize)
+{
+ DWORD dwRet = 0;
+ LPBYTE lpbData = (LPBYTE)mir_calloc((dwPhoneSize+(dwMessageSize*sizeof(WCHAR))+32));
+ LPBYTE lpbDataQueue = (LPBYTE)mir_calloc((dwPhoneSize+(dwMessageSize*sizeof(WCHAR))+32));
+ LPSTR lpszPhoneLocal = (LPSTR)mir_calloc((dwPhoneSize+32));
+ if (lpbData && lpbDataQueue && lpszPhoneLocal) {
+ lpszPhoneLocal[0] = '+';
+ dwPhoneSize = 1+CopyNumber((lpszPhoneLocal+1), lpszPhone, dwPhoneSize);
+
+ LPBYTE lpbDataCurrent = lpbData;
+ SetUL(&lpbDataCurrent, 0);
+ SetLPS(&lpbDataCurrent, lpszPhoneLocal, dwPhoneSize);
+ SetLPSW(&lpbDataCurrent, lpwszMessage, dwMessageSize);
+
+ (*(DWORD*)lpbDataQueue) = dwPhoneSize;
+ memmove((lpbDataQueue+sizeof(DWORD)), lpszPhoneLocal, (dwPhoneSize+1));
+ memmove((lpbDataQueue+sizeof(DWORD)+dwPhoneSize+1), lpwszMessage, ((dwMessageSize*sizeof(WCHAR))+1));
+
+ dwRet = MraSendQueueCMD(hSendQueueHandle, 0, hContact, ICQACKTYPE_SMS, lpbDataQueue, (dwPhoneSize+(dwMessageSize*sizeof(WCHAR))+sizeof(DWORD)+2), MRIM_CS_SMS, lpbData, (lpbDataCurrent-lpbData));
+ mir_free(lpbData);
+ mir_free(lpszPhoneLocal);
}
-return(dwRet);
-}
-
-
-
-DWORD MraSendCommand_Proxy(LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwIDRequest,DWORD dwDataType,LPSTR lpszData,SIZE_T dwDataSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize,MRA_GUID mguidSessionID)
-{// Соединение с прокси
- DWORD dwRet=0;
-
- if (lpszEMail && dwEMailSize>4)
- {
- LPBYTE lpbData,lpbDataCurrent;
-
- lpbData=(LPBYTE)MEMALLOC((dwEMailSize+(sizeof(DWORD)*2)+dwDataSize+dwAddresesSize+sizeof(MRA_GUID)+32));
- if (lpbData)
- {
- lpbDataCurrent=lpbData;
- SetLPSLowerCase(&lpbDataCurrent,lpszEMail,dwEMailSize);
- SetUL(&lpbDataCurrent,dwIDRequest);
- SetUL(&lpbDataCurrent,dwDataType);
- SetLPS(&lpbDataCurrent,lpszData,dwDataSize);
- SetLPS(&lpbDataCurrent,lpszAddreses,dwAddresesSize);
- SetGUID(&lpbDataCurrent,mguidSessionID);
-
- dwRet=MraSendCMD(MRIM_CS_PROXY,lpbData,(lpbDataCurrent-lpbData));
- MEMFREE(lpbData);
- }
- }else{
- DebugBreak();
+ else {
+ mir_free(lpbData);
+ mir_free(lpbDataQueue);
+ mir_free(lpszPhoneLocal);
}
-return(dwRet);
+ return dwRet;
}
-
-DWORD MraSendCommand_ProxyAck(DWORD dwStatus,LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwIDRequest,DWORD dwDataType,LPSTR lpszData,SIZE_T dwDataSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize,MRA_GUID mguidSessionID)
-{// Ответ на соединение с прокси
- DWORD dwRet=0;
-
- if (lpszEMail && dwEMailSize>4)
- {
- LPBYTE lpbData,lpbDataCurrent;
-
- lpbData=(LPBYTE)MEMALLOC((dwEMailSize+(sizeof(DWORD)*3)+dwDataSize+dwAddresesSize+sizeof(MRA_GUID)+32));
- if (lpbData)
- {
- lpbDataCurrent=lpbData;
- SetUL(&lpbDataCurrent,dwStatus);
- SetLPSLowerCase(&lpbDataCurrent,lpszEMail,dwEMailSize);
- SetUL(&lpbDataCurrent,dwIDRequest);
- SetUL(&lpbDataCurrent,dwDataType);
- SetLPS(&lpbDataCurrent,lpszData,dwDataSize);
- SetLPS(&lpbDataCurrent,lpszAddreses,dwAddresesSize);
- SetGUID(&lpbDataCurrent,mguidSessionID);
-
- dwRet=MraSendCMD(MRIM_CS_PROXY_ACK,lpbData,(lpbDataCurrent-lpbData));
- MEMFREE(lpbData);
+// Соединение с прокси
+DWORD CMraProto::MraProxy(LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIDRequest, DWORD dwDataType, LPSTR lpszData, size_t dwDataSize, LPSTR lpszAddreses, size_t dwAddresesSize, MRA_GUID mguidSessionID)
+{
+ DWORD dwRet = 0;
+
+ if (lpszEMail && dwEMailSize>4) {
+ LPBYTE lpbData = (LPBYTE)mir_calloc((dwEMailSize+(sizeof(DWORD)*2)+dwDataSize+dwAddresesSize+sizeof(MRA_GUID)+32));
+ if (lpbData) {
+ LPBYTE lpbDataCurrent = lpbData;
+ SetLPSLowerCase(&lpbDataCurrent, lpszEMail, dwEMailSize);
+ SetUL(&lpbDataCurrent, dwIDRequest);
+ SetUL(&lpbDataCurrent, dwDataType);
+ SetLPS(&lpbDataCurrent, lpszData, dwDataSize);
+ SetLPS(&lpbDataCurrent, lpszAddreses, dwAddresesSize);
+ SetGUID(&lpbDataCurrent, mguidSessionID);
+
+ dwRet = MraSendCMD(MRIM_CS_PROXY, lpbData, (lpbDataCurrent-lpbData));
+ mir_free(lpbData);
}
- }else{
- DebugBreak();
}
-return(dwRet);
+ return dwRet;
}
-
-DWORD MraSendCommand_ChangeUserBlogStatus(DWORD dwFlags,LPWSTR lpwszText,SIZE_T dwTextSize,DWORDLONG dwBlogStatusID)
-{// Отправка сообщения в микроблог
- DWORD dwRet=0;
- LPBYTE lpbData,lpbDataCurrent;
-
- if (dwTextSize>MICBLOG_STATUS_MAX) dwTextSize=MICBLOG_STATUS_MAX;
-
- lpbData=(LPBYTE)MEMALLOC((sizeof(DWORD)+(dwTextSize*sizeof(WCHAR))+sizeof(DWORDLONG)+32));
- if (lpbData)
- {
- lpbDataCurrent=lpbData;
- SetUL(&lpbDataCurrent,dwFlags);
- SetLPSW(&lpbDataCurrent,lpwszText,dwTextSize);
- SetUIDL(&lpbDataCurrent,dwBlogStatusID);
-
- dwRet=MraSendCMD(MRIM_CS_CHANGE_USER_BLOG_STATUS,lpbData,(lpbDataCurrent-lpbData));
- MEMFREE(lpbData);
- }
-
-return(dwRet);
-}
-
-
-void SetUL(LPBYTE *plpBuff,DWORD dwData)
+// Ответ на соединение с прокси
+DWORD CMraProto::MraProxyAck(DWORD dwStatus, LPSTR lpszEMail, size_t dwEMailSize, DWORD dwIDRequest, DWORD dwDataType, LPSTR lpszData, size_t dwDataSize, LPSTR lpszAddreses, size_t dwAddresesSize, MRA_GUID mguidSessionID)
{
- (*(DWORD*)(*plpBuff))=dwData;
- (*plpBuff)+=sizeof(DWORD);
-}
-
-
-void SetUIDL(LPBYTE *plpBuff,DWORDLONG dwData)
-{
- (*(DWORDLONG*)(*plpBuff))=dwData;
- (*plpBuff)+=sizeof(DWORDLONG);
-}
-
-
-void SetGUID(LPBYTE *plpBuff,MRA_GUID guidData)
-{
- (*(MRA_GUID*)(*plpBuff))=guidData;
- (*plpBuff)+=sizeof(MRA_GUID);
-}
-
-
-void SetLPS(LPBYTE *plpBuff,LPSTR lpszData,DWORD dwSize)
-{
- (*(DWORD*)(*plpBuff))=dwSize;
- (*plpBuff)+=sizeof(DWORD);
- memmove((*plpBuff),lpszData,dwSize);
- (*plpBuff)+=dwSize;
-}
-
-
-void SetLPSW(LPBYTE *plpBuff,LPWSTR lpwszData,DWORD dwSize)
-{
- dwSize*=sizeof(WCHAR);
- (*(DWORD*)(*plpBuff))=dwSize;
- (*plpBuff)+=sizeof(DWORD);
- memmove((*plpBuff),lpwszData,dwSize);
- (*plpBuff)+=dwSize;
-}
-
-
-void SetLPSWtoA(LPBYTE *plpBuff,LPWSTR lpwszData,DWORD dwSize)
-{
- dwSize=WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszData,dwSize,(LPSTR)((*plpBuff)+sizeof(DWORD)),(dwSize*sizeof(WCHAR)),NULL,NULL);
- (*(DWORD*)(*plpBuff))=dwSize;
- (*plpBuff)+=(sizeof(DWORD)+dwSize);
+ DWORD dwRet = 0;
+
+ if (lpszEMail && dwEMailSize>4) {
+ LPBYTE lpbData = (LPBYTE)mir_calloc((dwEMailSize+(sizeof(DWORD)*3)+dwDataSize+dwAddresesSize+sizeof(MRA_GUID)+32));
+ if (lpbData) {
+ LPBYTE lpbDataCurrent = lpbData;
+ SetUL(&lpbDataCurrent, dwStatus);
+ SetLPSLowerCase(&lpbDataCurrent, lpszEMail, dwEMailSize);
+ SetUL(&lpbDataCurrent, dwIDRequest);
+ SetUL(&lpbDataCurrent, dwDataType);
+ SetLPS(&lpbDataCurrent, lpszData, dwDataSize);
+ SetLPS(&lpbDataCurrent, lpszAddreses, dwAddresesSize);
+ SetGUID(&lpbDataCurrent, mguidSessionID);
+
+ dwRet = MraSendCMD(MRIM_CS_PROXY_ACK, lpbData, (lpbDataCurrent-lpbData));
+ mir_free(lpbData);
+ }
+ }
+ return dwRet;
}
-
-
-void SetLPSLowerCase(LPBYTE *plpBuff,LPSTR lpszData,DWORD dwSize)
+// Отправка сообщения в микроблог
+DWORD CMraProto::MraChangeUserBlogStatus(DWORD dwFlags, LPWSTR lpwszText, size_t dwTextSize, DWORDLONG dwBlogStatusID)
{
- (*(DWORD*)(*plpBuff))=dwSize;
- (*plpBuff)+=sizeof(DWORD);
- BuffToLowerCase((*plpBuff),lpszData,dwSize);
- (*plpBuff)+=dwSize;
-}
-
+ DWORD dwRet = 0;
+ if (dwTextSize > MICBLOG_STATUS_MAX)
+ dwTextSize = MICBLOG_STATUS_MAX;
+
+ LPBYTE lpbData = (LPBYTE)mir_calloc((sizeof(DWORD)+(dwTextSize*sizeof(WCHAR))+sizeof(DWORDLONG)+32));
+ if (lpbData) {
+ LPBYTE lpbDataCurrent = lpbData;
+ SetUL(&lpbDataCurrent, dwFlags);
+ SetLPSW(&lpbDataCurrent, lpwszText, dwTextSize);
+ SetUIDL(&lpbDataCurrent, dwBlogStatusID);
+
+ dwRet = MraSendCMD(MRIM_CS_CHANGE_USER_BLOG_STATUS, lpbData, (lpbDataCurrent-lpbData));
+ mir_free(lpbData);
+ }
-void SetLPSLowerCaseW(LPBYTE *plpBuff,LPWSTR lpwszData,DWORD dwSize)
-{
- dwSize*=sizeof(WCHAR);
- (*(DWORD*)(*plpBuff))=dwSize;
- (*plpBuff)+=sizeof(DWORD);
- memmove((*plpBuff),lpwszData,dwSize);
- CharLowerBuff((LPWSTR)(*plpBuff),(dwSize/sizeof(WCHAR)));
- (*plpBuff)+=dwSize;
+ return dwRet;
}
-
-DWORD MraSendPacket(HANDLE hConnection,DWORD dwCMDNum,DWORD dwType,LPVOID lpData,SIZE_T dwDataSize)
+DWORD CMraProto::MraSendPacket(HANDLE hConnection, DWORD dwCMDNum, DWORD dwType, LPVOID lpData, size_t dwDataSize)
{
DWORD dwRet;
- LPBYTE lpbData;
- mrim_packet_header_t *pmaHeader;
-
- lpbData=(LPBYTE)MEMALLOC((dwDataSize+sizeof(mrim_packet_header_t)));
- if (lpbData)
- {
- pmaHeader=(mrim_packet_header_t*)lpbData;
- pmaHeader->magic=CS_MAGIC;
- pmaHeader->proto=PROTO_VERSION;// Версия протокола
- pmaHeader->seq=dwCMDNum;// Sequence
- pmaHeader->msg=dwType;// Тип пакета
- pmaHeader->dlen=dwDataSize;// Длина данных
- //bzero(&maHeader->reserved[0],24);// Зарезервировано
-
- memmove((lpbData+sizeof(mrim_packet_header_t)),lpData,dwDataSize);
- dwRet=Netlib_Send(hConnection,(LPSTR)lpbData,(dwDataSize+sizeof(mrim_packet_header_t)),0);
-
- /*if (dwType==MRIM_CS_ADD_CONTACT)
- {
- {
- char sztm[100];
-
- SHA1GetStringDigestA((LPSTR)lpbData,(dwDataSize+sizeof(mrim_packet_header_t)),sztm);
- OutputDebugStringA((sztm));
- OutputDebugStringA("\r\n");
- }
-
- {
- DWORD dwTemp;
- HANDLE hFile=CreateFileW(L"C:\\Documents and Settings\\rozhuk_im\\Рабочий стол\\AddContact.txt",GENERIC_WRITE,FILE_SHARE_READ,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
-
- if (hFile!=INVALID_HANDLE_VALUE)
- {
- WriteFile(hFile,lpbData,(dwDataSize+sizeof(mrim_packet_header_t)),&dwTemp,NULL);
- CloseHandle(hFile);
- }
- }
- }//*/
- MEMFREE(lpbData);
+ LPBYTE lpbData = (LPBYTE)mir_calloc((dwDataSize+sizeof(mrim_packet_header_t)));
+ if (lpbData) {
+ mrim_packet_header_t *pmaHeader = (mrim_packet_header_t*)lpbData;
+ pmaHeader->magic = CS_MAGIC;
+ pmaHeader->proto = (PROTO_VERSION_MAJOR<<16) + PROTO_VERSION_MINOR; // Версия протокола
+ pmaHeader->seq = dwCMDNum;// Sequence
+ pmaHeader->msg = dwType;// Тип пакета
+ pmaHeader->dlen = dwDataSize;// Длина данных
+
+ memmove((lpbData+sizeof(mrim_packet_header_t)), lpData, dwDataSize);
+ dwRet = Netlib_Send(hConnection, (LPSTR)lpbData, (dwDataSize+sizeof(mrim_packet_header_t)), 0);
+ mir_free(lpbData);
}
-return(dwRet);
+ return dwRet;
}
-
-DWORD MraSendCMD(DWORD dwType,LPVOID lpData,SIZE_T dwDataSize)
+DWORD CMraProto::MraSendCMD(DWORD dwType, LPVOID lpData, size_t dwDataSize)
{
- DWORD dwRet;
+ DWORD dwRet = InterlockedIncrement((LONG volatile*)&dwCMDNum);
- dwRet=InterlockedIncrement((LONG volatile*)&masMraSettings.dwCMDNum);
- EnterCriticalSection(&masMraSettings.csCriticalSectionSend);// guarding winsock internal buffers
- if (MraSendPacket(masMraSettings.hConnection,dwRet,dwType,lpData,dwDataSize)==0)
- {// err on send
- dwRet=0;
- }
- LeaveCriticalSection(&masMraSettings.csCriticalSectionSend);
-return(dwRet);
+ mir_cslock l(csCriticalSectionSend); // guarding winsock internal buffers
+ return !MraSendPacket(hConnection, dwRet, dwType, lpData, dwDataSize) ? 0 : dwRet;
}
-DWORD MraSendQueueCMD(HANDLE hSendQueueHandle,DWORD dwFlags,HANDLE hContact,DWORD dwAckType,LPBYTE lpbDataQueue,SIZE_T dwDataQueueSize,DWORD dwType,LPVOID lpData,SIZE_T dwDataSize)
+DWORD CMraProto::MraSendQueueCMD(HANDLE hSendQueueHandle, DWORD dwFlags, HANDLE hContact, DWORD dwAckType, LPBYTE lpbDataQueue, size_t dwDataQueueSize, DWORD dwType, LPVOID lpData, size_t dwDataSize)
{
- DWORD dwRet;
-
- dwRet=InterlockedIncrement((LONG volatile*)&masMraSettings.dwCMDNum);
- if (MraSendQueueAdd(hSendQueueHandle,dwRet,dwFlags,hContact,dwAckType,lpbDataQueue,dwDataQueueSize)==NO_ERROR)
- {
- EnterCriticalSection(&masMraSettings.csCriticalSectionSend);// guarding winsock internal buffers
- if (MraSendPacket(masMraSettings.hConnection,dwRet,dwType,lpData,dwDataSize)==0)
- {
- MraSendQueueFree(hSendQueueHandle,dwRet);
- dwRet=0;
+ DWORD dwRet = InterlockedIncrement((LONG volatile*)&dwCMDNum);
+ if ( !MraSendQueueAdd(hSendQueueHandle, dwRet, dwFlags, hContact, dwAckType, lpbDataQueue, dwDataQueueSize)) {
+ mir_cslock l(csCriticalSectionSend); // guarding winsock internal buffers
+ if ( !MraSendPacket(hConnection, dwRet, dwType, lpData, dwDataSize)) {
+ MraSendQueueFree(hSendQueueHandle, dwRet);
+ dwRet = 0;
}
- LeaveCriticalSection(&masMraSettings.csCriticalSectionSend);
}
-return(dwRet);
+ return dwRet;
}
-
-
-
diff --git a/protocols/MRA/MraSendCommand.h b/protocols/MRA/MraSendCommand.h
index a32519b799..dd1eb9a2b0 100644
--- a/protocols/MRA/MraSendCommand.h
+++ b/protocols/MRA/MraSendCommand.h
@@ -7,30 +7,4 @@
#endif // _MSC_VER > 1000
-DWORD MraSendCommand_MessageW (BOOL bAddToQueue,HANDLE hContact,DWORD dwAckType,DWORD dwFlags,LPSTR lpszEMail,SIZE_T dwEMailSize,LPWSTR lpwszMessage,SIZE_T dwMessageSize,LPBYTE lpbMultiChatData,SIZE_T dwMultiChatDataSize);
-DWORD MraSendCommand_MessageAskW (DWORD dwMsgID,DWORD dwFlags,LPSTR lpszEMail,SIZE_T dwEMailSize,LPWSTR lpwszMessage,SIZE_T dwMessageSize,LPSTR lpwszMessageRTF,SIZE_T dwMessageRTFSize);
-DWORD MraSendCommand_MessageRecv (LPSTR lpszFrom,SIZE_T dwFromSize,DWORD dwMsgID);
-DWORD MraSendCommand_AddContactW (HANDLE hContact,DWORD dwContactFlag,DWORD dwGroupID,LPSTR lpszEMail,SIZE_T dwEMailSize,LPWSTR lpwszCustomName,SIZE_T dwCustomNameSize,LPSTR lpszPhones,SIZE_T dwPhonesSize,LPWSTR lpwszAuthMessage,SIZE_T dwAuthMessageSize,DWORD dwActions);
-DWORD MraSendCommand_ModifyContactW (HANDLE hContact,DWORD dwID,DWORD dwContactFlag,DWORD dwGroupID,LPSTR lpszEMail,SIZE_T dwEMailSize,LPWSTR lpwszCustomName,SIZE_T dwCustomNameSize,LPSTR lpszPhones,SIZE_T dwPhonesSize);
-DWORD MraSendCommand_OfflineMessageDel(DWORDLONG dwMsgUIDL);
-DWORD MraSendCommand_Authorize (LPSTR lpszEMail,SIZE_T dwEMailSize);
-DWORD MraSendCommand_ChangeStatusW (DWORD dwStatus,LPSTR lpszStatusUri,SIZE_T dwStatusUriSize,LPWSTR lpwszStatusTitle,SIZE_T dwStatusTitleSize,LPWSTR lpwszStatusDesc,SIZE_T dwStatusDescSize,DWORD dwFutureFlags);
-DWORD MraSendCommand_FileTransfer (LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwIdRequest,DWORD dwFilesTotalSize,LPWSTR lpwszFiles,SIZE_T dwFilesSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize);
-DWORD MraSendCommand_FileTransferAck (DWORD dwStatus,LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwIdRequest,LPBYTE lpbDescription,SIZE_T dwDescriptionSize);
-DWORD MraSendCommand_WPRequestW (HANDLE hContact,DWORD dwAckType,DWORD dwRequestFlags,LPSTR lpszUser,SIZE_T dwUserSize,LPSTR lpszDomain,SIZE_T dwDomainSize,LPWSTR lpwszNickName,SIZE_T dwNickNameSize,LPWSTR lpwszFirstName,SIZE_T dwFirstNameSize,LPWSTR lpwszLastName,SIZE_T dwLastNameSize,DWORD dwSex,DWORD dwDate1,DWORD dwDate2,DWORD dwCityID,DWORD dwZodiak,DWORD dwBirthdayMonth,DWORD dwBirthdayDay,DWORD dwCountryID,DWORD dwOnline);
-DWORD MraSendCommand_WPRequestA (HANDLE hContact,DWORD dwAckType,DWORD dwRequestFlags,LPSTR lpszUser,SIZE_T dwUserSize,LPSTR lpszDomain,SIZE_T dwDomainSize,LPSTR lpszNickName,SIZE_T dwNickNameSize,LPSTR lpszFirstName,SIZE_T dwFirstNameSize,LPSTR lpszLastName,SIZE_T dwLastNameSize,DWORD dwSex,DWORD dwDate1,DWORD dwDate2,DWORD dwCityID,DWORD dwZodiak,DWORD dwBirthdayMonth,DWORD dwBirthdayDay,DWORD dwCountryID,DWORD dwOnline);
-DWORD MraSendCommand_WPRequestByEMail (HANDLE hContact,DWORD dwAckType,LPSTR lpszEMail,SIZE_T dwEMailSize);
-DWORD MraSendCommand_Game (LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwGameSessionID,DWORD dwGameMsg,DWORD dwGameMsgID,LPSTR lpszData,SIZE_T dwDataSize);
-DWORD MraSendCommand_Login2W (LPSTR lpszLogin,SIZE_T dwLoginSize,LPSTR lpszPassword,SIZE_T dwPasswordSize,DWORD dwStatus,LPSTR lpszStatusUri,SIZE_T dwStatusUriSize,LPWSTR lpwszStatusTitle,SIZE_T dwStatusTitleSize,LPWSTR lpwszStatusDesc,SIZE_T dwStatusDescSize,DWORD dwFutureFlags,LPSTR lpszUserAgentFormated,SIZE_T dwUserAgentFormatedSize,LPSTR lpszUserAgent,SIZE_T dwUserAgentSize);
-DWORD MraSendCommand_SMSW (HANDLE hContact,LPSTR lpszPhone,SIZE_T dwPhoneSize,LPWSTR lpwszMessage,SIZE_T dwMessageSize);
-DWORD MraSendCommand_Proxy (LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwIDRequest,DWORD dwDataType,LPSTR lpszData,SIZE_T dwDataSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize,MRA_GUID mguidSessionID);
-DWORD MraSendCommand_ProxyAck (DWORD dwStatus,LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwIDRequest,DWORD dwDataType,LPSTR lpszData,SIZE_T dwDataSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize,MRA_GUID mguidSessionID);
-DWORD MraSendCommand_ChangeUserBlogStatus(DWORD dwFlags,LPWSTR lpwszText,SIZE_T dwTextSize,DWORDLONG dwBlogStatusID);
-
-DWORD MraSendPacket (HANDLE hConnection,DWORD dwCMDNum,DWORD dwType,LPVOID lpData,SIZE_T dwDataSize);
-DWORD MraSendCMD (DWORD dwType,LPVOID lpData,SIZE_T dwDataSize);
-DWORD MraSendQueueCMD (HANDLE hSendQueueHandle,DWORD dwFlags,HANDLE hContact,DWORD dwAckType,LPBYTE lpbDataQueue,SIZE_T dwDataQueueSize,DWORD dwType,LPVOID lpData,SIZE_T dwDataSize);
-
-
-
#endif // !defined(AFX_MRA_SENDCOMMAND_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraSendQueue.cpp b/protocols/MRA/MraSendQueue.cpp
index de68943569..a4f0891ccb 100644
--- a/protocols/MRA/MraSendQueue.cpp
+++ b/protocols/MRA/MraSendQueue.cpp
@@ -22,7 +22,7 @@ typedef struct
HANDLE hContact;
DWORD dwAckType;
LPBYTE lpbData;
- SIZE_T dwDataSize;
+ size_t dwDataSize;
} MRA_SEND_QUEUE_ITEM;
@@ -32,7 +32,7 @@ typedef struct
-DWORD MraSendQueueInitialize(DWORD dwSendTimeOutInterval,HANDLE *phSendQueueHandle)
+DWORD MraSendQueueInitialize(DWORD dwSendTimeOutInterval, HANDLE *phSendQueueHandle)
{
DWORD dwRetErrorCode;
@@ -40,20 +40,20 @@ DWORD MraSendQueueInitialize(DWORD dwSendTimeOutInterval,HANDLE *phSendQueueHand
{
MRA_SEND_QUEUE *pmrasqSendQueue;
- pmrasqSendQueue=(MRA_SEND_QUEUE*)MEMALLOC(sizeof(MRA_SEND_QUEUE));
+ pmrasqSendQueue = (MRA_SEND_QUEUE*)mir_calloc(sizeof(MRA_SEND_QUEUE));
if (pmrasqSendQueue)
{
- dwRetErrorCode=ListMTInitialize(&pmrasqSendQueue->lmtListMT,0);
- if (dwRetErrorCode==NO_ERROR)
+ dwRetErrorCode = ListMTInitialize(&pmrasqSendQueue->lmtListMT, 0);
+ if (dwRetErrorCode == NO_ERROR)
{
- pmrasqSendQueue->dwSendTimeOutInterval=dwSendTimeOutInterval;
- (*phSendQueueHandle)=(HANDLE)pmrasqSendQueue;
+ pmrasqSendQueue->dwSendTimeOutInterval = dwSendTimeOutInterval;
+ (*phSendQueueHandle) = (HANDLE)pmrasqSendQueue;
}
- }else{
- dwRetErrorCode=GetLastError();
+ }else {
+ dwRetErrorCode = GetLastError();
}
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }else {
+ dwRetErrorCode = ERROR_INVALID_HANDLE;
}
return(dwRetErrorCode);
}
@@ -63,161 +63,161 @@ void MraSendQueueDestroy(HANDLE hSendQueueHandle)
{
if (hSendQueueHandle)
{
- MRA_SEND_QUEUE *pmrasqSendQueue=(MRA_SEND_QUEUE*)hSendQueueHandle;
+ MRA_SEND_QUEUE *pmrasqSendQueue = (MRA_SEND_QUEUE*)hSendQueueHandle;
MRA_SEND_QUEUE_ITEM *pmrasqiSendQueueItem;
ListMTLock(&pmrasqSendQueue->lmtListMT);
- while(ListMTItemGetFirst(&pmrasqSendQueue->lmtListMT,NULL,(LPVOID*)&pmrasqiSendQueueItem)==NO_ERROR)
+ while(ListMTItemGetFirst(&pmrasqSendQueue->lmtListMT, NULL, (LPVOID*)&pmrasqiSendQueueItem) == NO_ERROR)
{
- ListMTItemDelete(&pmrasqSendQueue->lmtListMT,&pmrasqiSendQueueItem->lmtListMTItem);
- //MEMFREE(pmrasqiSendQueueItem->lpbData);
- MEMFREE(pmrasqiSendQueueItem);
+ ListMTItemDelete(&pmrasqSendQueue->lmtListMT, &pmrasqiSendQueueItem->lmtListMTItem);
+ //mir_free(pmrasqiSendQueueItem->lpbData);
+ mir_free(pmrasqiSendQueueItem);
}
ListMTUnLock(&pmrasqSendQueue->lmtListMT);
ListMTDestroy(&pmrasqSendQueue->lmtListMT);
- MEMFREE(pmrasqSendQueue);
+ mir_free(pmrasqSendQueue);
}
}
-DWORD MraSendQueueAdd(HANDLE hSendQueueHandle,DWORD dwCMDNum,DWORD dwFlags,HANDLE hContact,DWORD dwAckType,LPBYTE lpbData,SIZE_T dwDataSize)
+DWORD MraSendQueueAdd(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD dwFlags, HANDLE hContact, DWORD dwAckType, LPBYTE lpbData, size_t dwDataSize)
{
DWORD dwRetErrorCode;
if (hSendQueueHandle && dwCMDNum)
{
- MRA_SEND_QUEUE *pmrasqSendQueue=(MRA_SEND_QUEUE*)hSendQueueHandle;
+ MRA_SEND_QUEUE *pmrasqSendQueue = (MRA_SEND_QUEUE*)hSendQueueHandle;
MRA_SEND_QUEUE_ITEM *pmrasqiSendQueueItem;
- pmrasqiSendQueueItem=(MRA_SEND_QUEUE_ITEM*)MEMALLOC(sizeof(MRA_SEND_QUEUE_ITEM));
+ pmrasqiSendQueueItem = (MRA_SEND_QUEUE_ITEM*)mir_calloc(sizeof(MRA_SEND_QUEUE_ITEM));
if (pmrasqiSendQueueItem)
{
//pmrasqiSendQueueItem->lmtListMTItem;
GetSystemTimeAsFileTime(&pmrasqiSendQueueItem->ftSendTime);
- pmrasqiSendQueueItem->dwCMDNum=dwCMDNum;
- pmrasqiSendQueueItem->dwFlags=dwFlags;
- pmrasqiSendQueueItem->hContact=hContact;
- pmrasqiSendQueueItem->dwAckType=dwAckType;
- pmrasqiSendQueueItem->lpbData=lpbData;
- pmrasqiSendQueueItem->dwDataSize=dwDataSize;
+ pmrasqiSendQueueItem->dwCMDNum = dwCMDNum;
+ pmrasqiSendQueueItem->dwFlags = dwFlags;
+ pmrasqiSendQueueItem->hContact = hContact;
+ pmrasqiSendQueueItem->dwAckType = dwAckType;
+ pmrasqiSendQueueItem->lpbData = lpbData;
+ pmrasqiSendQueueItem->dwDataSize = dwDataSize;
ListMTLock(&pmrasqSendQueue->lmtListMT);
- ListMTItemAdd(&pmrasqSendQueue->lmtListMT,&pmrasqiSendQueueItem->lmtListMTItem,pmrasqiSendQueueItem);
+ ListMTItemAdd(&pmrasqSendQueue->lmtListMT, &pmrasqiSendQueueItem->lmtListMTItem, pmrasqiSendQueueItem);
ListMTUnLock(&pmrasqSendQueue->lmtListMT);
- dwRetErrorCode=NO_ERROR;
- }else{
- dwRetErrorCode=GetLastError();
+ dwRetErrorCode = NO_ERROR;
+ }else {
+ dwRetErrorCode = GetLastError();
}
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }else {
+ dwRetErrorCode = ERROR_INVALID_HANDLE;
}
return(dwRetErrorCode);
}
-DWORD MraSendQueueFree(HANDLE hSendQueueHandle,DWORD dwCMDNum)
+DWORD MraSendQueueFree(HANDLE hSendQueueHandle, DWORD dwCMDNum)
{
DWORD dwRetErrorCode;
if (hSendQueueHandle)
{
- MRA_SEND_QUEUE *pmrasqSendQueue=(MRA_SEND_QUEUE*)hSendQueueHandle;
+ MRA_SEND_QUEUE *pmrasqSendQueue = (MRA_SEND_QUEUE*)hSendQueueHandle;
MRA_SEND_QUEUE_ITEM *pmrasqiSendQueueItem;
LIST_MT_ITERATOR lmtiIterator;
- dwRetErrorCode=ERROR_NOT_FOUND;
+ dwRetErrorCode = ERROR_NOT_FOUND;
ListMTLock(&pmrasqSendQueue->lmtListMT);
- ListMTIteratorMoveFirst(&pmrasqSendQueue->lmtListMT,&lmtiIterator);
+ ListMTIteratorMoveFirst(&pmrasqSendQueue->lmtListMT, &lmtiIterator);
do
{// цикл
- if (ListMTIteratorGet(&lmtiIterator,NULL,(LPVOID*)&pmrasqiSendQueueItem)==NO_ERROR)
- if (pmrasqiSendQueueItem->dwCMDNum==dwCMDNum)
+ if (ListMTIteratorGet(&lmtiIterator, NULL, (LPVOID*)&pmrasqiSendQueueItem) == NO_ERROR)
+ if (pmrasqiSendQueueItem->dwCMDNum == dwCMDNum)
{
- ListMTItemDelete(&pmrasqSendQueue->lmtListMT,&pmrasqiSendQueueItem->lmtListMTItem);
- //MEMFREE(pmrasqiSendQueueItem->lpbData);
- MEMFREE(pmrasqiSendQueueItem);
- dwRetErrorCode=NO_ERROR;
+ ListMTItemDelete(&pmrasqSendQueue->lmtListMT, &pmrasqiSendQueueItem->lmtListMTItem);
+ //mir_free(pmrasqiSendQueueItem->lpbData);
+ mir_free(pmrasqiSendQueueItem);
+ dwRetErrorCode = NO_ERROR;
break;
}
}while(ListMTIteratorMoveNext(&lmtiIterator));
ListMTUnLock(&pmrasqSendQueue->lmtListMT);
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }else {
+ dwRetErrorCode = ERROR_INVALID_HANDLE;
}
return(dwRetErrorCode);
}
-DWORD MraSendQueueFind(HANDLE hSendQueueHandle,DWORD dwCMDNum,DWORD *pdwFlags,HANDLE *phContact,DWORD *pdwAckType,LPBYTE *plpbData,SIZE_T *pdwDataSize)
+DWORD MraSendQueueFind(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD *pdwFlags, HANDLE *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize)
{
DWORD dwRetErrorCode;
if (hSendQueueHandle)
{
- MRA_SEND_QUEUE *pmrasqSendQueue=(MRA_SEND_QUEUE*)hSendQueueHandle;
+ MRA_SEND_QUEUE *pmrasqSendQueue = (MRA_SEND_QUEUE*)hSendQueueHandle;
MRA_SEND_QUEUE_ITEM *pmrasqiSendQueueItem;
LIST_MT_ITERATOR lmtiIterator;
- dwRetErrorCode=ERROR_NOT_FOUND;
+ dwRetErrorCode = ERROR_NOT_FOUND;
ListMTLock(&pmrasqSendQueue->lmtListMT);
- ListMTIteratorMoveFirst(&pmrasqSendQueue->lmtListMT,&lmtiIterator);
+ ListMTIteratorMoveFirst(&pmrasqSendQueue->lmtListMT, &lmtiIterator);
do
{// цикл
- if (ListMTIteratorGet(&lmtiIterator,NULL,(LPVOID*)&pmrasqiSendQueueItem)==NO_ERROR)
- if (pmrasqiSendQueueItem->dwCMDNum==dwCMDNum)
+ if (ListMTIteratorGet(&lmtiIterator, NULL, (LPVOID*)&pmrasqiSendQueueItem) == NO_ERROR)
+ if (pmrasqiSendQueueItem->dwCMDNum == dwCMDNum)
{
- if (pdwFlags) (*pdwFlags)=pmrasqiSendQueueItem->dwFlags;
- if (phContact) (*phContact)=pmrasqiSendQueueItem->hContact;
- if (pdwAckType) (*pdwAckType)=pmrasqiSendQueueItem->dwAckType;
- if (plpbData) (*plpbData)=pmrasqiSendQueueItem->lpbData;
- if (pdwDataSize) (*pdwDataSize)=pmrasqiSendQueueItem->dwDataSize;
- dwRetErrorCode=NO_ERROR;
+ if (pdwFlags) (*pdwFlags) = pmrasqiSendQueueItem->dwFlags;
+ if (phContact) (*phContact) = pmrasqiSendQueueItem->hContact;
+ if (pdwAckType) (*pdwAckType) = pmrasqiSendQueueItem->dwAckType;
+ if (plpbData) (*plpbData) = pmrasqiSendQueueItem->lpbData;
+ if (pdwDataSize) (*pdwDataSize) = pmrasqiSendQueueItem->dwDataSize;
+ dwRetErrorCode = NO_ERROR;
break;
}
}while(ListMTIteratorMoveNext(&lmtiIterator));
ListMTUnLock(&pmrasqSendQueue->lmtListMT);
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }else {
+ dwRetErrorCode = ERROR_INVALID_HANDLE;
}
return(dwRetErrorCode);
}
-DWORD MraSendQueueFindOlderThan(HANDLE hSendQueueHandle,DWORD dwTime,DWORD *pdwCMDNum,DWORD *pdwFlags,HANDLE *phContact,DWORD *pdwAckType,LPBYTE *plpbData,SIZE_T *pdwDataSize)
+DWORD MraSendQueueFindOlderThan(HANDLE hSendQueueHandle, DWORD dwTime, DWORD *pdwCMDNum, DWORD *pdwFlags, HANDLE *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize)
{
DWORD dwRetErrorCode;
if (hSendQueueHandle)
{
FILETIME ftExpireTime;
- MRA_SEND_QUEUE *pmrasqSendQueue=(MRA_SEND_QUEUE*)hSendQueueHandle;
+ MRA_SEND_QUEUE *pmrasqSendQueue = (MRA_SEND_QUEUE*)hSendQueueHandle;
MRA_SEND_QUEUE_ITEM *pmrasqiSendQueueItem;
LIST_MT_ITERATOR lmtiIterator;
GetSystemTimeAsFileTime(&ftExpireTime);
(*((DWORDLONG*)&ftExpireTime))-=((DWORDLONG)dwTime*FILETIME_SECOND);
- dwRetErrorCode=ERROR_NOT_FOUND;
+ dwRetErrorCode = ERROR_NOT_FOUND;
ListMTLock(&pmrasqSendQueue->lmtListMT);
- ListMTIteratorMoveFirst(&pmrasqSendQueue->lmtListMT,&lmtiIterator);
+ ListMTIteratorMoveFirst(&pmrasqSendQueue->lmtListMT, &lmtiIterator);
do
{// цикл
- if (ListMTIteratorGet(&lmtiIterator,NULL,(LPVOID*)&pmrasqiSendQueueItem)==NO_ERROR)
+ if (ListMTIteratorGet(&lmtiIterator, NULL, (LPVOID*)&pmrasqiSendQueueItem) == NO_ERROR)
if ((*((DWORDLONG*)&ftExpireTime))>(*((DWORDLONG*)&pmrasqiSendQueueItem->ftSendTime)))
{
- if (pdwCMDNum) (*pdwCMDNum)=pmrasqiSendQueueItem->dwCMDNum;
- if (pdwFlags) (*pdwFlags)=pmrasqiSendQueueItem->dwFlags;
- if (phContact) (*phContact)=pmrasqiSendQueueItem->hContact;
- if (pdwAckType) (*pdwAckType)=pmrasqiSendQueueItem->dwAckType;
- if (plpbData) (*plpbData)=pmrasqiSendQueueItem->lpbData;
- if (pdwDataSize) (*pdwDataSize)=pmrasqiSendQueueItem->dwDataSize;
- dwRetErrorCode=NO_ERROR;
+ if (pdwCMDNum) (*pdwCMDNum) = pmrasqiSendQueueItem->dwCMDNum;
+ if (pdwFlags) (*pdwFlags) = pmrasqiSendQueueItem->dwFlags;
+ if (phContact) (*phContact) = pmrasqiSendQueueItem->hContact;
+ if (pdwAckType) (*pdwAckType) = pmrasqiSendQueueItem->dwAckType;
+ if (plpbData) (*plpbData) = pmrasqiSendQueueItem->lpbData;
+ if (pdwDataSize) (*pdwDataSize) = pmrasqiSendQueueItem->dwDataSize;
+ dwRetErrorCode = NO_ERROR;
break;
}
}while(ListMTIteratorMoveNext(&lmtiIterator));
ListMTUnLock(&pmrasqSendQueue->lmtListMT);
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }else {
+ dwRetErrorCode = ERROR_INVALID_HANDLE;
}
return(dwRetErrorCode);
}
diff --git a/protocols/MRA/MraSendQueue.h b/protocols/MRA/MraSendQueue.h
index f1376128c9..0e7f7ae51a 100644
--- a/protocols/MRA/MraSendQueue.h
+++ b/protocols/MRA/MraSendQueue.h
@@ -8,14 +8,14 @@
-DWORD MraSendQueueInitialize(DWORD dwSendTimeOutInterval,HANDLE *phSendQueueHandle);
+DWORD MraSendQueueInitialize(DWORD dwSendTimeOutInterval, HANDLE *phSendQueueHandle);
void MraSendQueueDestroy(HANDLE hSendQueueHandle);
-DWORD MraSendQueueAdd(HANDLE hSendQueueHandle,DWORD dwCMDNum,DWORD dwFlags,HANDLE hContact,DWORD dwAckType,LPBYTE lpbData,SIZE_T dwDataSize);
-DWORD MraSendQueueFree(HANDLE hSendQueueHandle,DWORD dwCMDNum);
+DWORD MraSendQueueAdd(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD dwFlags, HANDLE hContact, DWORD dwAckType, LPBYTE lpbData, size_t dwDataSize);
+DWORD MraSendQueueFree(HANDLE hSendQueueHandle, DWORD dwCMDNum);
-DWORD MraSendQueueFind(HANDLE hSendQueueHandle,DWORD dwCMDNum,DWORD *pdwFlags,HANDLE *phContact,DWORD *pdwAckType,LPBYTE *plpbData,SIZE_T *pdwDataSize);
-DWORD MraSendQueueFindOlderThan(HANDLE hSendQueueHandle,DWORD dwTime,DWORD *pdwCMDNum,DWORD *pdwFlags,HANDLE *phContact,DWORD *pdwAckType,LPBYTE *plpbData,SIZE_T *pdwDataSize);
+DWORD MraSendQueueFind(HANDLE hSendQueueHandle, DWORD dwCMDNum, DWORD *pdwFlags, HANDLE *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize);
+DWORD MraSendQueueFindOlderThan(HANDLE hSendQueueHandle, DWORD dwTime, DWORD *pdwCMDNum, DWORD *pdwFlags, HANDLE *phContact, DWORD *pdwAckType, LPBYTE *plpbData, size_t *pdwDataSize);
diff --git a/protocols/MRA/Mra_functions.cpp b/protocols/MRA/Mra_functions.cpp
index b3d1e1fbab..b4f49120c4 100644
--- a/protocols/MRA/Mra_functions.cpp
+++ b/protocols/MRA/Mra_functions.cpp
@@ -1,21 +1,20 @@
#include "Mra.h"
+#define MRA_PASS_CRYPT_VER 2
-
-typedef struct SetXStatusData_s {
+struct SetXStatusData
+{
+ CMraProto *ppro;
DWORD dwXStatus;
DWORD dwCountdown;
HICON hDlgIcon;
-}SetXStatusData;
-
+};
-typedef struct
+struct SetBlogStatusData
{
+ CMraProto *ppro;
HANDLE hContact;
-}SetBlogStatusData;
-
-
-
+};
#define RECURSION_DATA_STACK_ITEMS_MIN 128
struct RECURSION_DATA_STACK_ITEM
@@ -25,861 +24,790 @@ struct RECURSION_DATA_STACK_ITEM
WIN32_FIND_DATA w32fdFindFileData;
};
-
-typedef struct _MRA_APC_QUEUE_ITEM
+struct MRA_APC_QUEUE_ITEM
{
FIFO_MT_ITEM ffmtItem;
PAPCFUNC pfnAPC;
-}MRA_APC_QUEUE_ITEM;
-
-
-
-
-void MraAPCQueueProcess (PFIFO_MT pffmtAPCQueue);
-void CALLBACK ThreadMarandaCallbackAck (ULONG_PTR dwParam);
-LRESULT CALLBACK MessageEditSubclassProc (HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);
-INT_PTR CALLBACK SetXStatusDlgProc (HWND hWndDlg,UINT message,WPARAM wParam,LPARAM lParam);
-INT_PTR CALLBACK SendReplyBlogStatusDlgProc (HWND hWndDlg,UINT message,WPARAM wParam,LPARAM lParam);
-
+};
+void MraAPCQueueProcess(PFIFO_MT pffmtAPCQueue);
+void CALLBACK ThreadMarandaCallbackAck(ULONG_PTR dwParam);
+LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-DWORD MraGetSelfVersionString(LPSTR lpszSelfVersion,SIZE_T dwSelfVersionSize,SIZE_T *pdwSelfVersionSizeRet)
+DWORD MraGetSelfVersionString(LPSTR lpszSelfVersion, size_t dwSelfVersionSize, size_t *pdwSelfVersionSizeRet)
{
- DWORD dwRetErrorCode;
+ if (!lpszSelfVersion || !dwSelfVersionSize)
+ return ERROR_INVALID_HANDLE;
- if (lpszSelfVersion && dwSelfVersionSize)
- {
- DWORD dwMirVer=CallService(MS_SYSTEM_GETVERSION,0,0);
- LPSTR lpszUnicode=(IsUnicodeEnv()? " Unicode":""),
- lpszSecIM=(ServiceExists("SecureIM/IsContactSecured")? " + SecureIM":"");
- SIZE_T dwSelfVersionSizeRet;
+ WORD v[4];
+ DWORD dwMirVer = CallService(MS_SYSTEM_GETFILEVERSION, 0, (LPARAM)v);
+ LPSTR lpszUnicode = (IsUnicodeEnv()? " Unicode":""),
+ lpszSecIM = ( ServiceExists("SecureIM/IsContactSecured")? " + SecureIM":"");
+ size_t dwSelfVersionSizeRet;
- dwSelfVersionSizeRet=mir_snprintf(lpszSelfVersion,dwSelfVersionSize,"Miranda IM %lu.%lu.%lu.%lu%s (MRA v%lu.%lu.%lu.%lu)%s, version: %lu.%lu",(((dwMirVer)>>24)&0xFF),(((dwMirVer)>>16)&0xFF),(((dwMirVer)>>8)&0xFF),((dwMirVer)&0xFF),lpszUnicode,(((PLUGIN_VERSION_DWORD)>>24)&0xFF),(((PLUGIN_VERSION_DWORD)>>16)&0xFF),(((PLUGIN_VERSION_DWORD)>>8)&0xFF),((PLUGIN_VERSION_DWORD)&0xFF),lpszSecIM,PROTO_MAJOR(PROTO_VERSION),PROTO_MINOR(PROTO_VERSION));
+ dwSelfVersionSizeRet = mir_snprintf(lpszSelfVersion, dwSelfVersionSize, "Miranda IM %lu.%lu.%lu.%lu%s (MRA v%lu.%lu.%lu.%lu)%s, version: %lu.%lu",
+ v[0], v[1], v[2], v[3], lpszUnicode,
+ __FILEVERSION_STRING, lpszSecIM, PROTO_VERSION_MAJOR, PROTO_VERSION_MINOR);
- if (pdwSelfVersionSizeRet) (*pdwSelfVersionSizeRet)=dwSelfVersionSizeRet;
- dwRetErrorCode=NO_ERROR;
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
- }
-return(dwRetErrorCode);
+ if (pdwSelfVersionSizeRet)
+ *pdwSelfVersionSizeRet = dwSelfVersionSizeRet;
+ return 0;
}
-DWORD GetParamValue(LPSTR lpszData,SIZE_T dwDataSize,LPSTR lpszParamName,SIZE_T dwParamNameSize,LPSTR lpszParamValue,SIZE_T dwParamValueSize,SIZE_T *pParamValueSizeRet)
+DWORD GetParamValue(LPSTR lpszData, size_t dwDataSize, LPSTR lpszParamName, size_t dwParamNameSize, LPSTR lpszParamValue, size_t dwParamValueSize, size_t *pParamValueSizeRet)
{
- DWORD dwRetErrorCode;
-
- if (lpszData && dwDataSize && lpszParamName && dwParamNameSize && lpszParamValue && dwParamValueSize)
- {
- char szData[USER_AGENT_MAX+4096];
- LPSTR lpszParamDataStart,lpszParamDataEnd;
+ if (!lpszData || !dwDataSize || !lpszParamName || !dwParamNameSize || !lpszParamValue || !dwParamValueSize)
+ return ERROR_INVALID_HANDLE;
- dwRetErrorCode=ERROR_NOT_FOUND;
+ char szData[USER_AGENT_MAX+4096];
+ LPSTR lpszParamDataStart, lpszParamDataEnd;
- dwDataSize=((dwDataSize<SIZEOF(szData))? dwDataSize:SIZEOF(szData));
- BuffToLowerCase(szData,lpszData,dwDataSize);
+ dwDataSize = ((dwDataSize<SIZEOF(szData))? dwDataSize:SIZEOF(szData));
+ BuffToLowerCase(szData, lpszData, dwDataSize);
- lpszParamDataStart=(LPSTR)MemoryFind(0,szData,dwDataSize,lpszParamName,dwParamNameSize);
- if (lpszParamDataStart)
- if ((*((WORD*)(lpszParamDataStart+dwParamNameSize)))==(*((WORD*)"=\"")))
- {
- lpszParamDataStart+=dwParamNameSize+2;
- lpszParamDataEnd=(LPSTR)MemoryFindByte((lpszParamDataStart-szData),szData,dwDataSize,'"');
- if (lpszParamDataEnd)
- {
- memmove(lpszParamValue,(lpszData+(lpszParamDataStart-szData)),(lpszParamDataEnd-lpszParamDataStart));
- if (pParamValueSizeRet) (*pParamValueSizeRet)=(lpszParamDataEnd-lpszParamDataStart);
- dwRetErrorCode=NO_ERROR;
- }
+ lpszParamDataStart = (LPSTR)MemoryFind(0, szData, dwDataSize, lpszParamName, dwParamNameSize);
+ if (lpszParamDataStart)
+ if ((*((WORD*)(lpszParamDataStart+dwParamNameSize))) == (*((WORD*)"=\""))) {
+ lpszParamDataStart += dwParamNameSize+2;
+ lpszParamDataEnd = (LPSTR)MemoryFindByte((lpszParamDataStart-szData), szData, dwDataSize, '"');
+ if (lpszParamDataEnd) {
+ memmove(lpszParamValue, (lpszData+(lpszParamDataStart-szData)), (lpszParamDataEnd-lpszParamDataStart));
+ if (pParamValueSizeRet) (*pParamValueSizeRet) = (lpszParamDataEnd-lpszParamDataStart);
+ return NO_ERROR;
}
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
}
-return(dwRetErrorCode);
+ return ERROR_NOT_FOUND;
}
-DWORD MraGetVersionStringFromFormated(LPSTR lpszUserAgentFormated,SIZE_T dwUserAgentFormatedSize,LPSTR lpszVersion,SIZE_T dwVersionSize,SIZE_T *pdwVersionSizeRet)
+DWORD MraGetVersionStringFromFormatted(LPSTR lpszUserAgentFormated, size_t dwUserAgentFormatedSize, LPSTR lpszVersion, size_t dwVersionSize, size_t *pdwVersionSizeRet)
{
- DWORD dwRetErrorCode;
-
- if (lpszUserAgentFormated && dwUserAgentFormatedSize && lpszVersion && dwVersionSize)
- {
- char szBuff[4096];
- SIZE_T dwBuffSize,dwVersionSizeRet;
+ if (!lpszUserAgentFormated || !dwUserAgentFormatedSize || !lpszVersion || !dwVersionSize)
+ return ERROR_INVALID_HANDLE;
- if (GetParamValue(lpszUserAgentFormated,dwUserAgentFormatedSize,"name",4,szBuff,SIZEOF(szBuff),&dwBuffSize)==NO_ERROR && CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,szBuff,((dwBuffSize<10)? dwBuffSize:10),"Miranda IM",10)==CSTR_EQUAL)
- {// Miranda IM
- GetParamValue(lpszUserAgentFormated,dwUserAgentFormatedSize,"title",5,lpszVersion,dwVersionSize,pdwVersionSizeRet);
- }else{
- dwVersionSizeRet=0;
+ char szBuff[4096];
+ size_t dwBuffSize, dwVersionSizeRet;
- if (GetParamValue(lpszUserAgentFormated,dwUserAgentFormatedSize,"client",6,lpszVersion,dwVersionSize,&dwBuffSize)==NO_ERROR)
- {
- dwVersionSizeRet+=dwBuffSize;
- (*((BYTE*)(lpszVersion+dwVersionSizeRet)))=' ';
- }
+ if (GetParamValue(lpszUserAgentFormated, dwUserAgentFormatedSize, "name", 4, szBuff, SIZEOF(szBuff), &dwBuffSize) == NO_ERROR && CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, szBuff, ((dwBuffSize<10)? dwBuffSize:10), "Miranda IM", 10) == CSTR_EQUAL)
+ {// Miranda IM
+ GetParamValue(lpszUserAgentFormated, dwUserAgentFormatedSize, "title", 5, lpszVersion, dwVersionSize, pdwVersionSizeRet);
+ }
+ else {
+ dwVersionSizeRet = 0;
- if (GetParamValue(lpszUserAgentFormated,dwUserAgentFormatedSize,"name",4,lpszVersion,dwVersionSize,&dwBuffSize)==NO_ERROR)
- {
- dwVersionSizeRet+=dwBuffSize;
- (*((BYTE*)(lpszVersion+dwVersionSizeRet)))=' ';
- }
+ if (GetParamValue(lpszUserAgentFormated, dwUserAgentFormatedSize, "client", 6, lpszVersion, dwVersionSize, &dwBuffSize) == NO_ERROR)
+ {
+ dwVersionSizeRet += dwBuffSize;
+ (*((BYTE*)(lpszVersion+dwVersionSizeRet))) = ' ';
+ }
- if (GetParamValue(lpszUserAgentFormated,dwUserAgentFormatedSize,"title",5,lpszVersion,dwVersionSize,&dwBuffSize)==NO_ERROR)
- {
- dwVersionSizeRet+=dwBuffSize;
- (*((BYTE*)(lpszVersion+dwVersionSizeRet)))=' ';
- }
+ if (GetParamValue(lpszUserAgentFormated, dwUserAgentFormatedSize, "name", 4, lpszVersion, dwVersionSize, &dwBuffSize) == NO_ERROR)
+ {
+ dwVersionSizeRet += dwBuffSize;
+ (*((BYTE*)(lpszVersion+dwVersionSizeRet))) = ' ';
+ }
- if (GetParamValue(lpszUserAgentFormated,dwUserAgentFormatedSize,"version",7,(lpszVersion+dwVersionSizeRet+1),(dwVersionSize-dwVersionSizeRet),&dwBuffSize)==NO_ERROR)
- {
- dwVersionSizeRet+=(dwBuffSize+1);
- (*((BYTE*)(lpszVersion+dwVersionSizeRet)))='.';
- if (GetParamValue(lpszUserAgentFormated,dwUserAgentFormatedSize,"build",5,(lpszVersion+dwVersionSizeRet+1),(dwVersionSize-dwVersionSizeRet),&dwBuffSize)==NO_ERROR)
- {
- dwVersionSizeRet+=(dwBuffSize+1);
- }
- }
+ if (GetParamValue(lpszUserAgentFormated, dwUserAgentFormatedSize, "title", 5, lpszVersion, dwVersionSize, &dwBuffSize) == NO_ERROR)
+ {
+ dwVersionSizeRet += dwBuffSize;
+ (*((BYTE*)(lpszVersion+dwVersionSizeRet))) = ' ';
+ }
- if (dwVersionSizeRet==0)
- {// no data extracted, copy raw
- dwVersionSizeRet=((dwUserAgentFormatedSize<dwVersionSize)? dwUserAgentFormatedSize:dwVersionSize);
- memmove(lpszVersion,lpszUserAgentFormated,dwVersionSizeRet);
- }
+ if (GetParamValue(lpszUserAgentFormated, dwUserAgentFormatedSize, "version", 7, (lpszVersion+dwVersionSizeRet+1), (dwVersionSize-dwVersionSizeRet), &dwBuffSize) == NO_ERROR)
+ {
+ dwVersionSizeRet += (dwBuffSize+1);
+ (*((BYTE*)(lpszVersion+dwVersionSizeRet))) = '.';
+ if (GetParamValue(lpszUserAgentFormated, dwUserAgentFormatedSize, "build", 5, (lpszVersion+dwVersionSizeRet+1), (dwVersionSize-dwVersionSizeRet), &dwBuffSize) == NO_ERROR)
+ dwVersionSizeRet += (dwBuffSize+1);
+ }
- if (pdwVersionSizeRet) (*pdwVersionSizeRet)=dwVersionSizeRet;
+ // no data extracted, copy raw
+ if (dwVersionSizeRet == 0) {
+ dwVersionSizeRet = ((dwUserAgentFormatedSize<dwVersionSize)? dwUserAgentFormatedSize:dwVersionSize);
+ memmove(lpszVersion, lpszUserAgentFormated, dwVersionSizeRet);
}
- dwRetErrorCode=NO_ERROR;
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+
+ if (pdwVersionSizeRet)
+ *pdwVersionSizeRet = dwVersionSizeRet;
}
-return(dwRetErrorCode);
+ return NO_ERROR;
}
-
-DWORD MraAddrListGetFromBuff(LPSTR lpszAddreses,SIZE_T dwAddresesSize,MRA_ADDR_LIST *pmalAddrList)
+DWORD MraAddrListGetFromBuff(LPSTR lpszAddreses, size_t dwAddresesSize, MRA_ADDR_LIST *pmalAddrList)
{
- DWORD dwRetErrorCode;
+ if (!lpszAddreses || !dwAddresesSize || !pmalAddrList)
+ return ERROR_INVALID_HANDLE;
- if (lpszAddreses && dwAddresesSize && pmalAddrList)
- {
- LPSTR lpszCurrentItem,lpszDelimiter,lpszEndItem;
- DWORD dwAllocatedCount;
+ LPSTR lpszCurrentItem, lpszDelimiter, lpszEndItem;
+ DWORD dwAllocatedCount;
- dwAllocatedCount=ALLOCATED_COUNT;
- pmalAddrList->dwAddrCount=0;
- pmalAddrList->pmaliAddress=(MRA_ADDR_LIST_ITEM*)MEMALLOC(sizeof(MRA_ADDR_LIST_ITEM)*dwAllocatedCount);
- lpszCurrentItem=lpszAddreses;
+ dwAllocatedCount = ALLOCATED_COUNT;
+ pmalAddrList->dwAddrCount = 0;
+ pmalAddrList->pmaliAddress = (MRA_ADDR_LIST_ITEM*)mir_calloc(sizeof(MRA_ADDR_LIST_ITEM)*dwAllocatedCount);
+ lpszCurrentItem = lpszAddreses;
- while(TRUE)
- {
- lpszEndItem=(LPSTR)MemoryFindByte((lpszCurrentItem-lpszAddreses),lpszAddreses,dwAddresesSize,';');
- if (lpszEndItem==NULL) lpszEndItem=(lpszAddreses+dwAddresesSize);
- if (lpszEndItem)
- {
- lpszDelimiter=(LPSTR)MemoryFindByte((lpszCurrentItem-lpszAddreses),lpszAddreses,dwAddresesSize,':');
- if (lpszDelimiter)
- {
- if (pmalAddrList->dwAddrCount==dwAllocatedCount)
- {
- dwAllocatedCount+=ALLOCATED_COUNT;
- pmalAddrList->pmaliAddress=(MRA_ADDR_LIST_ITEM*)MEMREALLOC(pmalAddrList->pmaliAddress,(sizeof(MRA_ADDR_LIST_ITEM)*dwAllocatedCount));
- }
+ while(TRUE) {
+ lpszEndItem = (LPSTR)MemoryFindByte((lpszCurrentItem-lpszAddreses), lpszAddreses, dwAddresesSize, ';');
+ if (lpszEndItem == NULL) lpszEndItem = (lpszAddreses+dwAddresesSize);
+ if (!lpszEndItem)
+ break;
- (*lpszDelimiter)=0;
- pmalAddrList->pmaliAddress[pmalAddrList->dwAddrCount].dwAddr=inet_addr(lpszCurrentItem);
- pmalAddrList->pmaliAddress[pmalAddrList->dwAddrCount].dwPort=StrToUNum32((lpszDelimiter+1),(lpszEndItem-(lpszDelimiter+1)));
- (*lpszDelimiter)=':';
- pmalAddrList->dwAddrCount++;
- lpszCurrentItem=(lpszEndItem+1);
- }else{
- break;
- }
- if (lpszEndItem==(lpszAddreses+dwAddresesSize)) break;
- }else{
- break;
- }
+ lpszDelimiter = (LPSTR)MemoryFindByte((lpszCurrentItem-lpszAddreses), lpszAddreses, dwAddresesSize, ':');
+ if (!lpszDelimiter)
+ break;
+
+ if (pmalAddrList->dwAddrCount == dwAllocatedCount) {
+ dwAllocatedCount += ALLOCATED_COUNT;
+ pmalAddrList->pmaliAddress = (MRA_ADDR_LIST_ITEM*)mir_realloc(pmalAddrList->pmaliAddress, (sizeof(MRA_ADDR_LIST_ITEM)*dwAllocatedCount));
}
- pmalAddrList->pmaliAddress=(MRA_ADDR_LIST_ITEM*)MEMREALLOC(pmalAddrList->pmaliAddress,(sizeof(MRA_ADDR_LIST_ITEM)*pmalAddrList->dwAddrCount));
- dwRetErrorCode=NO_ERROR;
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+
+ (*lpszDelimiter) = 0;
+ pmalAddrList->pmaliAddress[pmalAddrList->dwAddrCount].dwAddr = inet_addr(lpszCurrentItem);
+ pmalAddrList->pmaliAddress[pmalAddrList->dwAddrCount].dwPort = StrToUNum32((lpszDelimiter+1), (lpszEndItem-(lpszDelimiter+1)));
+ (*lpszDelimiter) = ':';
+ pmalAddrList->dwAddrCount++;
+ lpszCurrentItem = (lpszEndItem+1);
+
+ if (lpszEndItem == lpszAddreses + dwAddresesSize)
+ break;
}
-return(dwRetErrorCode);
+ pmalAddrList->pmaliAddress = (MRA_ADDR_LIST_ITEM*)mir_realloc(pmalAddrList->pmaliAddress, (sizeof(MRA_ADDR_LIST_ITEM)*pmalAddrList->dwAddrCount));
+ return NO_ERROR;
}
-
-DWORD MraAddrListGetToBuff(MRA_ADDR_LIST *pmalAddrList,LPSTR lpszBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSizeRet)
+DWORD MraAddrListGetToBuff(MRA_ADDR_LIST *pmalAddrList, LPSTR lpszBuff, size_t dwBuffSize, size_t *pdwBuffSizeRet)
{
- DWORD dwRetErrorCode;
+ if (!pmalAddrList || !lpszBuff || !dwBuffSize)
+ return ERROR_INVALID_HANDLE;
- if (pmalAddrList && lpszBuff && dwBuffSize)
- {
- LPSTR lpszCurPos=lpszBuff;
+ LPSTR lpszCurPos = lpszBuff;
- for (SIZE_T i=0;i<pmalAddrList->dwAddrCount;i++)
- {
- lpszCurPos+=mir_snprintf(lpszCurPos,(dwBuffSize-((SIZE_T)lpszCurPos-(SIZE_T)lpszBuff)),"%s:%lu;",inet_ntoa((*((in_addr*)&pmalAddrList->pmaliAddress[i].dwAddr))),pmalAddrList->pmaliAddress[i].dwPort);
- }
+ for (size_t i = 0;i<pmalAddrList->dwAddrCount;i++)
+ lpszCurPos += mir_snprintf(lpszCurPos, (dwBuffSize-((size_t)lpszCurPos-(size_t)lpszBuff)), "%s:%lu;",
+ inet_ntoa((*((in_addr*)&pmalAddrList->pmaliAddress[i].dwAddr))), pmalAddrList->pmaliAddress[i].dwPort);
- if (pdwBuffSizeRet) (*pdwBuffSizeRet)=(lpszCurPos-lpszBuff);
- dwRetErrorCode=NO_ERROR;
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
- }
-return(dwRetErrorCode);
+ if (pdwBuffSizeRet)
+ *pdwBuffSizeRet = lpszCurPos - lpszBuff;
+ return NO_ERROR;
}
-
-void MraAddrListStoreToContact(HANDLE hContact,MRA_ADDR_LIST *pmalAddrList)
+void CMraProto::MraAddrListStoreToContact(HANDLE hContact, MRA_ADDR_LIST *pmalAddrList)
{
- if (hContact && pmalAddrList)
- if (pmalAddrList->dwAddrCount)
- {
- DB_Mra_SetDword(hContact,"OldIP",DB_Mra_GetDword(hContact,"IP",0));
- DB_Mra_SetDword(hContact,"IP",HTONL(pmalAddrList->pmaliAddress[0].dwAddr));
- if (pmalAddrList->dwAddrCount>1)
- {
- DB_Mra_SetDword(hContact,"OldRealIP",DB_Mra_GetDword(hContact,"RealIP",0));
- DB_Mra_SetDword(hContact,"RealIP",HTONL(pmalAddrList->pmaliAddress[1].dwAddr));
- }
+ if (!hContact || !pmalAddrList)
+ return;
+
+ if (!pmalAddrList->dwAddrCount)
+ return;
+
+ mraSetDword(hContact, "OldIP", mraGetDword(hContact, "IP", 0));
+ mraSetDword(hContact, "IP", HTONL(pmalAddrList->pmaliAddress[0].dwAddr));
+ if (pmalAddrList->dwAddrCount > 1) {
+ mraSetDword(hContact, "OldRealIP", mraGetDword(hContact, "RealIP", 0));
+ mraSetDword(hContact, "RealIP", HTONL(pmalAddrList->pmaliAddress[1].dwAddr));
}
}
-
void MraAddrListFree(MRA_ADDR_LIST *pmalAddrList)
{
- if (pmalAddrList)
- {
- MEMFREE(pmalAddrList->pmaliAddress);
- pmalAddrList->dwAddrCount=0;
+ if (pmalAddrList) {
+ mir_free(pmalAddrList->pmaliAddress);
+ pmalAddrList->dwAddrCount = 0;
}
}
-
-
-
-void DB_Mra_CreateResidentSetting(LPSTR lpszValueName)
+void CMraProto::DB_MraCreateResidentSetting(LPSTR lpszValueName)
{
char szSetting[2*MAX_PATH];
-
- mir_snprintf(szSetting,SIZEOF(szSetting),"%s/%s",PROTOCOL_NAMEA,lpszValueName);
- CallService(MS_DB_SETSETTINGRESIDENT,TRUE,(WPARAM)szSetting);
+ mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s", m_szModuleName, lpszValueName);
+ CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (WPARAM)szSetting);
}
-BOOL DB_GetStaticStringA(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPSTR lpszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize)
-{// sizes in wchars
- BOOL bRet=FALSE;
- SIZE_T dwReadedStringLen,dwRetBuffSizeLocal;
- DBVARIANT dbv={0};
- DBCONTACTGETSETTING sVal={0};
-
- dbv.type=DBVT_WCHAR;
- sVal.pValue=&dbv;
- sVal.szModule=lpszModule;
- sVal.szSetting=lpszValueName;
- if (CallService(MS_DB_CONTACT_GETSETTING_STR,(WPARAM)hContact,(LPARAM)&sVal)==0)
+BOOL DB_GetStaticStringA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize)
+{
+ BOOL bRet = FALSE;
+ size_t dwReadedStringLen, dwRetBuffSizeLocal;
+ DBVARIANT dbv = {0};
+ DBCONTACTGETSETTING sVal = {0};
+
+ dbv.type = DBVT_WCHAR;
+ sVal.pValue = &dbv;
+ sVal.szModule = lpszModule;
+ sVal.szSetting = lpszValueName;
+ if (CallService(MS_DB_CONTACT_GETSETTING_STR, (WPARAM)hContact, (LPARAM)&sVal) == 0)
{
- dwReadedStringLen=lstrlenW(dbv.pwszVal);
+ dwReadedStringLen = lstrlenW(dbv.pwszVal);
if (lpszRetBuff && (dwRetBuffSize>dwReadedStringLen))
{
- dwRetBuffSizeLocal=WideCharToMultiByte(MRA_CODE_PAGE,0,dbv.pwszVal,dwReadedStringLen,lpszRetBuff,dwRetBuffSize,NULL,NULL);
- (*((CHAR*)(lpszRetBuff+dwRetBuffSizeLocal)))=0;
- bRet=TRUE;
- }else{
- dwRetBuffSizeLocal=dwReadedStringLen;
- if (lpszRetBuff && dwRetBuffSize>=sizeof(WORD)) (*((WORD*)lpszRetBuff))=0;
+ dwRetBuffSizeLocal = WideCharToMultiByte(MRA_CODE_PAGE, 0, dbv.pwszVal, dwReadedStringLen, lpszRetBuff, dwRetBuffSize, NULL, NULL);
+ (*((CHAR*)(lpszRetBuff+dwRetBuffSizeLocal))) = 0;
+ bRet = TRUE;
+ }else {
+ dwRetBuffSizeLocal = dwReadedStringLen;
+ if (lpszRetBuff && dwRetBuffSize >= sizeof(WORD)) (*((WORD*)lpszRetBuff)) = 0;
}
- if (pdwRetBuffSize) (*pdwRetBuffSize)=dwRetBuffSizeLocal;
+ if (pdwRetBuffSize) (*pdwRetBuffSize) = dwRetBuffSizeLocal;
DBFreeVariant(&dbv);
- }else{
- if (lpszRetBuff && dwRetBuffSize>=sizeof(WORD)) (*((WORD*)lpszRetBuff))=0;
- if (pdwRetBuffSize) (*pdwRetBuffSize)=0;
+ }else {
+ if (lpszRetBuff && dwRetBuffSize >= sizeof(WORD)) (*((WORD*)lpszRetBuff)) = 0;
+ if (pdwRetBuffSize) (*pdwRetBuffSize) = 0;
}
-return(bRet);
+ return bRet;
}
-BOOL DB_GetStaticStringW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpwszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize)
+BOOL DB_GetStaticStringW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPWSTR lpwszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize)
{// sizes in wchars
- BOOL bRet=FALSE;
- SIZE_T dwReadedStringLen;
- DBVARIANT dbv={0};
- DBCONTACTGETSETTING sVal={0};
-
- dbv.type=DBVT_WCHAR;
- sVal.pValue=&dbv;
- sVal.szModule=lpszModule;
- sVal.szSetting=lpszValueName;
- if (CallService(MS_DB_CONTACT_GETSETTING_STR,(WPARAM)hContact,(LPARAM)&sVal)==0)
+ BOOL bRet = FALSE;
+ size_t dwReadedStringLen;
+ DBVARIANT dbv = {0};
+ DBCONTACTGETSETTING sVal = {0};
+
+ dbv.type = DBVT_WCHAR;
+ sVal.pValue = &dbv;
+ sVal.szModule = lpszModule;
+ sVal.szSetting = lpszValueName;
+ if (CallService(MS_DB_CONTACT_GETSETTING_STR, (WPARAM)hContact, (LPARAM)&sVal) == 0)
{
- dwReadedStringLen=lstrlenW(dbv.pwszVal);
+ dwReadedStringLen = lstrlenW(dbv.pwszVal);
if (lpwszRetBuff && (dwRetBuffSize>dwReadedStringLen))
{
- memmove(lpwszRetBuff,dbv.pszVal,(dwReadedStringLen*sizeof(WCHAR)));//include null terminated
- (*((WCHAR*)(lpwszRetBuff+dwReadedStringLen)))=0;
- bRet=TRUE;
- }else{
- if (lpwszRetBuff && dwRetBuffSize>=sizeof(WCHAR)) (*((WCHAR*)lpwszRetBuff))=0;
+ memmove(lpwszRetBuff, dbv.pszVal, (dwReadedStringLen*sizeof(WCHAR)));//include null terminated
+ (*((WCHAR*)(lpwszRetBuff+dwReadedStringLen))) = 0;
+ bRet = TRUE;
+ }else {
+ if (lpwszRetBuff && dwRetBuffSize >= sizeof(WCHAR)) (*((WCHAR*)lpwszRetBuff)) = 0;
}
- if (pdwRetBuffSize) (*pdwRetBuffSize)=dwReadedStringLen;
+ if (pdwRetBuffSize) (*pdwRetBuffSize) = dwReadedStringLen;
DBFreeVariant(&dbv);
- }else{
- if (lpwszRetBuff && dwRetBuffSize>=sizeof(WCHAR)) (*((WCHAR*)lpwszRetBuff))=0;
- if (pdwRetBuffSize) (*pdwRetBuffSize)=0;
+ }else {
+ if (lpwszRetBuff && dwRetBuffSize >= sizeof(WCHAR)) (*((WCHAR*)lpwszRetBuff)) = 0;
+ if (pdwRetBuffSize) (*pdwRetBuffSize) = 0;
}
-return(bRet);
+ return bRet;
}
-
-BOOL DB_SetStringExA(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPSTR lpszValue,SIZE_T dwValueSize)
+BOOL DB_SetStringExA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPCSTR lpszValue, size_t dwValueSize)
{
- BOOL bRet=FALSE;
+ BOOL bRet = FALSE;
- if (lpszValue && dwValueSize)
- {
+ if (lpszValue && dwValueSize) {
LPWSTR lpwszValueLocal;
- SIZE_T dwValueSizeLocal;
+ size_t dwValueSizeLocal;
- dwValueSizeLocal=(dwValueSize+MAX_PATH);
- lpwszValueLocal=(LPWSTR)MEMALLOC((dwValueSizeLocal*sizeof(WCHAR)));
+ dwValueSizeLocal = (dwValueSize+MAX_PATH);
+ lpwszValueLocal = (LPWSTR)mir_calloc((dwValueSizeLocal*sizeof(WCHAR)));
- if (lpwszValueLocal)
- {
- DBCONTACTWRITESETTING cws={0};
+ if (lpwszValueLocal) {
+ DBCONTACTWRITESETTING cws = {0};
- cws.szModule=lpszModule;
- cws.szSetting=lpszValueName;
- cws.value.type=DBVT_WCHAR;
- cws.value.pwszVal=(WCHAR*)lpwszValueLocal;
+ cws.szModule = lpszModule;
+ cws.szSetting = lpszValueName;
+ cws.value.type = DBVT_WCHAR;
+ cws.value.pwszVal = (WCHAR*)lpwszValueLocal;
- dwValueSizeLocal=MultiByteToWideChar(MRA_CODE_PAGE,0,lpszValue,dwValueSize,lpwszValueLocal,dwValueSizeLocal);
- lpwszValueLocal[dwValueSizeLocal]=0;
- bRet=(CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws)==0);
+ dwValueSizeLocal = MultiByteToWideChar(MRA_CODE_PAGE, 0, lpszValue, dwValueSize, lpwszValueLocal, dwValueSizeLocal);
+ lpwszValueLocal[dwValueSizeLocal] = 0;
+ bRet = (CallService(MS_DB_CONTACT_WRITESETTING, (WPARAM)hContact, (LPARAM)&cws) == 0);
- MEMFREE(lpwszValueLocal);
+ mir_free(lpwszValueLocal);
}
- }else{
- bRet=TRUE;
- DBDeleteContactSetting(hContact,lpszModule,lpszValueName);
}
-return(bRet);
+ else {
+ bRet = TRUE;
+ DBDeleteContactSetting(hContact, lpszModule, lpszValueName);
+ }
+ return bRet;
}
-
-BOOL DB_SetStringExW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpwszValue,SIZE_T dwValueSize)
+BOOL DB_SetStringExW(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPCWSTR lpwszValue, size_t dwValueSize)
{
- BOOL bRet=FALSE;
+ BOOL bRet = FALSE;
- if (lpwszValue && dwValueSize)
- {
- LPWSTR lpwszValueLocal=(LPWSTR)MEMALLOC(((dwValueSize+MAX_PATH)*sizeof(WCHAR)));
+ if (lpwszValue && dwValueSize) {
+ LPWSTR lpwszValueLocal = (LPWSTR)mir_calloc(((dwValueSize+MAX_PATH)*sizeof(WCHAR)));
- if (lpwszValueLocal)
- {
- DBCONTACTWRITESETTING cws={0};
+ if (lpwszValueLocal) {
+ DBCONTACTWRITESETTING cws = {0};
- cws.szModule=lpszModule;
- cws.szSetting=lpszValueName;
- cws.value.type=DBVT_WCHAR;
- cws.value.pwszVal=(WCHAR*)lpwszValueLocal;
- memmove(lpwszValueLocal,lpwszValue,(dwValueSize*sizeof(WCHAR)));
- bRet=(CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws)==0);
+ cws.szModule = lpszModule;
+ cws.szSetting = lpszValueName;
+ cws.value.type = DBVT_WCHAR;
+ cws.value.pwszVal = (WCHAR*)lpwszValueLocal;
+ memmove(lpwszValueLocal, lpwszValue, (dwValueSize*sizeof(WCHAR)));
+ bRet = (CallService(MS_DB_CONTACT_WRITESETTING, (WPARAM)hContact, (LPARAM)&cws) == 0);
- MEMFREE(lpwszValueLocal);
+ mir_free(lpwszValueLocal);
}
- }else{
- bRet=TRUE;
- DBDeleteContactSetting(hContact,lpszModule,lpszValueName);
}
-return(bRet);
+ else {
+ bRet = TRUE;
+ DBDeleteContactSetting(hContact, lpszModule, lpszValueName);
+ }
+ return bRet;
}
-
-int DB_WriteContactSettingBlob(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPVOID lpValue,SIZE_T dwValueSize)
+int DB_WriteContactSettingBlob(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPVOID lpValue, size_t dwValueSize)
{
- DBCONTACTWRITESETTING cws={0};
+ DBCONTACTWRITESETTING cws = {0};
- cws.szModule=lpszModule;
- cws.szSetting=lpszValueName;
- cws.value.type=DBVT_BLOB;
- cws.value.pbVal=(LPBYTE)lpValue;
- cws.value.cpbVal=(WORD)dwValueSize;
-return(CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws));
+ cws.szModule = lpszModule;
+ cws.szSetting = lpszValueName;
+ cws.value.type = DBVT_BLOB;
+ cws.value.pbVal = (LPBYTE)lpValue;
+ cws.value.cpbVal = (WORD)dwValueSize;
+ return CallService(MS_DB_CONTACT_WRITESETTING, (WPARAM)hContact, (LPARAM)&cws);
}
-
-BOOL DB_GetContactSettingBlob(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPVOID lpRet,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize)
+BOOL DB_GetContactSettingBlob(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPVOID lpRet, size_t dwRetBuffSize, size_t *pdwRetBuffSize)
{
- BOOL bRet=FALSE;
+ BOOL bRet = FALSE;
DBVARIANT dbv;
- DBCONTACTGETSETTING sVal={0};
+ DBCONTACTGETSETTING sVal = {0};
- sVal.pValue=&dbv;
- sVal.szModule=lpszModule;
- sVal.szSetting=lpszValueName;
- if (CallService(MS_DB_CONTACT_GETSETTING,(WPARAM)hContact,(LPARAM)&sVal)==0)
+ sVal.pValue = &dbv;
+ sVal.szModule = lpszModule;
+ sVal.szSetting = lpszValueName;
+ if (CallService(MS_DB_CONTACT_GETSETTING, (WPARAM)hContact, (LPARAM)&sVal) == 0)
{
- if (dbv.type==DBVT_BLOB)
+ if (dbv.type == DBVT_BLOB)
{
- if (dwRetBuffSize>=dbv.cpbVal)
+ if (dwRetBuffSize >= dbv.cpbVal)
{
- memmove(lpRet,dbv.pbVal,dbv.cpbVal);
- bRet=TRUE;
+ memmove(lpRet, dbv.pbVal, dbv.cpbVal);
+ bRet = TRUE;
}
- if (pdwRetBuffSize) (*pdwRetBuffSize)=dbv.cpbVal;
+ if (pdwRetBuffSize) (*pdwRetBuffSize) = dbv.cpbVal;
}
DBFreeVariant(&dbv);
- }else{
- if (pdwRetBuffSize) (*pdwRetBuffSize)=0;
- bRet=FALSE;
}
-return(bRet);
+ else {
+ if (pdwRetBuffSize) (*pdwRetBuffSize) = 0;
+ bRet = FALSE;
+ }
+ return(bRet);
}
-
-DWORD GetContactFlags(HANDLE hContact)
+DWORD CMraProto::GetContactFlags(HANDLE hContact)
{
- DWORD dwRet=0;
+ DWORD dwRet = 0;
if (IsContactMra(hContact))
{
CHAR szEMail[MAX_EMAIL_LEN];
- SIZE_T dwEMailSize;
+ size_t dwEMailSize;
- dwRet=DB_Mra_GetDword(hContact,"ContactFlags",0);
- dwRet&=~(CONTACT_FLAG_REMOVED|CONTACT_FLAG_GROUP|CONTACT_FLAG_INVISIBLE|CONTACT_FLAG_VISIBLE|CONTACT_FLAG_IGNORE|CONTACT_FLAG_SHADOW|CONTACT_FLAG_MULTICHAT);
- dwRet|=CONTACT_FLAG_UNICODE_NAME;
+ dwRet = mraGetDword(hContact, "ContactFlags", 0);
+ dwRet &= ~(CONTACT_FLAG_REMOVED|CONTACT_FLAG_GROUP|CONTACT_FLAG_INVISIBLE|CONTACT_FLAG_VISIBLE|CONTACT_FLAG_IGNORE|CONTACT_FLAG_SHADOW|CONTACT_FLAG_MULTICHAT);
+ dwRet |= CONTACT_FLAG_UNICODE_NAME;
- if (DB_Mra_GetStaticStringA(hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ if (mraGetStaticStringA(hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize))
{
- if (IsEMailChatAgent(szEMail,dwEMailSize))
+ if (IsEMailChatAgent(szEMail, dwEMailSize))
{
- dwRet|=CONTACT_FLAG_MULTICHAT;
+ dwRet |= CONTACT_FLAG_MULTICHAT;
}
}
- if (DBGetContactSettingByte(hContact,"CList","Hidden",0)) dwRet|=CONTACT_FLAG_SHADOW;
+ if (db_get_b(hContact, "CList", "Hidden", 0)) dwRet |= CONTACT_FLAG_SHADOW;
- switch(DB_Mra_GetWord(hContact,"ApparentMode",0)) {
+ switch (mraGetWord(hContact, "ApparentMode", 0)) {
case ID_STATUS_OFFLINE:
- dwRet|=CONTACT_FLAG_INVISIBLE;
+ dwRet |= CONTACT_FLAG_INVISIBLE;
break;
case ID_STATUS_ONLINE:
- dwRet|=CONTACT_FLAG_VISIBLE;
+ dwRet |= CONTACT_FLAG_VISIBLE;
break;
}
- if (CallService(MS_IGNORE_ISIGNORED,(WPARAM)hContact,IGNOREEVENT_MESSAGE)) dwRet|=CONTACT_FLAG_IGNORE;
+ if (CallService(MS_IGNORE_ISIGNORED, (WPARAM)hContact, IGNOREEVENT_MESSAGE)) dwRet |= CONTACT_FLAG_IGNORE;
}
-return(dwRet);
+ return(dwRet);
}
-DWORD SetContactFlags(HANDLE hContact,DWORD dwContactFlag)
+DWORD CMraProto::SetContactFlags(HANDLE hContact, DWORD dwContactFlag)
{
- DWORD dwRetErrorCode=NO_ERROR;
+ if ( !IsContactMra(hContact))
+ return ERROR_INVALID_HANDLE;
- if (IsContactMra(hContact))
- {
- DB_Mra_SetDword(hContact,"ContactFlags",dwContactFlag);
+ mraSetDword(hContact, "ContactFlags", dwContactFlag);
- if (dwContactFlag&CONTACT_FLAG_SHADOW)
- {
- DBWriteContactSettingByte(hContact,"CList","Hidden",1);
- }else{
- DBDeleteContactSetting(hContact,"CList","Hidden");
- }
- switch(dwContactFlag&(CONTACT_FLAG_INVISIBLE|CONTACT_FLAG_VISIBLE)) {
- case CONTACT_FLAG_INVISIBLE:
- DB_Mra_SetWord(hContact,"ApparentMode",ID_STATUS_OFFLINE);
- break;
- case CONTACT_FLAG_VISIBLE:
- DB_Mra_SetWord(hContact,"ApparentMode",ID_STATUS_ONLINE);
- break;
- default:
- DB_Mra_SetWord(hContact,"ApparentMode",0);
- break;
- }
+ if (dwContactFlag&CONTACT_FLAG_SHADOW)
+ DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
+ else
+ DBDeleteContactSetting(hContact, "CList", "Hidden");
- if (dwContactFlag&CONTACT_FLAG_IGNORE)
- {
- CallService(MS_IGNORE_IGNORE,(WPARAM)hContact,IGNOREEVENT_MESSAGE);
- }else{
- CallService(MS_IGNORE_UNIGNORE,(WPARAM)hContact,IGNOREEVENT_MESSAGE);
- }
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ switch (dwContactFlag&(CONTACT_FLAG_INVISIBLE|CONTACT_FLAG_VISIBLE)) {
+ case CONTACT_FLAG_INVISIBLE:
+ mraSetWord(hContact, "ApparentMode", ID_STATUS_OFFLINE);
+ break;
+ case CONTACT_FLAG_VISIBLE:
+ mraSetWord(hContact, "ApparentMode", ID_STATUS_ONLINE);
+ break;
+ default:
+ mraSetWord(hContact, "ApparentMode", 0);
+ break;
}
-return(dwRetErrorCode);
-}
+ if (dwContactFlag&CONTACT_FLAG_IGNORE)
+ CallService(MS_IGNORE_IGNORE, (WPARAM)hContact, IGNOREEVENT_MESSAGE);
+ else
+ CallService(MS_IGNORE_UNIGNORE, (WPARAM)hContact, IGNOREEVENT_MESSAGE);
+
+ return 0;
+}
-DWORD GetContactBasicInfoW(HANDLE hContact,DWORD *pdwID,DWORD *pdwGroupID,DWORD *pdwContactFlag,DWORD *pdwContactSeverFlags,DWORD *pdwStatus,LPSTR lpszEMail,SIZE_T dwEMailSize,SIZE_T *pdwEMailSize,LPWSTR lpwszNick,SIZE_T dwNickSize,SIZE_T *pdwNickSize,LPSTR lpszPhones,SIZE_T dwPhonesSize,SIZE_T *pdwPhonesSize)
+DWORD CMraProto::GetContactBasicInfoW(HANDLE hContact, DWORD *pdwID, DWORD *pdwGroupID, DWORD *pdwContactFlag, DWORD *pdwContactSeverFlags, DWORD *pdwStatus, LPSTR lpszEMail, size_t dwEMailSize, size_t *pdwEMailSize, LPWSTR lpwszNick, size_t dwNickSize, size_t *pdwNickSize, LPSTR lpszPhones, size_t dwPhonesSize, size_t *pdwPhonesSize)
{
- DWORD dwRetErrorCode=NO_ERROR;
+ DWORD dwRetErrorCode = NO_ERROR;
if (IsContactMra(hContact))
{
- if (pdwID) (*pdwID)=DB_Mra_GetDword(hContact,"ContactID",-1);
- if (pdwGroupID) (*pdwGroupID)=DB_Mra_GetDword(hContact,"GroupID",-1);
- if (pdwContactSeverFlags) (*pdwContactSeverFlags)=DB_Mra_GetDword(hContact,"ContactSeverFlags",0);
- if (pdwStatus) (*pdwStatus)=MraGetContactStatus(hContact);
- if (pdwContactFlag) (*pdwContactFlag)=GetContactFlags(hContact);
+ if (pdwID) (*pdwID) = mraGetDword(hContact, "ContactID", -1);
+ if (pdwGroupID) (*pdwGroupID) = mraGetDword(hContact, "GroupID", -1);
+ if (pdwContactSeverFlags) (*pdwContactSeverFlags) = mraGetDword(hContact, "ContactSeverFlags", 0);
+ if (pdwStatus) (*pdwStatus) = MraGetContactStatus(hContact);
+ if (pdwContactFlag) (*pdwContactFlag) = GetContactFlags(hContact);
- if (lpszEMail && pdwEMailSize) DB_Mra_GetStaticStringA(hContact,"e-mail",lpszEMail,dwEMailSize,pdwEMailSize);
+ if (lpszEMail && pdwEMailSize) mraGetStaticStringA(hContact, "e-mail", lpszEMail, dwEMailSize, pdwEMailSize);
if (lpwszNick && pdwNickSize)
{
- DB_GetStaticStringW(hContact,"CList","MyHandle",lpwszNick,dwNickSize,pdwNickSize);
- //if ((*pdwNickSize)==0) DebugBreak();
+ DB_GetStaticStringW(hContact, "CList", "MyHandle", lpwszNick, dwNickSize, pdwNickSize);
+ //if ((*pdwNickSize) == 0) DebugBreak();
}
if (lpszPhones && pdwPhonesSize)
{
- char szPhone[MAX_PATH],szValue[MAX_PATH];
- SIZE_T dwPhoneSize,dwCopyed=0;
+ char szPhone[MAX_PATH], szValue[MAX_PATH];
+ size_t dwPhoneSize, dwCopyed = 0;
- for(SIZE_T i=0;i<3;i++)
+ for (size_t i = 0;i<3;i++)
{
- mir_snprintf(szValue,SIZEOF(szValue),"MyPhone%lu",i);
- if (DB_GetStaticStringA(hContact,"UserInfo",szValue,szPhone,SIZEOF(szPhone),&dwPhoneSize))
+ mir_snprintf(szValue, SIZEOF(szValue), "MyPhone%lu", i);
+ if (DB_GetStaticStringA(hContact, "UserInfo", szValue, szPhone, SIZEOF(szPhone), &dwPhoneSize))
{
- if (dwCopyed) (*((LPBYTE)(lpszPhones+dwCopyed++)))=',';
- dwCopyed+=CopyNumber((lpszPhones+dwCopyed),szPhone,dwPhoneSize);
+ if (dwCopyed) (*((LPBYTE)(lpszPhones+dwCopyed++))) = ',';
+ dwCopyed += CopyNumber((lpszPhones+dwCopyed), szPhone, dwPhoneSize);
}
}
- (*pdwPhonesSize)=dwCopyed;
+ (*pdwPhonesSize) = dwCopyed;
}
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }else {
+ dwRetErrorCode = ERROR_INVALID_HANDLE;
}
return(dwRetErrorCode);
}
-DWORD SetContactBasicInfoW(HANDLE hContact,DWORD dwSetInfoFlags,DWORD dwFlags,DWORD dwID,DWORD dwGroupID,DWORD dwContactFlag,DWORD dwContactSeverFlags,DWORD dwStatus,LPSTR lpszEMail,SIZE_T dwEMailSize,LPWSTR lpwszNick,SIZE_T dwNickSize,LPSTR lpszPhones,SIZE_T dwPhonesSize)
+DWORD CMraProto::SetContactBasicInfoW(HANDLE hContact, DWORD dwSetInfoFlags, DWORD dwFlags, DWORD dwID, DWORD dwGroupID, DWORD dwContactFlag, DWORD dwContactSeverFlags, DWORD dwStatus, LPSTR lpszEMail, size_t dwEMailSize, LPWSTR lpwszNick, size_t dwNickSize, LPSTR lpszPhones, size_t dwPhonesSize)
{
- DWORD dwRetErrorCode=NO_ERROR;
+ DWORD dwRetErrorCode = NO_ERROR;
if (IsContactMra(hContact))
{
// LOCK
- if (dwSetInfoFlags&SCBIFSI_LOCK_CHANGES_EVENTS) DB_Mra_SetDword(hContact,"HooksLocked",TRUE);
+ if (dwSetInfoFlags&SCBIFSI_LOCK_CHANGES_EVENTS) mraSetDword(hContact, "HooksLocked", TRUE);
// поля которые нужны, и изменения которых не отслеживаются
- if(dwFlags&SCBIF_ID) DB_Mra_SetDword(hContact,"ContactID",dwID);
+ if (dwFlags&SCBIF_ID) mraSetDword(hContact, "ContactID", dwID);
- if(dwFlags&SCBIF_EMAIL)
+ if (dwFlags&SCBIF_EMAIL)
{
- if (lpszEMail && dwEMailSize) DB_Mra_SetStringExA(hContact,"e-mail",lpszEMail,dwEMailSize);
+ if (lpszEMail && dwEMailSize) mraSetStringExA(hContact, "e-mail", lpszEMail, dwEMailSize);
}
// поля изменения которых отслеживаются
- if(dwFlags&SCBIF_GROUP_ID) DB_Mra_SetDword(hContact,"GroupID",dwGroupID);
+ if (dwFlags&SCBIF_GROUP_ID) mraSetDword(hContact, "GroupID", dwGroupID);
- if(dwFlags&SCBIF_NICK)
+ if (dwFlags&SCBIF_NICK)
{
- if ((dwFlags&SCBIF_FLAG) && ((dwContactFlag&CONTACT_FLAG_UNICODE_NAME)==0))
+ if ((dwFlags&SCBIF_FLAG) && ((dwContactFlag&CONTACT_FLAG_UNICODE_NAME) == 0))
{
- if (lpwszNick && dwNickSize) DB_SetStringExA(hContact,"CList","MyHandle",(LPSTR)lpwszNick,dwNickSize);
- }else{
- if (lpwszNick && dwNickSize) DB_SetStringExW(hContact,"CList","MyHandle",lpwszNick,dwNickSize);
- //if (dwNickSize==0) DebugBreak();
+ if (lpwszNick && dwNickSize) DB_SetStringExA(hContact, "CList", "MyHandle", (LPSTR)lpwszNick, dwNickSize);
+ }else {
+ if (lpwszNick && dwNickSize) DB_SetStringExW(hContact, "CList", "MyHandle", lpwszNick, dwNickSize);
+ //if (dwNickSize == 0) DebugBreak();
}
}
- if(dwFlags&SCBIF_PHONES)
+ if (dwFlags&SCBIF_PHONES)
{
if (lpszPhones && dwPhonesSize)
{
- char szPhone[MAX_PATH],szValue[MAX_PATH];
- LPSTR lpszCurPhone,lpszPhoneNext;
- SIZE_T i,dwCurPhoneSize;
+ char szPhone[MAX_PATH], szValue[MAX_PATH];
+ LPSTR lpszCurPhone, lpszPhoneNext;
+ size_t i, dwCurPhoneSize;
- i=0;
- lpszCurPhone=lpszPhones;
- lpszPhoneNext=lpszPhones;
+ i = 0;
+ lpszCurPhone = lpszPhones;
+ lpszPhoneNext = lpszPhones;
while(lpszPhoneNext)
{
- lpszPhoneNext=(LPSTR)MemoryFindByte((lpszCurPhone-lpszPhones),lpszPhones,dwPhonesSize,',');
+ lpszPhoneNext = (LPSTR)MemoryFindByte((lpszCurPhone-lpszPhones), lpszPhones, dwPhonesSize, ',');
if (lpszPhoneNext)
{
- dwCurPhoneSize=(lpszPhoneNext-lpszCurPhone);
- }else{
- dwCurPhoneSize=((lpszPhones+dwPhonesSize)-lpszCurPhone);
+ dwCurPhoneSize = (lpszPhoneNext-lpszCurPhone);
+ }else {
+ dwCurPhoneSize = ((lpszPhones+dwPhonesSize)-lpszCurPhone);
}
- szPhone[0]='+';
- memmove((szPhone+1),lpszCurPhone,min(dwCurPhoneSize,(SIZEOF(szPhone)-1)));
- mir_snprintf(szValue,SIZEOF(szValue),"MyPhone%lu",i);
- DB_SetStringExA(hContact,"UserInfo",szValue,szPhone,(1+dwCurPhoneSize));
+ szPhone[0] = '+';
+ memmove((szPhone+1), lpszCurPhone, min(dwCurPhoneSize, (SIZEOF(szPhone)-1)));
+ mir_snprintf(szValue, SIZEOF(szValue), "MyPhone%lu", i);
+ DB_SetStringExA(hContact, "UserInfo", szValue, szPhone, (1+dwCurPhoneSize));
i++;
- lpszCurPhone=(lpszPhoneNext+1);
+ lpszCurPhone = (lpszPhoneNext+1);
}
}
}
- if(dwFlags&SCBIF_FLAG) SetContactFlags(hContact,dwContactFlag);
+ if (dwFlags&SCBIF_FLAG) SetContactFlags(hContact, dwContactFlag);
- if(dwFlags&SCBIF_SERVER_FLAG) DB_Mra_SetDword(hContact,"ContactSeverFlags",dwContactSeverFlags);
+ if (dwFlags&SCBIF_SERVER_FLAG) mraSetDword(hContact, "ContactSeverFlags", dwContactSeverFlags);
- if(dwFlags&SCBIF_STATUS) MraSetContactStatus(hContact,dwStatus);
+ if (dwFlags&SCBIF_STATUS) MraSetContactStatus(hContact, dwStatus);
SetExtraIcons(hContact);
// UNLOCK
- if (dwSetInfoFlags&SCBIFSI_LOCK_CHANGES_EVENTS) DB_Mra_SetDword(hContact,"HooksLocked",FALSE);
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ if (dwSetInfoFlags&SCBIFSI_LOCK_CHANGES_EVENTS) mraSetDword(hContact, "HooksLocked", FALSE);
+ }else {
+ dwRetErrorCode = ERROR_INVALID_HANDLE;
}
return(dwRetErrorCode);
}
-
-
-HANDLE MraHContactFromEmail(LPSTR lpszEMail,SIZE_T dwEMailSize,BOOL bAddIfNeeded,BOOL bTemporary,BOOL *pbAdded)
+HANDLE CMraProto::MraHContactFromEmail(LPSTR lpszEMail, size_t dwEMailSize, BOOL bAddIfNeeded, BOOL bTemporary, BOOL *pbAdded)
{
- HANDLE hContact=NULL;
+ HANDLE hContact = NULL;
if (lpszEMail && dwEMailSize)
{
- BOOL bFounded=FALSE;
+ BOOL bFound = FALSE;
CHAR szEMailLocal[MAX_EMAIL_LEN];
- SIZE_T dwEMailLocalSize;
+ size_t dwEMailLocalSize;
- if (dwEMailSize==-1) dwEMailSize=lstrlenA(lpszEMail);
+ if (dwEMailSize == -1) dwEMailSize = lstrlenA(lpszEMail);
//check not already on list
- for(hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ for (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
{
if (IsContactMra(hContact))
- if (DB_Mra_GetStaticStringA(hContact,"e-mail",szEMailLocal,SIZEOF(szEMailLocal),&dwEMailLocalSize))
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,szEMailLocal,dwEMailLocalSize,lpszEMail,dwEMailSize)==CSTR_EQUAL)
+ if (mraGetStaticStringA(hContact, "e-mail", szEMailLocal, SIZEOF(szEMailLocal), &dwEMailLocalSize))
+ if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, szEMailLocal, dwEMailLocalSize, lpszEMail, dwEMailSize) == CSTR_EQUAL)
{
- if (bTemporary==FALSE) DBDeleteContactSetting(hContact,"CList","NotOnList");
- bFounded=TRUE;
+ if (bTemporary == FALSE) DBDeleteContactSetting(hContact, "CList", "NotOnList");
+ bFound = TRUE;
break;
}
}
- if (bFounded==FALSE && bAddIfNeeded)
+ if (bFound == FALSE && bAddIfNeeded)
{//not already there: add
- if (IsEMailChatAgent(lpszEMail,dwEMailSize))
+ if (IsEMailChatAgent(lpszEMail, dwEMailSize))
{
- GCSESSION gcw={0};
- WCHAR wszEMail[MAX_EMAIL_LEN]={0};
-
- gcw.cbSize=sizeof(GCSESSION);
- gcw.iType=GCW_CHATROOM;
- gcw.pszModule=PROTOCOL_NAMEA;
- gcw.ptszName=wszEMail;
- gcw.ptszID=(LPWSTR)wszEMail;
- gcw.dwFlags=GC_UNICODE;
- MultiByteToWideChar(MRA_CODE_PAGE,0,lpszEMail,dwEMailSize,wszEMail,SIZEOF(wszEMail));
-
- if (CallServiceSync(MS_GC_NEWSESSION,NULL,(LPARAM)&gcw)==0)
+ GCSESSION gcw = {0};
+ WCHAR wszEMail[MAX_EMAIL_LEN] = {0};
+
+ gcw.cbSize = sizeof(GCSESSION);
+ gcw.iType = GCW_CHATROOM;
+ gcw.pszModule = m_szModuleName;
+ gcw.ptszName = wszEMail;
+ gcw.ptszID = (LPWSTR)wszEMail;
+ gcw.dwFlags = GC_UNICODE;
+ MultiByteToWideChar(MRA_CODE_PAGE, 0, lpszEMail, dwEMailSize, wszEMail, SIZEOF(wszEMail));
+
+ if (CallServiceSync(MS_GC_NEWSESSION, NULL, (LPARAM)&gcw) == 0)
{
- BOOL bChatAdded=FALSE;
- for(hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ BOOL bChatAdded = FALSE;
+ for (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
{
if (IsContactMra(hContact))
- if (DB_Mra_GetStaticStringA(hContact,"ChatRoomID",szEMailLocal,SIZEOF(szEMailLocal),&dwEMailLocalSize))
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,szEMailLocal,dwEMailLocalSize,lpszEMail,dwEMailSize)==CSTR_EQUAL)
+ if (mraGetStaticStringA(hContact, "ChatRoomID", szEMailLocal, SIZEOF(szEMailLocal), &dwEMailLocalSize))
+ if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, szEMailLocal, dwEMailLocalSize, lpszEMail, dwEMailSize) == CSTR_EQUAL)
{
- bChatAdded=TRUE;
+ bChatAdded = TRUE;
break;
}
}
- if (bChatAdded==FALSE) hContact=NULL;
+ if (bChatAdded == FALSE) hContact = NULL;
}
- }else{
- hContact=(HANDLE)CallService(MS_DB_CONTACT_ADD,0,0);
- CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)PROTOCOL_NAMEA);
+ }else {
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName);
}
- if (hContact)
- {
- if (IsEMailChatAgent(lpszEMail,dwEMailSize))
- {
- SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,(SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS|SCBIF_EMAIL),-1,-1,0,CONTACT_INTFLAG_NOT_AUTHORIZED,ID_STATUS_ONLINE,lpszEMail,dwEMailSize,NULL,0,NULL,0);
- }else{
- if (bTemporary) DBWriteContactSettingByte(hContact,"CList","NotOnList",1);
- DB_Mra_SetStringExA(hContact,"MirVer",MIRVER_UNKNOWN,(sizeof(MIRVER_UNKNOWN)-1));
- SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,(SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS|SCBIF_EMAIL),-1,-1,0,CONTACT_INTFLAG_NOT_AUTHORIZED,ID_STATUS_OFFLINE,lpszEMail,dwEMailSize,NULL,0,NULL,0);
+ if (hContact) {
+ if (IsEMailChatAgent(lpszEMail, dwEMailSize))
+ SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS|SCBIF_EMAIL), -1, -1, 0, CONTACT_INTFLAG_NOT_AUTHORIZED, ID_STATUS_ONLINE, lpszEMail, dwEMailSize, NULL, 0, NULL, 0);
+ else {
+ if (bTemporary)
+ DBWriteContactSettingByte(hContact, "CList", "NotOnList", 1);
+ mraSetStringExA(hContact, "MirVer", MIRVER_UNKNOWN, (sizeof(MIRVER_UNKNOWN)-1));
+ SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS|SCBIF_EMAIL), -1, -1, 0, CONTACT_INTFLAG_NOT_AUTHORIZED, ID_STATUS_OFFLINE, lpszEMail, dwEMailSize, NULL, 0, NULL, 0);
}
}
}
- if (pbAdded) (*pbAdded)=(bFounded==FALSE && bAddIfNeeded && hContact);
+ if (pbAdded) (*pbAdded) = (bFound == FALSE && bAddIfNeeded && hContact);
}
-return(hContact);
+ return hContact;
}
-
-
-BOOL MraUpdateContactInfo(HANDLE hContact)
+BOOL CMraProto::MraUpdateContactInfo(HANDLE hContact)
{
- BOOL bRet=FALSE;
+ BOOL bRet = FALSE;
- if (masMraSettings.bLoggedIn && hContact)
- if (IsContactMra(hContact))
- {
+ if (m_bLoggedIn && hContact)
+ if (IsContactMra(hContact)) {
CHAR szEMail[MAX_EMAIL_LEN];
- SIZE_T dwEMailSize;
+ size_t dwEMailSize;
- if (DB_Mra_GetStaticStringA(hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- MraAvatarsQueueGetAvatarSimple(masMraSettings.hAvatarsQueueHandle,GAIF_FORCE,hContact,0);
+ if (mraGetStaticStringA(hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize)) {
+ MraAvatarsQueueGetAvatarSimple(hAvatarsQueueHandle, GAIF_FORCE, hContact, 0);
- if (MraSendCommand_WPRequestByEMail(hContact,ACKTYPE_GETINFO,szEMail,dwEMailSize))
- {
- bRet=TRUE;
- }
+ if (MraWPRequestByEMail(hContact, ACKTYPE_GETINFO, szEMail, dwEMailSize))
+ bRet = TRUE;
}
}
-return(bRet);
+ return bRet;
}
-
-
-DWORD MraContactCapabilitiesGet(HANDLE hContact)
+DWORD CMraProto::MraContactCapabilitiesGet(HANDLE hContact)
{
-return(DB_Mra_GetDword(hContact,DBSETTING_CAPABILITIES,0));
+ return mraGetDword(hContact, DBSETTING_CAPABILITIES, 0);
}
-void MraContactCapabilitiesSet(HANDLE hContact,DWORD dwFutureFlags)
+void CMraProto::MraContactCapabilitiesSet(HANDLE hContact, DWORD dwFutureFlags)
{
- DB_Mra_SetDword(hContact,DBSETTING_CAPABILITIES,dwFutureFlags);
+ mraSetDword(hContact, DBSETTING_CAPABILITIES, dwFutureFlags);
}
-
-DWORD MraGetContactStatus(HANDLE hContact)
+DWORD CMraProto::MraGetContactStatus(HANDLE hContact)
{
-return(DB_Mra_GetWord(hContact,"Status",ID_STATUS_OFFLINE));
+ return mraGetWord(hContact, "Status", ID_STATUS_OFFLINE);
}
-
-DWORD MraSetContactStatus(HANDLE hContact,DWORD dwNewStatus)
+DWORD CMraProto::MraSetContactStatus(HANDLE hContact, DWORD dwNewStatus)
{
- DWORD dwOldStatus=MraGetContactStatus(hContact);
+ DWORD dwOldStatus = MraGetContactStatus(hContact);
- if (dwNewStatus!=dwOldStatus)
+ if (dwNewStatus != dwOldStatus)
{
BOOL bChatAgent;
- bChatAgent=IsContactChatAgent(hContact);
+ bChatAgent = IsContactChatAgent(hContact);
- if (dwNewStatus==ID_STATUS_OFFLINE)
+ if (dwNewStatus == ID_STATUS_OFFLINE)
{
if (hContact)
{
- DB_Mra_SetByte(hContact,DBSETTING_XSTATUSID,MRA_MIR_XSTATUS_NONE);
- DB_Mra_DeleteValue(hContact,DBSETTING_XSTATUSNAME);
- DB_Mra_DeleteValue(hContact,DBSETTING_XSTATUSMSG);
- DB_Mra_DeleteValue(hContact,DBSETTING_BLOGSTATUSTIME);
- DB_Mra_DeleteValue(hContact,DBSETTING_BLOGSTATUSID);
- DB_Mra_DeleteValue(hContact,DBSETTING_BLOGSTATUS);
- DB_Mra_DeleteValue(hContact,DBSETTING_BLOGSTATUSMUSIC);
- MraContactCapabilitiesSet(hContact,0);
+ mraSetByte(hContact, DBSETTING_XSTATUSID, MRA_MIR_XSTATUS_NONE);
+ mraDelValue(hContact, DBSETTING_XSTATUSNAME);
+ mraDelValue(hContact, DBSETTING_XSTATUSMSG);
+ mraDelValue(hContact, DBSETTING_BLOGSTATUSTIME);
+ mraDelValue(hContact, DBSETTING_BLOGSTATUSID);
+ mraDelValue(hContact, DBSETTING_BLOGSTATUS);
+ mraDelValue(hContact, DBSETTING_BLOGSTATUSMUSIC);
+ MraContactCapabilitiesSet(hContact, 0);
if (bChatAgent) MraChatSessionDestroy(hContact);
}
- DB_Mra_SetDword(hContact,"LogonTS",0);
- DB_Mra_DeleteValue(hContact,"IP");
- DB_Mra_DeleteValue(hContact,"RealIP");
- }else{
- if (dwOldStatus==ID_STATUS_OFFLINE)
+ mraSetDword(hContact, "LogonTS", 0);
+ mraDelValue(hContact, "IP");
+ mraDelValue(hContact, "RealIP");
+ }else {
+ if (dwOldStatus == ID_STATUS_OFFLINE)
{
- DWORD dwTime=(DWORD)_time32(NULL);
+ DWORD dwTime = (DWORD)_time32(NULL);
- DB_Mra_SetDword(hContact,"LogonTS",dwTime);
- DB_Mra_SetDword(hContact,"OldLogonTS",dwTime);
+ mraSetDword(hContact, "LogonTS", dwTime);
+ mraSetDword(hContact, "OldLogonTS", dwTime);
if (bChatAgent) MraChatSessionNew(hContact);
}
- MraAvatarsQueueGetAvatarSimple(masMraSettings.hAvatarsQueueHandle,0,hContact,0);
+ MraAvatarsQueueGetAvatarSimple(hAvatarsQueueHandle, 0, hContact, 0);
}
- DB_Mra_SetWord(hContact,"Status",(WORD)dwNewStatus);
+ mraSetWord(hContact, "Status", (WORD)dwNewStatus);
}
-return(dwOldStatus);
+ return(dwOldStatus);
}
-
-void MraUpdateEmailStatus(LPSTR lpszFrom,SIZE_T dwFromSize,LPSTR lpszSubject,SIZE_T dwSubjectSize,DWORD dwDate,DWORD dwUIDL)
+void CMraProto::MraUpdateEmailStatus(LPSTR lpszFrom, size_t dwFromSize, LPSTR lpszSubject, size_t dwSubjectSize, DWORD dwDate, DWORD dwUIDL)
{
BOOL bTrayIconNewMailNotify;
WCHAR szStatusText[MAX_SECONDLINE];
- bTrayIconNewMailNotify=DB_Mra_GetByte(NULL,"TrayIconNewMailNotify",MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY);
+ bTrayIconNewMailNotify = mraGetByte(NULL, "TrayIconNewMailNotify", MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY);
- if (masMraSettings.dwEmailMessagesUnRead)
+ if (dwEmailMessagesUnread)
{
LPSTR lpszEMail;
- SIZE_T dwEMailSize;
- HANDLE hContact=NULL;
+ size_t dwEMailSize;
+ HANDLE hContact = NULL;
WCHAR szMailBoxStatus[MAX_SECONDLINE];
- mir_sntprintf(szMailBoxStatus,SIZEOF(szMailBoxStatus),TranslateW(L"Unread mail is available: %lu/%lu messages"),masMraSettings.dwEmailMessagesUnRead,masMraSettings.dwEmailMessagesTotal);
+ mir_sntprintf(szMailBoxStatus, SIZEOF(szMailBoxStatus), TranslateW(L"Unread mail is available: %lu/%lu messages"), dwEmailMessagesUnread, dwEmailMessagesTotal);
if ((lpszFrom && dwFromSize) || (lpszSubject && dwSubjectSize))
{
- WCHAR szFrom[MAX_PATH]={0},szSubject[MAX_PATH]={0};
+ WCHAR szFrom[MAX_PATH] = {0}, szSubject[MAX_PATH] = {0};
- if (GetEMailFromString(lpszFrom,dwFromSize,&lpszEMail,&dwEMailSize))
+ if (GetEMailFromString(lpszFrom, dwFromSize, &lpszEMail, &dwEMailSize))
{
- hContact=MraHContactFromEmail(lpszEMail,dwEMailSize,FALSE,TRUE,NULL);
+ hContact = MraHContactFromEmail(lpszEMail, dwEMailSize, FALSE, TRUE, NULL);
}
- dwFromSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpszFrom,dwFromSize,szFrom,SIZEOF(szFrom));
- szFrom[dwFromSize]=0;
+ dwFromSize = MultiByteToWideChar(MRA_CODE_PAGE, 0, lpszFrom, dwFromSize, szFrom, SIZEOF(szFrom));
+ szFrom[dwFromSize] = 0;
- dwSubjectSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpszSubject,dwSubjectSize,szSubject,SIZEOF(szSubject));
- szSubject[dwSubjectSize]=0;
+ dwSubjectSize = MultiByteToWideChar(MRA_CODE_PAGE, 0, lpszSubject, dwSubjectSize, szSubject, SIZEOF(szSubject));
+ szSubject[dwSubjectSize] = 0;
- mir_sntprintf(szStatusText,SIZEOF(szStatusText),TranslateW(L"From: %s\r\nSubject: %s\r\n%s"),szFrom,szSubject,szMailBoxStatus);
- }else{
- lstrcpynW(szStatusText,szMailBoxStatus,SIZEOF(szStatusText));
+ mir_sntprintf(szStatusText, SIZEOF(szStatusText), TranslateW(L"From: %s\r\nSubject: %s\r\n%s"), szFrom, szSubject, szMailBoxStatus);
+ }else {
+ lstrcpynW(szStatusText, szMailBoxStatus, SIZEOF(szStatusText));
}
if (bTrayIconNewMailNotify)
{
- char szServiceFunction[MAX_PATH],*pszServiceFunctionName;
- CLISTEVENT cle={0};
+ char szServiceFunction[MAX_PATH], *pszServiceFunctionName;
+ CLISTEVENT cle = {0};
- cle.cbSize=sizeof(cle);
+ cle.cbSize = sizeof(cle);
//cle.hContact;
//cle.hDbEvent;
- cle.lpszProtocol=PROTOCOL_NAMEA;
- cle.hIcon=IconLibGetIcon(masMraSettings.hMainMenuIcons[0]);
- cle.flags=(CLEF_UNICODE|CLEF_PROTOCOLGLOBAL);
- cle.pszService="";
- cle.ptszTooltip=szStatusText;
+ cle.lpszProtocol = m_szModuleName;
+ cle.hIcon = IconLibGetIcon(hMainMenuIcons[0]);
+ cle.flags = (CLEF_UNICODE|CLEF_PROTOCOLGLOBAL);
+ cle.pszService = "";
+ cle.ptszTooltip = szStatusText;
- if (DB_Mra_GetByte(NULL,"TrayIconNewMailClkToInbox",MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX))
+ if (mraGetByte(NULL, "TrayIconNewMailClkToInbox", MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX))
{
- memmove(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
- pszServiceFunctionName=(szServiceFunction+PROTOCOL_NAME_LEN);
- memmove(pszServiceFunctionName,MRA_GOTO_INBOX,sizeof(MRA_GOTO_INBOX));
- cle.pszService=szServiceFunction;
+ strncpy(szServiceFunction, m_szModuleName, MAX_PATH);
+ pszServiceFunctionName = szServiceFunction+strlen(m_szModuleName);
+ memmove(pszServiceFunctionName, MRA_GOTO_INBOX, sizeof(MRA_GOTO_INBOX));
+ cle.pszService = szServiceFunction;
}
- CallService(MS_CLIST_ADDEVENT,0,(LPARAM)&cle);
+ CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
- SkinPlaySound(masMraSettings.szNewMailSound);
+ SkinPlaySound(szNewMailSound);
if (hContact)
{// update user info
MraUpdateContactInfo(hContact);
- MraPopupShowFromContactW(hContact,MRA_POPUP_TYPE_EMAIL_STATUS,(MRA_POPUP_ALLOW_ENTER),szStatusText);
- }else{
- MraPopupShowFromAgentW(MRA_POPUP_TYPE_EMAIL_STATUS,(MRA_POPUP_ALLOW_ENTER),szStatusText);
+ MraPopupShowFromContactW(hContact, MRA_POPUP_TYPE_EMAIL_STATUS, (MRA_POPUP_ALLOW_ENTER), szStatusText);
+ }else {
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_EMAIL_STATUS, (MRA_POPUP_ALLOW_ENTER), szStatusText);
}
- }else{
- if (DB_Mra_GetByte(NULL,"IncrementalNewMailNotify",MRA_DEFAULT_INC_NEW_MAIL_NOTIFY))
+ }else {
+ if (mraGetByte(NULL, "IncrementalNewMailNotify", MRA_DEFAULT_INC_NEW_MAIL_NOTIFY))
{
- if (bTrayIconNewMailNotify) CallService(MS_CLIST_REMOVEEVENT,0,(LPARAM)PROTOCOL_NAMEA);
- PUDeletePopUp(masMraSettings.hWndEMailPopupStatus);
- masMraSettings.hWndEMailPopupStatus=NULL;
- }else{
- mir_sntprintf(szStatusText,SIZEOF(szStatusText),TranslateW(L"No unread mail is available\r\nTotal messages: %lu"),masMraSettings.dwEmailMessagesTotal);
- MraPopupShowFromAgentW(MRA_POPUP_TYPE_EMAIL_STATUS,(MRA_POPUP_ALLOW_ENTER),szStatusText);
+ if (bTrayIconNewMailNotify) CallService(MS_CLIST_REMOVEEVENT, 0, (LPARAM)m_szModuleName);
+ PUDeletePopUp(hWndEMailPopupStatus);
+ hWndEMailPopupStatus = NULL;
+ }else {
+ mir_sntprintf(szStatusText, SIZEOF(szStatusText), TranslateW(L"No unread mail is available\r\nTotal messages: %lu"), dwEmailMessagesTotal);
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_EMAIL_STATUS, (MRA_POPUP_ALLOW_ENTER), szStatusText);
}
}
}
@@ -893,61 +821,59 @@ BOOL IsUnicodeEnv()
BOOL IsHTTPSProxyUsed(HANDLE hNetlibUser)
{
- BOOL bRet=FALSE;
- NETLIBUSERSETTINGS nlus={0};
+ BOOL bRet = FALSE;
+ NETLIBUSERSETTINGS nlus = {0};
- nlus.cbSize=sizeof(nlus);
- if (CallService(MS_NETLIB_GETUSERSETTINGS,(WPARAM)hNetlibUser,(LPARAM)&nlus))
+ nlus.cbSize = sizeof(nlus);
+ if (CallService(MS_NETLIB_GETUSERSETTINGS, (WPARAM)hNetlibUser, (LPARAM)&nlus))
{
- if (nlus.useProxy && nlus.proxyType==PROXYTYPE_HTTPS) bRet=TRUE;
+ if (nlus.useProxy && nlus.proxyType == PROXYTYPE_HTTPS) bRet = TRUE;
}
-return(bRet);
+ return(bRet);
}
-
-BOOL IsContactMra(HANDLE hContact)
-{// определяет принадлежность контакта данной копии плагина
-return(CallService(MS_PROTO_ISPROTOONCONTACT,(WPARAM)hContact,(LPARAM)PROTOCOL_NAMEA));
+// определяет принадлежность контакта данной копии плагина
+BOOL CMraProto::IsContactMra(HANDLE hContact)
+{
+ return(CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName));
}
-
+// определяется является ли контакт контактом MRA протокола, не зависимо от того какому плагину он принадлежит
BOOL IsContactMraProto(HANDLE hContact)
-{// определяется является ли контакт контактом MRA протокола, не зависимо от того какому плагину он принадлежит
- BOOL bRet=FALSE;
- LPSTR lpszProto=(LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
+{
+ BOOL bRet = FALSE;
+ LPSTR lpszProto = (LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (lpszProto)
{
WCHAR szBuff[MAX_PATH];
- if (DB_GetStaticStringW(hContact,lpszProto,"AvatarLastCheckTime",szBuff,SIZEOF(szBuff),NULL))
- if (DB_GetStaticStringW(hContact,lpszProto,"AvatarLastModifiedTime",szBuff,SIZEOF(szBuff),NULL))
+ if (DB_GetStaticStringW(hContact, lpszProto, "AvatarLastCheckTime", szBuff, SIZEOF(szBuff), NULL))
+ if (DB_GetStaticStringW(hContact, lpszProto, "AvatarLastModifiedTime", szBuff, SIZEOF(szBuff), NULL))
{
- bRet=TRUE;
+ bRet = TRUE;
}
}
-return(bRet);
+ return(bRet);
}
-
-
-BOOL IsEMailMy(LPSTR lpszEMail,SIZE_T dwEMailSize)
+BOOL CMraProto::IsEMailMy(LPSTR lpszEMail, size_t dwEMailSize)
{
- BOOL bRet=FALSE;
+ BOOL bRet = FALSE;
if (lpszEMail)
{
CHAR szEMailMy[MAX_EMAIL_LEN];
- SIZE_T dwEMailMySize;
+ size_t dwEMailMySize;
- if (DB_Mra_GetStaticStringA(NULL,"e-mail",szEMailMy,SIZEOF(szEMailMy),&dwEMailMySize))
+ if (mraGetStaticStringA(NULL, "e-mail", szEMailMy, SIZEOF(szEMailMy), &dwEMailMySize))
{
- if (dwEMailSize==0) dwEMailSize=lstrlenA(lpszEMail);
+ if (dwEMailSize == 0) dwEMailSize = lstrlenA(lpszEMail);
- if (dwEMailMySize==dwEMailSize)
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszEMail,dwEMailSize,szEMailMy,dwEMailMySize)==CSTR_EQUAL)
+ if (dwEMailMySize == dwEMailSize)
+ if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszEMail, dwEMailSize, szEMailMy, dwEMailMySize) == CSTR_EQUAL)
{
- bRet=TRUE;
+ bRet = TRUE;
}
}
}
@@ -955,19 +881,19 @@ return(bRet);
}
-BOOL IsEMailChatAgent(LPSTR lpszEMail,SIZE_T dwEMailSize)
+BOOL CMraProto::IsEMailChatAgent(LPSTR lpszEMail, size_t dwEMailSize)
{
- BOOL bRet=FALSE;
+ BOOL bRet = FALSE;
if (lpszEMail)
{
- if (dwEMailSize==0) dwEMailSize=lstrlenA(lpszEMail);
+ if (dwEMailSize == 0) dwEMailSize = lstrlenA(lpszEMail);
if ((sizeof(MAILRU_CHAT_CONF_DOMAIN)-1)<dwEMailSize)
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,MAILRU_CHAT_CONF_DOMAIN,(sizeof(MAILRU_CHAT_CONF_DOMAIN)-1),(lpszEMail+(dwEMailSize-(sizeof(MAILRU_CHAT_CONF_DOMAIN)-1))),(sizeof(MAILRU_CHAT_CONF_DOMAIN)-1))==CSTR_EQUAL)
+ if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, MAILRU_CHAT_CONF_DOMAIN, (sizeof(MAILRU_CHAT_CONF_DOMAIN)-1), (lpszEMail+(dwEMailSize-(sizeof(MAILRU_CHAT_CONF_DOMAIN)-1))), (sizeof(MAILRU_CHAT_CONF_DOMAIN)-1)) == CSTR_EQUAL)
{
- if ( (*(BYTE*)(lpszEMail+((dwEMailSize-(sizeof(MAILRU_CHAT_CONF_DOMAIN)-1))-1)))=='@' )
+ if ( (*(BYTE*)(lpszEMail+((dwEMailSize-(sizeof(MAILRU_CHAT_CONF_DOMAIN)-1))-1))) == '@' )
{
- bRet=TRUE;
+ bRet = TRUE;
}
}
}
@@ -975,44 +901,44 @@ return(bRet);
}
-BOOL IsContactChatAgent(HANDLE hContact)
+BOOL CMraProto::IsContactChatAgent(HANDLE hContact)
{
- BOOL bRet=FALSE;
+ BOOL bRet = FALSE;
if (hContact)
{
CHAR szEMail[MAX_EMAIL_LEN];
- SIZE_T dwEMailSize;
+ size_t dwEMailSize;
- if (DB_Mra_GetStaticStringA(hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ if (mraGetStaticStringA(hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize))
{
- bRet=IsEMailChatAgent(szEMail,dwEMailSize);
+ bRet = IsEMailChatAgent(szEMail, dwEMailSize);
}
- //bRet=((GetContactFlags(hContact)&CONTACT_FLAG_MULTICHAT)!=0);
+ //bRet = ((GetContactFlags(hContact)&CONTACT_FLAG_MULTICHAT) != 0);
}
return(bRet);
}
-BOOL IsEMailMR(LPSTR lpszEMail,SIZE_T dwEMailSize)
+BOOL IsEMailMR(LPSTR lpszEMail, size_t dwEMailSize)
{
- BOOL bRet=FALSE;
+ BOOL bRet = FALSE;
if (lpszEMail)
{
- SIZE_T i,dwDomainLen;
+ size_t i, dwDomainLen;
- if (dwEMailSize==0) dwEMailSize=lstrlenA(lpszEMail);
- for(i=0;lpcszMailRuDomains[i];i++)
+ if (dwEMailSize == 0) dwEMailSize = lstrlenA(lpszEMail);
+ for (i = 0;lpcszMailRuDomains[i];i++)
{
- dwDomainLen=lstrlenA(lpcszMailRuDomains[i]);
+ dwDomainLen = lstrlenA(lpcszMailRuDomains[i]);
if (dwDomainLen<dwEMailSize)
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpcszMailRuDomains[i],dwDomainLen,(lpszEMail+(dwEMailSize-dwDomainLen)),dwDomainLen)==CSTR_EQUAL)
+ if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpcszMailRuDomains[i], dwDomainLen, (lpszEMail+(dwEMailSize-dwDomainLen)), dwDomainLen) == CSTR_EQUAL)
{
- if ( (*(BYTE*)(lpszEMail+((dwEMailSize-dwDomainLen)-1)))=='@' )
+ if ( (*(BYTE*)(lpszEMail+((dwEMailSize-dwDomainLen)-1))) == '@' )
{
- bRet=TRUE;
+ bRet = TRUE;
break;
}
}
@@ -1022,55 +948,55 @@ return(bRet);
}
-BOOL GetEMailFromString(LPSTR lpszBuff,SIZE_T dwBuffSize,LPSTR *plpszEMail,SIZE_T *pdwEMailSize)
+BOOL GetEMailFromString(LPSTR lpszBuff, size_t dwBuffSize, LPSTR *plpszEMail, size_t *pdwEMailSize)
{
- BOOL bRet=FALSE;
+ BOOL bRet = FALSE;
if (lpszBuff && dwBuffSize)
{
- LPSTR lpszEMailStart,lpszEMailEnd;
+ LPSTR lpszEMailStart, lpszEMailEnd;
- if ((lpszEMailStart=(LPSTR)MemoryFindByte(0,lpszBuff,dwBuffSize,'<')))
+ if ((lpszEMailStart = (LPSTR)MemoryFindByte(0, lpszBuff, dwBuffSize, '<')))
{
lpszEMailStart++;
- if ((lpszEMailEnd=(LPSTR)MemoryFindByte((lpszEMailStart-lpszBuff),lpszBuff,dwBuffSize,'>')))
+ if ((lpszEMailEnd = (LPSTR)MemoryFindByte((lpszEMailStart-lpszBuff), lpszBuff, dwBuffSize, '>')))
{
- if (plpszEMail) (*plpszEMail)=lpszEMailStart;
- if (pdwEMailSize) (*pdwEMailSize)=(lpszEMailEnd-lpszEMailStart);
+ if (plpszEMail) (*plpszEMail) = lpszEMailStart;
+ if (pdwEMailSize) (*pdwEMailSize) = (lpszEMailEnd-lpszEMailStart);
- bRet=TRUE;
+ bRet = TRUE;
}
}
}
- if (bRet==FALSE)
+ if (bRet == FALSE)
{
- if (plpszEMail) (*plpszEMail)=NULL;
- if (pdwEMailSize) (*pdwEMailSize)=0;
+ if (plpszEMail) (*plpszEMail) = NULL;
+ if (pdwEMailSize) (*pdwEMailSize) = 0;
}
return(bRet);
}
-DWORD GetContactEMailCountParam(HANDLE hContact,BOOL bMRAOnly,LPSTR lpszModule,LPSTR lpszValueName)
+DWORD GetContactEMailCountParam(HANDLE hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName)
{
- DWORD dwRet=0;
- CHAR szBuff[MAX_PATH],szEMail[MAX_EMAIL_LEN];
- SIZE_T i,dwEMailSize;
+ DWORD dwRet = 0;
+ CHAR szBuff[MAX_PATH], szEMail[MAX_EMAIL_LEN];
+ size_t i, dwEMailSize;
- if(DB_GetStaticStringA(hContact,lpszModule,lpszValueName,szEMail,SIZEOF(szEMail),&dwEMailSize))
+ if (DB_GetStaticStringA(hContact, lpszModule, lpszValueName, szEMail, SIZEOF(szEMail), &dwEMailSize))
{
- if (bMRAOnly==FALSE || IsEMailMR(szEMail,dwEMailSize)) dwRet++;
+ if (bMRAOnly == FALSE || IsEMailMR(szEMail, dwEMailSize)) dwRet++;
}
- for (i=0;TRUE;i++)
+ for (i = 0;TRUE;i++)
{
- mir_snprintf(szBuff,SIZEOF(szBuff),"%s%lu",lpszValueName,i);
- if(DB_GetStaticStringA(hContact,lpszModule,szBuff,szEMail,SIZEOF(szEMail),&dwEMailSize))
+ mir_snprintf(szBuff, SIZEOF(szBuff), "%s%lu", lpszValueName, i);
+ if (DB_GetStaticStringA(hContact, lpszModule, szBuff, szEMail, SIZEOF(szEMail), &dwEMailSize))
{
- if (bMRAOnly==FALSE || IsEMailMR(szEMail,dwEMailSize)) dwRet++;
- }else{
+ if (bMRAOnly == FALSE || IsEMailMR(szEMail, dwEMailSize)) dwRet++;
+ }else {
if (i>EMAILS_MIN_COUNT) break;
}
}
@@ -1078,57 +1004,56 @@ return(dwRet);
}
-DWORD GetContactEMailCount(HANDLE hContact,BOOL bMRAOnly)
+DWORD CMraProto::GetContactEMailCount(HANDLE hContact, BOOL bMRAOnly)
{
- DWORD dwRet=0;
+ DWORD dwRet = 0;
LPSTR lpszProto;
if (hContact)
- {
- lpszProto=(LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
- }else{
- lpszProto=PROTOCOL_NAMEA;
- }
- dwRet+=GetContactEMailCountParam(hContact,bMRAOnly,lpszProto,"e-mail");
- dwRet+=GetContactEMailCountParam(hContact,bMRAOnly,"UserInfo","e-mail");
- dwRet+=GetContactEMailCountParam(hContact,bMRAOnly,"UserInfo","Mye-mail");
- dwRet+=GetContactEMailCountParam(hContact,bMRAOnly,"UserInfo","Companye-mail");
- dwRet+=GetContactEMailCountParam(hContact,bMRAOnly,"UserInfo","MyCompanye-mail");
+ lpszProto = (LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ else
+ lpszProto = m_szModuleName;
+
+ dwRet += GetContactEMailCountParam(hContact, bMRAOnly, lpszProto, "e-mail");
+ dwRet += GetContactEMailCountParam(hContact, bMRAOnly, "UserInfo", "e-mail");
+ dwRet += GetContactEMailCountParam(hContact, bMRAOnly, "UserInfo", "Mye-mail");
+ dwRet += GetContactEMailCountParam(hContact, bMRAOnly, "UserInfo", "Companye-mail");
+ dwRet += GetContactEMailCountParam(hContact, bMRAOnly, "UserInfo", "MyCompanye-mail");
return(dwRet);
}
-BOOL GetContactFirstEMailParam(HANDLE hContact,BOOL bMRAOnly,LPSTR lpszModule,LPSTR lpszValueName,LPSTR lpszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize)
+BOOL GetContactFirstEMailParam(HANDLE hContact, BOOL bMRAOnly, LPSTR lpszModule, LPSTR lpszValueName, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize)
{
- BOOL bRet=FALSE;
- CHAR szBuff[MAX_PATH],szEMail[MAX_EMAIL_LEN];
- SIZE_T i,dwEMailSize;
+ BOOL bRet = FALSE;
+ CHAR szBuff[MAX_PATH], szEMail[MAX_EMAIL_LEN];
+ size_t i, dwEMailSize;
- if(DB_GetStaticStringA(hContact,lpszModule,lpszValueName,szEMail,SIZEOF(szEMail),&dwEMailSize))
+ if (DB_GetStaticStringA(hContact, lpszModule, lpszValueName, szEMail, SIZEOF(szEMail), &dwEMailSize))
{
- if (bMRAOnly==FALSE || IsEMailMR(szEMail,dwEMailSize))
+ if (bMRAOnly == FALSE || IsEMailMR(szEMail, dwEMailSize))
{
- lstrcpynA(lpszRetBuff,szEMail,dwRetBuffSize);
- if (pdwRetBuffSize) (*pdwRetBuffSize)=dwEMailSize;
- bRet=TRUE;
+ lstrcpynA(lpszRetBuff, szEMail, dwRetBuffSize);
+ if (pdwRetBuffSize) (*pdwRetBuffSize) = dwEMailSize;
+ bRet = TRUE;
}
}
- for (i=0;bRet==FALSE;i++)
+ for (i = 0;bRet == FALSE;i++)
{
- mir_snprintf(szBuff,SIZEOF(szBuff),"%s%lu",lpszValueName,i);
- if(DB_GetStaticStringA(hContact,lpszModule,szBuff,szEMail,SIZEOF(szEMail),&dwEMailSize))
+ mir_snprintf(szBuff, SIZEOF(szBuff), "%s%lu", lpszValueName, i);
+ if (DB_GetStaticStringA(hContact, lpszModule, szBuff, szEMail, SIZEOF(szEMail), &dwEMailSize))
{
- if (bMRAOnly==FALSE || IsEMailMR(szEMail,dwEMailSize))
+ if (bMRAOnly == FALSE || IsEMailMR(szEMail, dwEMailSize))
{
- lstrcpynA(lpszRetBuff,szEMail,dwRetBuffSize);
- if (pdwRetBuffSize) (*pdwRetBuffSize)=dwEMailSize;
- bRet=TRUE;
+ lstrcpynA(lpszRetBuff, szEMail, dwRetBuffSize);
+ if (pdwRetBuffSize) (*pdwRetBuffSize) = dwEMailSize;
+ bRet = TRUE;
break;
}
- }else{
+ }else {
if (i>EMAILS_MIN_COUNT) break;
}
}
@@ -1136,81 +1061,71 @@ return(bRet);
}
-BOOL GetContactFirstEMail(HANDLE hContact,BOOL bMRAOnly,LPSTR lpszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize)
+BOOL CMraProto::GetContactFirstEMail(HANDLE hContact, BOOL bMRAOnly, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize)
{
- BOOL bRet=FALSE;
+ BOOL bRet = FALSE;
LPSTR lpszProto;
if (hContact)
- {
- lpszProto=(LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
- }else{
- lpszProto=PROTOCOL_NAMEA;
- }
- bRet=GetContactFirstEMailParam(hContact,bMRAOnly,lpszProto,"e-mail",lpszRetBuff,dwRetBuffSize,pdwRetBuffSize);
- if (bRet==FALSE) bRet=GetContactFirstEMailParam(hContact,bMRAOnly,"UserInfo","e-mail",lpszRetBuff,dwRetBuffSize,pdwRetBuffSize);
- if (bRet==FALSE) bRet=GetContactFirstEMailParam(hContact,bMRAOnly,"UserInfo","Mye-mail",lpszRetBuff,dwRetBuffSize,pdwRetBuffSize);
- if (bRet==FALSE) bRet=GetContactFirstEMailParam(hContact,bMRAOnly,"UserInfo","Companye-mail",lpszRetBuff,dwRetBuffSize,pdwRetBuffSize);
- if (bRet==FALSE) bRet=GetContactFirstEMailParam(hContact,bMRAOnly,"UserInfo","MyCompanye-mail",lpszRetBuff,dwRetBuffSize,pdwRetBuffSize);
+ lpszProto = (LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ else
+ lpszProto = m_szModuleName;
-return(bRet);
-}
+ bRet = GetContactFirstEMailParam(hContact, bMRAOnly, lpszProto, "e-mail", lpszRetBuff, dwRetBuffSize, pdwRetBuffSize);
+ if (bRet == FALSE) bRet = GetContactFirstEMailParam(hContact, bMRAOnly, "UserInfo", "e-mail", lpszRetBuff, dwRetBuffSize, pdwRetBuffSize);
+ if (bRet == FALSE) bRet = GetContactFirstEMailParam(hContact, bMRAOnly, "UserInfo", "Mye-mail", lpszRetBuff, dwRetBuffSize, pdwRetBuffSize);
+ if (bRet == FALSE) bRet = GetContactFirstEMailParam(hContact, bMRAOnly, "UserInfo", "Companye-mail", lpszRetBuff, dwRetBuffSize, pdwRetBuffSize);
+ if (bRet == FALSE) bRet = GetContactFirstEMailParam(hContact, bMRAOnly, "UserInfo", "MyCompanye-mail", lpszRetBuff, dwRetBuffSize, pdwRetBuffSize);
+ return bRet;
+}
/////////////////////////////////////////////////////////////////////////////////////////
//
-DWORD MraAPCQueueAdd(PAPCFUNC pfnAPC,PFIFO_MT pffmtAPCQueue,ULONG_PTR dwData)
-{
- DWORD dwRetErrorCode;
- if (masMraSettings.hThreadAPC && pffmtAPCQueue && pfnAPC)
- {
+DWORD CMraProto::MraAPCQueueAdd(PAPCFUNC pfnAPC, PFIFO_MT pffmtAPCQueue, ULONG_PTR dwData)
+{
+ if (hThreadAPC && pffmtAPCQueue && pfnAPC) {
MRA_APC_QUEUE_ITEM *pqiApcQueueItem;
- pqiApcQueueItem=(MRA_APC_QUEUE_ITEM*)MEMALLOC(sizeof(MRA_APC_QUEUE_ITEM));
- if (pqiApcQueueItem)
- {
- pqiApcQueueItem->pfnAPC=pfnAPC;
- FifoMTItemPush(pffmtAPCQueue,(PCFIFO_MT_ITEM)pqiApcQueueItem,(LPVOID)dwData);
- SetEvent(masMraSettings.hWaitEventThreadAPCHandle);
- dwRetErrorCode=NO_ERROR;
- }else{
- dwRetErrorCode=GetLastError();
+ pqiApcQueueItem = (MRA_APC_QUEUE_ITEM*)mir_calloc(sizeof(MRA_APC_QUEUE_ITEM));
+ if (pqiApcQueueItem) {
+ pqiApcQueueItem->pfnAPC = pfnAPC;
+ FifoMTItemPush(pffmtAPCQueue, (PCFIFO_MT_ITEM)pqiApcQueueItem, (LPVOID)dwData);
+ SetEvent(hWaitEventThreadAPCHandle);
+ return NO_ERROR;
}
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+
+ return GetLastError();
}
-return(dwRetErrorCode);
+
+ return ERROR_INVALID_HANDLE;
}
-
void MraAPCQueueProcess(PFIFO_MT pffmtAPCQueue)
{
LPVOID lpData;
MRA_APC_QUEUE_ITEM *pqiApcQueueItem;
- while(FifoMTItemPop(pffmtAPCQueue,(PFIFO_MT_ITEM*)&pqiApcQueueItem,&lpData)==NO_ERROR)
- {
- SleepEx(10,FALSE);
+ while(FifoMTItemPop(pffmtAPCQueue, (PFIFO_MT_ITEM*)&pqiApcQueueItem, &lpData) == NO_ERROR) {
+ SleepEx(10, FALSE);
pqiApcQueueItem->pfnAPC((ULONG_PTR)lpData);
- MEMFREE(pqiApcQueueItem);
+ mir_free(pqiApcQueueItem);
}
}
-void MraAPCQueueDestroy(PFIFO_MT pffmtAPCQueue)
+void CMraProto::MraAPCQueueDestroy(PFIFO_MT pffmtAPCQueue)
{
- if (masMraSettings.hThreadAPC)
- {
+ if (hThreadAPC) {
LPVOID lpData;
PFIFO_MT_ITEM pffmtiFifoItem;
FifoMTLock(pffmtAPCQueue);
- while(FifoMTItemPop(pffmtAPCQueue,&pffmtiFifoItem,&lpData)==NO_ERROR)
- {
- MEMFREE(lpData);
- MEMFREE(pffmtiFifoItem);
+ while( FifoMTItemPop(pffmtAPCQueue, &pffmtiFifoItem, &lpData) == NO_ERROR) {
+ mir_free(lpData);
+ mir_free(pffmtiFifoItem);
}
FifoMTUnLock(pffmtAPCQueue);
@@ -1218,181 +1133,164 @@ void MraAPCQueueDestroy(PFIFO_MT pffmtAPCQueue)
}
}
-
-void ShowFormatedErrorMessage(LPWSTR lpwszErrText,DWORD dwErrorCode)
+void CMraProto::ShowFormattedErrorMessage(LPWSTR lpwszErrText, DWORD dwErrorCode)
{
- WCHAR szErrorText[2048],szErrDescription[1024];
- SIZE_T dwErrDescriptionSize;
+ WCHAR szErrorText[2048], szErrDescription[1024];
+ size_t dwErrDescriptionSize;
- if (dwErrorCode==NO_ERROR)
- {
- mir_sntprintf(szErrorText,SIZEOF(szErrorText),L"%s",TranslateW(lpwszErrText));
- }else{
- dwErrDescriptionSize=(FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,NULL,dwErrorCode,0,szErrDescription,(SIZEOF(szErrDescription)-sizeof(WCHAR)),NULL)-2);
- szErrDescription[dwErrDescriptionSize]=0;
- mir_sntprintf(szErrorText,SIZEOF(szErrorText),L"%s %lu: %s",TranslateW(lpwszErrText),dwErrorCode,szErrDescription);
+ if (dwErrorCode == NO_ERROR)
+ mir_sntprintf(szErrorText, SIZEOF(szErrorText), L"%s", TranslateW(lpwszErrText));
+ else {
+ dwErrDescriptionSize = (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErrorCode, 0, szErrDescription, (SIZEOF(szErrDescription)-sizeof(WCHAR)), NULL)-2);
+ szErrDescription[dwErrDescriptionSize] = 0;
+ mir_sntprintf(szErrorText, SIZEOF(szErrorText), L"%s %lu: %s", TranslateW(lpwszErrText), dwErrorCode, szErrDescription);
}
- MraPopupShowFromAgentW(MRA_POPUP_TYPE_ERROR,0,szErrorText);
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_ERROR, 0, szErrorText);
}
-
-DWORD ProtoBroadcastAckAsynchEx(const char *szModule,HANDLE hContact,int type,int hResult,HANDLE hProcess,LPARAM lParam,SIZE_T dwLparamSize)
+DWORD CMraProto::ProtoBroadcastAckAsynchEx(HANDLE hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam, size_t dwLparamSize)
{
- DWORD dwRetErrorCode;
- SIZE_T dwModuleSize;
- ACKDATA *lpAck;
+ size_t dwModuleSize;
+
+ dwModuleSize = lstrlenA(m_szModuleName);
+ if (dwLparamSize == -1)
+ dwLparamSize = lstrlenA((LPSTR)lParam);
+
+ ACKDATA *lpAck = (ACKDATA*)mir_calloc((sizeof(ACKDATA)+dwModuleSize+dwLparamSize+sizeof(DWORD)));
+ if (!lpAck)
+ return GetLastError();
- dwModuleSize=lstrlenA(szModule);
- if (dwLparamSize==-1) dwLparamSize=lstrlenA((LPSTR)lParam);
- lpAck=(ACKDATA*)MEMALLOC((sizeof(ACKDATA)+dwModuleSize+dwLparamSize+sizeof(DWORD)));
- if (lpAck)
+ lpAck->cbSize = sizeof(ACKDATA);
+ lpAck->szModule = (((char*)lpAck)+sizeof(ACKDATA));
+ lpAck->hContact = hContact;
+ lpAck->type = type;
+ lpAck->result = hResult;
+ lpAck->hProcess = hProcess;
+ if (dwLparamSize)
{
- lpAck->cbSize=sizeof(ACKDATA);
- lpAck->szModule=(((char*)lpAck)+sizeof(ACKDATA));
- lpAck->hContact=hContact;
- lpAck->type=type;
- lpAck->result=hResult;
- lpAck->hProcess=hProcess;
- if (dwLparamSize)
- {
- lpAck->lParam=(LPARAM)(lpAck->szModule+dwModuleSize);
- memmove((LPVOID)lpAck->lParam,(LPVOID)lParam,dwLparamSize);
- }else{
- lpAck->lParam=lParam;
- }
- memmove((LPVOID)lpAck->szModule,(LPVOID)szModule,dwModuleSize);
+ lpAck->lParam = (LPARAM)(lpAck->szModule+dwModuleSize);
+ memmove((LPVOID)lpAck->lParam, (LPVOID)lParam, dwLparamSize);
+ }else {
+ lpAck->lParam = lParam;
+ }
+ memmove((LPVOID)lpAck->szModule, (LPVOID)m_szModuleName, dwModuleSize);
- if ((dwRetErrorCode=MraAPCQueueAdd(ThreadMarandaCallbackAck,&masMraSettings.ffmtAPCQueue,(ULONG_PTR)lpAck))!=NO_ERROR)
- {
- CallService(MS_PROTO_BROADCASTACK,0,(LPARAM)lpAck);
- MEMFREE(lpAck);
- }
- }else{
- dwRetErrorCode=GetLastError();
+ DWORD dwRetErrorCode = MraAPCQueueAdd(ThreadMarandaCallbackAck, &ffmtAPCQueue, (ULONG_PTR)lpAck);
+ if (dwRetErrorCode != NO_ERROR) {
+ CallService(MS_PROTO_BROADCASTACK, 0, (LPARAM)lpAck);
+ mir_free(lpAck);
+ return dwRetErrorCode;
}
-return(dwRetErrorCode);
-}
+ return 0;
+}
void CALLBACK ThreadMarandaCallbackAck(ULONG_PTR dwParam)
{
- if (dwParam)
- {
- CallService(MS_PROTO_BROADCASTACK,0,(LPARAM)dwParam);
- MEMFREE(dwParam);
+ if (dwParam) {
+ CallService(MS_PROTO_BROADCASTACK, 0, (LPARAM)dwParam);
+ mir_free(( void* )dwParam);
}
}
-
-void MraUserAPCThreadProc(LPVOID lpParameter)
+void CMraProto::MraUserAPCThreadProc(LPVOID lpParameter)
{
- DWORD dwWaitRetCode=WAIT_TIMEOUT,dwCurTickTime,dwNextCheckTime,dwLastPingTime,dwFailCounter;
+ DWORD dwWaitRetCode = WAIT_TIMEOUT, dwCurTickTime, dwNextCheckTime, dwLastPingTime, dwFailCounter;
- dwNextCheckTime=0;
- dwFailCounter=0;
+ dwNextCheckTime = 0;
+ dwFailCounter = 0;
- while(InterlockedExchangeAdd((volatile LONG*)&masMraSettings.dwAPCThreadRunning,0))
- {
- MraAPCQueueProcess(&masMraSettings.ffmtAPCQueue);
+ while( InterlockedExchangeAdd((volatile LONG*)&dwAPCThreadRunning, 0)) {
+ MraAPCQueueProcess(&ffmtAPCQueue);
- if (masMraSettings.hThreadWorker)
- if (IsThreadAlive(masMraSettings.hThreadWorker))
- {// check man thread last answer time
- dwCurTickTime=GetTickCount();
+ if (hThreadWorker)
+ if ( IsThreadAlive(hThreadWorker)) {// check man thread last answer time
+ dwCurTickTime = GetTickCount();
- if (dwCurTickTime>dwNextCheckTime)
- {
- dwLastPingTime=InterlockedExchangeAdd((volatile LONG*)&masMraSettings.dwThreadWorkerLastPingTime,0);
- if ((dwCurTickTime>dwLastPingTime) && ((dwCurTickTime-dwLastPingTime)>(THREAD_MAX_PING_TIME*1000)))
- {// ping failure, thread not answer
+ if (dwCurTickTime > dwNextCheckTime) {
+ dwLastPingTime = InterlockedExchangeAdd((volatile LONG*)&dwThreadWorkerLastPingTime, 0);
+ // ping failure, thread not answer
+ if (dwCurTickTime > dwLastPingTime && dwCurTickTime - dwLastPingTime > THREAD_MAX_PING_TIME*1000) {
dwFailCounter++;
DebugPrintCRLFW(L"Watchdog: mra worker thread not answering");
- if (dwFailCounter>THREAD_MAX_PING_FAIL_COUNT)
- {
+ if (dwFailCounter > THREAD_MAX_PING_FAIL_COUNT) {
DebugPrintCRLFW(L"Watchdog: TERMINATING mra worker thread");
- TerminateThread(masMraSettings.hThreadWorker,WAIT_TIMEOUT);
+ TerminateThread(hThreadWorker, WAIT_TIMEOUT);
MraThreadClean();
- dwFailCounter=0;
+ dwFailCounter = 0;
}
- }else{// ping ok, reset failures counter
- dwFailCounter=0;
}
- dwNextCheckTime=(dwCurTickTime+(THREAD_MAX_PING_TIME*1000));
+ else dwFailCounter = 0;
+ dwNextCheckTime = (dwCurTickTime+(THREAD_MAX_PING_TIME*1000));
}
- }else{// main thread is die, clean up
+ }
+ else { // main thread is die, clean up
DebugPrintCRLFW(L"Watchdog: mra worker thread is down!!!!");
MraThreadClean();
}
- dwWaitRetCode=WaitForSingleObjectEx(masMraSettings.hWaitEventThreadAPCHandle,THREAD_SLEEP_TIME,FALSE);
+ dwWaitRetCode = WaitForSingleObjectEx(hWaitEventThreadAPCHandle, THREAD_SLEEP_TIME, FALSE);
}
- if (masMraSettings.hWaitEventThreadAPCHandle)
- {
- CloseHandle(masMraSettings.hWaitEventThreadAPCHandle);
- masMraSettings.hWaitEventThreadAPCHandle=NULL;
+ if (hWaitEventThreadAPCHandle) {
+ CloseHandle(hWaitEventThreadAPCHandle);
+ hWaitEventThreadAPCHandle = NULL;
}
- MraAPCQueueDestroy(&masMraSettings.ffmtAPCQueue);
- masMraSettings.hThreadAPC=NULL;
- InterlockedExchange((volatile LONG*)&masMraSettings.dwAPCThreadRunning,FALSE);
+ MraAPCQueueDestroy(&ffmtAPCQueue);
+ hThreadAPC = NULL;
+ InterlockedExchange((volatile LONG*)&dwAPCThreadRunning, FALSE);
DebugPrintCRLFW(L"Watchdog: APC thread ended, no watching.");
}
-
-
-DWORD CreateBlobFromContact(HANDLE hContact,LPWSTR lpwszRequestReason,SIZE_T dwRequestReasonSize,LPBYTE lpbBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSizeRet)
+DWORD CMraProto::CreateBlobFromContact(HANDLE hContact, LPWSTR lpwszRequestReason, size_t dwRequestReasonSize, LPBYTE lpbBuff, size_t dwBuffSize, size_t *pdwBuffSizeRet)
{
DWORD dwRetErrorCode;
- SIZE_T dwBuffSizeRet=((sizeof(DWORD)*2)+dwRequestReasonSize+5),dwSize;
+ size_t dwBuffSizeRet = ((sizeof(DWORD)*2)+dwRequestReasonSize+5), dwSize;
- if (dwBuffSize>=dwBuffSizeRet)
- {
- PBYTE pCurBlob=lpbBuff;
+ if (dwBuffSize >= dwBuffSizeRet) {
+ PBYTE pCurBlob = lpbBuff;
- (*(DWORD*)pCurBlob)=0;pCurBlob+=sizeof(DWORD);
- (*(DWORD*)pCurBlob)=(DWORD)hContact;pCurBlob+=sizeof(DWORD);
+ *(DWORD*)pCurBlob = 0; pCurBlob += sizeof(DWORD);
+ *(DWORD*)pCurBlob = (DWORD)hContact; pCurBlob += sizeof(DWORD);
- DB_Mra_GetStaticStringA(hContact,"Nick",(LPSTR)pCurBlob,(dwBuffSize-(pCurBlob-lpbBuff)),&dwSize);
- (*(pCurBlob+dwSize))=0;
- pCurBlob+=(dwSize+1);
+ mraGetStaticStringA(hContact, "Nick", (LPSTR)pCurBlob, (dwBuffSize-(pCurBlob-lpbBuff)), &dwSize);
+ *(pCurBlob+dwSize) = 0;
+ pCurBlob += (dwSize+1);
- DB_Mra_GetStaticStringA(hContact,"FirstName",(LPSTR)pCurBlob,(dwBuffSize-(pCurBlob-lpbBuff)),&dwSize);
- (*(pCurBlob+dwSize))=0;
- pCurBlob+=(dwSize+1);
+ mraGetStaticStringA(hContact, "FirstName", (LPSTR)pCurBlob, (dwBuffSize-(pCurBlob-lpbBuff)), &dwSize);
+ *(pCurBlob+dwSize) = 0;
+ pCurBlob += (dwSize+1);
- DB_Mra_GetStaticStringA(hContact,"LastName",(LPSTR)pCurBlob,(dwBuffSize-(pCurBlob-lpbBuff)),&dwSize);
- (*(pCurBlob+dwSize))=0;
- pCurBlob+=(dwSize+1);
+ mraGetStaticStringA(hContact, "LastName", (LPSTR)pCurBlob, (dwBuffSize-(pCurBlob-lpbBuff)), &dwSize);
+ *(pCurBlob+dwSize) = 0;
+ pCurBlob += (dwSize+1);
- DB_Mra_GetStaticStringA(hContact,"e-mail",(LPSTR)pCurBlob,(dwBuffSize-(pCurBlob-lpbBuff)),&dwSize);
- (*(pCurBlob+dwSize))=0;
- pCurBlob+=(dwSize+1);
+ mraGetStaticStringA(hContact, "e-mail", (LPSTR)pCurBlob, (dwBuffSize-(pCurBlob-lpbBuff)), &dwSize);
+ *(pCurBlob+dwSize) = 0;
+ pCurBlob += (dwSize+1);
- dwSize=WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszRequestReason,dwRequestReasonSize,(LPSTR)pCurBlob,(dwBuffSize-(pCurBlob-lpbBuff)),NULL,NULL);
- //memmove(pCurBlob,lpszRequestReason,dwRequestReasonSize);
- (*(pCurBlob+dwSize))=0;
- pCurBlob+=(dwSize+1);
+ dwSize = WideCharToMultiByte(MRA_CODE_PAGE, 0, lpwszRequestReason, dwRequestReasonSize, (LPSTR)pCurBlob, (dwBuffSize-(pCurBlob-lpbBuff)), NULL, NULL);
+ *(pCurBlob+dwSize) = 0;
+ pCurBlob += (dwSize+1);
- dwBuffSizeRet=(pCurBlob-lpbBuff);
- dwRetErrorCode=NO_ERROR;
- }else{
- dwRetErrorCode=ERROR_INSUFFICIENT_BUFFER;
+ dwBuffSizeRet = (pCurBlob-lpbBuff);
+ dwRetErrorCode = NO_ERROR;
}
+ else dwRetErrorCode = ERROR_INSUFFICIENT_BUFFER;
- if (pdwBuffSizeRet) (*pdwBuffSizeRet)=dwBuffSizeRet;
-return(dwRetErrorCode);
+ if (pdwBuffSizeRet)
+ *pdwBuffSizeRet = dwBuffSizeRet;
+ return dwRetErrorCode;
}
-
-
-void CListCreateMenu(LONG lPosition,LONG lPopupPosition,HICON hMainIcon,LPSTR pszContactOwner,BOOL bIsMain,const GUI_DISPLAY_ITEM *pgdiItems,HANDLE *hIcoLibIcons,SIZE_T dwCount,HANDLE *hResult)
+void CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, HICON hMainIcon, LPSTR pszContactOwner, BOOL bIsMain, const GUI_DISPLAY_ITEM *pgdiItems, HANDLE *hIcoLibIcons, size_t dwCount, HANDLE *hResult)
{
if (!pgdiItems || !hIcoLibIcons || !dwCount || !hResult)
return;
- char szServiceFunction[MAX_PATH],*pszServiceFunctionName;
- memmove(szServiceFunction, PROTOCOL_NAMEA, PROTOCOL_NAME_SIZE);
- pszServiceFunctionName = szServiceFunction + PROTOCOL_NAME_LEN;
+ char szServiceFunction[MAX_PATH], *pszServiceFunctionName;
+ strncpy(szServiceFunction, m_szModuleName, sizeof(szServiceFunction));
+ pszServiceFunctionName = szServiceFunction + strlen(m_szModuleName);
CLISTMENUITEM mi = {0};
mi.cbSize = sizeof(mi);
@@ -1401,9 +1299,9 @@ void CListCreateMenu(LONG lPosition,LONG lPopupPosition,HICON hMainIcon,LPSTR ps
if (bIsMain) {
fnAddFunc = Menu_AddProtoMenuItem;
- HGENMENU hRootMenu = MO_GetProtoRootMenu(PROTOCOL_NAMEA);
+ HGENMENU hRootMenu = MO_GetProtoRootMenu(m_szModuleName);
if (hRootMenu == NULL) {
- mi.ptszName = PROTOCOL_DISPLAY_NAMEW;
+ mi.ptszName = m_tszUserName;
mi.position = -1999901008;
mi.hParentMenu = HGENMENU_ROOT;
mi.flags = CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
@@ -1415,999 +1313,708 @@ void CListCreateMenu(LONG lPosition,LONG lPopupPosition,HICON hMainIcon,LPSTR ps
}
else {
fnAddFunc = Menu_AddContactMenuItem;
- mi.ptszPopupName = PROTOCOL_DISPLAY_NAMEW;
+ mi.ptszPopupName = m_tszUserName;
mi.flags = CMIF_UNICODE | CMIF_ICONFROMICOLIB;
}
mi.popupPosition = lPopupPosition;
mi.pszService = szServiceFunction;
- for (size_t i=0; i < dwCount; i++) {
+ for (size_t i = 0; i < dwCount; i++) {
memmove(pszServiceFunctionName, pgdiItems[i].lpszName, lstrlenA(pgdiItems[i].lpszName)+1);
if (pgdiItems[i].lpFunc)
- CreateServiceFunction(szServiceFunction,pgdiItems[i].lpFunc);
- mi.position = lPosition + i;
+ CreateObjectSvc(szServiceFunction, pgdiItems[i].lpFunc);
+ mi.position = int(lPosition + i);
mi.icolibItem = hIcoLibIcons[i];
mi.ptszName = pgdiItems[i].lpwszDescr;
hResult[i] = fnAddFunc(&mi);
}
}
-
-void CListDestroyMenu(const GUI_DISPLAY_ITEM *pgdiItems,SIZE_T dwCount)
-{
- if (pgdiItems && dwCount)
- {
- CHAR szServiceFunction[MAX_PATH],*pszServiceFunctionName;
-
- memmove(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
- pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN;
-
- for (SIZE_T i=0;i<dwCount;i++)
- {
- memmove(pszServiceFunctionName,pgdiItems[i].lpszName,(lstrlenA(pgdiItems[i].lpszName)+1));
- if (pgdiItems[i].lpFunc) DestroyServiceFunction(szServiceFunction);
- }
- }
-}
-
-
-void CListShowMenuItem(HANDLE hMenuItem,BOOL bShow)
+void CMraProto::CListShowMenuItem(HANDLE hMenuItem, BOOL bShow)
{
- CLISTMENUITEM mi={0};
+ CLISTMENUITEM mi = {0};
- mi.cbSize=sizeof(mi);
- mi.flags=CMIM_FLAGS;
- if (bShow==FALSE) mi.flags|=CMIF_HIDDEN;
+ mi.cbSize = sizeof(mi);
+ mi.flags = CMIM_FLAGS;
+ if (bShow == FALSE) mi.flags |= CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMenuItem,(LPARAM)&mi);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItem, (LPARAM)&mi);
}
-/*void CListSetMenuItemIcon(HANDLE hMenuItem,HANDLE hIcon)
+int ExtraSetIcon(HANDLE hExtraIcon, HANDLE hContact, HANDLE hImage, int iColumnType)
{
- CLISTMENUITEM mi={0};
-
- mi.cbSize=sizeof(mi);
- mi.flags=CMIM_FLAGS|CMIM_ICON|CMIF_ICONFROMICOLIB;
- mi.icolibItem=hIcon;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMenuItem,(LPARAM)&mi);
-}*/
-
-int ExtraSetIcon(HANDLE hExtraIcon,HANDLE hContact,HANDLE hImage,int iColumnType)
-{
- int iRet;
-
if (hExtraIcon)
- {
- iRet=ExtraIcon_SetIcon(hExtraIcon,hContact,hImage);
- }else{
- IconExtraColumn iec;
-
- iec.cbSize=sizeof(iec);
- iec.ColumnType=iColumnType;
- iec.hImage=((hImage!=NULL)? hImage:INVALID_HANDLE_VALUE);
+ return ExtraIcon_SetIcon(hExtraIcon, hContact, hImage);
- iRet=CallService(MS_CLIST_EXTRA_SET_ICON,(WPARAM)hContact,(LPARAM)&iec);
- }
-return(iRet);
+ IconExtraColumn iec;
+ iec.cbSize = sizeof(iec);
+ iec.ColumnType = iColumnType;
+ iec.hImage = ((hImage != NULL)? hImage:INVALID_HANDLE_VALUE);
+ return CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)hContact, (LPARAM)&iec);
}
-
-
-SIZE_T CopyNumber(LPCVOID lpcOutBuff,LPCVOID lpcBuff,SIZE_T dwLen)
+size_t CopyNumber(LPCVOID lpcOutBuff, LPCVOID lpcBuff, size_t dwLen)
{
BYTE btChar;
- LPBYTE lpbOutBuff=(LPBYTE)lpcOutBuff,lpbInBuff=(LPBYTE)lpcBuff;
+ LPBYTE lpbOutBuff = (LPBYTE)lpcOutBuff, lpbInBuff = (LPBYTE)lpcBuff;
- for(SIZE_T i=0;i<dwLen;i++)
- {
- btChar=(*lpbInBuff++);
- if (btChar>='0' && btChar<='9') (*lpbOutBuff++)=btChar;
+ for (size_t i = 0; i < dwLen; i++) {
+ btChar = (*lpbInBuff++);
+ if (btChar >= '0' && btChar <= '9') (*lpbOutBuff++) = btChar;
}
- (*lpbOutBuff)=0;
+ *lpbOutBuff = 0;
-return((lpbOutBuff-(LPBYTE)lpcOutBuff));
+ return lpbOutBuff-(LPBYTE)lpcOutBuff;
}
-
-/*
-BOOL IsPhone(LPSTR lpszString,SIZE_T dwStringSize)
+void EnableControlsArray(HWND hWndDlg, WORD *pwControlsList, size_t dwControlsListCount, BOOL bEnabled)
{
- BOOL bRet;
-
- if (dwStringSize>1)
- {// country code
- BYTE btChar;
-
- bRet=TRUE;
- for(SIZE_T i=0;i<dwStringSize;i++)
- {
- btChar=(*lpszString++);
- if (btChar<'0' || btChar>'9')
- if (btChar!='+' && btChar!='S' && btChar!='M' && btChar!=' ' && btChar!='(' && btChar!=')')
- {
- bRet=FALSE;
- break;
- }
- }
- }else{
- bRet=FALSE;
- }
-return(bRet);
+ for (size_t i = 0; i < dwControlsListCount; i++)
+ EnableWindow(GetDlgItem(hWndDlg, pwControlsList[i]), bEnabled);
}
-
-BOOL IsContactPhoneParam(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPSTR lpszPhone,SIZE_T dwPhoneSize)
+LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- BOOL bRet=FALSE;
- char szBuff[MAX_PATH],szPhoneLocal[MAX_EMAIL_LEN];
- SIZE_T i,dwPhoneSizeLocal;
+ LRESULT lrRet = 0;
+ WNDPROC OldMessageEditProc = (WNDPROC)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if(DB_GetStaticStringA(hContact,lpszModule,lpszValueName,szPhoneLocal,SIZEOF(szPhoneLocal),&dwPhoneSizeLocal))
- if (IsPhone(szPhoneLocal,dwPhoneSizeLocal))
- {
- dwPhoneSizeLocal=CopyNumber(szPhoneLocal,szPhoneLocal,dwPhoneSizeLocal);
- if (MemoryCompare(szPhoneLocal,dwPhoneSizeLocal,lpszPhone,dwPhoneSize)==CMEM_EQUAL)
- {
- bRet=TRUE;
+ if (msg == WM_CHAR)
+ if (GetKeyState(VK_CONTROL) & 0x8000) {
+ if (wParam == '\n') {
+ PostMessage(GetParent(hwnd), WM_COMMAND, IDOK, 0);
+ return 0;
}
- }
-
- for (i=0;bRet==FALSE;i++)
- {
- mir_snprintf(szBuff,SIZEOF(szBuff),"%s%lu",lpszValueName,i);
- if(DB_GetStaticStringA(hContact,lpszModule,szBuff,szPhoneLocal,SIZEOF(szPhoneLocal),&dwPhoneSizeLocal))
- {
- if (IsPhone(szPhoneLocal,dwPhoneSizeLocal))
- {
- dwPhoneSizeLocal=CopyNumber(szPhoneLocal,szPhoneLocal,dwPhoneSizeLocal);
- if (MemoryCompare(szPhoneLocal,dwPhoneSizeLocal,lpszPhone,dwPhoneSize)==CMEM_EQUAL)
- {
- bRet=TRUE;
- break;
- }
- }
- }else{
- if (i>PHONES_MIN_COUNT) break;
- }
- }
-return(bRet);
-}
-
-
-BOOL IsContactPhone(HANDLE hContact,LPSTR lpszPhone,SIZE_T dwPhoneSize)
-{
- BOOL bRet=FALSE;
- char szPhoneLocal[MAX_EMAIL_LEN];
- LPSTR lpszProto;
- SIZE_T dwPhoneSizeLocal;
-
- if (hContact)
- {
- lpszProto=(LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
- }else{
- lpszProto=PROTOCOL_NAMEA;
- }
- dwPhoneSizeLocal=CopyNumber(szPhoneLocal,lpszPhone,dwPhoneSize);
-
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,lpszProto,"Phone",szPhoneLocal,dwPhoneSizeLocal);
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,lpszProto,"Cellular",szPhoneLocal,dwPhoneSizeLocal);
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,lpszProto,"Fax",szPhoneLocal,dwPhoneSizeLocal);
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,"UserInfo","MyPhone",szPhoneLocal,dwPhoneSizeLocal);
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,"UserInfo","Phone",szPhoneLocal,dwPhoneSizeLocal);
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,"UserInfo","Cellular",szPhoneLocal,dwPhoneSizeLocal);
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,"UserInfo","Fax",szPhoneLocal,dwPhoneSizeLocal);
-
-return(bRet);
-}
-
-
-HANDLE MraHContactFromPhone(LPSTR lpszPhone,SIZE_T dwPhoneSize,BOOL bAddIfNeeded,BOOL bTemporary,BOOL *pbAdded)
-{
- HANDLE hContact=NULL;
-
- if (lpszPhone && dwPhoneSize)
- {
- BOOL bFounded=FALSE;
-
- //check not already on list
- for(hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
- {
- if (IsContactPhone(hContact,lpszPhone,dwPhoneSize))
- {
- if (bTemporary==FALSE) DBDeleteContactSetting(hContact,"CList","NotOnList");
- bFounded=TRUE;
- break;
- }
+ if (wParam == 1) { // ctrl-a
+ SendMessage(hwnd, EM_SETSEL, 0, -1);
+ return 0;
}
-
- if (bFounded==FALSE && bAddIfNeeded)
- {//not already there: add
- hContact=(HANDLE)CallService(MS_DB_CONTACT_ADD,0,0);
- CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)PROTOCOL_NAMEA);
- //SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,(SCBIF_ID|SCBIF_GROUP_ID|SCBIF_FLAG|SCBIF_SERVER_FLAG|SCBIF_STATUS|SCBIF_EMAIL|SCBIF_PHONES),-1,-1,0,CONTACT_INTFLAG_NOT_AUTHORIZED,ID_STATUS_OFFLINE,lpszEMail,dwEMailSize,NULL,0,lpszPhone,dwPhoneSize);
- if (bTemporary) DBWriteContactSettingByte(hContact,"CList","NotOnList",1);
- DB_Mra_SetStringExA(hContact,"MirVer",MIRVER_UNKNOWN,(sizeof(MIRVER_UNKNOWN)-1));
- MraSetContactStatus(hContact,ID_STATUS_OFFLINE);
+ if (wParam == 23) { // ctrl-w
+ SendMessage(GetParent(hwnd), WM_CLOSE, 0, 0);
+ return 0;
}
-
- if (pbAdded) (*pbAdded)=(bFounded==FALSE && bAddIfNeeded && hContact);
}
-return(hContact);
-}*/
-
-void EnableControlsArray(HWND hWndDlg,WORD *pwControlsList,SIZE_T dwControlsListCount,BOOL bEnabled)
-{
- for(SIZE_T i=0;i<dwControlsListCount;i++) EnableWindow(GetDlgItem(hWndDlg,pwControlsList[i]),bEnabled);
-}
-
+ if (OldMessageEditProc)
+ lrRet = CallWindowProc(OldMessageEditProc, hwnd, msg, wParam, lParam);
-LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
-{
- LRESULT lrRet=0;
- WNDPROC OldMessageEditProc=(WNDPROC)GetWindowLongPtr(hwnd,GWLP_USERDATA);
-
- if (msg==WM_CHAR)
- if (GetKeyState(VK_CONTROL)&0x8000)
- {
- if(wParam=='\n')
- {
- PostMessage(GetParent(hwnd),WM_COMMAND,IDOK,0);
- return(0);
- }
- if (wParam==1)
- {// ctrl-a
- SendMessage(hwnd,EM_SETSEL,0,-1);
- return(0);
- }
- if (wParam==23)
- {// ctrl-w
- SendMessage(GetParent(hwnd),WM_CLOSE,0,0);
- return(0);
- }
- }
-
- if (OldMessageEditProc) lrRet=CallWindowProc(OldMessageEditProc,hwnd,msg,wParam,lParam);
-
-return(lrRet);
+ return lrRet;
}
+/////////////////////////////////////////////////////////////////////////////////////////
-BOOL MraRequestXStatusDetails(DWORD dwXStatus)
-{
- BOOL bRet;
-
- if (IsXStatusValid(dwXStatus))
- {
- bRet=(DialogBoxParamW(masMraSettings.hInstance,MAKEINTRESOURCE(IDD_SETXSTATUS),NULL,SetXStatusDlgProc,(LPARAM)dwXStatus)!=-1);
- }else{
- bRet=FALSE;
- }
-return(bRet);
-}
-
-INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
- INT_PTR iRet=FALSE;
- SetXStatusData *psxsData=(SetXStatusData*)GetWindowLongPtr(hWndDlg,GWLP_USERDATA);
+ INT_PTR iRet = FALSE;
+ SetXStatusData *dat = (SetXStatusData*)GetWindowLongPtr(hWndDlg, GWLP_USERDATA);
- switch(message){
- case WM_INITDIALOG:// set our xStatus
+ switch (message) {
+ case WM_INITDIALOG:// set our xStatus
TranslateDialogDefault(hWndDlg);
- psxsData=(SetXStatusData*)MEMALLOC(sizeof(SetXStatusData));
- if (psxsData)
- {
+ dat = (SetXStatusData*)lParam;
+ if (dat) {
char szValueName[MAX_PATH];
HWND hWndEdit;
WCHAR szBuff[STATUS_TITLE_MAX+STATUS_DESC_MAX];
WNDPROC OldMessageEditProc;
- psxsData->dwXStatus=lParam;
- psxsData->hDlgIcon=IconLibGetIcon(masMraSettings.hXStatusAdvancedStatusIcons[psxsData->dwXStatus]);
- psxsData->dwCountdown=5;
-
- hWndEdit=GetDlgItem(hWndDlg,IDC_XTITLE);
- OldMessageEditProc=(WNDPROC)SetWindowLongPtr(hWndEdit,GWLP_WNDPROC,(LONG_PTR)MessageEditSubclassProc);
- SetWindowLongPtr(hWndEdit,GWLP_USERDATA,(LONG_PTR)OldMessageEditProc);
-
- hWndEdit=GetDlgItem(hWndDlg,IDC_XMSG);
- OldMessageEditProc=(WNDPROC)SetWindowLongPtr(hWndEdit,GWLP_WNDPROC,(LONG_PTR)MessageEditSubclassProc);
- SetWindowLongPtr(hWndEdit,GWLP_USERDATA,(LONG_PTR)OldMessageEditProc);
-
- SetWindowLongPtr(hWndDlg,GWLP_USERDATA,(LONG_PTR)psxsData);
- SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_XTITLE,EM_LIMITTEXT,STATUS_TITLE_MAX,0);
- SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_XMSG,EM_LIMITTEXT,STATUS_DESC_MAX,0);
- SendMessage(hWndDlg,WM_SETICON,ICON_BIG,(LPARAM)psxsData->hDlgIcon);
- SendMessage(hWndDlg,WM_SETTEXT,0,(LPARAM)TranslateW(lpcszXStatusNameDef[psxsData->dwXStatus]));
-
- mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldName",psxsData->dwXStatus);
- if (DB_Mra_GetStaticStringW(NULL,szValueName,szBuff,(STATUS_TITLE_MAX+1),NULL))
- {// custom xstatus name
- SET_DLG_ITEM_TEXT(hWndDlg,IDC_XTITLE,szBuff);
- }else{// default xstatus name
- SET_DLG_ITEM_TEXT(hWndDlg,IDC_XTITLE,TranslateW(lpcszXStatusNameDef[psxsData->dwXStatus]));
- }
+ dat->hDlgIcon = IconLibGetIcon(dat->ppro->hXStatusAdvancedStatusIcons[dat->dwXStatus]);
+ dat->dwCountdown = 5;
- mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldMsg",psxsData->dwXStatus);
- if (DB_Mra_GetStaticStringW(NULL,szValueName,szBuff,(STATUS_DESC_MAX+1),NULL))
- {// custom xstatus description
- SET_DLG_ITEM_TEXT(hWndDlg,IDC_XMSG,szBuff);
- }else{// default xstatus description
- SET_DLG_ITEM_TEXT(hWndDlg,IDC_XMSG,L"");
- }
+ hWndEdit = GetDlgItem(hWndDlg, IDC_XTITLE);
+ OldMessageEditProc = (WNDPROC)SetWindowLongPtr(hWndEdit, GWLP_WNDPROC, (LONG_PTR)MessageEditSubclassProc);
+ SetWindowLongPtr(hWndEdit, GWLP_USERDATA, (LONG_PTR)OldMessageEditProc);
+
+ hWndEdit = GetDlgItem(hWndDlg, IDC_XMSG);
+ OldMessageEditProc = (WNDPROC)SetWindowLongPtr(hWndEdit, GWLP_WNDPROC, (LONG_PTR)MessageEditSubclassProc);
+ SetWindowLongPtr(hWndEdit, GWLP_USERDATA, (LONG_PTR)OldMessageEditProc);
+
+ SetWindowLongPtr(hWndDlg, GWLP_USERDATA, (LONG_PTR)dat);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_XTITLE, EM_LIMITTEXT, STATUS_TITLE_MAX, 0);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_XMSG, EM_LIMITTEXT, STATUS_DESC_MAX, 0);
+ SendMessage(hWndDlg, WM_SETICON, ICON_BIG, (LPARAM)dat->hDlgIcon);
+ SendMessage(hWndDlg, WM_SETTEXT, 0, (LPARAM)TranslateW(lpcszXStatusNameDef[dat->dwXStatus]));
+
+ mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldName", dat->dwXStatus);
+ if (dat->ppro->mraGetStaticStringW(NULL, szValueName, szBuff, (STATUS_TITLE_MAX+1), NULL))
+ SET_DLG_ITEM_TEXT(hWndDlg, IDC_XTITLE, szBuff); // custom xstatus name
+ else // default xstatus name
+ SET_DLG_ITEM_TEXT(hWndDlg, IDC_XTITLE, TranslateW(lpcszXStatusNameDef[dat->dwXStatus]));
- SendMessage(hWndDlg,WM_TIMER,0,0);
- SetTimer(hWndDlg,1,1000,0);
- iRet=TRUE;
+ mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldMsg", dat->dwXStatus);
+ if (dat->ppro->mraGetStaticStringW(NULL, szValueName, szBuff, (STATUS_DESC_MAX+1), NULL))
+ SET_DLG_ITEM_TEXT(hWndDlg, IDC_XMSG, szBuff); // custom xstatus description
+ else // default xstatus description
+ SET_DLG_ITEM_TEXT(hWndDlg, IDC_XMSG, L"");
+
+ SendMessage(hWndDlg, WM_TIMER, 0, 0);
+ SetTimer(hWndDlg, 1, 1000, 0);
+ iRet = TRUE;
}
break;
+
case WM_TIMER:
- if(psxsData->dwCountdown!=-1)
- {
+ if (dat->dwCountdown != -1) {
WCHAR szBuff[MAX_PATH];
- mir_sntprintf(szBuff,SIZEOF(szBuff),L"%s %ld",TranslateW(L"Closing in"),psxsData->dwCountdown);
- SET_DLG_ITEM_TEXT(hWndDlg,IDOK,szBuff);
- psxsData->dwCountdown--;
+ mir_sntprintf(szBuff, SIZEOF(szBuff), L"%s %ld", TranslateW(L"Closing in"), dat->dwCountdown);
+ SET_DLG_ITEM_TEXT(hWndDlg, IDOK, szBuff);
+ dat->dwCountdown--;
break;
}
- case WM_CLOSE:
- DestroyWindow(hWndDlg);
- break;
- case WM_COMMAND:
- switch(LOWORD(wParam)) {
+
+ case WM_CLOSE:
+ DestroyWindow(hWndDlg);
+ break;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
case IDOK:
DestroyWindow(hWndDlg);
break;
case IDC_XTITLE:
case IDC_XMSG:
- KillTimer(hWndDlg,1);
- SET_DLG_ITEM_TEXTW(hWndDlg,IDOK,TranslateW(L"OK"));
+ KillTimer(hWndDlg, 1);
+ SET_DLG_ITEM_TEXTW(hWndDlg, IDOK, TranslateW(L"OK"));
break;
}
break;
- case WM_DESTROY:
- if (psxsData)
- { // set our xStatus
+
+ case WM_DESTROY:
+ if (dat) { // set our xStatus
char szValueName[MAX_PATH];
HWND hWndEdit;
WCHAR szBuff[STATUS_TITLE_MAX+STATUS_DESC_MAX];
- SIZE_T dwBuffSize;
+ size_t dwBuffSize;
WNDPROC OldMessageEditProc;
- CLISTMENUITEM mi={0};
-
- SetWindowLongPtr(hWndDlg,GWLP_USERDATA,(LONG_PTR)0);
-
- hWndEdit=GetDlgItem(hWndDlg,IDC_XTITLE);
- OldMessageEditProc=(WNDPROC)GetWindowLongPtr(hWndEdit,GWLP_USERDATA);
- SetWindowLongPtr(hWndEdit,GWLP_WNDPROC,(LONG_PTR)OldMessageEditProc);
- SetWindowLongPtr(hWndEdit,GWLP_USERDATA,(LONG_PTR)0);
-
- hWndEdit=GetDlgItem(hWndDlg,IDC_XMSG);
- OldMessageEditProc=(WNDPROC)GetWindowLongPtr(hWndEdit,GWLP_USERDATA);
- SetWindowLongPtr(hWndEdit,GWLP_WNDPROC,(LONG_PTR)OldMessageEditProc);
- SetWindowLongPtr(hWndEdit,GWLP_USERDATA,(LONG_PTR)0);
-
- dwBuffSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_XMSG,szBuff,(STATUS_DESC_MAX+1));
- mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldMsg",psxsData->dwXStatus);
- DB_Mra_SetStringExW(NULL,szValueName,szBuff,dwBuffSize);
- DB_Mra_SetStringExW(NULL,DBSETTING_XSTATUSMSG,szBuff,dwBuffSize);
-
- dwBuffSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_XTITLE,szBuff,(STATUS_TITLE_MAX+1));
- if (dwBuffSize==0)
- {// user delete all text
- lstrcpynW(szBuff,TranslateW(lpcszXStatusNameDef[psxsData->dwXStatus]),(STATUS_TITLE_MAX+1));
- dwBuffSize=lstrlenW(szBuff);
+ CLISTMENUITEM mi = {0};
+
+ SetWindowLongPtr(hWndDlg, GWLP_USERDATA, (LONG_PTR)0);
+
+ hWndEdit = GetDlgItem(hWndDlg, IDC_XTITLE);
+ OldMessageEditProc = (WNDPROC)GetWindowLongPtr(hWndEdit, GWLP_USERDATA);
+ SetWindowLongPtr(hWndEdit, GWLP_WNDPROC, (LONG_PTR)OldMessageEditProc);
+ SetWindowLongPtr(hWndEdit, GWLP_USERDATA, (LONG_PTR)0);
+
+ hWndEdit = GetDlgItem(hWndDlg, IDC_XMSG);
+ OldMessageEditProc = (WNDPROC)GetWindowLongPtr(hWndEdit, GWLP_USERDATA);
+ SetWindowLongPtr(hWndEdit, GWLP_WNDPROC, (LONG_PTR)OldMessageEditProc);
+ SetWindowLongPtr(hWndEdit, GWLP_USERDATA, (LONG_PTR)0);
+
+ dwBuffSize = GET_DLG_ITEM_TEXT(hWndDlg, IDC_XMSG, szBuff, (STATUS_DESC_MAX+1));
+ mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldMsg", dat->dwXStatus);
+ dat->ppro->mraSetStringExW(NULL, szValueName, szBuff, dwBuffSize);
+ dat->ppro->mraSetStringExW(NULL, DBSETTING_XSTATUSMSG, szBuff, dwBuffSize);
+
+ dwBuffSize = GET_DLG_ITEM_TEXT(hWndDlg, IDC_XTITLE, szBuff, (STATUS_TITLE_MAX+1));
+ if (dwBuffSize == 0) { // user delete all text
+ lstrcpynW(szBuff, TranslateW(lpcszXStatusNameDef[dat->dwXStatus]), (STATUS_TITLE_MAX+1));
+ dwBuffSize = lstrlenW(szBuff);
}
- mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%dName",psxsData->dwXStatus);
- DB_Mra_SetStringExW(NULL,szValueName,szBuff,dwBuffSize);
- DB_Mra_SetStringExW(NULL,DBSETTING_XSTATUSNAME,szBuff,dwBuffSize);
+ mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%dName", dat->dwXStatus);
+ dat->ppro->mraSetStringExW(NULL, szValueName, szBuff, dwBuffSize);
+ dat->ppro->mraSetStringExW(NULL, DBSETTING_XSTATUSNAME, szBuff, dwBuffSize);
- mi.cbSize=sizeof(mi);
- mi.flags=(CMIM_NAME|CMIF_UNICODE);
- mi.ptszName=szBuff;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)masMraSettings.hXStatusMenuItems[psxsData->dwXStatus],(LPARAM)&mi);
+ mi.cbSize = sizeof(mi);
+ mi.flags = (CMIM_NAME|CMIF_UNICODE);
+ mi.ptszName = szBuff;
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)dat->ppro->hXStatusMenuItems[dat->dwXStatus], (LPARAM)&mi);
- MraSetXStatusInternal(psxsData->dwXStatus);
+ dat->ppro->MraSetXStatusInternal(dat->dwXStatus);
- MEMFREE(psxsData);
+ mir_free(dat);
}
- EndDialog(hWndDlg,NO_ERROR);
+ EndDialog(hWndDlg, NO_ERROR);
break;
- //default:
- // bRet=DefWindowProc(hWndDlg,message,wParam,lParam);
- // break;
}
-return(iRet);
+ return iRet;
}
-
-BOOL MraSendReplyBlogStatus(HANDLE hContact)
+BOOL CMraProto::MraRequestXStatusDetails(DWORD dwXStatus)
{
- BOOL bRet;
-
- bRet=(CreateDialogParam(masMraSettings.hInstance,MAKEINTRESOURCE(IDD_MINIBLOG),NULL,SendReplyBlogStatusDlgProc,(LPARAM)hContact)!=NULL);
-return(bRet);
+ if ( IsXStatusValid(dwXStatus)) {
+ SetXStatusData *dat = (SetXStatusData*)mir_calloc(sizeof(SetXStatusData));
+ dat->dwXStatus = dwXStatus;
+ dat->ppro = this;
+ return DialogBoxParam(masMraSettings.hInstance, MAKEINTRESOURCE(IDD_SETXSTATUS), NULL, SetXStatusDlgProc, (LPARAM)dat) != -1;
+ }
+
+ return FALSE;
}
-INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM lParam)
+/////////////////////////////////////////////////////////////////////////////////////////
+
+INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
- INT_PTR iRet=FALSE;
- SetBlogStatusData *psbsdData=(SetBlogStatusData*)GetWindowLongPtr(hWndDlg,GWLP_USERDATA);
+ INT_PTR iRet = FALSE;
+ SetBlogStatusData *dat = (SetBlogStatusData*)GetWindowLongPtr(hWndDlg, GWLP_USERDATA);
- switch(message){
+ switch (message) {
case WM_INITDIALOG:// set our xStatus
TranslateDialogDefault(hWndDlg);
- psbsdData=(SetBlogStatusData*)MEMALLOC(sizeof(SetBlogStatusData));
- if (psbsdData)
- {
- HWND hWndEdit;
- DWORD dwTime;
+ dat = (SetBlogStatusData*)lParam;
+ if (dat) {
WCHAR szBuff[MICBLOG_STATUS_MAX];
- WNDPROC OldMessageEditProc;
- SYSTEMTIME stBlogStatusTime={0};
+ SYSTEMTIME stBlogStatusTime = {0};
- psbsdData->hContact=(HANDLE)lParam;
- //psbsdData->hDlgIcon=IconLibGetIcon(masMraSettings.hXStatusAdvancedStatusIcons[psxsData->dwXStatus]);
- SetWindowLongPtr(hWndDlg,GWLP_USERDATA,(LONG_PTR)psbsdData);
+ SetWindowLongPtr(hWndDlg, GWLP_USERDATA, (LONG_PTR)dat);
- hWndEdit=GetDlgItem(hWndDlg,IDC_MSG_TO_SEND);
- OldMessageEditProc=(WNDPROC)SetWindowLongPtr(hWndEdit,GWLP_WNDPROC,(LONG_PTR)MessageEditSubclassProc);
- SetWindowLongPtr(hWndEdit,GWLP_USERDATA,(LONG_PTR)OldMessageEditProc);
- SendMessage(hWndEdit,EM_LIMITTEXT,MICBLOG_STATUS_MAX,0);
+ HWND hWndEdit = GetDlgItem(hWndDlg, IDC_MSG_TO_SEND);
+ WNDPROC OldMessageEditProc = (WNDPROC)SetWindowLongPtr(hWndEdit, GWLP_WNDPROC, (LONG_PTR)MessageEditSubclassProc);
+ SetWindowLongPtr(hWndEdit, GWLP_USERDATA, (LONG_PTR)OldMessageEditProc);
+ SendMessage(hWndEdit, EM_LIMITTEXT, MICBLOG_STATUS_MAX, 0);
+ SendMessage(hWndDlg, WM_SETICON, ICON_BIG, (LPARAM)IconLibGetIcon(dat->ppro->hMainMenuIcons[5]));
- SendMessage(hWndDlg,WM_SETICON,ICON_BIG,(LPARAM)IconLibGetIcon(masMraSettings.hMainMenuIcons[5]));
+ // blog status message
+ if (dat->ppro->mraGetStaticStringW(dat->hContact, DBSETTING_BLOGSTATUS, szBuff, SIZEOF(szBuff), NULL))
+ SET_DLG_ITEM_TEXT(hWndDlg, IDC_USER_BLOG_STATUS_MSG, szBuff);
- if (DB_Mra_GetStaticStringW(psbsdData->hContact,DBSETTING_BLOGSTATUS,szBuff,SIZEOF(szBuff),NULL))
- {// blog status message
- SET_DLG_ITEM_TEXT(hWndDlg,IDC_USER_BLOG_STATUS_MSG,szBuff);
+ // reply to some user blog
+ if (dat->hContact) {
+ mir_sntprintf(szBuff, SIZEOF(szBuff), TranslateW(L"Reply to %s blog status"), GetContactNameW(dat->hContact));
+ SendMessage(hWndDlg, WM_SETTEXT, 0, (LPARAM)szBuff);
}
+ else SendMessage(hWndDlg, WM_SETTEXT, 0, (LPARAM)TranslateW(L"Set my blog status"));
- if (psbsdData->hContact)
- {// reply to some user blog
- mir_sntprintf(szBuff,SIZEOF(szBuff),TranslateW(L"Reply to %s blog status"),GetContactNameW(psbsdData->hContact));
- SendMessage(hWndDlg,WM_SETTEXT,0,(LPARAM)szBuff);
- }else{
- SendMessage(hWndDlg,WM_SETTEXT,0,(LPARAM)TranslateW(L"Set my blog status"));
- }
-
- dwTime=DB_Mra_GetDword(psbsdData->hContact,DBSETTING_BLOGSTATUSTIME,0);
- if (dwTime && MakeLocalSystemTimeFromTime32(dwTime,&stBlogStatusTime))
- {
- mir_sntprintf(szBuff,SIZEOF(szBuff),L"%s: %04ld.%02ld.%02ld %02ld:%02ld",TranslateW(L"Writed"),stBlogStatusTime.wYear,stBlogStatusTime.wMonth,stBlogStatusTime.wDay,stBlogStatusTime.wHour,stBlogStatusTime.wMinute);
- }else{
- szBuff[0]=0;
- }
- SET_DLG_ITEM_TEXT(hWndDlg,IDC_STATIC_WRITED_TIME,szBuff);
+ DWORD dwTime = dat->ppro->mraGetDword(dat->hContact, DBSETTING_BLOGSTATUSTIME, 0);
+ if (dwTime && MakeLocalSystemTimeFromTime32(dwTime, &stBlogStatusTime))
+ mir_sntprintf(szBuff, SIZEOF(szBuff), L"%s: %04ld.%02ld.%02ld %02ld:%02ld", TranslateW(L"Writed"), stBlogStatusTime.wYear, stBlogStatusTime.wMonth, stBlogStatusTime.wDay, stBlogStatusTime.wHour, stBlogStatusTime.wMinute);
+ else
+ szBuff[0] = 0;
- EnableWindow(GetDlgItem(hWndDlg,IDC_CHK_NOTIFY),(psbsdData->hContact==NULL));
-
- iRet=TRUE;
+ SET_DLG_ITEM_TEXT(hWndDlg, IDC_STATIC_WRITED_TIME, szBuff);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_CHK_NOTIFY), (dat->hContact == NULL));
+ iRet = TRUE;
}
break;
- case WM_CLOSE:
- DestroyWindow(hWndDlg);
- break;
- case WM_COMMAND:
- switch(LOWORD(wParam)) {
- case IDOK:
- {
- DWORD dwFlags;
- WCHAR szBuff[MICBLOG_STATUS_MAX];
- SIZE_T dwBuffSize;
- DWORDLONG dwBlogStatusID;
-
- dwBuffSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_MSG_TO_SEND,szBuff,SIZEOF(szBuff));
- if (psbsdData->hContact)
- {
- dwFlags=(MRIM_BLOG_STATUS_REPLY|MRIM_BLOG_STATUS_NOTIFY);
- DB_Mra_GetContactSettingBlob(psbsdData->hContact,DBSETTING_BLOGSTATUSID,&dwBlogStatusID,sizeof(DWORDLONG),NULL);
- }else{
- dwFlags=MRIM_BLOG_STATUS_UPDATE;
- if (IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_CHK_NOTIFY)) dwFlags|=MRIM_BLOG_STATUS_NOTIFY;
- dwBlogStatusID=0;
- }
- MraSendCommand_ChangeUserBlogStatus(dwFlags,szBuff,dwBuffSize,dwBlogStatusID);
- }
- case IDCANCEL:
- DestroyWindow(hWndDlg);
- break;
- case IDC_MSG_TO_SEND:
- if (HIWORD(wParam)==EN_CHANGE)
- {
- WCHAR wszBuff[MAX_PATH];
- SIZE_T dwMessageSize=GET_DLG_ITEM_TEXT_LENGTH(hWndDlg,IDC_MSG_TO_SEND);
- EnableWindow(GetDlgItem(hWndDlg,IDOK),dwMessageSize);
- mir_sntprintf(wszBuff,SIZEOF(wszBuff),L"%d/%d",dwMessageSize,MICBLOG_STATUS_MAX);
- SET_DLG_ITEM_TEXTW(hWndDlg,IDC_STATIC_CHARS_COUNTER,wszBuff);
- }
- break;
- }
- break;
- case WM_DESTROY:
- if (psbsdData)
- {
- HWND hWndEdit;
- WNDPROC OldMessageEditProc;
-
- SetWindowLongPtr(hWndDlg,GWLP_USERDATA,(LONG_PTR)0);
-
- hWndEdit=GetDlgItem(hWndDlg,IDC_MSG_TO_SEND);
- OldMessageEditProc=(WNDPROC)GetWindowLongPtr(hWndEdit,GWLP_USERDATA);
- SetWindowLongPtr(hWndEdit,GWLP_WNDPROC,(LONG_PTR)OldMessageEditProc);
- SetWindowLongPtr(hWndEdit,GWLP_USERDATA,(LONG_PTR)0);
-
-
- MEMFREE(psbsdData);
- }
- EndDialog(hWndDlg,NO_ERROR);
- break;
- //default:
- // bRet=DefWindowProc(hWndDlg,message,wParam,lParam);
- // break;
- }
-return(iRet);
+ case WM_CLOSE:
+ DestroyWindow(hWndDlg);
+ break;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDOK:
+ {
+ DWORD dwFlags;
+ WCHAR szBuff[MICBLOG_STATUS_MAX];
+ size_t dwBuffSize;
+ DWORDLONG dwBlogStatusID;
+
+ dwBuffSize = GET_DLG_ITEM_TEXT(hWndDlg, IDC_MSG_TO_SEND, szBuff, SIZEOF(szBuff));
+ if (dat->hContact) {
+ dwFlags = (MRIM_BLOG_STATUS_REPLY|MRIM_BLOG_STATUS_NOTIFY);
+ dat->ppro->mraGetContactSettingBlob(dat->hContact, DBSETTING_BLOGSTATUSID, &dwBlogStatusID, sizeof(DWORDLONG), NULL);
+ }
+ else {
+ dwFlags = MRIM_BLOG_STATUS_UPDATE;
+ if (IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_NOTIFY)) dwFlags |= MRIM_BLOG_STATUS_NOTIFY;
+ dwBlogStatusID = 0;
+ }
+ dat->ppro->MraChangeUserBlogStatus(dwFlags, szBuff, dwBuffSize, dwBlogStatusID);
+ }
+ case IDCANCEL:
+ DestroyWindow(hWndDlg);
+ break;
+
+ case IDC_MSG_TO_SEND:
+ if (HIWORD(wParam) == EN_CHANGE) {
+ WCHAR wszBuff[MAX_PATH];
+ size_t dwMessageSize = GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MSG_TO_SEND);
+
+ EnableWindow(GetDlgItem(hWndDlg, IDOK), dwMessageSize);
+ mir_sntprintf(wszBuff, SIZEOF(wszBuff), L"%d/%d", dwMessageSize, MICBLOG_STATUS_MAX);
+ SET_DLG_ITEM_TEXTW(hWndDlg, IDC_STATIC_CHARS_COUNTER, wszBuff);
+ }
+ break;
+ }
+ break;
+
+ case WM_DESTROY:
+ if (dat) {
+ HWND hWndEdit;
+ WNDPROC OldMessageEditProc;
+
+ SetWindowLongPtr(hWndDlg, GWLP_USERDATA, (LONG_PTR)0);
+
+ hWndEdit = GetDlgItem(hWndDlg, IDC_MSG_TO_SEND);
+ OldMessageEditProc = (WNDPROC)GetWindowLongPtr(hWndEdit, GWLP_USERDATA);
+ SetWindowLongPtr(hWndEdit, GWLP_WNDPROC, (LONG_PTR)OldMessageEditProc);
+ SetWindowLongPtr(hWndEdit, GWLP_USERDATA, (LONG_PTR)0);
+ mir_free(dat);
+ }
+ EndDialog(hWndDlg, NO_ERROR);
+ break;
+ }
+ return iRet;
+}
+
+BOOL CMraProto::MraSendReplyBlogStatus(HANDLE hContact)
+{
+ SetBlogStatusData* dat = (SetBlogStatusData*)mir_calloc( sizeof(SetBlogStatusData));
+ dat->ppro = this;
+ dat->hContact = hContact;
+ return CreateDialogParam(masMraSettings.hInstance, MAKEINTRESOURCE(IDD_MINIBLOG), NULL, SendReplyBlogStatusDlgProc, (LPARAM)dat) != NULL;
}
+/////////////////////////////////////////////////////////////////////////////////////////
DWORD GetYears(CONST PSYSTEMTIME pcstSystemTime)
{
- DWORD dwRet=0;
+ DWORD dwRet = 0;
- if (pcstSystemTime)
- {
+ if (pcstSystemTime) {
SYSTEMTIME stTime;
-
GetLocalTime(&stTime);
- dwRet=(stTime.wYear-pcstSystemTime->wYear);
+ dwRet = stTime.wYear - pcstSystemTime->wYear;
+ // день рожденья будет в след месяце
if (stTime.wMonth<pcstSystemTime->wMonth)
- {// день рожденья будет в след месяце
dwRet--;
- }else{// др ещё будет в этом месяце или уже был...
- if (stTime.wMonth==pcstSystemTime->wMonth)
- {// др в этом месяце
+ // др ещё будет в этом месяце или уже был...
+ else {
+ // др в этом месяце
+ if (stTime.wMonth == pcstSystemTime->wMonth)
+ // ещё только будет, не сегодня
if (stTime.wDay<pcstSystemTime->wDay)
- {// ещё только будет, не сегодня
dwRet--;
- }// др ещё будет сегодня или уже был...
- }
}
}
-return(dwRet);
+ return dwRet;
}
-
-
-DWORD FindFile(LPWSTR lpszFolder,DWORD dwFolderLen,LPWSTR lpszFileName,DWORD dwFileNameLen,LPWSTR lpszRetFilePathName,DWORD dwRetFilePathLen,DWORD *pdwRetFilePathLen)
+DWORD FindFile(LPWSTR lpszFolder, DWORD dwFolderLen, LPWSTR lpszFileName, DWORD dwFileNameLen, LPWSTR lpszRetFilePathName, DWORD dwRetFilePathLen, DWORD *pdwRetFilePathLen)
{
DWORD dwRetErrorCode;
- if (lpszFolder && dwFolderLen && lpszFileName && dwFileNameLen)
- {
+ if (lpszFolder && dwFolderLen && lpszFileName && dwFileNameLen) {
WCHAR szPath[32768];
- DWORD dwPathLen,dwRecDeepAllocated,dwRecDeepCurPos,dwFilePathLen;
+ DWORD dwPathLen, dwRecDeepAllocated, dwRecDeepCurPos, dwFilePathLen;
RECURSION_DATA_STACK_ITEM *prdsiItems;
- if (dwFolderLen==-1) dwFolderLen=lstrlenW(lpszFolder);
- if (dwFileNameLen==-1) dwFileNameLen=lstrlenW(lpszFileName);
-
- dwRecDeepCurPos=0;
- dwRecDeepAllocated=RECURSION_DATA_STACK_ITEMS_MIN;
- prdsiItems=(RECURSION_DATA_STACK_ITEM*)MEMALLOC(dwRecDeepAllocated*sizeof(RECURSION_DATA_STACK_ITEM));
- if (prdsiItems)
- {
- dwPathLen=dwFolderLen;
- memmove(szPath,lpszFolder,(dwPathLen*sizeof(WCHAR)));
- if (szPath[(dwPathLen-1)]!='\\')
- {
- szPath[dwPathLen]='\\';
+ if (dwFolderLen == -1) dwFolderLen = lstrlenW(lpszFolder);
+ if (dwFileNameLen == -1) dwFileNameLen = lstrlenW(lpszFileName);
+
+ dwRecDeepCurPos = 0;
+ dwRecDeepAllocated = RECURSION_DATA_STACK_ITEMS_MIN;
+ prdsiItems = (RECURSION_DATA_STACK_ITEM*)mir_calloc(dwRecDeepAllocated*sizeof(RECURSION_DATA_STACK_ITEM));
+ if (prdsiItems) {
+ dwPathLen = dwFolderLen;
+ memmove(szPath, lpszFolder, (dwPathLen*sizeof(WCHAR)));
+ if (szPath[(dwPathLen-1)] != '\\') {
+ szPath[dwPathLen] = '\\';
dwPathLen++;
}
- szPath[dwPathLen]=0;
- lstrcatW(szPath,L"*.*");
-
- prdsiItems[dwRecDeepCurPos].dwFileNameLen=0;
- prdsiItems[dwRecDeepCurPos].hFind=FindFirstFileEx(szPath,FindExInfoStandard,&prdsiItems[dwRecDeepCurPos].w32fdFindFileData,FindExSearchNameMatch,NULL,0);
- if (prdsiItems[dwRecDeepCurPos].hFind!=INVALID_HANDLE_VALUE)
- {
- dwRetErrorCode=ERROR_FILE_NOT_FOUND;
- do
- {
+ szPath[dwPathLen] = 0;
+ lstrcatW(szPath, L"*.*");
+
+ prdsiItems[dwRecDeepCurPos].dwFileNameLen = 0;
+ prdsiItems[dwRecDeepCurPos].hFind = FindFirstFileEx(szPath, FindExInfoStandard, &prdsiItems[dwRecDeepCurPos].w32fdFindFileData, FindExSearchNameMatch, NULL, 0);
+ if (prdsiItems[dwRecDeepCurPos].hFind != INVALID_HANDLE_VALUE) {
+ dwRetErrorCode = ERROR_FILE_NOT_FOUND;
+ do {
dwPathLen-=prdsiItems[dwRecDeepCurPos].dwFileNameLen;
- while(dwRetErrorCode==ERROR_FILE_NOT_FOUND && FindNextFile(prdsiItems[dwRecDeepCurPos].hFind,&prdsiItems[dwRecDeepCurPos].w32fdFindFileData))
- {
- if (prdsiItems[dwRecDeepCurPos].w32fdFindFileData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
- {// folder
- if (CompareString(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName,-1,L".",1)!=CSTR_EQUAL)
- if (CompareString(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName,-1,L"..",2)!=CSTR_EQUAL)
- {
- prdsiItems[dwRecDeepCurPos].dwFileNameLen=(lstrlenW(prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName)+1);
- memmove((szPath+dwPathLen),prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName,(prdsiItems[dwRecDeepCurPos].dwFileNameLen*sizeof(WCHAR)));
- lstrcatW(szPath,L"\\*.*");
- dwPathLen+=prdsiItems[dwRecDeepCurPos].dwFileNameLen;
+ while(dwRetErrorCode == ERROR_FILE_NOT_FOUND && FindNextFile(prdsiItems[dwRecDeepCurPos].hFind, &prdsiItems[dwRecDeepCurPos].w32fdFindFileData)) {
+ if (prdsiItems[dwRecDeepCurPos].w32fdFindFileData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {// folder
+ if (CompareString( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, -1, L".", 1) != CSTR_EQUAL)
+ if (CompareString( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, -1, L"..", 2) != CSTR_EQUAL) {
+ prdsiItems[dwRecDeepCurPos].dwFileNameLen = (lstrlenW(prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName)+1);
+ memmove((szPath+dwPathLen), prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, (prdsiItems[dwRecDeepCurPos].dwFileNameLen*sizeof(WCHAR)));
+ lstrcatW(szPath, L"\\*.*");
+ dwPathLen += prdsiItems[dwRecDeepCurPos].dwFileNameLen;
dwRecDeepCurPos++;
- if (dwRecDeepCurPos==dwRecDeepAllocated)
- {// need more space
- dwRecDeepAllocated+=RECURSION_DATA_STACK_ITEMS_MIN;
- prdsiItems=(RECURSION_DATA_STACK_ITEM*)MEMREALLOC(prdsiItems,dwRecDeepAllocated*sizeof(RECURSION_DATA_STACK_ITEM));
- if (prdsiItems==NULL)
- {
- dwRecDeepCurPos=0;
- dwRetErrorCode=GetLastError();
+ if (dwRecDeepCurPos == dwRecDeepAllocated) { // need more space
+ dwRecDeepAllocated += RECURSION_DATA_STACK_ITEMS_MIN;
+ prdsiItems = (RECURSION_DATA_STACK_ITEM*)mir_realloc(prdsiItems, dwRecDeepAllocated*sizeof(RECURSION_DATA_STACK_ITEM));
+ if (prdsiItems == NULL) {
+ dwRecDeepCurPos = 0;
+ dwRetErrorCode = GetLastError();
break;
}
}
- prdsiItems[dwRecDeepCurPos].hFind=FindFirstFileEx(szPath,FindExInfoStandard,&prdsiItems[dwRecDeepCurPos].w32fdFindFileData,FindExSearchNameMatch,NULL,0);
+ prdsiItems[dwRecDeepCurPos].hFind = FindFirstFileEx(szPath, FindExInfoStandard, &prdsiItems[dwRecDeepCurPos].w32fdFindFileData, FindExSearchNameMatch, NULL, 0);
}
- }else{// file
- if (CompareString(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName,-1,lpszFileName,dwFileNameLen)==CSTR_EQUAL)
- {
- prdsiItems[dwRecDeepCurPos].dwFileNameLen=lstrlenW(prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName);
- memmove((szPath+dwPathLen),prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName,((prdsiItems[dwRecDeepCurPos].dwFileNameLen+1)*sizeof(WCHAR)));
- dwFilePathLen=(dwPathLen+prdsiItems[dwRecDeepCurPos].dwFileNameLen);
-
- if (pdwRetFilePathLen) (*pdwRetFilePathLen)=dwFilePathLen;
- if (lpszRetFilePathName && dwRetFilePathLen)
- {
- dwFilePathLen=min(dwFilePathLen,dwRetFilePathLen);
- memmove(lpszRetFilePathName,szPath,((dwFilePathLen+1)*sizeof(WCHAR)));
+ }
+ else {// file
+ if (CompareString( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, -1, lpszFileName, dwFileNameLen) == CSTR_EQUAL) {
+ prdsiItems[dwRecDeepCurPos].dwFileNameLen = lstrlenW(prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName);
+ memmove((szPath+dwPathLen), prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName, ((prdsiItems[dwRecDeepCurPos].dwFileNameLen+1)*sizeof(WCHAR)));
+ dwFilePathLen = (dwPathLen+prdsiItems[dwRecDeepCurPos].dwFileNameLen);
+
+ if (pdwRetFilePathLen) (*pdwRetFilePathLen) = dwFilePathLen;
+ if (lpszRetFilePathName && dwRetFilePathLen) {
+ dwFilePathLen = min(dwFilePathLen, dwRetFilePathLen);
+ memmove(lpszRetFilePathName, szPath, ((dwFilePathLen+1)*sizeof(WCHAR)));
}
- dwRetErrorCode=NO_ERROR;
+ dwRetErrorCode = NO_ERROR;
}
}
}
if (prdsiItems) FindClose(prdsiItems[dwRecDeepCurPos].hFind);
dwRecDeepCurPos--;
- }while(dwRecDeepCurPos!=-1);
+ }
+ while(dwRecDeepCurPos != -1);
}
- MEMFREE(prdsiItems);
- }else{
- dwRetErrorCode=GetLastError();
+ mir_free(prdsiItems);
}
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ else dwRetErrorCode = GetLastError();
}
-return(dwRetErrorCode);
+ else dwRetErrorCode = ERROR_INVALID_HANDLE;
+
+ return dwRetErrorCode;
}
-DWORD MemFillRandom(LPVOID lpBuff,SIZE_T dwBuffSize)
+DWORD MemFillRandom(LPVOID lpBuff, size_t dwBuffSize)
{
DWORD dwRetErrorCode;
- if (lpBuff && dwBuffSize)
- {
- HCRYPTPROV hCryptProv=NULL;
+ if (lpBuff && dwBuffSize) {
+ HCRYPTPROV hCryptProv = NULL;
- if (CryptAcquireContext(&hCryptProv,NULL,MS_STRONG_PROV,PROV_RSA_FULL,0)==FALSE && GetLastError()==NTE_BAD_KEYSET) CryptAcquireContext(&hCryptProv,NULL,MS_STRONG_PROV,PROV_RSA_FULL,CRYPT_NEWKEYSET);
+ if (CryptAcquireContext(&hCryptProv, NULL, MS_STRONG_PROV, PROV_RSA_FULL, 0) == FALSE && GetLastError() == NTE_BAD_KEYSET)
+ CryptAcquireContext(&hCryptProv, NULL, MS_STRONG_PROV, PROV_RSA_FULL, CRYPT_NEWKEYSET);
- if (hCryptProv)
- {
- if (CryptGenRandom(hCryptProv,dwBuffSize,(BYTE*)lpBuff))
- {
- dwRetErrorCode=NO_ERROR;
- }else{
- dwRetErrorCode=GetLastError();
- }
- }else{
- dwRetErrorCode=GetLastError();
+ if (hCryptProv) {
+ if (CryptGenRandom(hCryptProv, dwBuffSize, (BYTE*)lpBuff))
+ dwRetErrorCode = NO_ERROR;
+ else
+ dwRetErrorCode = GetLastError();
}
+ else dwRetErrorCode = GetLastError();
- CryptReleaseContext(hCryptProv,0);
- }else{
- dwRetErrorCode=ERROR_INVALID_HANDLE;
+ CryptReleaseContext(hCryptProv, 0);
}
-return(dwRetErrorCode);
-}
-
-
-
-
-
-#define MRA_PASS_CRYPT_VER 2
-
-
-
-#if MRA_PASS_CRYPT_VER==1
-
-BOOL SetPassDB(LPSTR lpszBuff,SIZE_T dwBuffSize)
-{
- BOOL bRet=FALSE;
- BYTE btRandomData[256],btCryptedPass[256]={0},bthmacSHA1[SHA1HashSize]={0};
- char szEMail[MAX_EMAIL_LEN]={0};
- SIZE_T dwEMailSize;
-
-
-#if /*defined (_DEBUG) ||*/ defined (REL_DEB)
-
- DB_Mra_SetStringExA(NULL,"Pass",lpszBuff,dwBuffSize);
- bRet=TRUE;
-#else
- if (dwBuffSize<128)
- if (DB_Mra_GetStaticStringA(NULL,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- MemFillRandom(btRandomData,sizeof(btRandomData));
-
- SHA1GetDigest(lpszBuff,dwBuffSize,&btCryptedPass[1]);
+ else dwRetErrorCode = ERROR_INVALID_HANDLE;
- BASE64EncodeUnSafe(lpszBuff,dwBuffSize,&btCryptedPass[(1+SHA1HashSize)],(sizeof(btCryptedPass)-1),&dwBuffSize);
- btCryptedPass[0]=(BYTE)dwBuffSize;
- //memmove(&btCryptedPass[1],lpszBuff,dwBuffSize);
-
- hmac_sha1(btRandomData,sizeof(btRandomData),(BYTE*)szEMail,dwEMailSize,bthmacSHA1);
-
- RC4(btCryptedPass,sizeof(btCryptedPass),bthmacSHA1,SHA1HashSize);
- RC4(btCryptedPass,sizeof(btCryptedPass),btRandomData,sizeof(btRandomData));
- CopyMemoryReverseDWORD(btCryptedPass,btCryptedPass,sizeof(btCryptedPass));
- RC4(btCryptedPass,sizeof(btCryptedPass),bthmacSHA1,SHA1HashSize);
-
-
- DB_Mra_SetDword(NULL,"pCryptVer",MRA_PASS_CRYPT_VER);
- DB_Mra_WriteContactSettingBlob(NULL,"pCryptData",btRandomData,sizeof(btRandomData));
- DB_Mra_WriteContactSettingBlob(NULL,"pCryptPass",btCryptedPass,sizeof(btCryptedPass));
-
- bRet=TRUE;
- }
-#endif
-return(bRet);
+ return dwRetErrorCode;
}
-#endif
-
-#if MRA_PASS_CRYPT_VER==2
-BOOL SetPassDB(LPSTR lpszBuff,SIZE_T dwBuffSize)
+BOOL CMraProto::SetPassDB(LPSTR lpszBuff, size_t dwBuffSize)
{
- BOOL bRet=FALSE;
- BYTE btRandomData[256],btCryptedPass[256]={0},bthmacSHA1[SHA1HashSize]={0};
- char szEMail[MAX_EMAIL_LEN]={0};
- SIZE_T dwEMailSize;
-
+ BOOL bRet = FALSE;
+ BYTE btRandomData[256], btCryptedPass[256] = {0}, bthmacSHA1[SHA1HashSize] = {0};
+ char szEMail[MAX_EMAIL_LEN] = {0};
+ size_t dwEMailSize;
#if /*defined (_DEBUG) ||*/ defined (REL_DEB)
- DB_Mra_SetStringExA(NULL,"Pass",lpszBuff,dwBuffSize);
- bRet=TRUE;
+ mraSetStringExA(NULL, "Pass", lpszBuff, dwBuffSize);
+ bRet = TRUE;
#else
- if (dwBuffSize<128)
- if (DB_Mra_GetStaticStringA(NULL,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- MemFillRandom(btRandomData,sizeof(btRandomData));
+ if (dwBuffSize < 128)
+ if (mraGetStaticStringA(NULL, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize)) {
+ MemFillRandom(btRandomData, sizeof(btRandomData));
- SHA1GetDigest(lpszBuff,dwBuffSize,&btCryptedPass[1]);
+ SHA1GetDigest(lpszBuff, dwBuffSize, &btCryptedPass[1]);
- //BASE64EncodeUnSafe(lpszBuff,dwBuffSize,&btCryptedPass[(1+SHA1HashSize)],(sizeof(btCryptedPass)-1),&dwBuffSize);
- memmove(&btCryptedPass[(1+SHA1HashSize)],lpszBuff,dwBuffSize);
- btCryptedPass[0]=(BYTE)dwBuffSize;
- //memmove(&btCryptedPass[1],lpszBuff,dwBuffSize);
+ //BASE64EncodeUnSafe(lpszBuff, dwBuffSize, &btCryptedPass[(1+SHA1HashSize)], (sizeof(btCryptedPass)-1), &dwBuffSize);
+ memmove(&btCryptedPass[(1+SHA1HashSize)], lpszBuff, dwBuffSize);
+ btCryptedPass[0] = (BYTE)dwBuffSize;
+ //memmove(&btCryptedPass[1], lpszBuff, dwBuffSize);
- hmac_sha1(btRandomData,sizeof(btRandomData),(BYTE*)szEMail,dwEMailSize,bthmacSHA1);
+ hmac_sha1(btRandomData, sizeof(btRandomData), (BYTE*)szEMail, dwEMailSize, bthmacSHA1);
- RC4(btCryptedPass,sizeof(btCryptedPass),bthmacSHA1,SHA1HashSize);
- RC4(btCryptedPass,sizeof(btCryptedPass),btRandomData,sizeof(btRandomData));
- CopyMemoryReverseDWORD(btCryptedPass,btCryptedPass,sizeof(btCryptedPass));
- RC4(btCryptedPass,sizeof(btCryptedPass),bthmacSHA1,SHA1HashSize);
+ RC4(btCryptedPass, sizeof(btCryptedPass), bthmacSHA1, SHA1HashSize);
+ RC4(btCryptedPass, sizeof(btCryptedPass), btRandomData, sizeof(btRandomData));
+ CopyMemoryReverseDWORD(btCryptedPass, btCryptedPass, sizeof(btCryptedPass));
+ RC4(btCryptedPass, sizeof(btCryptedPass), bthmacSHA1, SHA1HashSize);
- DB_Mra_SetDword(NULL,"pCryptVer",MRA_PASS_CRYPT_VER);
- DB_Mra_WriteContactSettingBlob(NULL,"pCryptData",btRandomData,sizeof(btRandomData));
- DB_Mra_WriteContactSettingBlob(NULL,"pCryptPass",btCryptedPass,sizeof(btCryptedPass));
+ mraSetDword(NULL, "pCryptVer", MRA_PASS_CRYPT_VER);
+ mraWriteContactSettingBlob(NULL, "pCryptData", btRandomData, sizeof(btRandomData));
+ mraWriteContactSettingBlob(NULL, "pCryptPass", btCryptedPass, sizeof(btCryptedPass));
- bRet=TRUE;
+ bRet = TRUE;
}
#endif
return(bRet);
}
-#endif
-BOOL GetPassDB_v1(LPSTR lpszBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSize)
+BOOL CMraProto::GetPassDB_v1(LPSTR lpszBuff, size_t dwBuffSize, size_t *pdwBuffSize)
{
- BOOL bRet=FALSE;
- BYTE btRandomData[256]={0},btCryptedPass[256]={0},bthmacSHA1[SHA1HashSize]={0};
- char szEMail[MAX_EMAIL_LEN]={0};
- SIZE_T dwRandomDataSize,dwCryptedPass,dwEMailSize,dwPassSize;
+ BYTE btRandomData[256] = {0}, btCryptedPass[256] = {0}, bthmacSHA1[SHA1HashSize] = {0};
+ char szEMail[MAX_EMAIL_LEN] = {0};
+ size_t dwRandomDataSize, dwCryptedPass, dwEMailSize, dwPassSize;
+ if (mraGetDword(NULL, "pCryptVer", 0) == 1)
+ if (mraGetContactSettingBlob(NULL, "pCryptData", btRandomData, sizeof(btRandomData), &dwRandomDataSize))
+ if (dwRandomDataSize == sizeof(btRandomData))
+ if (mraGetContactSettingBlob(NULL, "pCryptPass", btCryptedPass, sizeof(btCryptedPass), &dwCryptedPass))
+ if (dwCryptedPass == sizeof(btCryptedPass))
+ if (mraGetStaticStringA(NULL, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize)) {
+ hmac_sha1(btRandomData, sizeof(btRandomData), (BYTE*)szEMail, dwEMailSize, bthmacSHA1);
- if (DB_Mra_GetDword(NULL,"pCryptVer",0)==1)
- if (DB_Mra_GetContactSettingBlob(NULL,"pCryptData",btRandomData,sizeof(btRandomData),&dwRandomDataSize))
- if (dwRandomDataSize==sizeof(btRandomData))
- if (DB_Mra_GetContactSettingBlob(NULL,"pCryptPass",btCryptedPass,sizeof(btCryptedPass),&dwCryptedPass))
- if (dwCryptedPass==sizeof(btCryptedPass))
- if (DB_Mra_GetStaticStringA(NULL,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- hmac_sha1(btRandomData,sizeof(btRandomData),(BYTE*)szEMail,dwEMailSize,bthmacSHA1);
-
- RC4(btCryptedPass,sizeof(btCryptedPass),bthmacSHA1,SHA1HashSize);
- CopyMemoryReverseDWORD(btCryptedPass,btCryptedPass,sizeof(btCryptedPass));
- RC4(btCryptedPass,sizeof(btCryptedPass),btRandomData,dwRandomDataSize);
- RC4(btCryptedPass,sizeof(btCryptedPass),bthmacSHA1,SHA1HashSize);
-
- dwPassSize=(*btCryptedPass);
- BASE64DecodeUnSafe(&btCryptedPass[(1+SHA1HashSize)],dwPassSize,&btCryptedPass[(1+SHA1HashSize)],(sizeof(btCryptedPass)-1),&dwPassSize);
- SHA1GetDigest(&btCryptedPass[(1+SHA1HashSize)],dwPassSize,btRandomData);
- if (MemoryCompare(&btCryptedPass[1],SHA1HashSize,btRandomData,SHA1HashSize)==CMEM_EQUAL)
- if (dwBuffSize>=dwPassSize)
- {
- memmove(lpszBuff,&btCryptedPass[(1+SHA1HashSize)],dwPassSize);
- (*(lpszBuff+dwPassSize))=0;
+ RC4(btCryptedPass, sizeof(btCryptedPass), bthmacSHA1, SHA1HashSize);
+ CopyMemoryReverseDWORD(btCryptedPass, btCryptedPass, sizeof(btCryptedPass));
+ RC4(btCryptedPass, sizeof(btCryptedPass), btRandomData, dwRandomDataSize);
+ RC4(btCryptedPass, sizeof(btCryptedPass), bthmacSHA1, SHA1HashSize);
- if (pdwBuffSize) (*pdwBuffSize)=dwPassSize;
- bRet=TRUE;
+ dwPassSize = (*btCryptedPass);
+ BASE64DecodeUnSafe(&btCryptedPass[(1+SHA1HashSize)], dwPassSize, &btCryptedPass[(1+SHA1HashSize)], (sizeof(btCryptedPass)-1), &dwPassSize);
+ SHA1GetDigest(&btCryptedPass[(1+SHA1HashSize)], dwPassSize, btRandomData);
+ if (MemoryCompare(&btCryptedPass[1], SHA1HashSize, btRandomData, SHA1HashSize) == CMEM_EQUAL)
+ if (dwBuffSize >= dwPassSize) {
+ memmove(lpszBuff, &btCryptedPass[(1+SHA1HashSize)], dwPassSize);
+ *(lpszBuff + dwPassSize) = 0;
+
+ if (pdwBuffSize)
+ *pdwBuffSize = dwPassSize;
+ return TRUE;
}
}
-return(bRet);
+ return FALSE;
}
-BOOL GetPassDB_v2(LPSTR lpszBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSize)
+BOOL CMraProto::GetPassDB_v2(LPSTR lpszBuff, size_t dwBuffSize, size_t *pdwBuffSize)
{
- BOOL bRet=FALSE;
- BYTE btRandomData[256]={0},btCryptedPass[256]={0},bthmacSHA1[SHA1HashSize]={0};
- char szEMail[MAX_EMAIL_LEN]={0};
- SIZE_T dwRandomDataSize,dwCryptedPass,dwEMailSize,dwPassSize;
+ BYTE btRandomData[256] = {0}, btCryptedPass[256] = {0}, bthmacSHA1[SHA1HashSize] = {0};
+ char szEMail[MAX_EMAIL_LEN] = {0};
+ size_t dwRandomDataSize, dwCryptedPass, dwEMailSize, dwPassSize;
+ if (mraGetDword(NULL, "pCryptVer", 0) == 2)
+ if (mraGetContactSettingBlob(NULL, "pCryptData", btRandomData, sizeof(btRandomData), &dwRandomDataSize))
+ if (dwRandomDataSize == sizeof(btRandomData))
+ if (mraGetContactSettingBlob(NULL, "pCryptPass", btCryptedPass, sizeof(btCryptedPass), &dwCryptedPass))
+ if (dwCryptedPass == sizeof(btCryptedPass))
+ if (mraGetStaticStringA(NULL, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize)) {
+ hmac_sha1(btRandomData, sizeof(btRandomData), (BYTE*)szEMail, dwEMailSize, bthmacSHA1);
- if (DB_Mra_GetDword(NULL,"pCryptVer",0)==2)
- if (DB_Mra_GetContactSettingBlob(NULL,"pCryptData",btRandomData,sizeof(btRandomData),&dwRandomDataSize))
- if (dwRandomDataSize==sizeof(btRandomData))
- if (DB_Mra_GetContactSettingBlob(NULL,"pCryptPass",btCryptedPass,sizeof(btCryptedPass),&dwCryptedPass))
- if (dwCryptedPass==sizeof(btCryptedPass))
- if (DB_Mra_GetStaticStringA(NULL,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- hmac_sha1(btRandomData,sizeof(btRandomData),(BYTE*)szEMail,dwEMailSize,bthmacSHA1);
-
- RC4(btCryptedPass,sizeof(btCryptedPass),bthmacSHA1,SHA1HashSize);
- CopyMemoryReverseDWORD(btCryptedPass,btCryptedPass,sizeof(btCryptedPass));
- RC4(btCryptedPass,sizeof(btCryptedPass),btRandomData,dwRandomDataSize);
- RC4(btCryptedPass,sizeof(btCryptedPass),bthmacSHA1,SHA1HashSize);
+ RC4(btCryptedPass, sizeof(btCryptedPass), bthmacSHA1, SHA1HashSize);
+ CopyMemoryReverseDWORD(btCryptedPass, btCryptedPass, sizeof(btCryptedPass));
+ RC4(btCryptedPass, sizeof(btCryptedPass), btRandomData, dwRandomDataSize);
+ RC4(btCryptedPass, sizeof(btCryptedPass), bthmacSHA1, SHA1HashSize);
- dwPassSize=((*btCryptedPass)&0xff);
- SHA1GetDigest(&btCryptedPass[(1+SHA1HashSize)],dwPassSize,btRandomData);
- if (MemoryCompare(&btCryptedPass[1],SHA1HashSize,btRandomData,SHA1HashSize)==CMEM_EQUAL)
- if (dwBuffSize>=dwPassSize)
+ dwPassSize = ((*btCryptedPass)&0xff);
+ SHA1GetDigest(&btCryptedPass[(1+SHA1HashSize)], dwPassSize, btRandomData);
+ if (MemoryCompare(&btCryptedPass[1], SHA1HashSize, btRandomData, SHA1HashSize) == CMEM_EQUAL)
+ if (dwBuffSize >= dwPassSize)
{
- memmove(lpszBuff,&btCryptedPass[(1+SHA1HashSize)],dwPassSize);
- (*(lpszBuff+dwPassSize))=0;
+ memmove(lpszBuff, &btCryptedPass[(1+SHA1HashSize)], dwPassSize);
+ (*(lpszBuff+dwPassSize)) = 0;
- if (pdwBuffSize) (*pdwBuffSize)=dwPassSize;
- bRet=TRUE;
+ if (pdwBuffSize) (*pdwBuffSize) = dwPassSize;
+ return TRUE;
}
}
-return(bRet);
+ return FALSE;
}
-
-BOOL GetPassDB(LPSTR lpszBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSize)
+BOOL CMraProto::GetPassDB(LPSTR lpszBuff, size_t dwBuffSize, size_t *pdwBuffSize)
{
- BOOL bRet=FALSE;
-
-#if /*defined (_DEBUG) ||*/ defined (REL_DEB)
- DB_Mra_GetStaticStringA(NULL,"Pass",lpszBuff,dwBuffSize,pdwBuffSize);
- bRet=TRUE;
-#else
- switch (DB_Mra_GetDword(NULL,"pCryptVer",0)) {
- case 1:
- bRet=GetPassDB_v1(lpszBuff,dwBuffSize,pdwBuffSize);
- break;
- case 2:
- bRet=GetPassDB_v2(lpszBuff,dwBuffSize,pdwBuffSize);
- break;
- default:
- bRet=FALSE;
- break;
- }
-#endif
-
-return(bRet);
+ #if /*defined (_DEBUG) ||*/ defined (REL_DEB)
+ mraGetStaticStringA(NULL, "Pass", lpszBuff, dwBuffSize, pdwBuffSize);
+ return TRUE;
+ #else
+ switch (mraGetDword(NULL, "pCryptVer", 0)) {
+ case 1:
+ return GetPassDB_v1(lpszBuff, dwBuffSize, pdwBuffSize);
+ case 2:
+ return GetPassDB_v2(lpszBuff, dwBuffSize, pdwBuffSize);
+ default:
+ return FALSE;
+ }
+ #endif
}
-
-
-
-DWORD ReplaceInBuff(LPVOID lpInBuff,SIZE_T dwInBuffSize,SIZE_T dwReplaceItemsCount,LPVOID *plpInReplaceItems,SIZE_T *pdwInReplaceItemsCounts,LPVOID *plpOutReplaceItems,SIZE_T *pdwOutReplaceItemsCounts,LPVOID lpOutBuff,SIZE_T dwOutBuffSize,SIZE_T *pdwOutBuffSize)
+DWORD ReplaceInBuff(LPVOID lpInBuff, size_t dwInBuffSize, size_t dwReplaceItemsCount, LPVOID *plpInReplaceItems, size_t *pdwInReplaceItemsCounts, LPVOID *plpOutReplaceItems, size_t *pdwOutReplaceItemsCounts, LPVOID lpOutBuff, size_t dwOutBuffSize, size_t *pdwOutBuffSize)
{
- DWORD dwRetErrorCode=NO_ERROR;
+ DWORD dwRetErrorCode = NO_ERROR;
LPBYTE *plpbtFounded;
-#ifdef _DEBUG //check tables
- for(SIZE_T i=0;i<dwReplaceItemsCount;i++)
- {
- if (lstrlen((LPTSTR)plpInReplaceItems[i])!=(pdwInReplaceItemsCounts[i]/sizeof(TCHAR))) DebugBreak();
- if (lstrlen((LPTSTR)plpOutReplaceItems[i])!=(pdwOutReplaceItemsCounts[i]/sizeof(TCHAR))) DebugBreak();
- }
-#endif
+ #ifdef _DEBUG //check tables
+ for (size_t i = 0;i<dwReplaceItemsCount;i++)
+ {
+ if (lstrlen((LPTSTR)plpInReplaceItems[i]) != (pdwInReplaceItemsCounts[i]/sizeof(TCHAR))) DebugBreak();
+ if (lstrlen((LPTSTR)plpOutReplaceItems[i]) != (pdwOutReplaceItemsCounts[i]/sizeof(TCHAR))) DebugBreak();
+ }
+ #endif
- plpbtFounded=(LPBYTE*)MEMALLOC((sizeof(LPBYTE)*dwReplaceItemsCount));
- if (plpbtFounded)
- {
- LPBYTE lpbtOutBuffCur,lpbtInBuffCur,lpbtInBuffCurPrev,lpbtOutBuffMax;
- SIZE_T i,dwFirstFoundedIndex=0,dwFoundedCount=0,dwMemPartToCopy;
-
- lpbtInBuffCurPrev=(LPBYTE)lpInBuff;
- lpbtOutBuffCur=(LPBYTE)lpOutBuff;
- lpbtOutBuffMax=(((LPBYTE)lpOutBuff)+dwOutBuffSize);
- for(i=0;i<dwReplaceItemsCount;i++)
- {// loking for in first time
- plpbtFounded[i]=(LPBYTE)MemoryFind((lpbtInBuffCurPrev-(LPBYTE)lpInBuff),lpInBuff,dwInBuffSize,plpInReplaceItems[i],pdwInReplaceItemsCounts[i]);
- if (plpbtFounded[i]) dwFoundedCount++;
+ plpbtFounded = (LPBYTE*)mir_calloc((sizeof(LPBYTE)*dwReplaceItemsCount));
+ if (plpbtFounded) {
+ LPBYTE lpbtOutBuffCur, lpbtInBuffCur, lpbtInBuffCurPrev, lpbtOutBuffMax;
+ size_t i, dwFirstFoundIndex = 0, dwFoundCount = 0, dwMemPartToCopy;
+
+ lpbtInBuffCurPrev = (LPBYTE)lpInBuff;
+ lpbtOutBuffCur = (LPBYTE)lpOutBuff;
+ lpbtOutBuffMax = (((LPBYTE)lpOutBuff)+dwOutBuffSize);
+ for (i = 0; i < dwReplaceItemsCount; i++) {// looking for the first time
+ plpbtFounded[i] = (LPBYTE)MemoryFind((lpbtInBuffCurPrev-(LPBYTE)lpInBuff), lpInBuff, dwInBuffSize, plpInReplaceItems[i], pdwInReplaceItemsCounts[i]);
+ if (plpbtFounded[i])
+ dwFoundCount++;
}
- while(dwFoundedCount)
- {
- for(i=0;i<dwReplaceItemsCount;i++)
- {// looking for first to replace
- if (plpbtFounded[i] && (plpbtFounded[i]<plpbtFounded[dwFirstFoundedIndex] || plpbtFounded[dwFirstFoundedIndex]==NULL)) dwFirstFoundedIndex=i;
- }
+ while(dwFoundCount) {
+ for (i = 0; i < dwReplaceItemsCount; i++)
+ if (plpbtFounded[i] && (plpbtFounded[i] < plpbtFounded[dwFirstFoundIndex] || plpbtFounded[dwFirstFoundIndex] == NULL))
+ dwFirstFoundIndex = i;
- if (plpbtFounded[dwFirstFoundedIndex])
- {// in founded
- dwMemPartToCopy=(plpbtFounded[dwFirstFoundedIndex]-lpbtInBuffCurPrev);
- if (lpbtOutBuffMax>(lpbtOutBuffCur+(dwMemPartToCopy+pdwInReplaceItemsCounts[dwFirstFoundedIndex])))
+ if (plpbtFounded[dwFirstFoundIndex]) {// in found
+ dwMemPartToCopy = (plpbtFounded[dwFirstFoundIndex]-lpbtInBuffCurPrev);
+ if (lpbtOutBuffMax>(lpbtOutBuffCur+(dwMemPartToCopy+pdwInReplaceItemsCounts[dwFirstFoundIndex])))
{
- memmove(lpbtOutBuffCur,lpbtInBuffCurPrev,dwMemPartToCopy);lpbtOutBuffCur+=dwMemPartToCopy;
- memmove(lpbtOutBuffCur,plpOutReplaceItems[dwFirstFoundedIndex],pdwOutReplaceItemsCounts[dwFirstFoundedIndex]);lpbtOutBuffCur+=pdwOutReplaceItemsCounts[dwFirstFoundedIndex];
- lpbtInBuffCurPrev=(plpbtFounded[dwFirstFoundedIndex]+pdwInReplaceItemsCounts[dwFirstFoundedIndex]);
-
- for(i=0;i<dwReplaceItemsCount;i++)
- {// loking for in next time
- if (plpbtFounded[i] && plpbtFounded[i]<lpbtInBuffCurPrev)
- {
- plpbtFounded[i]=(LPBYTE)MemoryFind((lpbtInBuffCurPrev-(LPBYTE)lpInBuff),lpInBuff,dwInBuffSize,plpInReplaceItems[i],pdwInReplaceItemsCounts[i]);
- if (plpbtFounded[i]==NULL) dwFoundedCount--;
+ memmove(lpbtOutBuffCur, lpbtInBuffCurPrev, dwMemPartToCopy);lpbtOutBuffCur += dwMemPartToCopy;
+ memmove(lpbtOutBuffCur, plpOutReplaceItems[dwFirstFoundIndex], pdwOutReplaceItemsCounts[dwFirstFoundIndex]);lpbtOutBuffCur += pdwOutReplaceItemsCounts[dwFirstFoundIndex];
+ lpbtInBuffCurPrev = (plpbtFounded[dwFirstFoundIndex]+pdwInReplaceItemsCounts[dwFirstFoundIndex]);
+
+ for (i = 0;i<dwReplaceItemsCount;i++) {// looking for in next time
+ if (plpbtFounded[i] && plpbtFounded[i] < lpbtInBuffCurPrev) {
+ plpbtFounded[i] = (LPBYTE)MemoryFind((lpbtInBuffCurPrev-(LPBYTE)lpInBuff), lpInBuff, dwInBuffSize, plpInReplaceItems[i], pdwInReplaceItemsCounts[i]);
+ if (plpbtFounded[i] == NULL) dwFoundCount--;
}
}
- }else{
- dwRetErrorCode=ERROR_BUFFER_OVERFLOW;
+ }
+ else {
+ dwRetErrorCode = ERROR_BUFFER_OVERFLOW;
DebugBreak();
break;
}
- }else{// сюда по идее никогда не попадём, на всякий случай.
+ }
+ else {// сюда по идее никогда не попадём, на всякий случай.
DebugBreak();
break;
}
}
- lpbtInBuffCur=(((LPBYTE)lpInBuff)+dwInBuffSize);
- memmove(lpbtOutBuffCur,lpbtInBuffCurPrev,(lpbtInBuffCur-lpbtInBuffCurPrev));lpbtOutBuffCur+=(lpbtInBuffCur-lpbtInBuffCurPrev);
- (*((WORD*)lpbtOutBuffCur))=0;
+ lpbtInBuffCur = (((LPBYTE)lpInBuff)+dwInBuffSize);
+ memmove(lpbtOutBuffCur, lpbtInBuffCurPrev, (lpbtInBuffCur-lpbtInBuffCurPrev));lpbtOutBuffCur += (lpbtInBuffCur-lpbtInBuffCurPrev);
+ (*((WORD*)lpbtOutBuffCur)) = 0;
- MEMFREE(plpbtFounded);
+ mir_free(plpbtFounded);
- if (pdwOutBuffSize) (*pdwOutBuffSize)=(lpbtOutBuffCur-((LPBYTE)lpOutBuff));
- }else{
- dwRetErrorCode=GetLastError();
+ if (pdwOutBuffSize) (*pdwOutBuffSize) = (lpbtOutBuffCur-((LPBYTE)lpOutBuff));
}
-return(dwRetErrorCode);
-}
+ else dwRetErrorCode = GetLastError();
+ return dwRetErrorCode;
+}
-static const LPTSTR lpszXMLTags[] ={TEXT("&apos;"), TEXT("&quot;"), TEXT("&amp;"), TEXT("&lt;"), TEXT("&gt;")};
-static const SIZE_T dwXMLTagsCount[] ={(6*sizeof(TCHAR)), (6*sizeof(TCHAR)), (5*sizeof(TCHAR)), (4*sizeof(TCHAR)), (4*sizeof(TCHAR))};
-static const LPTSTR lpszXMLSymbols[] ={TEXT("\'"), TEXT("\""), TEXT("&"), TEXT("<"), TEXT(">")};
-static const SIZE_T dwXMLSymbolsCount[] ={sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR)};
+static const LPTSTR lpszXMLTags[] = {TEXT("&apos;"), TEXT("&quot;"), TEXT("&amp;"), TEXT("&lt;"), TEXT("&gt;")};
+static const size_t dwXMLTagsCount[] = {(6*sizeof(TCHAR)), (6*sizeof(TCHAR)), (5*sizeof(TCHAR)), (4*sizeof(TCHAR)), (4*sizeof(TCHAR))};
+static const LPTSTR lpszXMLSymbols[] = {TEXT("\'"), TEXT("\""), TEXT("&"), TEXT("<"), TEXT(">")};
+static const size_t dwXMLSymbolsCount[] = {sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR)};
//Decode XML coded string. The function translate special xml code into standard characters.
-DWORD DecodeXML(LPTSTR lptszMessage,SIZE_T dwMessageSize,LPTSTR lptszMessageConverted,SIZE_T dwMessageConvertedBuffSize,SIZE_T *pdwMessageConvertedSize)
+DWORD DecodeXML(LPTSTR lptszMessage, size_t dwMessageSize, LPTSTR lptszMessageConverted, size_t dwMessageConvertedBuffSize, size_t *pdwMessageConvertedSize)
{
- DWORD dwRet=ReplaceInBuff(lptszMessage,(dwMessageSize*sizeof(TCHAR)),SIZEOF(lpszXMLTags),(LPVOID*)lpszXMLTags,(SIZE_T*)dwXMLTagsCount,(LPVOID*)lpszXMLSymbols,(SIZE_T*)dwXMLSymbolsCount,lptszMessageConverted,(dwMessageConvertedBuffSize*sizeof(TCHAR)),pdwMessageConvertedSize);
-
- if (pdwMessageConvertedSize) (*pdwMessageConvertedSize)/=sizeof(TCHAR);
-return(dwRet);
+ DWORD dwRet = ReplaceInBuff(lptszMessage, (dwMessageSize*sizeof(TCHAR)), SIZEOF(lpszXMLTags), (LPVOID*)lpszXMLTags, (size_t*)dwXMLTagsCount, (LPVOID*)lpszXMLSymbols, (size_t*)dwXMLSymbolsCount, lptszMessageConverted, (dwMessageConvertedBuffSize*sizeof(TCHAR)), pdwMessageConvertedSize);
+ if (pdwMessageConvertedSize)
+ *pdwMessageConvertedSize /= sizeof(TCHAR);
+ return dwRet;
}
//Encode XML coded string. The function translate special saved xml characters into special characters.
-DWORD EncodeXML(LPTSTR lptszMessage,SIZE_T dwMessageSize,LPTSTR lptszMessageConverted,SIZE_T dwMessageConvertedBuffSize,SIZE_T *pdwMessageConvertedSize)
+DWORD EncodeXML(LPTSTR lptszMessage, size_t dwMessageSize, LPTSTR lptszMessageConverted, size_t dwMessageConvertedBuffSize, size_t *pdwMessageConvertedSize)
{
- DWORD dwRet=ReplaceInBuff(lptszMessage,(dwMessageSize*sizeof(TCHAR)),SIZEOF(lpszXMLTags),(LPVOID*)lpszXMLSymbols,(SIZE_T*)dwXMLSymbolsCount,(LPVOID*)lpszXMLTags,(SIZE_T*)dwXMLTagsCount,lptszMessageConverted,(dwMessageConvertedBuffSize*sizeof(TCHAR)),pdwMessageConvertedSize);
-
- if (pdwMessageConvertedSize) (*pdwMessageConvertedSize)/=sizeof(TCHAR);
-return(dwRet);
+ DWORD dwRet = ReplaceInBuff(lptszMessage, (dwMessageSize*sizeof(TCHAR)), SIZEOF(lpszXMLTags), (LPVOID*)lpszXMLSymbols, (size_t*)dwXMLSymbolsCount, (LPVOID*)lpszXMLTags, (size_t*)dwXMLTagsCount, lptszMessageConverted, (dwMessageConvertedBuffSize*sizeof(TCHAR)), pdwMessageConvertedSize);
+ if (pdwMessageConvertedSize)
+ *pdwMessageConvertedSize /= sizeof(TCHAR);
+ return dwRet;
}
diff --git a/protocols/MRA/Mra_options.cpp b/protocols/MRA/Mra_options.cpp
index 137b347f1c..e85405b859 100644
--- a/protocols/MRA/Mra_options.cpp
+++ b/protocols/MRA/Mra_options.cpp
@@ -1,238 +1,211 @@
#include "Mra.h"
-
-
-INT_PTR CALLBACK DlgProcOptsAccount (HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-INT_PTR CALLBACK DlgProcOptsConnections (HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-
-
-
-int OptInit(WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK DlgProcOptsAccount(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- OPTIONSDIALOGPAGE odp={0};
- odp.cbSize = sizeof(odp);
- odp.hInstance = masMraSettings.hInstance;
- odp.pszTitle = PROTOCOL_NAMEA;
- odp.pszGroup = LPGEN("Network");
- odp.flags = ODPF_BOLDGROUPS;
-
- odp.pszTab = LPGEN("Account");
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ACCOUNT);
- odp.pfnDlgProc = DlgProcOptsAccount;
- Options_AddPage(wParam, &odp);
-
- odp.pszTab = LPGEN("Connections");
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CONNECTIONS);
- odp.pfnDlgProc = DlgProcOptsConnections;
- Options_AddPage(wParam, &odp);
-
- odp.pszTab = LPGEN("Anti spam");
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ANTISPAM);
- odp.pfnDlgProc = MraAntiSpamDlgProcOpts;
- Options_AddPage(wParam, &odp);
-
- odp.pszTab = LPGEN("Files");
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FILES);
- odp.pfnDlgProc = MraFilesQueueDlgProcOpts;
- Options_AddPage(wParam, &odp);
+ CMraProto *ppro = (CMraProto*)GetWindowLongPtr(hWndDlg, GWLP_USERDATA);
+ WCHAR szBuff[MAX_EMAIL_LEN];
- odp.pszTab = LPGEN("Avatars");
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_AVATRS);
- odp.pfnDlgProc = MraAvatarsQueueDlgProcOpts;
- Options_AddPage(wParam, &odp);
-
- MraPopupOptInit(wParam,lParam);
- return 0;
-}
-
-
-
-INT_PTR CALLBACK DlgProcOptsAccount(HWND hWndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
-{
- switch(msg){
+ switch (msg) {
case WM_INITDIALOG:
- {
- WCHAR szBuff[MAX_PATH];
- //SIZE_T dwBuffSize;
+ TranslateDialogDefault(hWndDlg);
+ SetWindowLongPtr(hWndDlg, GWLP_USERDATA, lParam);
+ ppro = (CMraProto*)lParam;
- TranslateDialogDefault(hWndDlg);
+ if ( ppro->mraGetStaticStringW(NULL, "e-mail", szBuff, SIZEOF(szBuff), NULL))
+ SET_DLG_ITEM_TEXTW(hWndDlg, IDC_LOGIN, szBuff);
+
+ SET_DLG_ITEM_TEXTW(hWndDlg, IDC_PASSWORD, (LPWSTR)L"");
+ return TRUE;
- if (DB_Mra_GetStaticStringW(NULL,"e-mail",szBuff,SIZEOF(szBuff),NULL))
- {
- SET_DLG_ITEM_TEXTW(hWndDlg,IDC_LOGIN,szBuff);
- }
-
- SET_DLG_ITEM_TEXTW(hWndDlg,IDC_PASSWORD,(LPWSTR)L"");
- //if (GetPassDB((LPSTR)szBuff,SIZEOF(szBuff),&dwBuffSize))
- //{//bit of a security hole here, since it's easy to extract a password from an edit box
- // SET_DLG_ITEM_TEXTA(hWndDlg,IDC_PASSWORD,(LPSTR)szBuff);
- // SecureZeroMemory(szBuff,sizeof(szBuff));
- //}
- }
- return(TRUE);
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_NEW_ACCOUNT_LINK:
- CallService(MS_UTILS_OPENURL,TRUE,(LPARAM)MRA_REGISTER_URL);
- return(TRUE);
+ CallService(MS_UTILS_OPENURL, TRUE, (LPARAM)MRA_REGISTER_URL);
+ return TRUE;
+
case IDC_LOOKUPLINK:
- CallService(MS_UTILS_OPENURL,TRUE,(LPARAM)MRA_FORGOT_PASSWORD_URL);
- return(TRUE);
+ CallService(MS_UTILS_OPENURL, TRUE, (LPARAM)MRA_FORGOT_PASSWORD_URL);
+ return TRUE;
}
- if ((LOWORD(wParam)==IDC_LOGIN || LOWORD(wParam)==IDC_PASSWORD) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return 0;
- SendMessage(GetParent(hWndDlg),PSM_CHANGED,0,0);
+ if ((LOWORD(wParam) == IDC_LOGIN || LOWORD(wParam) == IDC_PASSWORD) && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
+ return 0;
+
+ SendMessage(GetParent(hWndDlg), PSM_CHANGED, 0, 0);
break;
+
case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->code){
+ switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- {
- WCHAR szBuff[MAX_EMAIL_LEN];
-
- GET_DLG_ITEM_TEXT(hWndDlg,IDC_LOGIN,szBuff,SIZEOF(szBuff));
- DB_Mra_SetStringW(NULL,"e-mail",szBuff);
+ GET_DLG_ITEM_TEXT(hWndDlg, IDC_LOGIN, szBuff, SIZEOF(szBuff));
+ ppro->mraSetStringW(NULL, "e-mail", szBuff);
- if (GET_DLG_ITEM_TEXTA(hWndDlg,IDC_PASSWORD,(LPSTR)szBuff,SIZEOF(szBuff)))
- {
- SetPassDB((LPSTR)szBuff,lstrlenA((LPSTR)szBuff));
- SecureZeroMemory(szBuff,sizeof(szBuff));
- }
+ if (GET_DLG_ITEM_TEXTA(hWndDlg, IDC_PASSWORD, (LPSTR)szBuff, SIZEOF(szBuff))) {
+ ppro->SetPassDB((LPSTR)szBuff, lstrlenA((LPSTR)szBuff));
+ SecureZeroMemory(szBuff, sizeof(szBuff));
}
- return(TRUE);
+ return TRUE;
}
break;
}
-return(FALSE);
+ return FALSE;
}
-INT_PTR CALLBACK DlgProcOptsConnections(HWND hWndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK DlgProcOptsConnections(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg){
- case WM_INITDIALOG:
- {
- WCHAR szBuff[MAX_PATH];
+ CMraProto *ppro = (CMraProto*)GetWindowLongPtr(hWndDlg, GWLP_USERDATA);
+ WCHAR szBuff[MAX_PATH];
- TranslateDialogDefault(hWndDlg);
+ switch (msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hWndDlg);
+ SetWindowLongPtr(hWndDlg, GWLP_USERDATA, lParam);
+ ppro = (CMraProto*)lParam;
+
+ if (ppro->mraGetStaticStringW(NULL, "Server", szBuff, SIZEOF(szBuff), NULL))
+ SET_DLG_ITEM_TEXT(hWndDlg, IDC_SERVER, szBuff);
+ else
+ SET_DLG_ITEM_TEXTA(hWndDlg, IDC_SERVER, MRA_DEFAULT_SERVER);
+
+ SetDlgItemInt(hWndDlg, IDC_SERVERPORT, ppro->mraGetWord(NULL, "ServerPort", MRA_DEFAULT_SERVER_PORT), FALSE);
+ // if set SSL proxy, setting will ignored
+
+ //CHECK_DLG_BUTTON(hWndDlg, IDC_KEEPALIVE, mraGetByte(NULL, "keepalive", 0));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_ADD_CONTACTS_TO_SERVER, ppro->mraGetByte(NULL, "AutoAddContactsToServer", MRA_DEFAULT_AUTO_ADD_CONTACTS_TO_SERVER));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_AUTH_REQ_ON_LOGON, ppro->mraGetByte(NULL, "AutoAuthRequestOnLogon", MRA_DEFAULT_AUTO_AUTH_REQ_ON_LOGON));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_AUTH_GRAND_IN_CLIST, ppro->mraGetByte(NULL, "AutoAuthGrandUsersInCList", MRA_DEFAULT_AUTO_AUTH_GRAND_IN_CLIST));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS, ppro->mraGetByte(NULL, "AutoAuthGrandNewUsers", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK, ppro->mraGetByte(NULL, "AutoAuthGrandNewUsersDisableSPAMCheck", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK), IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS));
+
+ CHECK_DLG_BUTTON(hWndDlg, IDC_SLOWSEND, ppro->mraGetByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_INCREMENTAL_NEW_MAIL_NOTIFY, ppro->mraGetByte(NULL, "IncrementalNewMailNotify", MRA_DEFAULT_INC_NEW_MAIL_NOTIFY));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY, ppro->mraGetByte(NULL, "TrayIconNewMailNotify", MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY));
+ CHECK_DLG_BUTTON(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX, ppro->mraGetByte(NULL, "TrayIconNewMailClkToInbox", MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX), ppro->mraGetByte(NULL, "TrayIconNewMailNotify", MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY));
+
+ CHECK_DLG_BUTTON(hWndDlg, IDC_HIDE_MENU_ITEMS_FOR_NON_MRA, ppro->mraGetByte(NULL, "HideMenuItemsForNonMRAContacts", MRA_DEFAULT_HIDE_MENU_ITEMS_FOR_NON_MRA));
+
+ CHECK_DLG_BUTTON(hWndDlg, IDC_RTF_RECEIVE_ENABLE, ppro->mraGetByte(NULL, "RTFReceiveEnable", MRA_DEFAULT_RTF_RECEIVE_ENABLE));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RTF_RECEIVE_ENABLE), (BOOL)(masMraSettings.lpfnUncompress != NULL));
+
+ CHECK_DLG_BUTTON(hWndDlg, IDC_RTF_SEND_ENABLE, ppro->mraGetByte(NULL, "RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RTF_SEND_ENABLE), (BOOL)(masMraSettings.lpfnCompress2 != NULL));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RTF_SEND_SMART), ppro->mraGetByte(NULL, "RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE) && masMraSettings.lpfnCompress2);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_BUTTON_FONT), ppro->mraGetByte(NULL, "RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE) && masMraSettings.lpfnCompress2);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RTF_BGCOLOUR), ppro->mraGetByte(NULL, "RTFSendEnable", MRA_DEFAULT_RTF_SEND_ENABLE) && masMraSettings.lpfnCompress2);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_RTF_BGCOLOUR, CPM_SETCOLOUR, 0, ppro->mraGetDword(NULL, "RTFBackgroundColour", MRA_DEFAULT_RTF_BACKGROUND_COLOUR));
+ return TRUE;
- if (DB_Mra_GetStaticStringW(NULL,"Server",szBuff,SIZEOF(szBuff),NULL))
- {
- SET_DLG_ITEM_TEXT(hWndDlg,IDC_SERVER,szBuff);
- }else{
- SET_DLG_ITEM_TEXTA(hWndDlg,IDC_SERVER,MRA_DEFAULT_SERVER);
- }
- SetDlgItemInt(hWndDlg,IDC_SERVERPORT,DB_Mra_GetWord(NULL,"ServerPort",MRA_DEFAULT_SERVER_PORT),FALSE);
- // if set SSL proxy, setting will ignored
-
- //CHECK_DLG_BUTTON(hWndDlg, IDC_KEEPALIVE,DB_Mra_GetByte(NULL,"keepalive",0));
- CHECK_DLG_BUTTON(hWndDlg,IDC_AUTO_ADD_CONTACTS_TO_SERVER,DB_Mra_GetByte(NULL,"AutoAddContactsToServer",MRA_DEFAULT_AUTO_ADD_CONTACTS_TO_SERVER));
- CHECK_DLG_BUTTON(hWndDlg,IDC_AUTO_AUTH_REQ_ON_LOGON,DB_Mra_GetByte(NULL,"AutoAuthRequestOnLogon",MRA_DEFAULT_AUTO_AUTH_REQ_ON_LOGON));
- CHECK_DLG_BUTTON(hWndDlg,IDC_AUTO_AUTH_GRAND_IN_CLIST,DB_Mra_GetByte(NULL,"AutoAuthGrandUsersInCList",MRA_DEFAULT_AUTO_AUTH_GRAND_IN_CLIST));
- CHECK_DLG_BUTTON(hWndDlg,IDC_AUTO_AUTH_GRAND_NEW_USERS,DB_Mra_GetByte(NULL,"AutoAuthGrandNewUsers",MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS));
- CHECK_DLG_BUTTON(hWndDlg,IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK,DB_Mra_GetByte(NULL,"AutoAuthGrandNewUsersDisableSPAMCheck",MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK));
- EnableWindow(GetDlgItem(hWndDlg,IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK),IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_AUTO_AUTH_GRAND_NEW_USERS));
-
- CHECK_DLG_BUTTON(hWndDlg,IDC_SLOWSEND,DB_Mra_GetByte(NULL,"SlowSend",MRA_DEFAULT_SLOW_SEND));
- CHECK_DLG_BUTTON(hWndDlg,IDC_INCREMENTAL_NEW_MAIL_NOTIFY,DB_Mra_GetByte(NULL,"IncrementalNewMailNotify",MRA_DEFAULT_INC_NEW_MAIL_NOTIFY));
- CHECK_DLG_BUTTON(hWndDlg,IDC_TRAYICON_NEW_MAIL_NOTIFY,DB_Mra_GetByte(NULL,"TrayIconNewMailNotify",MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY));
- CHECK_DLG_BUTTON(hWndDlg,IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX,DB_Mra_GetByte(NULL,"TrayIconNewMailClkToInbox",MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX));
- EnableWindow(GetDlgItem(hWndDlg,IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX),DB_Mra_GetByte(NULL,"TrayIconNewMailNotify",MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY));
-
- CHECK_DLG_BUTTON(hWndDlg,IDC_HIDE_MENU_ITEMS_FOR_NON_MRA,DB_Mra_GetByte(NULL,"HideMenuItemsForNonMRAContacts",MRA_DEFAULT_HIDE_MENU_ITEMS_FOR_NON_MRA));
-
- CHECK_DLG_BUTTON(hWndDlg,IDC_RTF_RECEIVE_ENABLE,DB_Mra_GetByte(NULL,"RTFReceiveEnable",MRA_DEFAULT_RTF_RECEIVE_ENABLE));
- EnableWindow(GetDlgItem(hWndDlg,IDC_RTF_RECEIVE_ENABLE),(BOOL)(masMraSettings.lpfnUncompress!=NULL));
-
- CHECK_DLG_BUTTON(hWndDlg,IDC_RTF_SEND_ENABLE,DB_Mra_GetByte(NULL,"RTFSendEnable",MRA_DEFAULT_RTF_SEND_ENABLE));
- EnableWindow(GetDlgItem(hWndDlg,IDC_RTF_SEND_ENABLE),(BOOL)(masMraSettings.lpfnCompress2!=NULL));
- EnableWindow(GetDlgItem(hWndDlg,IDC_RTF_SEND_SMART),(DB_Mra_GetByte(NULL,"RTFSendEnable",MRA_DEFAULT_RTF_SEND_ENABLE) && masMraSettings.lpfnCompress2));
- EnableWindow(GetDlgItem(hWndDlg,IDC_BUTTON_FONT),(DB_Mra_GetByte(NULL,"RTFSendEnable",MRA_DEFAULT_RTF_SEND_ENABLE) && masMraSettings.lpfnCompress2));
- EnableWindow(GetDlgItem(hWndDlg,IDC_RTF_BGCOLOUR),(DB_Mra_GetByte(NULL,"RTFSendEnable",MRA_DEFAULT_RTF_SEND_ENABLE) && masMraSettings.lpfnCompress2));
- SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_RTF_BGCOLOUR,CPM_SETCOLOUR,0,DB_Mra_GetDword(NULL,"RTFBackgroundColour",MRA_DEFAULT_RTF_BACKGROUND_COLOUR));
- }
- return(TRUE);
case WM_COMMAND:
- switch(LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
case IDC_BUTTON_DEFAULT:
- SET_DLG_ITEM_TEXTA(hWndDlg,IDC_SERVER,MRA_DEFAULT_SERVER);
- SetDlgItemInt(hWndDlg,IDC_SERVERPORT,MRA_DEFAULT_SERVER_PORT,FALSE);
+ SET_DLG_ITEM_TEXTA(hWndDlg, IDC_SERVER, MRA_DEFAULT_SERVER);
+ SetDlgItemInt(hWndDlg, IDC_SERVERPORT, MRA_DEFAULT_SERVER_PORT, FALSE);
break;
case IDC_AUTO_AUTH_GRAND_NEW_USERS:
- EnableWindow(GetDlgItem(hWndDlg,IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK),IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_AUTO_AUTH_GRAND_NEW_USERS));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK), IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS));
break;
case IDC_TRAYICON_NEW_MAIL_NOTIFY:
- EnableWindow(GetDlgItem(hWndDlg,IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX),IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_TRAYICON_NEW_MAIL_NOTIFY));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX), IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY));
break;
case IDC_RTF_SEND_ENABLE:
- EnableWindow(GetDlgItem(hWndDlg,IDC_RTF_SEND_SMART),IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_RTF_SEND_ENABLE));
- EnableWindow(GetDlgItem(hWndDlg,IDC_BUTTON_FONT),IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_RTF_SEND_ENABLE));
- EnableWindow(GetDlgItem(hWndDlg,IDC_RTF_BGCOLOUR),IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_RTF_SEND_ENABLE));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RTF_SEND_SMART), IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_RTF_SEND_ENABLE));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_BUTTON_FONT), IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_RTF_SEND_ENABLE));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_RTF_BGCOLOUR), IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_RTF_SEND_ENABLE));
break;
case IDC_BUTTON_FONT:
{
- LOGFONT lf={0};
- CHOOSEFONT cf={0};
-
- cf.lStructSize=sizeof(cf);
- cf.lpLogFont=&lf;
- cf.rgbColors=DB_Mra_GetDword(NULL,"RTFFontColour",MRA_DEFAULT_RTF_FONT_COLOUR);
- cf.Flags=(CF_SCREENFONTS|CF_EFFECTS|CF_FORCEFONTEXIST|CF_INITTOLOGFONTSTRUCT);
- if (DB_Mra_GetContactSettingBlob(NULL,"RTFFont",&lf,sizeof(LOGFONT),NULL)==FALSE)
- {
- HDC hDC=GetDC(NULL);// kegl
- lf.lfCharSet=MRA_DEFAULT_RTF_FONT_CHARSET;
- lf.lfHeight=-MulDiv(MRA_DEFAULT_RTF_FONT_SIZE,GetDeviceCaps(hDC,LOGPIXELSY),72);
- lstrcpynW(lf.lfFaceName,MRA_DEFAULT_RTF_FONT_NAME,LF_FACESIZE);
- ReleaseDC(NULL,hDC);
+ LOGFONT lf = {0};
+ CHOOSEFONT cf = {0};
+
+ cf.lStructSize = sizeof(cf);
+ cf.lpLogFont = &lf;
+ cf.rgbColors = ppro->mraGetDword(NULL, "RTFFontColour", MRA_DEFAULT_RTF_FONT_COLOUR);
+ cf.Flags = (CF_SCREENFONTS|CF_EFFECTS|CF_FORCEFONTEXIST|CF_INITTOLOGFONTSTRUCT);
+ if (ppro->mraGetContactSettingBlob(NULL, "RTFFont", &lf, sizeof(LOGFONT), NULL) == FALSE) {
+ HDC hDC = GetDC(NULL);// kegl
+ lf.lfCharSet = MRA_DEFAULT_RTF_FONT_CHARSET;
+ lf.lfHeight = -MulDiv(MRA_DEFAULT_RTF_FONT_SIZE, GetDeviceCaps(hDC, LOGPIXELSY), 72);
+ lstrcpynW(lf.lfFaceName, MRA_DEFAULT_RTF_FONT_NAME, LF_FACESIZE);
+ ReleaseDC(NULL, hDC);
}
- if (ChooseFont(&cf))
- {
- /*HDC hDC=GetDC(NULL);
- DWORD dwFontSize;
- dwFontSize=-MulDiv(lf.lfHeight,72,GetDeviceCaps(hDC,LOGPIXELSY));
- dwFontSize+=((dwFontSize+4)/8);//MulDiv(dwFontSize,GetDeviceCaps(hDC,PHYSICALWIDTH),72);
- ReleaseDC(NULL,hDC);*/
-
- DB_Mra_WriteContactSettingBlob(NULL,"RTFFont",&lf,sizeof(LOGFONT));
- DB_Mra_SetDword(NULL,"RTFFontColour",cf.rgbColors);
+ if (ChooseFont(&cf)) {
+ ppro->mraWriteContactSettingBlob(NULL, "RTFFont", &lf, sizeof(LOGFONT));
+ ppro->mraSetDword(NULL, "RTFFontColour", cf.rgbColors);
}
}
break;
}
- if ((LOWORD(wParam)==IDC_SERVER || LOWORD(wParam)==IDC_SERVERPORT) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return(FALSE);
- SendMessage(GetParent(hWndDlg),PSM_CHANGED,0,0);
+ if ((LOWORD(wParam) == IDC_SERVER || LOWORD(wParam) == IDC_SERVERPORT) && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) return FALSE;
+ SendMessage(GetParent(hWndDlg), PSM_CHANGED, 0, 0);
break;
case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->code){
+ switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- {
- WCHAR szBuff[MAX_PATH];
-
- GET_DLG_ITEM_TEXT(hWndDlg,IDC_SERVER,szBuff,SIZEOF(szBuff));
- DB_Mra_SetStringW(NULL,"Server",szBuff);
- DB_Mra_SetWord(NULL,"ServerPort",(WORD)GetDlgItemInt(hWndDlg,IDC_SERVERPORT,NULL,FALSE));
- DB_Mra_SetByte(NULL,"AutoAddContactsToServer",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_AUTO_ADD_CONTACTS_TO_SERVER));
- DB_Mra_SetByte(NULL,"AutoAuthRequestOnLogon",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_AUTO_AUTH_REQ_ON_LOGON));
- DB_Mra_SetByte(NULL,"AutoAuthGrandUsersInCList",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_AUTO_AUTH_GRAND_IN_CLIST));
- DB_Mra_SetByte(NULL,"AutoAuthGrandNewUsers",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_AUTO_AUTH_GRAND_NEW_USERS));
- DB_Mra_SetByte(NULL,"AutoAuthGrandNewUsersDisableSPAMCheck",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK));
-
- DB_Mra_SetByte(NULL,"SlowSend",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_SLOWSEND));
- DB_Mra_SetByte(NULL,"IncrementalNewMailNotify",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_INCREMENTAL_NEW_MAIL_NOTIFY));
- DB_Mra_SetByte(NULL,"TrayIconNewMailNotify",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_TRAYICON_NEW_MAIL_NOTIFY));
- DB_Mra_SetByte(NULL,"TrayIconNewMailClkToInbox",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX));
-
- DB_Mra_SetByte(NULL,"HideMenuItemsForNonMRAContacts",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_HIDE_MENU_ITEMS_FOR_NON_MRA));
-
- DB_Mra_SetByte(NULL,"RTFReceiveEnable",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_RTF_RECEIVE_ENABLE));
- DB_Mra_SetByte(NULL,"RTFSendEnable",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_RTF_SEND_ENABLE));
- DBWriteContactSettingDword(NULL,PROTOCOL_NAMEA,"RTFBackgroundColour",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_RTF_BGCOLOUR,CPM_GETCOLOUR,0,0));
- }
- return(TRUE);
+ GET_DLG_ITEM_TEXT(hWndDlg, IDC_SERVER, szBuff, SIZEOF(szBuff));
+ ppro->mraSetStringW(NULL, "Server", szBuff);
+ ppro->mraSetWord(NULL, "ServerPort", (WORD)GetDlgItemInt(hWndDlg, IDC_SERVERPORT, NULL, FALSE));
+ ppro->mraSetByte(NULL, "AutoAddContactsToServer", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_ADD_CONTACTS_TO_SERVER));
+ ppro->mraSetByte(NULL, "AutoAuthRequestOnLogon", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_REQ_ON_LOGON));
+ ppro->mraSetByte(NULL, "AutoAuthGrandUsersInCList", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_GRAND_IN_CLIST));
+ ppro->mraSetByte(NULL, "AutoAuthGrandNewUsers", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS));
+ ppro->mraSetByte(NULL, "AutoAuthGrandNewUsersDisableSPAMCheck", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK));
+
+ ppro->mraSetByte(NULL, "SlowSend", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_SLOWSEND));
+ ppro->mraSetByte(NULL, "IncrementalNewMailNotify", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_INCREMENTAL_NEW_MAIL_NOTIFY));
+ ppro->mraSetByte(NULL, "TrayIconNewMailNotify", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY));
+ ppro->mraSetByte(NULL, "TrayIconNewMailClkToInbox", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX));
+
+ ppro->mraSetByte(NULL, "HideMenuItemsForNonMRAContacts", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_HIDE_MENU_ITEMS_FOR_NON_MRA));
+
+ ppro->mraSetByte(NULL, "RTFReceiveEnable", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_RTF_RECEIVE_ENABLE));
+ ppro->mraSetByte(NULL, "RTFSendEnable", IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_RTF_SEND_ENABLE));
+ ppro->mraSetDword(NULL, "RTFBackgroundColour", SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_RTF_BGCOLOUR, CPM_GETCOLOUR, 0, 0));
+ return TRUE;
}
break;
}
-return(FALSE);
+ return FALSE;
}
+int CMraProto::OnOptionsInit(WPARAM wParam, LPARAM lParam)
+{
+ OPTIONSDIALOGPAGE odp = {0};
+ odp.cbSize = sizeof(odp);
+ odp.dwInitParam = (LPARAM)this;
+ odp.hInstance = masMraSettings.hInstance;
+ odp.pszTitle = m_szModuleName;
+ odp.pszGroup = LPGEN("Network");
+ odp.flags = ODPF_BOLDGROUPS;
+
+ odp.pszTab = LPGEN("Account");
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ACCOUNT);
+ odp.pfnDlgProc = DlgProcOptsAccount;
+ Options_AddPage(wParam, &odp);
+
+ odp.pszTab = LPGEN("Connections");
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CONNECTIONS);
+ odp.pfnDlgProc = DlgProcOptsConnections;
+ Options_AddPage(wParam, &odp);
+
+ odp.pszTab = LPGEN("Anti spam");
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ANTISPAM);
+ odp.pfnDlgProc = MraAntiSpamDlgProcOpts;
+ Options_AddPage(wParam, &odp);
+
+ odp.pszTab = LPGEN("Files");
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FILES);
+ odp.pfnDlgProc = MraFilesQueueDlgProcOpts;
+ Options_AddPage(wParam, &odp);
+
+ odp.pszTab = LPGEN("Avatars");
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_AVATRS);
+ odp.pfnDlgProc = MraAvatarsQueueDlgProcOpts;
+ Options_AddPage(wParam, &odp);
+
+ OnPopupOptInit(wParam, lParam);
+ return 0;
+}
diff --git a/protocols/MRA/Mra_proto.cpp b/protocols/MRA/Mra_proto.cpp
index 04e6023dd8..91ac4f9d0e 100644
--- a/protocols/MRA/Mra_proto.cpp
+++ b/protocols/MRA/Mra_proto.cpp
@@ -3,1290 +3,1136 @@
#include "MraRTFMsg.h"
#include "MraPlaces.h"
+DWORD GetUL(LPBYTE *plpData);
+DWORDLONG GetUIDL(LPBYTE *plpData);
+MRA_GUID GetGUID(LPBYTE *plpData);
+DWORD GetLPS(LPBYTE lpbData, DWORD dwDataSize, LPBYTE *plpCurrentData, MRA_LPS *plpsString);
-
-
-
-
-void MraThreadProc (LPVOID lpParameter);
-DWORD MraGetNLBData (LPSTR lpszHost,SIZE_T dwHostBuffSize,WORD *pwPort);
-DWORD MraNetworkDispather ();
-DWORD MraCommandDispather (mrim_packet_header_t *pmaHeader,DWORD *pdwPingPeriod,DWORD *pdwNextPingSendTickTime,BOOL *pbContinue);
-
-
-
-
-//DWORD GetMraStatusFromMiradaStatus (DWORD dwMirandaStatus,DWORD dwXStatusMir,DWORD *pdwXStatusMra);
-//DWORD GetMiradaStatusFromMraStatus (DWORD dwMraStatus,DWORD dwXStatusMra,DWORD *pdwXStatusMir);
-//DWORD GetMraXStatusIDFromMraUriStatus (LPSTR lpszStatusUri,SIZE_T dwStatusUriSize);
-
-DWORD GetUL (LPBYTE *plpData);
-DWORDLONG GetUIDL (LPBYTE *plpData);
-MRA_GUID GetGUID (LPBYTE *plpData);
-DWORD GetLPS (LPBYTE lpbData,DWORD dwDataSize,LPBYTE *plpCurrentData,MRA_LPS *plpsString);
-
-
-
-
-
-
-DWORD StartConnect()
+DWORD CMraProto::StartConnect()
{
- DWORD dwRetErrorCode=NO_ERROR;
-
- if (InterlockedExchangeAdd((volatile LONG*)&masMraSettings.dwGlobalPluginRunning,0))
- {
- if (InterlockedCompareExchange((volatile LONG*)&masMraSettings.dwThreadWorkerRunning,TRUE,FALSE)==FALSE)
- {// поток ещё/уже не работал, поставили статус что работает и запускаем
- char szPass[MAX_PATH];
- SIZE_T dwEMailSize=0,dwPasswordSize=0;
-
- DB_Mra_GetStaticStringA(NULL,"e-mail",NULL,0,&dwEMailSize);
-
- if (dwEMailSize>5 && GetPassDB(szPass,sizeof(szPass),&dwPasswordSize))
- {// mir_forkthread
- InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerLastPingTime,GetTickCount());
- masMraSettings.hThreadWorker=mir_forkthread(MraThreadProc,NULL);
- if (masMraSettings.hThreadWorker==NULL)
- {
- dwRetErrorCode=GetLastError();
- InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerRunning,FALSE);
- MraSetStatus(ID_STATUS_OFFLINE,0);
- }
- }else{
- MraThreadClean();
- if (!(dwEMailSize>5))
- {
- MraPopupShowFromAgentW(MRA_POPUP_TYPE_WARNING,0,TranslateW(L"Please, setup e-mail in options"));
- }else{
- MraPopupShowFromAgentW(MRA_POPUP_TYPE_WARNING,0,TranslateW(L"Please, setup password in options"));
- }
+ if ( !InterlockedExchangeAdd((volatile LONG*)&masMraSettings.dwGlobalPluginRunning, 0))
+ return ERROR_OPERATION_ABORTED;
+
+ // поток ещё/уже не работал, поставили статус что работает и запускаем
+ if (InterlockedCompareExchange((volatile LONG*)&dwThreadWorkerRunning, TRUE, FALSE) == FALSE) {
+ char szPass[MAX_PATH];
+ size_t dwEMailSize = 0, dwPasswordSize = 0;
+
+ mraGetStaticStringA(NULL, "e-mail", NULL, 0, &dwEMailSize);
+
+ if (dwEMailSize > 5 && GetPassDB(szPass, sizeof(szPass), &dwPasswordSize)) {
+ InterlockedExchange((volatile LONG*)&dwThreadWorkerLastPingTime, GetTickCount());
+ hThreadWorker = ForkThreadEx(&CMraProto::MraThreadProc, NULL);
+ if (hThreadWorker == NULL) {
+ DWORD dwRetErrorCode = GetLastError();
+ InterlockedExchange((volatile LONG*)&dwThreadWorkerRunning, FALSE);
+ SetStatus(ID_STATUS_OFFLINE);
+ return dwRetErrorCode;
}
- SecureZeroMemory(szPass,sizeof(szPass));
- }else{
- DebugBreak();
}
- }else{
- dwRetErrorCode=ERROR_OPERATION_ABORTED;
- //DebugBreak();
+ else {
+ MraThreadClean();
+ if (dwEMailSize <= 5)
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_WARNING, 0, TranslateW(L"Please, setup e-mail in options"));
+ else
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_WARNING, 0, TranslateW(L"Please, setup password in options"));
+ }
+ SecureZeroMemory(szPass, sizeof(szPass));
}
-return(dwRetErrorCode);
-}
+ return 0;
+}
-void MraThreadProc(LPVOID lpParameter)
+void CMraProto::MraThreadProc(LPVOID lpParameter)
{
- DWORD dwRetErrorCode=NO_ERROR;
+ DWORD dwRetErrorCode = NO_ERROR;
- if (TRUE)
- {
- BOOL bConnected=FALSE;
- char szHost[MAX_PATH];
- DWORD dwConnectReTryCount,dwCurConnectReTryCount;
- NETLIBOPENCONNECTION nloc={0};
+ BOOL bConnected = FALSE;
+ char szHost[MAX_PATH];
+ DWORD dwConnectReTryCount, dwCurConnectReTryCount;
+ NETLIBOPENCONNECTION nloc = {0};
- SleepEx(100,FALSE);// to prevent high CPU load by some status plugins like allwaysonline
+ SleepEx(100, FALSE);// to prevent high CPU load by some status plugins like allwaysonline
- dwConnectReTryCount=DB_Mra_GetDword(NULL,"ConnectReTryCountMRIM",MRA_DEFAULT_CONN_RETRY_COUNT_MRIM);
+ dwConnectReTryCount = mraGetDword(NULL, "ConnectReTryCountMRIM", MRA_DEFAULT_CONN_RETRY_COUNT_MRIM);
- nloc.cbSize=sizeof(nloc);
- nloc.flags=NLOCF_V2;
- nloc.szHost=szHost;
- nloc.timeout=DB_Mra_GetDword(NULL,"TimeOutConnectMRIM",MRA_DEFAULT_TIMEOUT_CONN_MRIM);
- if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout=MRA_TIMEOUT_CONN_MIN;
- if (nloc.timeout>MRA_TIMEOUT_CONN_МАХ) nloc.timeout=MRA_TIMEOUT_CONN_МАХ;
-
- InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerLastPingTime,GetTickCount());
- if (MraGetNLBData((LPSTR)nloc.szHost,MAX_PATH,&nloc.wPort)==NO_ERROR)
- {
- dwCurConnectReTryCount=dwConnectReTryCount;
- do{
- InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerLastPingTime,GetTickCount());
- masMraSettings.hConnection=(HANDLE)CallService(MS_NETLIB_OPENCONNECTION,(WPARAM)masMraSettings.hNetlibUser,(LPARAM)&nloc);
- }while(--dwCurConnectReTryCount && masMraSettings.hConnection==NULL);
-
- if (masMraSettings.hConnection)
- {
- bConnected=TRUE;
- }
+ nloc.cbSize = sizeof(nloc);
+ nloc.flags = NLOCF_V2;
+ nloc.szHost = szHost;
+ nloc.timeout = mraGetDword(NULL, "TimeOutConnectMRIM", MRA_DEFAULT_TIMEOUT_CONN_MRIM);
+ if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout = MRA_TIMEOUT_CONN_MIN;
+ if (nloc.timeout>MRA_TIMEOUT_CONN_МАХ) nloc.timeout = MRA_TIMEOUT_CONN_МАХ;
+
+ InterlockedExchange((volatile LONG*)&dwThreadWorkerLastPingTime, GetTickCount());
+ if (MraGetNLBData((LPSTR)nloc.szHost, MAX_PATH, &nloc.wPort) == NO_ERROR) {
+ dwCurConnectReTryCount = dwConnectReTryCount;
+ do {
+ InterlockedExchange((volatile LONG*)&dwThreadWorkerLastPingTime, GetTickCount());
+ hConnection = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)hNetlibUser, (LPARAM)&nloc);
}
+ while(--dwCurConnectReTryCount && hConnection == NULL);
- if (bConnected==FALSE)
- if (DB_Mra_GetByte(NULL,"NLBFailDirectConnect",MRA_DEFAULT_NLB_FAIL_DIRECT_CONNECT))
- {
- if (IsHTTPSProxyUsed(masMraSettings.hNetlibUser))
- {// через https прокси только 443 порт
- nloc.wPort=MRA_SERVER_PORT_HTTPS;
- }else{
- nloc.wPort=DB_Mra_GetWord(NULL,"ServerPort",MRA_DEFAULT_SERVER_PORT);
- if (nloc.wPort==MRA_SERVER_PORT_STANDART_NLB) nloc.wPort=MRA_SERVER_PORT_STANDART;
- }
+ if (hConnection)
+ bConnected = TRUE;
+ }
- for(DWORD i=1;(i<MRA_MAX_MRIM_SERVER && MraGetStatus(0,0)!=ID_STATUS_OFFLINE);i++)
- {
- mir_snprintf(szHost,SIZEOF(szHost),"mrim%lu.mail.ru",i);
+ if (bConnected == FALSE)
+ if (mraGetByte(NULL, "NLBFailDirectConnect", MRA_DEFAULT_NLB_FAIL_DIRECT_CONNECT)) {
+ if (IsHTTPSProxyUsed(hNetlibUser))
+ nloc.wPort = MRA_SERVER_PORT_HTTPS;
+ else {
+ nloc.wPort = mraGetWord(NULL, "ServerPort", MRA_DEFAULT_SERVER_PORT);
+ if (nloc.wPort == MRA_SERVER_PORT_STANDART_NLB) nloc.wPort = MRA_SERVER_PORT_STANDART;
+ }
+
+ for (DWORD i = 1;(i<MRA_MAX_MRIM_SERVER && m_iStatus != ID_STATUS_OFFLINE); i++) {
+ mir_snprintf(szHost, SIZEOF(szHost), "mrim%lu.mail.ru", i);
- dwCurConnectReTryCount=dwConnectReTryCount;
- do{
- InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerLastPingTime,GetTickCount());
- masMraSettings.hConnection=(HANDLE)CallService(MS_NETLIB_OPENCONNECTION,(WPARAM)masMraSettings.hNetlibUser,(LPARAM)&nloc);
- }while(--dwCurConnectReTryCount && masMraSettings.hConnection==NULL);
+ dwCurConnectReTryCount = dwConnectReTryCount;
+ do {
+ InterlockedExchange((volatile LONG*)&dwThreadWorkerLastPingTime, GetTickCount());
+ hConnection = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)hNetlibUser, (LPARAM)&nloc);
+ }
+ while(--dwCurConnectReTryCount && hConnection == NULL);
- if (masMraSettings.hConnection)
- {
- bConnected=TRUE;
- break;
- }
+ if (hConnection) {
+ bConnected = TRUE;
+ break;
}
}
+ }
-
- if (bConnected && MraGetStatus(0,0)!=ID_STATUS_OFFLINE)
- {
- /*SOCKET sktSocket;
- struct sockaddr_in saName;
- int iNamelen=sizeof(struct sockaddr_in);
-
- sktSocket=(SOCKET)CallService(MS_NETLIB_GETSOCKET,(WPARAM)masMraSettings.hConnection,(LPARAM)NULL);
- getsockname(sktSocket,(struct sockaddr*)&saName,&iNamelen);
- memmove(&masMraSettings.dwIP,&saName.sin_addr,4);
- masMraSettings.dwPort=ntohs(saName.sin_port);*/
-
- dwRetErrorCode=MraNetworkDispather();
- }else{
- if (bConnected==FALSE)
- {
- ShowFormatedErrorMessage(L"Can't connect to MRIM server, error",GetLastError());
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,NULL,ACKTYPE_LOGIN,ACKRESULT_FAILED,NULL,LOGINERR_NONETWORK,0);
- }
+ if (bConnected && m_iStatus != ID_STATUS_OFFLINE)
+ MraNetworkDispatcher();
+ else {
+ if (bConnected == FALSE) {
+ ShowFormattedErrorMessage(L"Can't connect to MRIM server, error", GetLastError());
+ ProtoBroadcastAckAsynchEx(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NONETWORK, 0);
}
}
+
MraThreadClean();
}
-
-void MraThreadClean()
+void CMraProto::MraThreadClean()
{
- MraMPopSessionQueueFlush(masMraSettings.hMPopSessionQueue);
- Netlib_CloseHandle(masMraSettings.hConnection);// called twice, if user set offline, its normal
- masMraSettings.hConnection=NULL;
- masMraSettings.dwCMDNum=0;
+ MraMPopSessionQueueFlush(hMPopSessionQueue);
+ Netlib_CloseHandle(hConnection);// called twice, if user set offline, its normal
+ hConnection = NULL;
+ dwCMDNum = 0;
- SleepEx(100,FALSE);// to prevent high CPU load by some status plugins like allwaysonline
+ SleepEx(100, FALSE);// to prevent high CPU load by some status plugins like allwaysonline
- masMraSettings.hThreadWorker=NULL;
- InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerRunning,FALSE);
- MraSetStatus(ID_STATUS_OFFLINE,0);
+ hThreadWorker = NULL;
+ InterlockedExchange((volatile LONG*)&dwThreadWorkerRunning, FALSE);
+ SetStatus(ID_STATUS_OFFLINE);
}
-
-
-DWORD MraGetNLBData(LPSTR lpszHost,SIZE_T dwHostBuffSize,WORD *pwPort)
+DWORD CMraProto::MraGetNLBData(LPSTR lpszHost, size_t dwHostBuffSize, WORD *pwPort)
{
DWORD dwRetErrorCode;
- BOOL bContinue=TRUE;
+ BOOL bContinue = TRUE;
BYTE btBuff[MAX_PATH];
- DWORD dwConnectReTryCount,dwCurConnectReTryCount;
+ DWORD dwConnectReTryCount, dwCurConnectReTryCount;
LPSTR lpszPort;
- SIZE_T dwBytesReceived,dwRcvBuffSizeUsed=0;
- NETLIBSELECT nls={0};
- NETLIBOPENCONNECTION nloc={0};
-
+ size_t dwBytesReceived, dwRcvBuffSizeUsed = 0;
+ NETLIBSELECT nls = {0};
+ NETLIBOPENCONNECTION nloc = {0};
- dwConnectReTryCount=DB_Mra_GetDword(NULL,"ConnectReTryCountNLB",MRA_DEFAULT_CONN_RETRY_COUNT_NLB);
+ dwConnectReTryCount = mraGetDword(NULL, "ConnectReTryCountNLB", MRA_DEFAULT_CONN_RETRY_COUNT_NLB);
- nloc.cbSize=sizeof(nloc);
- nloc.flags=NLOCF_V2;
- if (DB_Mra_GetStaticStringA(NULL,"Server",(LPSTR)btBuff,SIZEOF(btBuff),NULL))
- {
- nloc.szHost=(LPSTR)btBuff;
- }else{
- nloc.szHost=MRA_DEFAULT_SERVER;
- }
-
- if (IsHTTPSProxyUsed(masMraSettings.hNetlibUser))
- {// через https прокси только 443 порт
- nloc.wPort=MRA_SERVER_PORT_HTTPS;
- }else{
- nloc.wPort=DB_Mra_GetWord(NULL,"ServerPort",MRA_DEFAULT_SERVER_PORT);
+ nloc.cbSize = sizeof(nloc);
+ nloc.flags = NLOCF_V2;
+ if (mraGetStaticStringA(NULL, "Server", (LPSTR)btBuff, SIZEOF(btBuff), NULL))
+ nloc.szHost = (LPSTR)btBuff;
+ else
+ nloc.szHost = MRA_DEFAULT_SERVER;
+
+ if ( IsHTTPSProxyUsed(hNetlibUser))
+ nloc.wPort = MRA_SERVER_PORT_HTTPS;
+ else
+ nloc.wPort = mraGetWord(NULL, "ServerPort", MRA_DEFAULT_SERVER_PORT);
+
+ nloc.timeout = mraGetDword(NULL, "TimeOutConnectNLB", MRA_DEFAULT_TIMEOUT_CONN_NLB);
+ if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout = MRA_TIMEOUT_CONN_MIN;
+ if (nloc.timeout>MRA_TIMEOUT_CONN_МАХ) nloc.timeout = MRA_TIMEOUT_CONN_МАХ;
+
+ dwCurConnectReTryCount = dwConnectReTryCount;
+ do {
+ InterlockedExchange((volatile LONG*)&dwThreadWorkerLastPingTime, GetTickCount());
+ nls.hReadConns[0] = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)hNetlibUser, (LPARAM)&nloc);
}
- nloc.timeout=DB_Mra_GetDword(NULL,"TimeOutConnectNLB",MRA_DEFAULT_TIMEOUT_CONN_NLB);
- if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout=MRA_TIMEOUT_CONN_MIN;
- if (nloc.timeout>MRA_TIMEOUT_CONN_МАХ) nloc.timeout=MRA_TIMEOUT_CONN_МАХ;
+ while(--dwCurConnectReTryCount && nls.hReadConns[0] == NULL);
+ if (nls.hReadConns[0]) {
+ nls.cbSize = sizeof(nls);
+ nls.dwTimeout = 1000 * mraGetDword(NULL, "TimeOutReceiveNLB", MRA_DEFAULT_TIMEOUT_RECV_NLB);
+ InterlockedExchange((volatile LONG*)&dwThreadWorkerLastPingTime, GetTickCount());
- dwCurConnectReTryCount=dwConnectReTryCount;
- do{
- InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerLastPingTime,GetTickCount());
- nls.hReadConns[0]=(HANDLE)CallService(MS_NETLIB_OPENCONNECTION,(WPARAM)masMraSettings.hNetlibUser,(LPARAM)&nloc);
- }while(--dwCurConnectReTryCount && nls.hReadConns[0]==NULL);
-
- if (nls.hReadConns[0])
- {
- nls.cbSize=sizeof(nls);
- nls.dwTimeout=(1000*DB_Mra_GetDword(NULL,"TimeOutReceiveNLB",MRA_DEFAULT_TIMEOUT_RECV_NLB));
- InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerLastPingTime,GetTickCount());
-
- while(MraGetStatus(0,0)!=ID_STATUS_OFFLINE && bContinue)
- {
- switch(CallService(MS_NETLIB_SELECT,0,(LPARAM)&nls)) {
+ while (m_iStatus != ID_STATUS_OFFLINE && bContinue) {
+ switch (CallService(MS_NETLIB_SELECT, 0, (LPARAM)&nls)) {
case SOCKET_ERROR:
case 0:// Time out
- bContinue=FALSE;
+ bContinue = FALSE;
break;
case 1:
- dwBytesReceived=Netlib_Recv(nls.hReadConns[0],(LPSTR)(btBuff+dwRcvBuffSizeUsed),(SIZEOF(btBuff)-dwRcvBuffSizeUsed),0);
- if (dwBytesReceived && dwBytesReceived!=SOCKET_ERROR)
- {
- dwRcvBuffSizeUsed+=dwBytesReceived;
- }else{
- bContinue=FALSE;
- }
+ dwBytesReceived = Netlib_Recv(nls.hReadConns[0], (LPSTR)(btBuff+dwRcvBuffSizeUsed), (SIZEOF(btBuff)-dwRcvBuffSizeUsed), 0);
+ if (dwBytesReceived && dwBytesReceived != SOCKET_ERROR)
+ dwRcvBuffSizeUsed += dwBytesReceived;
+ else
+ bContinue = FALSE;
break;
}
- InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerLastPingTime,GetTickCount());
+ InterlockedExchange((volatile LONG*)&dwThreadWorkerLastPingTime, GetTickCount());
}
Netlib_CloseHandle(nls.hReadConns[0]);
- if (dwRcvBuffSizeUsed)
- {// received, work with data
- lpszPort=(LPSTR)MemoryFindByte(0,btBuff,dwRcvBuffSizeUsed,':');
- if (lpszPort)
- {
- (*lpszPort)=0;
+ if (dwRcvBuffSizeUsed) {
+ lpszPort = (LPSTR)MemoryFindByte(0, btBuff, dwRcvBuffSizeUsed, ':');
+ if (lpszPort) {
+ (*lpszPort) = 0;
lpszPort++;
- lstrcpynA(lpszHost,(LPSTR)btBuff,dwHostBuffSize);
- if (pwPort) (*pwPort)=(WORD)StrToUNum32(lpszPort,(dwRcvBuffSizeUsed-(lpszPort-(LPSTR)btBuff)));
- dwRetErrorCode=NO_ERROR;
- }else{
- dwRetErrorCode=ERROR_INVALID_USER_BUFFER;
- ShowFormatedErrorMessage(L"NLB data corrupted",NO_ERROR);
+ lstrcpynA(lpszHost, (LPSTR)btBuff, dwHostBuffSize);
+ if (pwPort) (*pwPort) = (WORD)StrToUNum32(lpszPort, (dwRcvBuffSizeUsed-(lpszPort-(LPSTR)btBuff)));
+ dwRetErrorCode = NO_ERROR;
+ }
+ else {
+ dwRetErrorCode = ERROR_INVALID_USER_BUFFER;
+ ShowFormattedErrorMessage(L"NLB data corrupted", NO_ERROR);
}
- }else{
- dwRetErrorCode=GetLastError();
- ShowFormatedErrorMessage(L"Can't get data for NLB, error",dwRetErrorCode);
}
- }else{
- dwRetErrorCode=GetLastError();
- ShowFormatedErrorMessage(L"Can't connect to NLB server, error",dwRetErrorCode);
+ else {
+ dwRetErrorCode = GetLastError();
+ ShowFormattedErrorMessage(L"Can't get data for NLB, error", dwRetErrorCode);
+ }
+ }
+ else {
+ dwRetErrorCode = GetLastError();
+ ShowFormattedErrorMessage(L"Can't connect to NLB server, error", dwRetErrorCode);
}
-return(dwRetErrorCode);
-}
+ return dwRetErrorCode;
+}
-DWORD MraNetworkDispather()
+DWORD CMraProto::MraNetworkDispatcher()
{
- DWORD dwRetErrorCode=NO_ERROR;
+ DWORD dwRetErrorCode = NO_ERROR;
- BOOL bContinue=TRUE;
- DWORD dwSelectRet,dwBytesReceived,dwDataCurrentBuffSize,dwDataCurrentBuffSizeUsed,dwPingPeriod=MAXDWORD,dwNextPingSendTickTime=MAXDWORD;
- SIZE_T dwRcvBuffSize=BUFF_SIZE_RCV,dwRcvBuffSizeUsed=0,dwDataCurrentBuffOffset=0;
+ BOOL bContinue = TRUE;
+ DWORD dwSelectRet, dwBytesReceived, dwDataCurrentBuffSize, dwDataCurrentBuffSizeUsed, dwPingPeriod = MAXDWORD, dwNextPingSendTickTime = MAXDWORD;
+ size_t dwRcvBuffSize = BUFF_SIZE_RCV, dwRcvBuffSizeUsed = 0, dwDataCurrentBuffOffset = 0;
LPBYTE lpbBufferRcv;
- NETLIBSELECT nls={0};
mrim_packet_header_t *pmaHeader;
- nls.cbSize=sizeof(nls);
- nls.dwTimeout=NETLIB_SELECT_TIMEOUT;
- nls.hReadConns[0]=masMraSettings.hConnection;
+ NETLIBSELECT nls = {0};
+ nls.cbSize = sizeof(nls);
+ nls.dwTimeout = NETLIB_SELECT_TIMEOUT;
+ nls.hReadConns[0] = hConnection;
- lpbBufferRcv=(LPBYTE)MEMALLOC(dwRcvBuffSize);
+ lpbBufferRcv = (LPBYTE)mir_calloc(dwRcvBuffSize);
- masMraSettings.dwCMDNum=0;
- MraSendCMD(MRIM_CS_HELLO,NULL,0);
- InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerLastPingTime,GetTickCount());
- while(MraGetStatus(0,0)!=ID_STATUS_OFFLINE && bContinue)
+ dwCMDNum = 0;
+ MraSendCMD(MRIM_CS_HELLO, NULL, 0);
+ InterlockedExchange((volatile LONG*)&dwThreadWorkerLastPingTime, GetTickCount());
+ while(m_iStatus != ID_STATUS_OFFLINE && bContinue)
{
- dwSelectRet=CallService(MS_NETLIB_SELECT,0,(LPARAM)&nls);
- switch(dwSelectRet){
+ dwSelectRet = CallService(MS_NETLIB_SELECT, 0, (LPARAM)&nls);
+ switch (dwSelectRet) {
case SOCKET_ERROR:
- if (MraGetStatus(0,0)!=ID_STATUS_OFFLINE)
- {
- dwRetErrorCode=GetLastError();
- ShowFormatedErrorMessage(L"Disconnected, socket error",dwRetErrorCode);
+ if (m_iStatus != ID_STATUS_OFFLINE) {
+ dwRetErrorCode = GetLastError();
+ ShowFormattedErrorMessage(L"Disconnected, socket error", dwRetErrorCode);
}
- bContinue=FALSE;
+ bContinue = FALSE;
break;
+
case 0:// Time out
case 1:
- dwBytesReceived=GetTickCount();
- InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerLastPingTime,dwBytesReceived);
- if (dwNextPingSendTickTime<=dwBytesReceived)
- {// server ping
- dwNextPingSendTickTime=(dwBytesReceived+(dwPingPeriod*1000));
- MraSendCMD(MRIM_CS_PING,NULL,0);
+ dwBytesReceived = GetTickCount();
+ InterlockedExchange((volatile LONG*)&dwThreadWorkerLastPingTime, dwBytesReceived);
+ // server ping
+ if (dwNextPingSendTickTime <= dwBytesReceived) {
+ dwNextPingSendTickTime = (dwBytesReceived+(dwPingPeriod*1000));
+ MraSendCMD(MRIM_CS_PING, NULL, 0);
}
{
- DWORD dwCMDNum,dwFlags,dwAckType;
+ DWORD dwCMDNum, dwFlags, dwAckType;
HANDLE hContact;
LPBYTE lpbData;
- SIZE_T dwDataSize;
- while (MraSendQueueFindOlderThan(masMraSettings.hSendQueueHandle,SEND_QUEUE_TIMEOUT,&dwCMDNum,&dwFlags,&hContact,&dwAckType,&lpbData,&dwDataSize)==NO_ERROR)
- {
- switch(dwAckType){
+ size_t dwDataSize;
+ while ( !MraSendQueueFindOlderThan(hSendQueueHandle, SEND_QUEUE_TIMEOUT, &dwCMDNum, &dwFlags, &hContact, &dwAckType, &lpbData, &dwDataSize)) {
+ switch (dwAckType) {
case ACKTYPE_ADDED:
case ACKTYPE_AUTHREQ:
case ACKTYPE_CONTACTS:
- //nothink to do
+ //nothing to do
break;
case ACKTYPE_MESSAGE:
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_FAILED,(HANDLE)dwCMDNum,(LPARAM)"Undefined message deliver error, time out",-1);
+ ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)dwCMDNum, (LPARAM)"Undefined message deliver error, time out", -1);
break;
case ACKTYPE_GETINFO:
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_FAILED,(HANDLE)1,(LPARAM)NULL,0);
+ ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)1, (LPARAM)NULL, 0);
break;
case ACKTYPE_SEARCH:
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_SUCCESS,(HANDLE)dwCMDNum,(LPARAM)NULL,0);
+ ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_SUCCESS, (HANDLE)dwCMDNum, (LPARAM)NULL, 0);
break;
case ICQACKTYPE_SMS:
- MEMFREE(lpbData);
+ mir_free(lpbData);
break;
}
- MraSendQueueFree(masMraSettings.hSendQueueHandle,dwCMDNum);
+ MraSendQueueFree(hSendQueueHandle, dwCMDNum);
}
}
- if (dwSelectRet==0) break;// Time out
+ if (dwSelectRet == 0) // Time out
+ break;
- if ((dwRcvBuffSize-dwRcvBuffSizeUsed)<BUFF_SIZE_RCV_MIN_FREE)
- {// динамическое увеличение буффера приёма
- dwRcvBuffSize+=BUFF_SIZE_RCV;
- lpbBufferRcv=(LPBYTE)MEMREALLOC(lpbBufferRcv,dwRcvBuffSize);
+ // expand receive buffer dynamically
+ if ((dwRcvBuffSize - dwRcvBuffSizeUsed) < BUFF_SIZE_RCV_MIN_FREE) {
+ dwRcvBuffSize += BUFF_SIZE_RCV;
+ lpbBufferRcv = (LPBYTE)mir_realloc(lpbBufferRcv, dwRcvBuffSize);
}
- dwBytesReceived=Netlib_Recv(nls.hReadConns[0],(LPSTR)(lpbBufferRcv+dwRcvBuffSizeUsed),(dwRcvBuffSize-dwRcvBuffSizeUsed),0);
- if (dwBytesReceived && dwBytesReceived!=SOCKET_ERROR)
- {// connected
- dwRcvBuffSizeUsed+=dwBytesReceived;
-
- while(TRUE)
- {// разбор принятого
- dwDataCurrentBuffSize=(dwRcvBuffSize-dwDataCurrentBuffOffset);
- dwDataCurrentBuffSizeUsed=(dwRcvBuffSizeUsed-dwDataCurrentBuffOffset);
- pmaHeader=(mrim_packet_header_t*)(lpbBufferRcv+dwDataCurrentBuffOffset);
- if (dwDataCurrentBuffSizeUsed>=sizeof(mrim_packet_header_t))
- {// packet header received
- if (pmaHeader->magic==CS_MAGIC)
- {// packet OK
- if ((dwDataCurrentBuffSizeUsed-sizeof(mrim_packet_header_t))>=pmaHeader->dlen)
- {// full packet received, may be more than one
-
- MraCommandDispather(pmaHeader,&dwPingPeriod,&dwNextPingSendTickTime,&bContinue);
+ dwBytesReceived = Netlib_Recv(nls.hReadConns[0], (LPSTR)(lpbBufferRcv+dwRcvBuffSizeUsed), (dwRcvBuffSize-dwRcvBuffSizeUsed), 0);
+ if (dwBytesReceived && dwBytesReceived != SOCKET_ERROR) {
+ dwRcvBuffSizeUsed += dwBytesReceived;
+
+ while(TRUE) {
+ dwDataCurrentBuffSize = (dwRcvBuffSize-dwDataCurrentBuffOffset);
+ dwDataCurrentBuffSizeUsed = (dwRcvBuffSizeUsed-dwDataCurrentBuffOffset);
+ pmaHeader = (mrim_packet_header_t*)(lpbBufferRcv+dwDataCurrentBuffOffset);
+
+ // packet header received
+ if (dwDataCurrentBuffSizeUsed >= sizeof(mrim_packet_header_t)) {
+ // packet OK
+ if (pmaHeader->magic == CS_MAGIC) {
+ // full packet received, may be more than one
+ if ((dwDataCurrentBuffSizeUsed-sizeof(mrim_packet_header_t)) >= pmaHeader->dlen) {
+
+ MraCommandDispatcher(pmaHeader, &dwPingPeriod, &dwNextPingSendTickTime, &bContinue);
- if ((dwDataCurrentBuffSizeUsed-sizeof(mrim_packet_header_t))>pmaHeader->dlen)
- {// move pointer to next packet in buffer
- dwDataCurrentBuffOffset+=(sizeof(mrim_packet_header_t)+pmaHeader->dlen);
- }else{// move pointer to begin of buffer
- if (dwRcvBuffSize>BUFF_SIZE_RCV)
- {// динамическое уменьшение буффера приёма
- dwRcvBuffSize=BUFF_SIZE_RCV;
- lpbBufferRcv=(LPBYTE)MEMREALLOC(lpbBufferRcv,dwRcvBuffSize);
+ // move pointer to next packet in buffer
+ if (dwDataCurrentBuffSizeUsed - sizeof(mrim_packet_header_t) > pmaHeader->dlen)
+ dwDataCurrentBuffOffset += sizeof(mrim_packet_header_t) + pmaHeader->dlen;
+ // move pointer to begin of buffer
+ else {
+ // динамическое уменьшение буффера приёма
+ if (dwRcvBuffSize > BUFF_SIZE_RCV) {
+ dwRcvBuffSize = BUFF_SIZE_RCV;
+ lpbBufferRcv = (LPBYTE)mir_realloc(lpbBufferRcv, dwRcvBuffSize);
}
- dwDataCurrentBuffOffset=0;
- dwRcvBuffSizeUsed=0;
+ dwDataCurrentBuffOffset = 0;
+ dwRcvBuffSizeUsed = 0;
break;
}
- }else{// not all packet received, continue receiving
- if (dwDataCurrentBuffOffset)
- {
- memmove(lpbBufferRcv,(lpbBufferRcv+dwDataCurrentBuffOffset),dwDataCurrentBuffSizeUsed);
- dwRcvBuffSizeUsed=dwDataCurrentBuffSizeUsed;
- dwDataCurrentBuffOffset=0;
+ }
+ // not all packet received, continue receiving
+ else {
+ if (dwDataCurrentBuffOffset) {
+ memmove(lpbBufferRcv, (lpbBufferRcv+dwDataCurrentBuffOffset), dwDataCurrentBuffSizeUsed);
+ dwRcvBuffSizeUsed = dwDataCurrentBuffSizeUsed;
+ dwDataCurrentBuffOffset = 0;
}
DebugPrintCRLFW(L"Not all packet received, continue receiving");
break;
}
- }else{// bad packet
+ }
+ // bad packet
+ else {
DebugPrintCRLFW(L"Bad packet");
- dwDataCurrentBuffOffset=0;
- dwRcvBuffSizeUsed=0;
+ dwDataCurrentBuffOffset = 0;
+ dwRcvBuffSizeUsed = 0;
break;
}
- }else{// packet to small, continue receiving
+ }
+ // packet to small, continue receiving
+ else {
DebugPrintCRLFW(L"Packet to small, continue receiving");
- memmove(lpbBufferRcv,(lpbBufferRcv+dwDataCurrentBuffOffset),dwDataCurrentBuffSizeUsed);
- dwRcvBuffSizeUsed=dwDataCurrentBuffSizeUsed;
- dwDataCurrentBuffOffset=0;
+ memmove(lpbBufferRcv, (lpbBufferRcv+dwDataCurrentBuffOffset), dwDataCurrentBuffSizeUsed);
+ dwRcvBuffSizeUsed = dwDataCurrentBuffSizeUsed;
+ dwDataCurrentBuffOffset = 0;
break;
}
}
- }else{// disconnected
- if (MraGetStatus(0,0)!=ID_STATUS_OFFLINE)
- {
- dwRetErrorCode=GetLastError();
- ShowFormatedErrorMessage(L"Disconnected, socket read error",dwRetErrorCode);
+ }
+ // disconnected
+ else {
+ if (m_iStatus != ID_STATUS_OFFLINE) {
+ dwRetErrorCode = GetLastError();
+ ShowFormattedErrorMessage(L"Disconnected, socket read error", dwRetErrorCode);
}
- bContinue=FALSE;
+ bContinue = FALSE;
}
break;
}// end switch
}// end while
- MEMFREE(lpbBufferRcv);
+ mir_free(lpbBufferRcv);
-return(dwRetErrorCode);
+ return dwRetErrorCode;
}
-
-DWORD MraCommandDispather(mrim_packet_header_t *pmaHeader,DWORD *pdwPingPeriod,DWORD *pdwNextPingSendTickTime,BOOL *pbContinue)
+DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pdwPingPeriod, DWORD *pdwNextPingSendTickTime, BOOL *pbContinue)
{
- WCHAR szBuff[4096]={0};
- DWORD dwDataSize,dwTemp,dwAckType;
- SIZE_T dwStringSize;
- MRA_LPS lpsString={0},lpsEMail={0};
- HANDLE hContact=NULL;
- LPBYTE lpbData,lpbDataCurrent;
-
- lpbData=((((LPBYTE)pmaHeader))+sizeof(mrim_packet_header_t));
- lpbDataCurrent=lpbData;
- dwDataSize=pmaHeader->dlen;
-
-
- switch(pmaHeader->msg){
+ WCHAR szBuff[4096] = {0};
+ DWORD dwDataSize, dwTemp, dwAckType;
+ size_t dwStringSize;
+ MRA_LPS lpsString = {0}, lpsEMail = {0};
+ HANDLE hContact = NULL;
+ LPBYTE lpbData, lpbDataCurrent;
+
+ lpbData = ((((LPBYTE)pmaHeader))+sizeof(mrim_packet_header_t));
+ lpbDataCurrent = lpbData;
+ dwDataSize = pmaHeader->dlen;
+
+ switch (pmaHeader->msg) {
case MRIM_CS_HELLO_ACK://Подтверждение установки соединения// UL ## ping_period ## Ожидаемая частота подтверждения соединения (в секундах)
- //CredUIPromptForCredentials
- //CYPTPROTECTMEMORY_BLOCK_SIZE=RTL_ENCRYPT_MEMORY_SIZE=8
- //CryptProtectMemory(szBuff,sizeof(szBuff),CRYPTPROTECTMEMORY_SAME_PROCESS);
- if(GetPassDB((LPSTR)szBuff,SIZEOF(szBuff),&dwStringSize))
- {//bit of a security hole here, since it's easy to extract a password from an edit box
- CHAR szEMail[MAX_EMAIL_LEN],szSelfVersionString[MAX_PATH],szUserAgentFormated[USER_AGENT_MAX+MAX_PATH],szValueName[MAX_PATH];
- WCHAR wszStatusTitle[STATUS_TITLE_MAX+4],wszStatusDesc[STATUS_DESC_MAX+4];
- DWORD dwStatus,dwXStatus,dwXStatusMir,dwFutureFlags;
- LPWSTR lpwszStatusTitle,lpwszStatusDesc;
- SIZE_T dwEMailSize,dwSelfVersionSize,dwStatusTitleSize,dwStatusDescSize,dwUserAgentFormatedSize;
-
- dwXStatusMir=MraGetXStatusInternal();
- dwStatus=GetMraStatusFromMiradaStatus(masMraSettings.dwDesiredStatusMode,dwXStatusMir,&dwXStatus);
- if (IsXStatusValid(dwXStatusMir))
- {// xstatuses
- mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldName",dwXStatusMir);
- if (DB_Mra_GetStaticStringW(NULL,szValueName,wszStatusTitle,(STATUS_TITLE_MAX+1),&dwStatusTitleSize))
- {// custom xstatus name
- lpwszStatusTitle=wszStatusTitle;
- }else{// default xstatus name
- lpwszStatusTitle=TranslateW(lpcszXStatusNameDef[dwXStatusMir]);
- dwStatusTitleSize=lstrlenW(lpwszStatusTitle);
+ //bit of a security hole here, since it's easy to extract a password from an edit box
+ if (GetPassDB((LPSTR)szBuff, SIZEOF(szBuff), &dwStringSize)) {
+ CHAR szEMail[MAX_EMAIL_LEN], szSelfVersionString[MAX_PATH], szUserAgentFormated[USER_AGENT_MAX+MAX_PATH], szValueName[MAX_PATH];
+ WCHAR wszStatusTitle[STATUS_TITLE_MAX+4], wszStatusDesc[STATUS_DESC_MAX+4];
+ DWORD dwStatus, dwXStatus, dwXStatusMir, dwFutureFlags;
+ LPWSTR lpwszStatusTitle, lpwszStatusDesc;
+ size_t dwEMailSize, dwSelfVersionSize, dwStatusTitleSize, dwStatusDescSize, dwUserAgentFormatedSize;
+
+ dwXStatusMir = m_iXStatus;
+ dwStatus = GetMraStatusFromMiradaStatus(m_iDesiredStatus, dwXStatusMir, &dwXStatus);
+ if ( IsXStatusValid(dwXStatusMir)) {// xstatuses
+ mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldName", dwXStatusMir);
+ if (mraGetStaticStringW(NULL, szValueName, wszStatusTitle, (STATUS_TITLE_MAX+1), &dwStatusTitleSize))
+ lpwszStatusTitle = wszStatusTitle;
+ else { // default xstatus name
+ lpwszStatusTitle = TranslateW(lpcszXStatusNameDef[dwXStatusMir]);
+ dwStatusTitleSize = lstrlenW(lpwszStatusTitle);
}
- mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldMsg",dwXStatusMir);
- if (DB_Mra_GetStaticStringW(NULL,szValueName,wszStatusDesc,(STATUS_DESC_MAX+1),&dwStatusDescSize))
- {// custom xstatus description
- lpwszStatusDesc=wszStatusDesc;
- }else{// default xstatus description
- lpwszStatusDesc=NULL;
- dwStatusDescSize=0;
+ mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldMsg", dwXStatusMir);
+ if (mraGetStaticStringW(NULL, szValueName, wszStatusDesc, (STATUS_DESC_MAX+1), &dwStatusDescSize))
+ lpwszStatusDesc = wszStatusDesc;
+ else { // default xstatus description
+ lpwszStatusDesc = NULL;
+ dwStatusDescSize = 0;
}
- }else{// not xstatuses
- lpwszStatusTitle=GetStatusModeDescriptionW(masMraSettings.dwDesiredStatusMode);
- dwStatusTitleSize=lstrlenW(lpwszStatusTitle);
- lpwszStatusDesc=NULL;
- dwStatusDescSize=0;
+ }
+ else { // not xstatuses
+ lpwszStatusTitle = GetStatusModeDescriptionW(m_iDesiredStatus);
+ dwStatusTitleSize = lstrlenW(lpwszStatusTitle);
+ lpwszStatusDesc = NULL;
+ dwStatusDescSize = 0;
}
- MraGetSelfVersionString(szSelfVersionString,SIZEOF(szSelfVersionString),&dwSelfVersionSize);
- if (DB_Mra_GetStaticStringA(NULL,"MirVerCustom",szUserAgentFormated,SIZEOF(szUserAgentFormated),&dwUserAgentFormatedSize)==FALSE)
- {
- dwUserAgentFormatedSize=mir_snprintf(szUserAgentFormated,SIZEOF(szUserAgentFormated),"client=\"magent\" name=\"Miranda IM\" title=\"%s\" version=\"777.%lu.%lu.%lu\" build=\"%lu\" protocol=\"%lu.%lu\"",szSelfVersionString,(((PLUGIN_VERSION_DWORD)>>24)&0xFF),(((PLUGIN_VERSION_DWORD)>>16)&0xFF),(((PLUGIN_VERSION_DWORD)>>8)&0xFF),((PLUGIN_VERSION_DWORD)&0xFF),PROTO_MAJOR(PROTO_VERSION),PROTO_MINOR(PROTO_VERSION));// "client=\"magent\" version=\"9.3\" build=\"777\""
+ MraGetSelfVersionString(szSelfVersionString, SIZEOF(szSelfVersionString), &dwSelfVersionSize);
+ if ( mraGetStaticStringA(NULL, "MirVerCustom", szUserAgentFormated, SIZEOF(szUserAgentFormated), &dwUserAgentFormatedSize) == FALSE) {
+ dwUserAgentFormatedSize = mir_snprintf(szUserAgentFormated, SIZEOF(szUserAgentFormated),
+ "client=\"magent\" name=\"Miranda IM\" title=\"%s\" version=\"777.%lu.%lu.%lu\" build=\"%lu\" protocol=\"%lu.%lu\"",
+ szSelfVersionString, __FILEVERSION_STRING, PROTO_VERSION_MAJOR, PROTO_VERSION_MINOR);
}
- dwFutureFlags=((DB_Mra_GetByte(NULL,"RTFReceiveEnable",MRA_DEFAULT_RTF_RECEIVE_ENABLE)? FEATURE_FLAG_RTF_MESSAGE:0)|MRA_FEATURE_FLAGS);
+ dwFutureFlags = ((mraGetByte(NULL, "RTFReceiveEnable", MRA_DEFAULT_RTF_RECEIVE_ENABLE)? FEATURE_FLAG_RTF_MESSAGE:0)|MRA_FEATURE_FLAGS);
- if (DB_Mra_GetStaticStringA(NULL,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- MraSendCommand_Login2W(szEMail,dwEMailSize,(LPSTR)szBuff,dwStringSize,dwStatus,lpcszStatusUri[dwXStatus],lstrlenA(lpcszStatusUri[dwXStatus]),lpwszStatusTitle,dwStatusTitleSize,lpwszStatusDesc,dwStatusDescSize,dwFutureFlags,szUserAgentFormated,dwUserAgentFormatedSize,szSelfVersionString,dwSelfVersionSize);
- }else{// no login
- (*pbContinue)=FALSE;
- }
- SecureZeroMemory(szBuff,sizeof(szBuff));
- }else{// no password
- (*pbContinue)=FALSE;
+ if (mraGetStaticStringA(NULL, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize))
+ MraLogin2W(szEMail, dwEMailSize, (LPSTR)szBuff, dwStringSize, dwStatus, lpcszStatusUri[dwXStatus], lstrlenA(lpcszStatusUri[dwXStatus]), lpwszStatusTitle, dwStatusTitleSize, lpwszStatusDesc, dwStatusDescSize, dwFutureFlags, szUserAgentFormated, dwUserAgentFormatedSize, szSelfVersionString, dwSelfVersionSize);
+ else
+ *pbContinue = FALSE;
+
+ SecureZeroMemory(szBuff, sizeof(szBuff));
}
- (*pdwPingPeriod)=GetUL(&lpbDataCurrent);
+ else *pbContinue = FALSE;
+
+ *pdwPingPeriod = GetUL(&lpbDataCurrent);
break;
- case MRIM_CS_LOGIN_ACK://Успешная авторизация
- masMraSettings.bLoggedIn=TRUE;
- (*pdwNextPingSendTickTime)=0;// force send ping
- MraSendCMD(MRIM_CS_PING,NULL,0);
- MraSetStatus(masMraSettings.dwDesiredStatusMode,masMraSettings.dwDesiredStatusMode);
- //(*((LPBYTE)NULL))=1;// force exception
- //while(TRUE) Sleep(1); // force infinite loop
- MraAvatarsQueueGetAvatarSimple(masMraSettings.hAvatarsQueueHandle,GAIF_FORCE,NULL,0);
+
+ case MRIM_CS_LOGIN_ACK: // Successful authorization
+ m_bLoggedIn = TRUE;
+ *pdwNextPingSendTickTime = 0; // force send ping
+ MraSendCMD(MRIM_CS_PING, NULL, 0);
+ SetStatus(m_iDesiredStatus);
+ MraAvatarsQueueGetAvatarSimple(hAvatarsQueueHandle, GAIF_FORCE, NULL, 0);
break;
- case MRIM_CS_LOGIN_REJ://Неверная авторизация //LPS ## reason ## причина отказа
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,NULL,ACKTYPE_LOGIN,ACKRESULT_FAILED,NULL,LOGINERR_WRONGPASSWORD,0);
-
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
- dwStringSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpsString.lpszData,lpsString.dwSize,szBuff,SIZEOF(szBuff));
- szBuff[dwStringSize]=0;
- MraPopupShowW(NULL,MRA_POPUP_TYPE_ERROR,0,TranslateW(L"Logon error: invalid login/password"),szBuff);
- (*pbContinue)=FALSE;
+
+ case MRIM_CS_LOGIN_REJ: // Unsuccessful authorization //LPS ## reason ## причина отказа
+ ProtoBroadcastAckAsynchEx(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD, 0);
+
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+ dwStringSize = MultiByteToWideChar(MRA_CODE_PAGE, 0, lpsString.lpszData, lpsString.dwSize, szBuff, SIZEOF(szBuff));
+ szBuff[dwStringSize] = 0;
+ MraPopupShowW(NULL, MRA_POPUP_TYPE_ERROR, 0, TranslateW(L"Logon error: invalid login/password"), szBuff);
+ *pbContinue = FALSE;
break;
- case MRIM_CS_MESSAGE_ACK:// Доставка сообщения
+
+ case MRIM_CS_MESSAGE_ACK:// Message delivery
{
- DWORD dwMsgID,dwFlags;
- MRA_LPS lpsText,lpsRTFText,lpsMultiChatData;
-
- dwMsgID=GetUL(&lpbDataCurrent);
- dwFlags=GetUL(&lpbDataCurrent);
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsEMail);//LPS ## from ## Адрес отправителя
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsText);//LPS ## message ## текстовая версия сообщения
- //if (dwFlags&MESSAGE_FLAG_RTF)
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsRTFText);//LPS ## rtf-message ## форматированная версия сообщения
- if (dwFlags&MESSAGE_FLAG_MULTICHAT) GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsMultiChatData); // LPS multichat_data
-
- if (MraRecvCommand_Message((DWORD)_time32(NULL),dwFlags,&lpsEMail,&lpsText,&lpsRTFText,&lpsMultiChatData)==NO_ERROR)
- {// подтверждаем получение, только если удалось его обработать
- if ((dwFlags&MESSAGE_FLAG_NORECV)==0)
- {// need send delivery status
- MraSendCommand_MessageRecv(lpsEMail.lpszData,lpsEMail.dwSize,dwMsgID);
- }
- }
+ DWORD dwMsgID, dwFlags;
+ MRA_LPS lpsText, lpsRTFText, lpsMultiChatData;
+
+ dwMsgID = GetUL(&lpbDataCurrent);
+ dwFlags = GetUL(&lpbDataCurrent);
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsEMail);//LPS ## from ## Адрес отправителя
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsText);//LPS ## message ## текстовая версия сообщения
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsRTFText);//LPS ## rtf-message ## форматированная версия сообщения
+ if (dwFlags&MESSAGE_FLAG_MULTICHAT) GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsMultiChatData); // LPS multichat_data
+
+ // подтверждаем получение, только если удалось его обработать
+ if (MraRecvCommand_Message((DWORD)_time32(NULL), dwFlags, &lpsEMail, &lpsText, &lpsRTFText, &lpsMultiChatData) == NO_ERROR)
+ if ((dwFlags&MESSAGE_FLAG_NORECV) == 0)
+ MraMessageRecv(lpsEMail.lpszData, lpsEMail.dwSize, dwMsgID);
}
break;
+
case MRIM_CS_MESSAGE_STATUS:
- if (MraSendQueueFind(masMraSettings.hSendQueueHandle,pmaHeader->seq,NULL,&hContact,&dwAckType,(LPBYTE*)&lpsString.lpszData,&lpsString.dwSize)==NO_ERROR)
- {
- dwTemp=GetUL(&lpbDataCurrent);
- switch(dwTemp){
+ if (MraSendQueueFind(hSendQueueHandle, pmaHeader->seq, NULL, &hContact, &dwAckType, (LPBYTE*)&lpsString.lpszData, &lpsString.dwSize) == NO_ERROR) {
+ dwTemp = GetUL(&lpbDataCurrent);
+ switch (dwTemp) {
case MESSAGE_DELIVERED:// Message delivered directly to user
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_SUCCESS,(HANDLE)pmaHeader->seq,(LPARAM)NULL,0);
+ ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_SUCCESS, (HANDLE)pmaHeader->seq, (LPARAM)NULL, 0);
break;//***deb возможны сбои из-за асинхронности тк там передаётся указатель
case MESSAGE_REJECTED_NOUSER:// Message rejected - no such user
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_FAILED,(HANDLE)pmaHeader->seq,(LPARAM)"Message rejected - no such user",-1);
+ ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)"Message rejected - no such user", -1);
break;
case MESSAGE_REJECTED_INTERR:// Internal server error
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_FAILED,(HANDLE)pmaHeader->seq,(LPARAM)"Internal server error",-1);
+ ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)"Internal server error", -1);
break;
case MESSAGE_REJECTED_LIMIT_EXCEEDED:// Offline messages limit exceeded
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_FAILED,(HANDLE)pmaHeader->seq,(LPARAM)"Offline messages limit exceeded",-1);
+ ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)"Offline messages limit exceeded", -1);
break;
case MESSAGE_REJECTED_TOO_LARGE:// Message is too large
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_FAILED,(HANDLE)pmaHeader->seq,(LPARAM)"Message is too large",-1);
+ ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)"Message is too large", -1);
break;
case MESSAGE_REJECTED_DENY_OFFMSG:// User does not accept offline messages
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_FAILED,(HANDLE)pmaHeader->seq,(LPARAM)"User does not accept offline messages",-1);
+ ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)"User does not accept offline messages", -1);
break;
case MESSAGE_REJECTED_DENY_OFFFLSH:// User does not accept offline flash animation
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_FAILED,(HANDLE)pmaHeader->seq,(LPARAM)"User does not accept offline flash animation",-1);
+ ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)"User does not accept offline flash animation", -1);
break;
default:
- dwTemp=mir_snprintf((LPSTR)szBuff,SIZEOF(szBuff),"Undefined message deliver error, code: %lu",dwTemp);
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_FAILED,(HANDLE)pmaHeader->seq,(LPARAM)szBuff,dwTemp);
+ dwTemp = mir_snprintf((LPSTR)szBuff, SIZEOF(szBuff), "Undefined message deliver error, code: %lu", dwTemp);
+ ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)pmaHeader->seq, (LPARAM)szBuff, dwTemp);
break;
}
- MraSendQueueFree(masMraSettings.hSendQueueHandle,pmaHeader->seq);
- }else{// not found in queue
- if (GetUL(&lpbDataCurrent)!=MESSAGE_DELIVERED) MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG,0,TranslateW(L"MRIM_CS_MESSAGE_STATUS: not found in queue"));
+ MraSendQueueFree(hSendQueueHandle, pmaHeader->seq);
}
+ // not found in queue
+ else if ( GetUL(&lpbDataCurrent) != MESSAGE_DELIVERED)
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, TranslateW(L"MRIM_CS_MESSAGE_STATUS: not found in queue"));
break;
+
case MRIM_CS_CONNECTION_PARAMS:// Изменение параметров соединения
- (*pdwPingPeriod)=GetUL(&lpbDataCurrent);
- (*pdwNextPingSendTickTime)=0;// force send ping
- MraSendCMD(MRIM_CS_PING,NULL,0);
+ *pdwPingPeriod = GetUL(&lpbDataCurrent);
+ *pdwNextPingSendTickTime = 0; // force send ping
+ MraSendCMD(MRIM_CS_PING, NULL, 0);
break;
+
case MRIM_CS_USER_INFO:
- while (lpbDataCurrent<(lpbData+dwDataSize))
- {
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"MESSAGES.TOTAL",14)==CSTR_EQUAL)
- {
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
- masMraSettings.dwEmailMessagesTotal=StrToUNum32(lpsString.lpszData,lpsString.dwSize);
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"MESSAGES.UNREAD",15)==CSTR_EQUAL)
- {
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
- masMraSettings.dwEmailMessagesUnRead=StrToUNum32(lpsString.lpszData,lpsString.dwSize);
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"MRIM.NICKNAME",13)==CSTR_EQUAL)
- {
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
- DB_Mra_SetLPSStringW(NULL,"Nick",&lpsString);
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"client.endpoint",15)==CSTR_EQUAL)
- {
+ while (lpbDataCurrent < lpbData + dwDataSize) {
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+ if ( !_strnicmp(lpsString.lpszData, "MESSAGES.TOTAL", 14)) {
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+ dwEmailMessagesTotal = StrToUNum32(lpsString.lpszData, lpsString.dwSize);
+ }
+ else if ( !_strnicmp(lpsString.lpszData, "MESSAGES.UNREAD", 15)) {
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+ dwEmailMessagesUnread = StrToUNum32(lpsString.lpszData, lpsString.dwSize);
+ }
+ else if ( !_strnicmp(lpsString.lpszData, "MRIM.NICKNAME", 13)) {
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+ mraSetLPSStringW(NULL, "Nick", &lpsString);
+ }
+ else if ( !_strnicmp(lpsString.lpszData, "client.endpoint", 15)) {
LPSTR lpszDelimiter;
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
- dwStringSize=WideCharToMultiByte(MRA_CODE_PAGE,0,lpsString.lpwszData,lpsString.dwSize,(LPSTR)szBuff,sizeof(szBuff),NULL,NULL);
- lpszDelimiter=(LPSTR)MemoryFind(0,szBuff,dwStringSize,":",1);
- if (lpszDelimiter)
- {
- (*lpszDelimiter)=0;
- lpszDelimiter=(LPSTR)szBuff;
- DB_Mra_SetDword(NULL,"IP",HTONL(inet_addr(lpszDelimiter)));
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+ dwStringSize = WideCharToMultiByte(MRA_CODE_PAGE, 0, lpsString.lpwszData, lpsString.dwSize, (LPSTR)szBuff, sizeof(szBuff), NULL, NULL);
+ lpszDelimiter = (LPSTR)MemoryFind(0, szBuff, dwStringSize, ":", 1);
+ if (lpszDelimiter) {
+ (*lpszDelimiter) = 0;
+ lpszDelimiter = (LPSTR)szBuff;
+ mraSetDword(NULL, "IP", HTONL(inet_addr(lpszDelimiter)));
}
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"connect.xml",11)==CSTR_EQUAL)
- {
+ }
+ else if ( !_strnicmp(lpsString.lpszData, "connect.xml", 11)) {
DebugPrintA(lpsString.lpszData);
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
DebugPrintCRLFW(lpsString.lpwszData);
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"micblog.show_title",18)==CSTR_EQUAL)
- {
+ }
+ else if ( !_strnicmp(lpsString.lpszData, "micblog.show_title", 18)) {
DebugPrintA(lpsString.lpszData);
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
DebugPrintCRLFW(lpsString.lpwszData);
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"micblog.status.id",17)==CSTR_EQUAL)
- {
+ }
+ else if ( !_strnicmp(lpsString.lpszData, "micblog.status.id", 17)) {
DWORDLONG dwBlogStatusID;
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
- dwBlogStatusID=StrToUNum64(lpsString.lpszData,lpsString.dwSize);
- DB_Mra_WriteContactSettingBlob(NULL,DBSETTING_BLOGSTATUSID,&dwBlogStatusID,sizeof(DWORDLONG));
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"micblog.status.time",19)==CSTR_EQUAL)
- {
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
- DB_Mra_SetDword(NULL,DBSETTING_BLOGSTATUSTIME,StrToUNum32(lpsString.lpszData,lpsString.dwSize));
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"micblog.status.text",19)==CSTR_EQUAL)
- {
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
- DB_Mra_SetLPSStringW(NULL,DBSETTING_BLOGSTATUS,&lpsString);
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"HAS_MYMAIL",10)==CSTR_EQUAL)
- {// ???
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
- //DB_Mra_SetDword(NULL,DBSETTING_BLOGSTATUSTIME,StrToUNum32(lpsString.lpszData,lpsString.dwSize));
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"mrim.status.open_search",23)==CSTR_EQUAL)
- {// ???
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
- //DB_Mra_SetDword(NULL,DBSETTING_BLOGSTATUSTIME,StrToUNum32(lpsString.lpszData,lpsString.dwSize));
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"rb.target.cookie",16)==CSTR_EQUAL)
- {// ???
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
- //DB_Mra_SetDword(NULL,DBSETTING_BLOGSTATUSTIME,StrToUNum32(lpsString.lpszData,lpsString.dwSize));
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"show_web_history_link",21)==CSTR_EQUAL)
- {// ???
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
- //DB_Mra_SetDword(NULL,DBSETTING_BLOGSTATUSTIME,StrToUNum32(lpsString.lpszData,lpsString.dwSize));
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"friends_suggest",15)==CSTR_EQUAL)
- {// ???
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
- //DB_Mra_SetDword(NULL,DBSETTING_BLOGSTATUSTIME,StrToUNum32(lpsString.lpszData,lpsString.dwSize));
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"timestamp",9)==CSTR_EQUAL)
- {// ???
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
- //DB_Mra_SetDword(NULL,DBSETTING_BLOGSTATUSTIME,StrToUNum32(lpsString.lpszData,lpsString.dwSize));
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"trusted_update",14)==CSTR_EQUAL)
- {// ???
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
- //DB_Mra_SetDword(NULL,DBSETTING_BLOGSTATUSTIME,StrToUNum32(lpsString.lpszData,lpsString.dwSize));
- }else{
- #ifdef _DEBUG
- LPSTR lpszCurrentPos=(LPSTR)szBuff;
- memmove(lpszCurrentPos,lpsString.lpszData,lpsString.dwSize);
- lpszCurrentPos+=lpsString.dwSize;
- (*((WORD*)lpszCurrentPos))=(*((WORD*)": "));
- lpszCurrentPos+=sizeof(WORD);
-
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
- memmove(lpszCurrentPos,lpsString.lpszData,lpsString.dwSize);
- lpszCurrentPos+=lpsString.dwSize;
- (*((WORD*)lpszCurrentPos))=(*((WORD*)szCRLF));
- lpszCurrentPos+=sizeof(WORD);(*((WORD*)lpszCurrentPos))=0;
-
- DebugPrintCRLFA((LPSTR)szBuff);
- //MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG,0,szBuff);
- DebugBreak();
- #endif
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+ dwBlogStatusID = StrToUNum64(lpsString.lpszData, lpsString.dwSize);
+ mraWriteContactSettingBlob(NULL, DBSETTING_BLOGSTATUSID, &dwBlogStatusID, sizeof(DWORDLONG));
+ }
+ else if ( !_strnicmp(lpsString.lpszData, "micblog.status.time", 19)) {
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+ mraSetDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
+ }
+ else if ( !_strnicmp(lpsString.lpszData, "micblog.status.text", 19)) {
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+ mraSetLPSStringW(NULL, DBSETTING_BLOGSTATUS, &lpsString);
+ }
+ else if ( !_strnicmp(lpsString.lpszData, "HAS_MYMAIL", 10)) {
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+ //mraSetDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
+ }
+ else if ( !_strnicmp(lpsString.lpszData, "mrim.status.open_search", 23)) {
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+ //mraSetDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
+ }
+ else if ( !_strnicmp(lpsString.lpszData, "rb.target.cookie", 16)) {
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+ //mraSetDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
+ }
+ else if ( !_strnicmp(lpsString.lpszData, "show_web_history_link", 21)) {
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+ //mraSetDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
+ }
+ else if ( !_strnicmp(lpsString.lpszData, "friends_suggest", 15)) {
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+ //mraSetDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
+ }
+ else if ( !_strnicmp(lpsString.lpszData, "timestamp", 9)) {
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+ //mraSetDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
+ }
+ else if ( !_strnicmp(lpsString.lpszData, "trusted_update", 14)) {
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+ //mraSetDword(NULL, DBSETTING_BLOGSTATUSTIME, StrToUNum32(lpsString.lpszData, lpsString.dwSize));
+ }
+ else {
+ #ifdef _DEBUG
+ LPSTR lpszCurrentPos = (LPSTR)szBuff;
+ memmove(lpszCurrentPos, lpsString.lpszData, lpsString.dwSize);
+ lpszCurrentPos += lpsString.dwSize;
+ *((WORD*)lpszCurrentPos) = *((WORD*)": ");
+ lpszCurrentPos += sizeof(WORD);
+
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+ memmove(lpszCurrentPos, lpsString.lpszData, lpsString.dwSize);
+ lpszCurrentPos += lpsString.dwSize;
+ *((WORD*)lpszCurrentPos) = *((WORD*)szCRLF);
+ lpszCurrentPos += sizeof(WORD);(*((WORD*)lpszCurrentPos)) = 0;
+
+ DebugPrintCRLFA((LPSTR)szBuff);
+ DebugBreak();
+ #endif
}
}
- MraUpdateEmailStatus(NULL,0,NULL,0,0,0);
+ MraUpdateEmailStatus(NULL, 0, NULL, 0, 0, 0);
break;
+
case MRIM_CS_OFFLINE_MESSAGE_ACK://Сообщение доставленное, пока пользователь не был подключен к сети
{
- DWORD dwTime,dwFlags;
- MRA_LPS lpsText,lpsRTFText,lpsMultiChatData;
- LPBYTE lpbBuff=NULL;
- DWORDLONG dwMsgUIDL;
-
- dwMsgUIDL=GetUIDL(&lpbDataCurrent);
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
-
- if (MraOfflineMessageGet(&lpsString,&dwTime,&dwFlags,&lpsEMail,&lpsText,&lpsRTFText,&lpsMultiChatData,&lpbBuff)==NO_ERROR)
- {
- dwTemp=MraRecvCommand_Message(dwTime,dwFlags,&lpsEMail,&lpsText,&lpsRTFText,&lpsMultiChatData);
- if (dwTemp==NO_ERROR || dwTemp==ERROR_ACCESS_DENIED)
- {// подтверждаем получение, только если удалось его обработать
- MraSendCommand_OfflineMessageDel(dwMsgUIDL);
- }else{
- ShowFormatedErrorMessage(L"Offline message processing error, message will not deleted from server",NO_ERROR);
- }
- }else{
- ShowFormatedErrorMessage(L"Offline message processing error, message will not deleted from server",NO_ERROR);
+ DWORD dwTime, dwFlags;
+ MRA_LPS lpsText, lpsRTFText, lpsMultiChatData;
+ LPBYTE lpbBuff = NULL;
+ DWORDLONG dwMsgUIDL = GetUIDL(&lpbDataCurrent);
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+
+ if (MraOfflineMessageGet(&lpsString, &dwTime, &dwFlags, &lpsEMail, &lpsText, &lpsRTFText, &lpsMultiChatData, &lpbBuff) == NO_ERROR) {
+ dwTemp = MraRecvCommand_Message(dwTime, dwFlags, &lpsEMail, &lpsText, &lpsRTFText, &lpsMultiChatData);
+ if (dwTemp == NO_ERROR || dwTemp == ERROR_ACCESS_DENIED)
+ MraOfflineMessageDel(dwMsgUIDL);
+ else
+ ShowFormattedErrorMessage(L"Offline message processing error, message will not deleted from server", NO_ERROR);
}
- MEMFREE(lpbBuff);
+ else ShowFormattedErrorMessage(L"Offline message processing error, message will not deleted from server", NO_ERROR);
+
+ mir_free(lpbBuff);
}
break;
- case MRIM_CS_AUTHORIZE_ACK://Информация об авторизации
- {// нас автоизовали, те разрешили нам получать уведомление об изменении статуса, значит юзер у нас в списке
+
+ case MRIM_CS_AUTHORIZE_ACK: // Auth confirmation
+ {
BOOL bAdded;
BYTE btBuff[BUFF_SIZE_BLOB];
- DBEVENTINFO dbei={0};
+ DBEVENTINFO dbei = {0};
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsEMail);
- hContact=MraHContactFromEmail(lpsEMail.lpszData,lpsEMail.dwSize,TRUE,TRUE,&bAdded);
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsEMail);
+ hContact = MraHContactFromEmail(lpsEMail.lpszData, lpsEMail.dwSize, TRUE, TRUE, &bAdded);
if (bAdded) MraUpdateContactInfo(hContact);
- if (IsEMailChatAgent(lpsEMail.lpszData,lpsEMail.dwSize)==FALSE)
- {
- dbei.cbSize=sizeof(dbei);
- dbei.szModule=PROTOCOL_NAMEA;
- dbei.timestamp=(DWORD)_time32(NULL);
- dbei.flags=0;
- dbei.eventType=EVENTTYPE_ADDED;
- //dbei.cbBlob=0;
- CreateBlobFromContact(hContact,NULL,0,(LPBYTE)&btBuff,SIZEOF(btBuff),&dwStringSize);
- dbei.cbBlob=dwStringSize;
- dbei.pBlob=btBuff;
-
- CallService(MS_DB_EVENT_ADD,(WPARAM)NULL,(LPARAM)&dbei);
+ if (IsEMailChatAgent(lpsEMail.lpszData, lpsEMail.dwSize) == FALSE) {
+ dbei.cbSize = sizeof(dbei);
+ dbei.szModule = m_szModuleName;
+ dbei.timestamp = (DWORD)_time32(NULL);
+ dbei.flags = 0;
+ dbei.eventType = EVENTTYPE_ADDED;
+ //dbei.cbBlob = 0;
+ CreateBlobFromContact(hContact, NULL, 0, (LPBYTE)&btBuff, SIZEOF(btBuff), &dwStringSize);
+ dbei.cbBlob = dwStringSize;
+ dbei.pBlob = btBuff;
+
+ CallService(MS_DB_EVENT_ADD, (WPARAM)NULL, (LPARAM)&dbei);
}
- GetContactBasicInfoW(hContact,NULL,NULL,NULL,&dwTemp,NULL,NULL,0,NULL,NULL,0,NULL,NULL,0,NULL);
- dwTemp&=~CONTACT_INTFLAG_NOT_AUTHORIZED;
- SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,SCBIF_SERVER_FLAG,0,0,0,dwTemp,0,NULL,0,NULL,0,NULL,0);
- DB_Mra_SetDword(hContact,"HooksLocked",TRUE);
- DBDeleteContactSetting(hContact,"CList","NotOnList");
- DB_Mra_SetDword(hContact,"HooksLocked",FALSE);
+ GetContactBasicInfoW(hContact, NULL, NULL, NULL, &dwTemp, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, 0, NULL);
+ dwTemp &= ~CONTACT_INTFLAG_NOT_AUTHORIZED;
+ SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, SCBIF_SERVER_FLAG, 0, 0, 0, dwTemp, 0, NULL, 0, NULL, 0, NULL, 0);
+ mraSetDword(hContact, "HooksLocked", TRUE);
+ DBDeleteContactSetting(hContact, "CList", "NotOnList");
+ mraSetDword(hContact, "HooksLocked", FALSE);
}
break;
- case MRIM_CS_MPOP_SESSION://Ключ для web-авторизации //
- if (GetUL(&lpbDataCurrent))
- {
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
- MraMPopSessionQueueSetNewMPopKey(masMraSettings.hMPopSessionQueue,lpsString.lpszData,lpsString.dwSize);
- MraMPopSessionQueueStart(masMraSettings.hMPopSessionQueue);
- }else{//error
- MraPopupShowFromAgentW(MRA_POPUP_TYPE_WARNING,0,TranslateW(L"Server error: cant get MPOP key for web authorize"));
- MraMPopSessionQueueFlush(masMraSettings.hMPopSessionQueue);
+
+ case MRIM_CS_MPOP_SESSION: // Web auth key
+ if ( GetUL(&lpbDataCurrent)) {
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+ MraMPopSessionQueueSetNewMPopKey(hMPopSessionQueue, lpsString.lpszData, lpsString.dwSize);
+ MraMPopSessionQueueStart(hMPopSessionQueue);
+ }
+ else { //error
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_WARNING, 0, TranslateW(L"Server error: cant get MPOP key for web authorize"));
+ MraMPopSessionQueueFlush(hMPopSessionQueue);
}
break;
-/////////////////////////////////////////////////////////////////////////////////////
+
+ /////////////////////////////////////////////////////////////////////////////////////
case MRIM_CS_FILE_TRANSFER:
{
BOOL bAdded;
- DWORD dwIDRequest,dwFilesTotalSize;
- MRA_LPS lpsFiles={0},lpsFilesW={0},lpsAddreses={0};
-
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsEMail);// LPS TO/FROM ANSI
- dwIDRequest=GetUL(&lpbDataCurrent);// DWORD id_request
- dwFilesTotalSize=GetUL(&lpbDataCurrent);// DWORD FILESIZE
- if (GetUL(&lpbDataCurrent))//LPS:
- {
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsFiles);// LPS Files (FileName;FileSize;FileName;FileSize;) ANSI
- if (GetUL(&lpbDataCurrent))// LPS DESCRIPTION
- {
- dwTemp=GetUL(&lpbDataCurrent);// ???
- DebugBreakIf(dwTemp!=1);
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsFilesW);// LPS Files (FileName;FileSize;FileName;FileSize;) UNICODE
+ DWORD dwIDRequest, dwFilesTotalSize;
+ MRA_LPS lpsFiles = {0}, lpsFilesW = {0}, lpsAddreses = {0};
+
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsEMail);// LPS TO/FROM ANSI
+ dwIDRequest = GetUL(&lpbDataCurrent);// DWORD id_request
+ dwFilesTotalSize = GetUL(&lpbDataCurrent);// DWORD FILESIZE
+ if ( GetUL(&lpbDataCurrent)) {
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsFiles);// LPS Files (FileName;FileSize;FileName;FileSize;) ANSI
+ if ( GetUL(&lpbDataCurrent)) { // LPS DESCRIPTION
+ dwTemp = GetUL(&lpbDataCurrent);
+ DebugBreakIf(dwTemp != 1);
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsFilesW);// LPS Files (FileName;FileSize;FileName;FileSize;) UNICODE
}
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsAddreses);// LPS Conn (IP:Port;IP:Port;) ANSI
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsAddreses);// LPS Conn (IP:Port;IP:Port;) ANSI
}
- hContact=MraHContactFromEmail(lpsEMail.lpszData,lpsEMail.dwSize,TRUE,TRUE,&bAdded);
+ hContact = MraHContactFromEmail(lpsEMail.lpszData, lpsEMail.dwSize, TRUE, TRUE, &bAdded);
if (bAdded) MraUpdateContactInfo(hContact);
- bAdded=FALSE;
- if (lpsFilesW.dwSize==0)
- {
- lpsFilesW.lpwszData=(LPWSTR)MEMALLOC((lpsFiles.dwSize+MAX_PATH)*sizeof(WCHAR));
- if (lpsFilesW.lpwszData)
- {
- lpsFilesW.dwSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpsFiles.lpszData,lpsFiles.dwSize,lpsFilesW.lpwszData,(lpsFiles.dwSize+MAX_PATH));
- bAdded=TRUE;
+ bAdded = FALSE;
+ if (lpsFilesW.dwSize == 0) {
+ lpsFilesW.lpwszData = (LPWSTR)mir_calloc((lpsFiles.dwSize+MAX_PATH)*sizeof(WCHAR));
+ if (lpsFilesW.lpwszData) {
+ lpsFilesW.dwSize = MultiByteToWideChar(MRA_CODE_PAGE, 0, lpsFiles.lpszData, lpsFiles.dwSize, lpsFilesW.lpwszData, (lpsFiles.dwSize+MAX_PATH));
+ bAdded = TRUE;
}
}
- if (lpsFilesW.dwSize) MraFilesQueueAddReceive(masMraSettings.hFilesQueueHandle,0,hContact,dwIDRequest,lpsFilesW.lpwszData,lpsFilesW.dwSize,lpsAddreses.lpszData,lpsAddreses.dwSize);
- if (bAdded) MEMFREE(lpsFilesW.lpwszData);
+ if (lpsFilesW.dwSize)
+ MraFilesQueueAddReceive(hFilesQueueHandle, 0, hContact, dwIDRequest, lpsFilesW.lpwszData, lpsFilesW.dwSize, lpsAddreses.lpszData, lpsAddreses.dwSize);
+ if (bAdded)
+ mir_free(lpsFilesW.lpwszData);
}
break;
+
case MRIM_CS_FILE_TRANSFER_ACK:
- dwAckType=GetUL(&lpbDataCurrent);// DWORD status
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsEMail);// LPS TO/FROM
- dwTemp=GetUL(&lpbDataCurrent);// DWORD id_request
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);// LPS DESCRIPTION
+ dwAckType = GetUL(&lpbDataCurrent);// DWORD status
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsEMail);// LPS TO/FROM
+ dwTemp = GetUL(&lpbDataCurrent);// DWORD id_request
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);// LPS DESCRIPTION
- switch(dwAckType){
+ switch (dwAckType) {
case FILE_TRANSFER_STATUS_OK:// игнорируем, мы и так уже слушаем порт(ждём), то что кто то согласился ничего не меняет
- //hContact=MraHContactFromEmail(lpsEMail.lpszData,lpsEMail.dwSize,TRUE,TRUE,NULL);
+ //hContact = MraHContactFromEmail(lpsEMail.lpszData, lpsEMail.dwSize, TRUE, TRUE, NULL);
break;
case FILE_TRANSFER_STATUS_DECLINE:
- MraFilesQueueCancel(masMraSettings.hFilesQueueHandle,dwTemp,FALSE);
+ MraFilesQueueCancel(hFilesQueueHandle, dwTemp, FALSE);
break;
case FILE_TRANSFER_STATUS_ERROR:
- ShowFormatedErrorMessage(L"File transfer: error",NO_ERROR);
- MraFilesQueueCancel(masMraSettings.hFilesQueueHandle,dwTemp,FALSE);
+ ShowFormattedErrorMessage(L"File transfer: error", NO_ERROR);
+ MraFilesQueueCancel(hFilesQueueHandle, dwTemp, FALSE);
break;
case FILE_TRANSFER_STATUS_INCOMPATIBLE_VERS:
- ShowFormatedErrorMessage(L"File transfer: incompatible versions",NO_ERROR);
- MraFilesQueueCancel(masMraSettings.hFilesQueueHandle,dwTemp,FALSE);
+ ShowFormattedErrorMessage(L"File transfer: incompatible versions", NO_ERROR);
+ MraFilesQueueCancel(hFilesQueueHandle, dwTemp, FALSE);
break;
case FILE_TRANSFER_MIRROR:
- MraFilesQueueSendMirror(masMraSettings.hFilesQueueHandle,dwTemp,lpsString.lpszData,lpsString.dwSize);
+ MraFilesQueueSendMirror(hFilesQueueHandle, dwTemp, lpsString.lpszData, lpsString.dwSize);
break;
default:// ## unknown error
- mir_sntprintf(szBuff,SIZEOF(szBuff),TranslateW(L"MRIM_CS_FILE_TRANSFER_ACK: unknown error, code: %lu"),dwAckType);
- ShowFormatedErrorMessage(szBuff,NO_ERROR);
+ mir_sntprintf(szBuff, SIZEOF(szBuff), TranslateW(L"MRIM_CS_FILE_TRANSFER_ACK: unknown error, code: %lu"), dwAckType);
+ ShowFormattedErrorMessage(szBuff, NO_ERROR);
break;
}
break;
-/////////////////////////////////////////////////////////////////////////////////////
+
+ /////////////////////////////////////////////////////////////////////////////////////
case MRIM_CS_USER_STATUS://Смена статуса другого пользователя
{
BOOL bAdded;
- DWORD dwStatus,dwXStatus,dwFutureFlags;
- MRA_LPS lpsSpecStatusUri,lpsStatusTitle,lpsStatusDesc,lpsUserAgentFormated;
-
- dwStatus=GetUL(&lpbDataCurrent);
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsSpecStatusUri);
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsStatusTitle);
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsStatusDesc);
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsEMail);
- dwFutureFlags=GetUL(&lpbDataCurrent);// com_support (>=1.14)
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsUserAgentFormated);
-
-
- if ((hContact=MraHContactFromEmail(lpsEMail.lpszData,lpsEMail.dwSize,TRUE,TRUE,&bAdded)))
- {
- if (bAdded) MraUpdateContactInfo(hContact);
-
- dwTemp=GetMiradaStatusFromMraStatus(dwStatus,GetMraXStatusIDFromMraUriStatus(lpsSpecStatusUri.lpszData,lpsSpecStatusUri.dwSize),&dwXStatus);
+ DWORD dwStatus, dwXStatus, dwFutureFlags;
+ MRA_LPS lpsSpecStatusUri, lpsStatusTitle, lpsStatusDesc, lpsUserAgentFormated;
+
+ dwStatus = GetUL(&lpbDataCurrent);
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsSpecStatusUri);
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsStatusTitle);
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsStatusDesc);
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsEMail);
+ dwFutureFlags = GetUL(&lpbDataCurrent);// com_support ( >= 1.14)
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsUserAgentFormated);
+
+ if ((hContact = MraHContactFromEmail(lpsEMail.lpszData, lpsEMail.dwSize, TRUE, TRUE, &bAdded))) {
+ if (bAdded)
+ MraUpdateContactInfo(hContact);
+
+ dwTemp = GetMiradaStatusFromMraStatus(dwStatus, GetMraXStatusIDFromMraUriStatus(lpsSpecStatusUri.lpszData, lpsSpecStatusUri.dwSize), &dwXStatus);
- MraContactCapabilitiesSet(hContact,dwFutureFlags);
- DB_Mra_SetByte(hContact,DBSETTING_XSTATUSID,(BYTE)dwXStatus);
- DB_Mra_SetLPSStringW(hContact,DBSETTING_XSTATUSNAME,&lpsStatusTitle);
- DB_Mra_SetLPSStringW(hContact,DBSETTING_XSTATUSMSG,&lpsStatusDesc);
+ MraContactCapabilitiesSet(hContact, dwFutureFlags);
+ mraSetByte(hContact, DBSETTING_XSTATUSID, (BYTE)dwXStatus);
+ mraSetLPSStringW(hContact, DBSETTING_XSTATUSNAME, &lpsStatusTitle);
+ mraSetLPSStringW(hContact, DBSETTING_XSTATUSMSG, &lpsStatusDesc);
- if (dwTemp!=ID_STATUS_OFFLINE)// пишем клиента только если юзер не отключён, иначе не затираем старое
- {
- if (lpsUserAgentFormated.dwSize)
- {// есть чё писать
- if (DB_Mra_GetByte(NULL,"MirVerRaw",MRA_DEFAULT_MIRVER_RAW)==FALSE)
- {// приводим к человеческому виду, если получится...
- MraGetVersionStringFromFormated(lpsUserAgentFormated.lpszData,lpsUserAgentFormated.dwSize,(LPSTR)szBuff,SIZEOF(szBuff),&dwStringSize);
- lpsUserAgentFormated.lpszData=(LPSTR)szBuff;
- lpsUserAgentFormated.dwSize=dwStringSize;
+ if (dwTemp != ID_STATUS_OFFLINE) { // пишем клиента только если юзер не отключён, иначе не затираем старое
+ if (lpsUserAgentFormated.dwSize) {
+ if (mraGetByte(NULL, "MirVerRaw", MRA_DEFAULT_MIRVER_RAW) == FALSE) {
+ MraGetVersionStringFromFormatted(lpsUserAgentFormated.lpszData, lpsUserAgentFormated.dwSize, (LPSTR)szBuff, SIZEOF(szBuff), &dwStringSize);
+ lpsUserAgentFormated.lpszData = (LPSTR)szBuff;
+ lpsUserAgentFormated.dwSize = dwStringSize;
}
- }else{// хз чё за клиент
- lpsUserAgentFormated.lpszData=MIRVER_UNKNOWN;
- lpsUserAgentFormated.dwSize=(sizeof(MIRVER_UNKNOWN)-1);
}
- DB_Mra_SetLPSStringA(hContact,"MirVer",&lpsUserAgentFormated);
+ else { // хз чё за клиент
+ lpsUserAgentFormated.lpszData = MIRVER_UNKNOWN;
+ lpsUserAgentFormated.dwSize = (sizeof(MIRVER_UNKNOWN)-1);
+ }
+ mraSetLPSStringA(hContact, "MirVer", &lpsUserAgentFormated);
}
- if (dwTemp==MraGetContactStatus(hContact))
- {// меняем шило на шило, подозрительно? ;)
- if (dwTemp==ID_STATUS_OFFLINE)
- {// was/now invisible
+ if (dwTemp == MraGetContactStatus(hContact)) {// меняем шило на шило, подозрительно? ;)
+ if (dwTemp == ID_STATUS_OFFLINE) { // was/now invisible
WCHAR szEMail[MAX_EMAIL_LEN];
- DB_Mra_GetStaticStringW(hContact,"e-mail",szEMail,SIZEOF(szEMail),NULL);
- mir_sntprintf(szBuff,SIZEOF(szBuff),L"%s <%s> - %s",GetContactNameW(hContact),szEMail,TranslateW(L"invisible status changed"));
- MraPopupShowFromContactW(hContact,MRA_POPUP_TYPE_INFORMATION,0,szBuff);
+ mraGetStaticStringW(hContact, "e-mail", szEMail, SIZEOF(szEMail), NULL);
+ mir_sntprintf(szBuff, SIZEOF(szBuff), L"%s <%s> - %s", GetContactNameW(hContact), szEMail, TranslateW(L"invisible status changed"));
+ MraPopupShowFromContactW(hContact, MRA_POPUP_TYPE_INFORMATION, 0, szBuff);
- MraSetContactStatus(hContact,ID_STATUS_INVISIBLE);
- }else{// server or miranda bug or status change
- //DebugBreak();
+ MraSetContactStatus(hContact, ID_STATUS_INVISIBLE);
}
}
- MraSetContactStatus(hContact,dwTemp);
+ MraSetContactStatus(hContact, dwTemp);
SetExtraIcons(hContact);
}
}
break;
+
case MRIM_CS_LOGOUT:// Пользователь отключен из-за параллельного входа с его логином.
- if (GetUL(&lpbDataCurrent)==LOGOUT_NO_RELOGIN_FLAG) ShowFormatedErrorMessage(L"Another user connected with your login",NO_ERROR);
- (*pbContinue)=FALSE;
+ if ( GetUL(&lpbDataCurrent) == LOGOUT_NO_RELOGIN_FLAG)
+ ShowFormattedErrorMessage(L"Another user connected with your login", NO_ERROR);
+ *pbContinue = FALSE;
break;
+
case MRIM_CS_ADD_CONTACT_ACK:
case MRIM_CS_MODIFY_CONTACT_ACK:
- if (MraSendQueueFind(masMraSettings.hSendQueueHandle,pmaHeader->seq,NULL,&hContact,&dwAckType,(LPBYTE*)&lpsString.lpszData,&lpsString.dwSize)==NO_ERROR)
- {
- dwTemp=GetUL(&lpbDataCurrent);
- switch(dwTemp){
+ if ( !MraSendQueueFind(hSendQueueHandle, pmaHeader->seq, NULL, &hContact, &dwAckType, (LPBYTE*)&lpsString.lpszData, &lpsString.dwSize)) {
+ dwTemp = GetUL(&lpbDataCurrent);
+ switch (dwTemp) {
case CONTACT_OPER_SUCCESS:// ## добавление произведено успешно
- if (pmaHeader->msg==MRIM_CS_ADD_CONTACT_ACK) SetContactBasicInfoW(hContact,0,(SCBIF_ID|SCBIF_SERVER_FLAG),GetUL(&lpbDataCurrent),0,0,CONTACT_INTFLAG_NOT_AUTHORIZED,0,NULL,0,NULL,0,NULL,0);
+ if (pmaHeader->msg == MRIM_CS_ADD_CONTACT_ACK) SetContactBasicInfoW(hContact, 0, (SCBIF_ID|SCBIF_SERVER_FLAG), GetUL(&lpbDataCurrent), 0, 0, CONTACT_INTFLAG_NOT_AUTHORIZED, 0, NULL, 0, NULL, 0, NULL, 0);
break;
case CONTACT_OPER_ERROR:// ## переданные данные были некорректны
- ShowFormatedErrorMessage(L"Sended data is invalid",NO_ERROR);
+ ShowFormattedErrorMessage(L"Sended data is invalid", NO_ERROR);
break;
case CONTACT_OPER_INTERR:// ## при обработке запроса произошла внутренняя ошибка
- ShowFormatedErrorMessage(L"Internal server error",NO_ERROR);
+ ShowFormattedErrorMessage(L"Internal server error", NO_ERROR);
break;
case CONTACT_OPER_NO_SUCH_USER:// ## добавляемого пользователя не существует в системе
- SetContactBasicInfoW(hContact,0,SCBIF_SERVER_FLAG,0,0,0,-1,0,NULL,0,NULL,0,NULL,0);
- ShowFormatedErrorMessage(L"User does not registred",NO_ERROR);
+ SetContactBasicInfoW(hContact, 0, SCBIF_SERVER_FLAG, 0, 0, 0, -1, 0, NULL, 0, NULL, 0, NULL, 0);
+ ShowFormattedErrorMessage(L"User does not registred", NO_ERROR);
break;
case CONTACT_OPER_INVALID_INFO:// ## некорректное имя пользователя
- ShowFormatedErrorMessage(L"Invalid user name",NO_ERROR);
+ ShowFormattedErrorMessage(L"Invalid user name", NO_ERROR);
break;
case CONTACT_OPER_USER_EXISTS:// ## пользователь уже есть в контакт-листе
- ShowFormatedErrorMessage(L"User allready added",NO_ERROR);
+ ShowFormattedErrorMessage(L"User allready added", NO_ERROR);
break;
case CONTACT_OPER_GROUP_LIMIT:// ## превышено максимально допустимое количество групп (20)
- ShowFormatedErrorMessage(L"Group limit is 20",NO_ERROR);
+ ShowFormattedErrorMessage(L"Group limit is 20", NO_ERROR);
break;
default:// ## unknown error
- mir_sntprintf(szBuff,SIZEOF(szBuff),TranslateW(L"MRIM_CS_*_CONTACT_ACK: unknown server error, code: %lu"),dwTemp);
- MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG,0,szBuff);
+ mir_sntprintf(szBuff, SIZEOF(szBuff), TranslateW(L"MRIM_CS_*_CONTACT_ACK: unknown server error, code: %lu"), dwTemp);
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, szBuff);
break;
}
- MraSendQueueFree(masMraSettings.hSendQueueHandle,pmaHeader->seq);
- }else{// not found in queue
- MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG,0,TranslateW(L"MRIM_CS_*_CONTACT_ACK: not found in queue"));
+ MraSendQueueFree(hSendQueueHandle, pmaHeader->seq);
}
+ else MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, TranslateW(L"MRIM_CS_*_CONTACT_ACK: not found in queue"));
break;
+
case MRIM_CS_ANKETA_INFO:
- if (MraSendQueueFind(masMraSettings.hSendQueueHandle,pmaHeader->seq,NULL,&hContact,&dwAckType,(LPBYTE*)&lpsString.lpszData,&lpsString.dwSize)==NO_ERROR)
- {
- switch(GetUL(&lpbDataCurrent)) {
+ if ( !MraSendQueueFind(hSendQueueHandle, pmaHeader->seq, NULL, &hContact, &dwAckType, (LPBYTE*)&lpsString.lpszData, &lpsString.dwSize)) {
+ switch (GetUL(&lpbDataCurrent)) {
case MRIM_ANKETA_INFO_STATUS_OK:// поиск успешно завершен
{
- DWORD dwFeildsNum,dwMaxRows,dwServerTime,dwStatus;
- SIZE_T i;
- MRA_LPS *pmralpsFeilds,*pmralpsValues;
-
- dwFeildsNum=GetUL(&lpbDataCurrent);
- dwMaxRows=GetUL(&lpbDataCurrent);
- dwServerTime=GetUL(&lpbDataCurrent);
-
- pmralpsFeilds=(MRA_LPS*)MEMALLOC(((dwFeildsNum*2)+4)*sizeof(MRA_LPS));
- if (pmralpsFeilds)
- {
- pmralpsValues=(pmralpsFeilds+dwFeildsNum);
+ DWORD dwFeildsNum, dwMaxRows, dwServerTime, dwStatus;
+ size_t i;
+ MRA_LPS *pmralpsFeilds, *pmralpsValues;
+
+ dwFeildsNum = GetUL(&lpbDataCurrent);
+ dwMaxRows = GetUL(&lpbDataCurrent);
+ dwServerTime = GetUL(&lpbDataCurrent);
+
+ pmralpsFeilds = (MRA_LPS*)mir_calloc(((dwFeildsNum*2)+4)*sizeof(MRA_LPS));
+ if (pmralpsFeilds) {
+ pmralpsValues = (pmralpsFeilds+dwFeildsNum);
// read headers name
- for (i=0;i<dwFeildsNum;i++)
- {
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&pmralpsFeilds[i]);
+ for (i = 0; i < dwFeildsNum; i++) {
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &pmralpsFeilds[i]);
DebugPrintCRLFA(pmralpsFeilds[i].lpszData);
}
- while (lpbDataCurrent<(lpbData+dwDataSize))
- {
+ while (lpbDataCurrent < lpbData+dwDataSize) {
// read values
- for (i=0;i<dwFeildsNum;i++) GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&pmralpsValues[i]);
+ for (i = 0;i<dwFeildsNum;i++)
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &pmralpsValues[i]);
- if (dwAckType==ACKTYPE_GETINFO && hContact)
- {// write to DB and exit loop
- DB_Mra_SetDword(hContact,"InfoTS",(DWORD)_time32(NULL));
+ // write to DB and exit loop
+ if (dwAckType == ACKTYPE_GETINFO && hContact) {
+ mraSetDword(hContact, "InfoTS", (DWORD)_time32(NULL));
//MRA_LPS mralpsUsernameValue;
- for (i=0;i<dwFeildsNum;i++)
- {
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Username",8)==CSTR_EQUAL)
- {
- //mralpsUsernameValue=pmralpsValues[i];
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Domain",6)==CSTR_EQUAL)
- {
- //memmove(szBuff,mralpsUsernameValue.lpszData,mralpsUsernameValue.dwSize);
- //(*((WORD*)&szBuff[mralpsUsernameValue.dwSize]))=(*((WORD*)"@"));
- //memmove(&szBuff[mralpsUsernameValue.dwSize+1],pmralpsValues[i].lpszData,pmralpsValues[i].dwSize);
- //(*((WORD*)&szBuff[pmralpsValues[i].dwSize+mralpsUsernameValue.dwSize+1]))=0;
- //DB_Mra_SetStringA(hContact,"e-mail",pmralpsValues[i].lpszData);
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Flags",5)==CSTR_EQUAL)
- {
- //***
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Nickname",8)==CSTR_EQUAL)
- {
- DB_Mra_SetLPSStringW(hContact,"Nick",&pmralpsValues[i]);
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"FirstName",9)==CSTR_EQUAL)
- {
- DB_Mra_SetLPSStringW(hContact,"FirstName",&pmralpsValues[i]);
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"LastName",8)==CSTR_EQUAL)
- {
- DB_Mra_SetLPSStringW(hContact,"LastName",&pmralpsValues[i]);
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Sex",3)==CSTR_EQUAL)
- {
- switch(StrToUNum32(pmralpsValues[i].lpszData,pmralpsValues[i].dwSize)) {
+ for (i = 0; i < dwFeildsNum; i++) {
+ if ( !_strnicmp(pmralpsFeilds[i].lpszData, "Username", 8))
+ ; //mralpsUsernameValue = pmralpsValues[i];
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "Domain", 6))
+ ;
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "Flags", 5))
+ ;
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "Nickname", 8))
+ mraSetLPSStringW(hContact, "Nick", &pmralpsValues[i]);
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "FirstName", 9))
+ mraSetLPSStringW(hContact, "FirstName", &pmralpsValues[i]);
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "LastName", 8))
+ mraSetLPSStringW(hContact, "LastName", &pmralpsValues[i]);
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "Sex", 3)) {
+ switch (StrToUNum32(pmralpsValues[i].lpszData, pmralpsValues[i].dwSize)) {
case 1:// мужской
- DB_Mra_SetByte(hContact,"Gender",'M');
+ mraSetByte(hContact, "Gender", 'M');
break;
case 2:// женский
- DB_Mra_SetByte(hContact,"Gender",'F');
+ mraSetByte(hContact, "Gender", 'F');
break;
default:// а фиг его знает
- DB_Mra_DeleteValue(hContact,"Gender");
+ mraDelValue(hContact, "Gender");
break;
}
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Birthday",8)==CSTR_EQUAL)
- {
- if (pmralpsValues[i].dwSize>9)
- {// calc "Age"
- SYSTEMTIME stTime={0};
-
- stTime.wYear=(WORD)StrToUNum32(pmralpsValues[i].lpszData,4);
- stTime.wMonth=(WORD)StrToUNum32((pmralpsValues[i].lpszData+5),2);
- stTime.wDay=(WORD)StrToUNum32((pmralpsValues[i].lpszData+8),2);
- DB_Mra_SetWord(hContact,"BirthYear",stTime.wYear);
- DB_Mra_SetByte(hContact,"BirthMonth",(BYTE)stTime.wMonth);
- DB_Mra_SetByte(hContact,"BirthDay",(BYTE)stTime.wDay);
-
- DB_Mra_SetWord(hContact,"Age",(WORD)GetYears(&stTime));
- }else{
- DB_Mra_DeleteValue(hContact,"BirthYear");
- DB_Mra_DeleteValue(hContact,"BirthMonth");
- DB_Mra_DeleteValue(hContact,"BirthDay");
- DB_Mra_DeleteValue(hContact,"Age");
+ }
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "Birthday", 8)) {
+ if (pmralpsValues[i].dwSize > 9) {// calc "Age"
+ SYSTEMTIME stTime = {0};
+
+ stTime.wYear = (WORD)StrToUNum32(pmralpsValues[i].lpszData, 4);
+ stTime.wMonth = (WORD)StrToUNum32((pmralpsValues[i].lpszData+5), 2);
+ stTime.wDay = (WORD)StrToUNum32((pmralpsValues[i].lpszData+8), 2);
+ mraSetWord(hContact, "BirthYear", stTime.wYear);
+ mraSetByte(hContact, "BirthMonth", (BYTE)stTime.wMonth);
+ mraSetByte(hContact, "BirthDay", (BYTE)stTime.wDay);
+
+ mraSetWord(hContact, "Age", (WORD)GetYears(&stTime));
+ }
+ else {
+ mraDelValue(hContact, "BirthYear");
+ mraDelValue(hContact, "BirthMonth");
+ mraDelValue(hContact, "BirthDay");
+ mraDelValue(hContact, "Age");
}
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"City_id",7)==CSTR_EQUAL)
- {
- dwTemp=StrToUNum32(pmralpsValues[i].lpszData,pmralpsValues[i].dwSize);
- if (dwTemp)
- {
- for(SIZE_T j=0;mrapPlaces[j].lpszData;j++)
- {
- if (mrapPlaces[j].dwCityID==dwTemp)
- {
- DB_Mra_SetStringW(hContact,"City",mrapPlaces[j].lpszData);
+ }
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "City_id", 7)) {
+ dwTemp = StrToUNum32(pmralpsValues[i].lpszData, pmralpsValues[i].dwSize);
+ if (dwTemp) {
+ for (size_t j = 0;mrapPlaces[j].lpszData;j++) {
+ if (mrapPlaces[j].dwCityID == dwTemp) {
+ mraSetStringW(hContact, "City", mrapPlaces[j].lpszData);
break;
}
}
- }else{
- DB_Mra_DeleteValue(hContact,"City");
}
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Location",8)==CSTR_EQUAL)
- {//***
- DB_Mra_SetLPSStringW(hContact,"About",&pmralpsValues[i]);
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Zodiac",6)==CSTR_EQUAL)
- {
- //***
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"BMonth",6)==CSTR_EQUAL)
- {// used Birthday
- //if (pmralpsValues[i].dwSize) DB_Mra_SetByte(hContact,"BirthMonth",(BYTE)StrToUNum32(pmralpsValues[i].lpszData,pmralpsValues[i].dwSize));
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"BDay",4)==CSTR_EQUAL)
- {// used Birthday
- //if (pmralpsValues[i].dwSize) DB_Mra_SetByte(hContact,"BirthDay",(BYTE)StrToUNum32(pmralpsValues[i].lpszData,pmralpsValues[i].dwSize));
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Country_id",10)==CSTR_EQUAL)
- {
- dwTemp=StrToUNum32(pmralpsValues[i].lpszData,pmralpsValues[i].dwSize);
- if (dwTemp)
- {
- for(SIZE_T j=0;mrapPlaces[j].lpszData;j++)
- {
- if (mrapPlaces[j].dwCountryID==dwTemp)
- {
- DB_Mra_SetStringW(hContact,"Country",mrapPlaces[j].lpszData);
+ else mraDelValue(hContact, "City");
+ }
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "Location", 8))
+ mraSetLPSStringW(hContact, "About", &pmralpsValues[i]);
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "Zodiac", 6))
+ ;
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "BMonth", 6))
+ ;
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "BDay", 4))
+ ;
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "Country_id", 10)) {
+ dwTemp = StrToUNum32(pmralpsValues[i].lpszData, pmralpsValues[i].dwSize);
+ if (dwTemp) {
+ for (size_t j = 0; mrapPlaces[j].lpszData; j++) {
+ if (mrapPlaces[j].dwCountryID == dwTemp) {
+ mraSetStringW(hContact, "Country", mrapPlaces[j].lpszData);
break;
}
}
- }else{
- DB_Mra_DeleteValue(hContact,"Country");
}
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Phone",5)==CSTR_EQUAL)
- {
- DB_Mra_DeleteValue(hContact,"Phone");
- DB_Mra_DeleteValue(hContact,"Cellular");
- DB_Mra_DeleteValue(hContact,"Fax");
-
- if (pmralpsValues[i].dwSize)
- {
- LPSTR lpszCurPos;
-
- lpsString.lpszData=pmralpsValues[i].lpszData;
- lpszCurPos=(LPSTR)MemoryFindByte(0,pmralpsValues[i].lpszData,pmralpsValues[i].dwSize,',');
+ else mraDelValue(hContact, "Country");
+ }
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "Phone", 5)) {
+ mraDelValue(hContact, "Phone");
+ mraDelValue(hContact, "Cellular");
+ mraDelValue(hContact, "Fax");
+
+ if (pmralpsValues[i].dwSize) {
+ lpsString.lpszData = pmralpsValues[i].lpszData;
+ LPSTR lpszCurPos = (LPSTR)MemoryFindByte(0, pmralpsValues[i].lpszData, pmralpsValues[i].dwSize, ',');
if (lpszCurPos)
- {
- lpsString.dwSize=(lpszCurPos-lpsString.lpszData);
- }else{
- lpsString.dwSize=((pmralpsValues[i].lpszData+pmralpsValues[i].dwSize)-lpsString.lpszData);
- }
- DB_Mra_SetLPSStringA(hContact,"Phone",&lpsString);
+ lpsString.dwSize = (lpszCurPos-lpsString.lpszData);
+ else
+ lpsString.dwSize = ((pmralpsValues[i].lpszData+pmralpsValues[i].dwSize)-lpsString.lpszData);
- if (lpszCurPos)
- {
- lpsString.lpszData=(++lpszCurPos);
- lpszCurPos=(LPSTR)MemoryFindByte((lpszCurPos-pmralpsValues[i].lpszData),pmralpsValues[i].lpszData,pmralpsValues[i].dwSize,',');
- if (lpszCurPos)
- {
- lpsString.dwSize=(lpszCurPos-lpsString.lpszData);
- }else{
- lpsString.dwSize=((pmralpsValues[i].lpszData+pmralpsValues[i].dwSize)-lpsString.lpszData);
- }
- DB_Mra_SetLPSStringA(hContact,"Cellular",&lpsString);
+ mraSetLPSStringA(hContact, "Phone", &lpsString);
+
+ if (lpszCurPos) {
+ lpsString.lpszData = (++lpszCurPos);
+ lpszCurPos = (LPSTR)MemoryFindByte((lpszCurPos-pmralpsValues[i].lpszData), pmralpsValues[i].lpszData, pmralpsValues[i].dwSize, ',');
+ if (lpszCurPos)
+ lpsString.dwSize = (lpszCurPos-lpsString.lpszData);
+ else
+ lpsString.dwSize = ((pmralpsValues[i].lpszData+pmralpsValues[i].dwSize)-lpsString.lpszData);
+
+ mraSetLPSStringA(hContact, "Cellular", &lpsString);
}
- if (lpszCurPos)
- {
- lpsString.lpszData=(++lpszCurPos);
- lpszCurPos=(LPSTR)MemoryFindByte((lpszCurPos-pmralpsValues[i].lpszData),pmralpsValues[i].lpszData,pmralpsValues[i].dwSize,',');
+ if (lpszCurPos) {
+ lpsString.lpszData = (++lpszCurPos);
+ lpszCurPos = (LPSTR)MemoryFindByte((lpszCurPos-pmralpsValues[i].lpszData), pmralpsValues[i].lpszData, pmralpsValues[i].dwSize, ',');
if (lpszCurPos)
- {
- lpsString.dwSize=(lpszCurPos-lpsString.lpszData);
- }else{
- lpsString.dwSize=((pmralpsValues[i].lpszData+pmralpsValues[i].dwSize)-lpsString.lpszData);
- }
- DB_Mra_SetLPSStringA(hContact,"Fax",&lpsString);
+ lpsString.dwSize = (lpszCurPos-lpsString.lpszData);
+ else
+ lpsString.dwSize = ((pmralpsValues[i].lpszData+pmralpsValues[i].dwSize)-lpsString.lpszData);
+
+ mraSetLPSStringA(hContact, "Fax", &lpsString);
}
}
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"mrim_status",11)==CSTR_EQUAL)
- {
- if (pmralpsValues[i].dwSize)
- {
- DWORD dwID,dwContactSeverFlags;
-
- GetContactBasicInfoW(hContact,&dwID,NULL,NULL,&dwContactSeverFlags,NULL,NULL,0,NULL,NULL,0,NULL,NULL,0,NULL);
- if (dwID==-1 || dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED)
- {// для авторизованного нам и так присылают правильный статус
- dwStatus=StrHexToUNum32(pmralpsValues[i].lpszData,pmralpsValues[i].dwSize);
- MraSetContactStatus(hContact,GetMiradaStatusFromMraStatus(dwStatus,MRA_MIR_XSTATUS_NONE,NULL));
- DB_Mra_SetByte(hContact,DBSETTING_XSTATUSID,(BYTE)MRA_MIR_XSTATUS_NONE);
+ }
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "mrim_status", 11)) {
+ if (pmralpsValues[i].dwSize) {
+ DWORD dwID, dwContactSeverFlags;
+
+ GetContactBasicInfoW(hContact, &dwID, NULL, NULL, &dwContactSeverFlags, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, 0, NULL);
+ // для авторизованного нам и так присылают правильный статус
+ if (dwID == -1 || (dwContactSeverFlags & CONTACT_INTFLAG_NOT_AUTHORIZED)) {
+ dwStatus = StrHexToUNum32(pmralpsValues[i].lpszData, pmralpsValues[i].dwSize);
+ MraSetContactStatus(hContact, GetMiradaStatusFromMraStatus(dwStatus, MRA_MIR_XSTATUS_NONE, NULL));
+ mraSetByte(hContact, DBSETTING_XSTATUSID, (BYTE)MRA_MIR_XSTATUS_NONE);
}
}
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"status_uri",10)==CSTR_EQUAL)
- {
- if (pmralpsValues[i].dwSize)
- {
- DWORD dwID,dwContactSeverFlags,dwXStatus;
-
- GetContactBasicInfoW(hContact,&dwID,NULL,NULL,&dwContactSeverFlags,NULL,NULL,0,NULL,NULL,0,NULL,NULL,0,NULL);
- if (dwID==-1 || dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED)
- {// для авторизованного нам и так присылают правильный статус
- MraSetContactStatus(hContact,GetMiradaStatusFromMraStatus(dwStatus,GetMraXStatusIDFromMraUriStatus(pmralpsValues[i].lpszData,pmralpsValues[i].dwSize),&dwXStatus));
- DB_Mra_SetByte(hContact,DBSETTING_XSTATUSID,(BYTE)dwXStatus);
+ }
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "status_uri", 10)) {
+ if (pmralpsValues[i].dwSize) {
+ DWORD dwID, dwContactSeverFlags, dwXStatus;
+
+ GetContactBasicInfoW(hContact, &dwID, NULL, NULL, &dwContactSeverFlags, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, 0, NULL);
+ if (dwID == -1 || dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED) {
+ MraSetContactStatus(hContact, GetMiradaStatusFromMraStatus(dwStatus, GetMraXStatusIDFromMraUriStatus(pmralpsValues[i].lpszData, pmralpsValues[i].dwSize), &dwXStatus));
+ mraSetByte(hContact, DBSETTING_XSTATUSID, (BYTE)dwXStatus);
}
}
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"status_title",12)==CSTR_EQUAL)
- {
- if (pmralpsValues[i].dwSize)
- {
- DWORD dwID,dwContactSeverFlags;
-
- GetContactBasicInfoW(hContact,&dwID,NULL,NULL,&dwContactSeverFlags,NULL,NULL,0,NULL,NULL,0,NULL,NULL,0,NULL);
- if (dwID==-1 || dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED)
- {// для авторизованного нам и так присылают правильный статус
- DB_Mra_SetLPSStringW(hContact,DBSETTING_XSTATUSNAME,&pmralpsValues[i]);
- }
+ }
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "status_title", 12)) {
+ if (pmralpsValues[i].dwSize) {
+ DWORD dwID, dwContactSeverFlags;
+
+ GetContactBasicInfoW(hContact, &dwID, NULL, NULL, &dwContactSeverFlags, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, 0, NULL);
+ if (dwID == -1 || dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED)
+ mraSetLPSStringW(hContact, DBSETTING_XSTATUSNAME, &pmralpsValues[i]);
}
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"status_desc",11)==CSTR_EQUAL)
- {
- if (pmralpsValues[i].dwSize)
- {
- DWORD dwID,dwContactSeverFlags;
-
- GetContactBasicInfoW(hContact,&dwID,NULL,NULL,&dwContactSeverFlags,NULL,NULL,0,NULL,NULL,0,NULL,NULL,0,NULL);
- if (dwID==-1 || dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED)
- {// для авторизованного нам и так присылают правильный статус
- DB_Mra_SetLPSStringW(hContact,DBSETTING_XSTATUSMSG,&pmralpsValues[i]);
- }
+ }
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "status_desc", 11)) {
+ if (pmralpsValues[i].dwSize) {
+ DWORD dwID, dwContactSeverFlags;
+
+ GetContactBasicInfoW(hContact, &dwID, NULL, NULL, &dwContactSeverFlags, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, 0, NULL);
+ if (dwID == -1 || dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED)
+ mraSetLPSStringW(hContact, DBSETTING_XSTATUSMSG, &pmralpsValues[i]);
}
- }else{// for DEBUG ONLY
- #ifdef _DEBUG
- DebugPrintCRLFA(pmralpsFeilds[i].lpszData);
- DebugPrintCRLFA(pmralpsValues[i].lpszData);
- //DebugBreak();
- #endif
+ }
+ else {// for DEBUG ONLY
+ #ifdef _DEBUG
+ DebugPrintCRLFA(pmralpsFeilds[i].lpszData);
+ DebugPrintCRLFA(pmralpsValues[i].lpszData);
+ //DebugBreak();
+ #endif
}
}
- }else
- if (dwAckType==ACKTYPE_SEARCH)
- {
- WCHAR szNick[MAX_EMAIL_LEN]={0},
- szFirstName[MAX_EMAIL_LEN]={0},
- szLastName[MAX_EMAIL_LEN]={0},
- szEMail[MAX_EMAIL_LEN]={0};
- MRA_LPS mralpsUsernameValue={0};
- PROTOSEARCHRESULT psr={0};
-
- psr.cbSize=sizeof(psr);
- psr.flags=PSR_UNICODE;
- psr.nick=szNick;
- psr.firstName=szFirstName;
- psr.lastName=szLastName;
- psr.email=szEMail;
- psr.id=szEMail;
-
- for (i=0;i<dwFeildsNum;i++)
- {
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Username",8)==CSTR_EQUAL)
- {
- mralpsUsernameValue=pmralpsValues[i];
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Domain",6)==CSTR_EQUAL)
- {// имя было уже задано ранее
- dwStringSize=MultiByteToWideChar(MRA_CODE_PAGE,0,mralpsUsernameValue.lpszData,mralpsUsernameValue.dwSize,szEMail,SIZEOF(szEMail));
-
- szEMail[dwStringSize]=(*((WCHAR*)L"@"));
+ }
+ else if (dwAckType == ACKTYPE_SEARCH) {
+ WCHAR szNick[MAX_EMAIL_LEN] = {0},
+ szFirstName[MAX_EMAIL_LEN] = {0},
+ szLastName[MAX_EMAIL_LEN] = {0},
+ szEMail[MAX_EMAIL_LEN] = {0};
+ MRA_LPS mralpsUsernameValue = {0};
+ PROTOSEARCHRESULT psr = {0};
+
+ psr.cbSize = sizeof(psr);
+ psr.flags = PSR_UNICODE;
+ psr.nick = szNick;
+ psr.firstName = szFirstName;
+ psr.lastName = szLastName;
+ psr.email = szEMail;
+ psr.id = szEMail;
+
+ for (i = 0;i<dwFeildsNum;i++) {
+ if ( !_strnicmp(pmralpsFeilds[i].lpszData, "Username", 8))
+ mralpsUsernameValue = pmralpsValues[i];
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "Domain", 6)) { // имя было уже задано ранее
+ dwStringSize = MultiByteToWideChar(MRA_CODE_PAGE, 0, mralpsUsernameValue.lpszData, mralpsUsernameValue.dwSize, szEMail, SIZEOF(szEMail));
+
+ szEMail[dwStringSize] = (*((WCHAR*)L"@"));
dwStringSize++;
- dwStringSize+=MultiByteToWideChar(MRA_CODE_PAGE,0,pmralpsValues[i].lpszData,pmralpsValues[i].dwSize,&szEMail[dwStringSize],(SIZEOF(szEMail)-(dwStringSize+1)));
- szEMail[dwStringSize]=0;
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Nickname",8)==CSTR_EQUAL)
- {
- dwStringSize=min((sizeof(szNick)-sizeof(WCHAR)),pmralpsValues[i].dwSize);
- memmove(szNick,pmralpsValues[i].lpwszData,dwStringSize);
- szNick[dwStringSize]=0;
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"FirstName",9)==CSTR_EQUAL)
- {
- dwStringSize=min((sizeof(szFirstName)-sizeof(WCHAR)),pmralpsValues[i].dwSize);
- memmove(szFirstName,pmralpsValues[i].lpwszData,dwStringSize);
- szFirstName[dwStringSize]=0;
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"LastName",8)==CSTR_EQUAL)
- {
- dwStringSize=min((sizeof(szLastName)-sizeof(WCHAR)),pmralpsValues[i].dwSize);
- memmove(szLastName,pmralpsValues[i].lpwszData,dwStringSize);
- szLastName[dwStringSize]=0;
+ dwStringSize += MultiByteToWideChar(MRA_CODE_PAGE, 0, pmralpsValues[i].lpszData, pmralpsValues[i].dwSize, &szEMail[dwStringSize], (SIZEOF(szEMail)-(dwStringSize+1)));
+ szEMail[dwStringSize] = 0;
+ }
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "Nickname", 8)) {
+ dwStringSize = min((sizeof(szNick)-sizeof(WCHAR)), pmralpsValues[i].dwSize);
+ memmove(szNick, pmralpsValues[i].lpwszData, dwStringSize);
+ szNick[dwStringSize] = 0;
+ }
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "FirstName", 9)) {
+ dwStringSize = min((sizeof(szFirstName)-sizeof(WCHAR)), pmralpsValues[i].dwSize);
+ memmove(szFirstName, pmralpsValues[i].lpwszData, dwStringSize);
+ szFirstName[dwStringSize] = 0;
+ }
+ else if ( !_strnicmp(pmralpsFeilds[i].lpszData, "LastName", 8)) {
+ dwStringSize = min((sizeof(szLastName)-sizeof(WCHAR)), pmralpsValues[i].dwSize);
+ memmove(szLastName, pmralpsValues[i].lpwszData, dwStringSize);
+ szLastName[dwStringSize] = 0;
}
}// end for
- ProtoBroadcastAck(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_DATA,(HANDLE)pmaHeader->seq,(LPARAM)&psr);
+ ProtoBroadcastAck(m_szModuleName, hContact, dwAckType, ACKRESULT_DATA, (HANDLE)pmaHeader->seq, (LPARAM)&psr);
}
}// end while
- MEMFREE(pmralpsFeilds);
+ mir_free(pmralpsFeilds);
}
}
- switch(dwAckType){
+ switch (dwAckType) {
case ACKTYPE_GETINFO:
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_SUCCESS,(HANDLE)1,(LPARAM)NULL,0);
+ ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)NULL, 0);
break;
case ACKTYPE_SEARCH:
default:
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_SUCCESS,(HANDLE)pmaHeader->seq,(LPARAM)NULL,0);
+ ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_SUCCESS, (HANDLE)pmaHeader->seq, (LPARAM)NULL, 0);
break;
}
break;
+
case MRIM_ANKETA_INFO_STATUS_NOUSER:// не найдено ни одной подходящей записи
- SetContactBasicInfoW(hContact,0,SCBIF_SERVER_FLAG,0,0,0,-1,0,NULL,0,NULL,0,NULL,0);
+ SetContactBasicInfoW(hContact, 0, SCBIF_SERVER_FLAG, 0, 0, 0, -1, 0, NULL, 0, NULL, 0, NULL, 0);
case MRIM_ANKETA_INFO_STATUS_DBERR:// ошибка базы данных
case MRIM_ANKETA_INFO_STATUS_RATELIMERR:// слишком много запросов, поиск временно запрещен
- switch(dwAckType){
+ switch (dwAckType) {
case ACKTYPE_GETINFO:
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_FAILED,(HANDLE)1,(LPARAM)NULL,0);
+ ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_FAILED, (HANDLE)1, (LPARAM)NULL, 0);
break;
case ACKTYPE_SEARCH:
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_SUCCESS,(HANDLE)pmaHeader->seq,(LPARAM)NULL,0);
+ ProtoBroadcastAckAsynchEx(hContact, dwAckType, ACKRESULT_SUCCESS, (HANDLE)pmaHeader->seq, (LPARAM)NULL, 0);
break;
default:
DebugBreak();
@@ -1297,41 +1143,42 @@ DWORD MraCommandDispather(mrim_packet_header_t *pmaHeader,DWORD *pdwPingPeriod,D
DebugBreak();
break;
}
- MraSendQueueFree(masMraSettings.hSendQueueHandle,pmaHeader->seq);
- }else{// not found in queue
- MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG,0,TranslateW(L"MRIM_ANKETA_INFO: not found in queue"));
+ MraSendQueueFree(hSendQueueHandle, pmaHeader->seq);
}
+ else MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, TranslateW(L"MRIM_ANKETA_INFO: not found in queue"));
break;
- case MRIM_CS_MAILBOX_STATUS:
- dwTemp=GetUL(&lpbDataCurrent);
- if (dwTemp > masMraSettings.dwEmailMessagesTotal) masMraSettings.dwEmailMessagesTotal+=(dwTemp-masMraSettings.dwEmailMessagesUnRead);
- dwAckType=masMraSettings.dwEmailMessagesUnRead;// save old value
- masMraSettings.dwEmailMessagesUnRead=dwTemp;// store new value
- if (DB_Mra_GetByte(NULL,"IncrementalNewMailNotify",MRA_DEFAULT_INC_NEW_MAIL_NOTIFY)==0 || dwAckType<dwTemp || dwTemp==0)
- {
- MraUpdateEmailStatus(NULL,0,NULL,0,0,0);
- }
+ case MRIM_CS_MAILBOX_STATUS:
+ dwTemp = GetUL(&lpbDataCurrent);
+ if (dwTemp > dwEmailMessagesTotal)
+ dwEmailMessagesTotal += (dwTemp - dwEmailMessagesUnread);
+
+ dwAckType = dwEmailMessagesUnread;// save old value
+ dwEmailMessagesUnread = dwTemp;// store new value
+ if (mraGetByte(NULL, "IncrementalNewMailNotify", MRA_DEFAULT_INC_NEW_MAIL_NOTIFY) == 0 || dwAckType<dwTemp || dwTemp == 0)
+ MraUpdateEmailStatus(NULL, 0, NULL, 0, 0, 0);
break;
+
case MRIM_CS_GAME:
{
- DWORD dwGameSessionID,dwGameMsg,dwGameMsgID;
+ DWORD dwGameSessionID, dwGameMsg, dwGameMsgID;
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsEMail);//LPS to/from
- dwGameSessionID=GetUL(&lpbDataCurrent);//DWORD session unique per game
- dwGameMsg=GetUL(&lpbDataCurrent);//DWORD msg internal game message
- dwGameMsgID=GetUL(&lpbDataCurrent);//DWORD msg_id id for ack
- dwTemp=GetUL(&lpbDataCurrent);//DWORD time_send time of client
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);//LPS data
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsEMail);//LPS to/from
+ dwGameSessionID = GetUL(&lpbDataCurrent);//DWORD session unique per game
+ dwGameMsg = GetUL(&lpbDataCurrent);//DWORD msg internal game message
+ dwGameMsgID = GetUL(&lpbDataCurrent);//DWORD msg_id id for ack
+ dwTemp = GetUL(&lpbDataCurrent);//DWORD time_send time of client
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);//LPS data
- #ifdef _DEBUG
- BYTE btBuff[1024]={0};
- memmove(btBuff,lpsString.lpszData,lpsString.dwSize);
- #endif
+ #ifdef _DEBUG
+ BYTE btBuff[1024] = {0};
+ memmove(btBuff, lpsString.lpszData, lpsString.dwSize);
+ #endif
- switch(dwGameMsg){
+ switch (dwGameMsg) {
case GAME_CONNECTION_INVITE:
- if (MraGetStatus(0,0)!=ID_STATUS_INVISIBLE) MraSendCommand_Game(lpsEMail.lpszData,lpsEMail.dwSize,dwGameSessionID,GAME_DECLINE,dwGameMsgID,lpsString.lpszData,lpsString.dwSize);
+ if (m_iStatus != ID_STATUS_INVISIBLE)
+ MraGame(lpsEMail.lpszData, lpsEMail.dwSize, dwGameSessionID, GAME_DECLINE, dwGameMsgID, lpsString.lpszData, lpsString.dwSize);
break;
case GAME_CONNECTION_ACCEPT:
break;
@@ -1340,11 +1187,9 @@ DWORD MraCommandDispather(mrim_packet_header_t *pmaHeader,DWORD *pdwPingPeriod,D
case GAME_INC_VERSION:
break;
case GAME_NO_SUCH_GAME:// user invisible
- if ((hContact=MraHContactFromEmail(lpsEMail.lpszData,lpsEMail.dwSize,FALSE,TRUE,NULL)))
- if (MraGetContactStatus(hContact)==ID_STATUS_OFFLINE)
- {
- MraSetContactStatus(hContact,ID_STATUS_INVISIBLE);
- }
+ if ((hContact = MraHContactFromEmail(lpsEMail.lpszData, lpsEMail.dwSize, FALSE, TRUE, NULL)))
+ if (MraGetContactStatus(hContact) == ID_STATUS_OFFLINE)
+ MraSetContactStatus(hContact, ID_STATUS_INVISIBLE);
break;
case GAME_JOIN:
break;
@@ -1365,78 +1210,71 @@ DWORD MraCommandDispather(mrim_packet_header_t *pmaHeader,DWORD *pdwPingPeriod,D
case GAME_MESSAGES_NUMBER:
break;
default:
- mir_sntprintf(szBuff,SIZEOF(szBuff),TranslateW(L"MRIM_CS_GAME: unknown internal game message code: %lu"),dwGameMsg);
- MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG,0,szBuff);
+ mir_sntprintf(szBuff, SIZEOF(szBuff), TranslateW(L"MRIM_CS_GAME: unknown internal game message code: %lu"), dwGameMsg);
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, szBuff);
break;
}
}
break;
case MRIM_CS_CONTACT_LIST2:
- dwTemp=GetUL(&lpbDataCurrent);
- if (dwTemp==GET_CONTACTS_OK)
- {// получили контакт лист
+ dwTemp = GetUL(&lpbDataCurrent);
+ if (dwTemp == GET_CONTACTS_OK) { // received contact list
BOOL bAdded;
- char szGroupMask[MAX_PATH],szContactMask[MAX_PATH];
- DWORD dwID,dwGroupFlags,dwContactFlag,dwGroupID,dwContactSeverFlags,dwStatus,dwXStatus,dwFutureFlags,dwBlogStatusTime;
- MRA_LPS mralpsGroupName,mralpsNick,mralpsCustomPhones,lpsSpecStatusUri,lpsStatusTitle,lpsStatusDesc,lpsUserAgentFormated,lpsBlogStatus,lpsBlogStatusMusic;
- SIZE_T i,j,dwGroupsCount,dwGroupMaskSize,dwContactMaskSize,dwControlParam;
+ char szGroupMask[MAX_PATH], szContactMask[MAX_PATH];
+ DWORD dwID, dwGroupFlags, dwContactFlag, dwGroupID, dwContactSeverFlags, dwStatus, dwXStatus, dwFutureFlags, dwBlogStatusTime;
+ MRA_LPS mralpsGroupName, mralpsNick, mralpsCustomPhones, lpsSpecStatusUri, lpsStatusTitle, lpsStatusDesc, lpsUserAgentFormated, lpsBlogStatus, lpsBlogStatusMusic;
+ size_t i, j, dwGroupsCount, dwGroupMaskSize, dwContactMaskSize, dwControlParam;
ULARGE_INTEGER dwBlogStatusID;
- dwGroupsCount=GetUL(&lpbDataCurrent);
+ dwGroupsCount = GetUL(&lpbDataCurrent);
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
- dwGroupMaskSize=lpsString.dwSize;
- memmove(szGroupMask,lpsString.lpszData,dwGroupMaskSize);(*(szGroupMask+dwGroupMaskSize))=0;
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+ dwGroupMaskSize = lpsString.dwSize;
+ memmove(szGroupMask, lpsString.lpszData, dwGroupMaskSize);(*(szGroupMask+dwGroupMaskSize)) = 0;
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
- dwContactMaskSize=lpsString.dwSize;
- memmove(szContactMask,lpsString.lpszData,dwContactMaskSize);(*(szContactMask+dwContactMaskSize))=0;
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
+ dwContactMaskSize = lpsString.dwSize;
+ memmove(szContactMask, lpsString.lpszData, dwContactMaskSize);(*(szContactMask+dwContactMaskSize)) = 0;
DebugPrintCRLFW(L"Groups:");
DebugPrintCRLFA(szGroupMask);
- dwID=0;
- for(i=0;i<dwGroupsCount;i++)//groups handle
- {
- dwControlParam=0;
- for(j=0;j<dwGroupMaskSize;j++)//enumerating parameters
- {
- switch(szGroupMask[j]) {
+ dwID = 0;
+ for (i = 0; i < dwGroupsCount; i++) { //groups handle
+ dwControlParam = 0;
+ for (j = 0; j < dwGroupMaskSize; j++) { //enumerating parameters
+ switch (szGroupMask[j]) {
case 's'://LPS
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
break;
case 'u'://UL
- dwTemp=GetUL(&lpbDataCurrent);
+ dwTemp = GetUL(&lpbDataCurrent);
break;
case 'z'://sz
- lpsString.lpszData=(LPSTR)lpbDataCurrent;
- lpsString.dwSize=lstrlenA((LPSTR)lpbDataCurrent);
- lpbDataCurrent+=lpsString.dwSize;
+ lpsString.lpszData = (LPSTR)lpbDataCurrent;
+ lpsString.dwSize = lstrlenA((LPSTR)lpbDataCurrent);
+ lpbDataCurrent += lpsString.dwSize;
DebugBreak();
break;
}
- if (j==0 && szGroupMask[j]=='u')
- {// GroupFlags
- dwGroupFlags=dwTemp;
+ if (j == 0 && szGroupMask[j] == 'u') {// GroupFlags
+ dwGroupFlags = dwTemp;
dwControlParam++;
- }else
- if (j==1 && szGroupMask[j]=='s')
- {// GroupName
- mralpsGroupName=lpsString;
+ }
+ else if (j == 1 && szGroupMask[j] == 's') {// GroupName
+ mralpsGroupName = lpsString;
dwControlParam++;
}
}
// add/modify group
- if (dwControlParam>1)// все параметры правильно инициализированны!
- //if (dwGroupFlags&CONTACT_FLAG_GROUP && (dwGroupFlags&CONTACT_FLAG_REMOVED)==0)
- {
+ if (dwControlParam > 1) { // все параметры правильно инициализированны!
#ifdef _DEBUG
- memmove(szBuff,mralpsGroupName.lpszData,mralpsGroupName.dwSize);
- szBuff[(mralpsGroupName.dwSize/sizeof(WCHAR))]=0;
+ memmove(szBuff, mralpsGroupName.lpszData, mralpsGroupName.dwSize);
+ szBuff[(mralpsGroupName.dwSize/sizeof(WCHAR))] = 0;
DebugPrintW(szBuff);
- mir_snprintf((LPSTR)szBuff,SIZEOF(szBuff),": flags: %lu (",dwGroupFlags);
+ mir_snprintf((LPSTR)szBuff, SIZEOF(szBuff), ": flags: %lu (", dwGroupFlags);
DebugPrintA((LPSTR)szBuff);
if (dwGroupFlags&CONTACT_FLAG_REMOVED) DebugPrintA("CONTACT_FLAG_REMOVED, ");
if (dwGroupFlags&CONTACT_FLAG_GROUP) DebugPrintA("CONTACT_FLAG_GROUP, ");
@@ -1454,161 +1292,130 @@ DWORD MraCommandDispather(mrim_packet_header_t *pmaHeader,DWORD *pdwPingPeriod,D
dwID++;
}// end for (processing groups)
-
DebugPrintCRLFW(L"Contacts:");
DebugPrintCRLFA(szContactMask);
- dwID=20;
- while (lpbDataCurrent<(lpbData+dwDataSize))
- {
- dwControlParam=0;
- for(j=0;j<dwContactMaskSize;j++)//enumerating parameters
- {
- switch(szContactMask[j]) {
+ dwID = 20;
+ while (lpbDataCurrent < lpbData + dwDataSize) {
+ dwControlParam = 0;
+ for (j = 0; j < dwContactMaskSize; j++) { //enumerating parameters
+ switch (szContactMask[j]) {
case 's'://LPS
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);
break;
case 'u'://UL
- dwTemp=GetUL(&lpbDataCurrent);
+ dwTemp = GetUL(&lpbDataCurrent);
break;
case 'z'://sz
- lpsString.lpszData=(LPSTR)lpbDataCurrent;
- lpsString.dwSize=lstrlenA((LPSTR)lpbDataCurrent);
- lpbDataCurrent+=lpsString.dwSize;
+ lpsString.lpszData = (LPSTR)lpbDataCurrent;
+ lpsString.dwSize = lstrlenA((LPSTR)lpbDataCurrent);
+ lpbDataCurrent += lpsString.dwSize;
DebugBreak();
break;
}
- if (j==0 && szContactMask[j]=='u')
- {// Flags
- dwContactFlag=dwTemp;
+ if (j == 0 && szContactMask[j] == 'u') { // Flags
+ dwContactFlag = dwTemp;
dwControlParam++;
- }else
- if (j==1 && szContactMask[j]=='u')
- {// Group id
- dwGroupID=dwTemp;
+ }
+ else if (j == 1 && szContactMask[j] == 'u') { // Group id
+ dwGroupID = dwTemp;
dwControlParam++;
- }else
- if (j==2 && szContactMask[j]=='s')
- {// Email
- lpsEMail=lpsString;
+ }
+ else if (j == 2 && szContactMask[j] == 's') { // Email
+ lpsEMail = lpsString;
dwControlParam++;
- }else
- if (j==3 && szContactMask[j]=='s')
- {// Nick
- mralpsNick=lpsString;
+ }
+ else if (j == 3 && szContactMask[j] == 's') { // Nick
+ mralpsNick = lpsString;
dwControlParam++;
- }else
- if (j==4 && szContactMask[j]=='u')
- {// Server flags
- dwContactSeverFlags=dwTemp;
+ }
+ else if (j == 4 && szContactMask[j] == 'u') { // Server flags
+ dwContactSeverFlags = dwTemp;
dwControlParam++;
- }else
- if (j==5 && szContactMask[j]=='u')
- {// Status
- dwStatus=dwTemp;
+ }
+ else if (j == 5 && szContactMask[j] == 'u') { // Status
+ dwStatus = dwTemp;
dwControlParam++;
- }else
- if (j==6 && szContactMask[j]=='s')
- {// Custom Phone number,
- mralpsCustomPhones=lpsString;
+ }
+ else if (j == 6 && szContactMask[j] == 's') { // Custom Phone number,
+ mralpsCustomPhones = lpsString;
dwControlParam++;
- }else
- if (j==7 && szContactMask[j]=='s')
- {// spec_status_uri
- lpsSpecStatusUri=lpsString;
+ }
+ else if (j == 7 && szContactMask[j] == 's') { // spec_status_uri
+ lpsSpecStatusUri = lpsString;
dwControlParam++;
- }else
- if (j==8 && szContactMask[j]=='s')
- {// status_title
- lpsStatusTitle=lpsString;
+ }
+ else if (j == 8 && szContactMask[j] == 's') { // status_title
+ lpsStatusTitle = lpsString;
dwControlParam++;
- }else
- if (j==9 && szContactMask[j]=='s')
- {// status_desc
- lpsStatusDesc=lpsString;
+ }
+ else if (j == 9 && szContactMask[j] == 's') { // status_desc
+ lpsStatusDesc = lpsString;
dwControlParam++;
- }else
- if (j==10 && szContactMask[j]=='u')
- {// com_support (future flags)
- dwFutureFlags=dwTemp;
+ }
+ else if (j == 10 && szContactMask[j] == 'u') { // com_support (future flags)
+ dwFutureFlags = dwTemp;
dwControlParam++;
- }else
- if (j==11 && szContactMask[j]=='s')
- {// user_agent (formated string)
- lpsUserAgentFormated=lpsString;
+ }
+ else if (j == 11 && szContactMask[j] == 's') { // user_agent (formated string)
+ lpsUserAgentFormated = lpsString;
dwControlParam++;
- }else
- if (j==12 && szContactMask[j]=='u')
- {// BlogStatusID
- dwBlogStatusID.LowPart=dwTemp;
+ }
+ else if (j == 12 && szContactMask[j] == 'u') { // BlogStatusID
+ dwBlogStatusID.LowPart = dwTemp;
dwControlParam++;
- }else
- if (j==13 && szContactMask[j]=='u')
- {// BlogStatusID
- dwBlogStatusID.HighPart=dwTemp;
+ }
+ else if (j == 13 && szContactMask[j] == 'u') { // BlogStatusID
+ dwBlogStatusID.HighPart = dwTemp;
dwControlParam++;
- }else
- if (j==14 && szContactMask[j]=='u')
- {// BlogStatusTime
- dwBlogStatusTime=dwTemp;
+ }
+ else if (j == 14 && szContactMask[j] == 'u') { // BlogStatusTime
+ dwBlogStatusTime = dwTemp;
dwControlParam++;
- }else
- if (j==15 && szContactMask[j]=='s')
- {// BlogStatus
- lpsBlogStatus=lpsString;
+ }
+ else if (j == 15 && szContactMask[j] == 's') { // BlogStatus
+ lpsBlogStatus = lpsString;
dwControlParam++;
- }else
- if (j==16 && szContactMask[j]=='s')
- {// BlogStatusMusic
- lpsBlogStatusMusic=lpsString;
+ }
+ else if (j == 16 && szContactMask[j] == 's') { // BlogStatusMusic
+ lpsBlogStatusMusic = lpsString;
dwControlParam++;
- }else
- if (j==17 && szContactMask[j]=='s')
- {// BlogStatusSender // ignory
- lpsString=lpsString;
+ }
+ else if (j == 17 && szContactMask[j] == 's') { // BlogStatusSender // ignory
+ lpsString = lpsString;
dwControlParam++;
- }else
- if (j==18 && szContactMask[j]=='s')
- {// geo data ?
- lpsString=lpsString;
+ }
+ else if (j == 18 && szContactMask[j] == 's') { // geo data ?
+ lpsString = lpsString;
dwControlParam++;
- }else
- if (j==19 && szContactMask[j]=='s')
- {// ?????? ?
- lpsString=lpsString;
+ }
+ else if (j == 19 && szContactMask[j] == 's') { // ?????? ?
+ lpsString = lpsString;
dwControlParam++;
DebugBreakIf(lpsString.dwSize);
- }else{
- if (szContactMask[j]=='s')
- {
+ }
+ else {
+ if (szContactMask[j] == 's') {
if (lpsString.dwSize)
- {
- //DebugPrintCRLFA(lpsString.lpszData);
DebugPrintCRLFW(lpsString.lpwszData);
- }
- }else
- if (szContactMask[j]=='u')
- {
- mir_snprintf((LPSTR)szBuff,SIZEOF(szBuff),"%lu, ",dwTemp);//;
+ }
+ else if (szContactMask[j] == 'u') {
+ mir_snprintf((LPSTR)szBuff, SIZEOF(szBuff), "%lu, ", dwTemp);//;
DebugPrintCRLFA((LPSTR)szBuff);
- }else{
- DebugBreak();
}
+ else DebugBreak();
}
}
-
#ifdef _DEBUG
-
- mir_snprintf((LPSTR)szBuff,SIZEOF(szBuff),"ID: %lu, Group id: %lu, ",dwID,dwGroupID);
+ mir_snprintf((LPSTR)szBuff, SIZEOF(szBuff), "ID: %lu, Group id: %lu, ", dwID, dwGroupID);
DebugPrintA((LPSTR)szBuff);
-
- memmove(szBuff,lpsEMail.lpszData,lpsEMail.dwSize);
- szBuff[(lpsEMail.dwSize/sizeof(WCHAR))]=0;
+ memmove(szBuff, lpsEMail.lpszData, lpsEMail.dwSize);
+ szBuff[(lpsEMail.dwSize/sizeof(WCHAR))] = 0;
DebugPrintA((LPSTR)szBuff);
- mir_snprintf((LPSTR)szBuff,SIZEOF(szBuff),": flags: %lu (",dwContactFlag);
+ mir_snprintf((LPSTR)szBuff, SIZEOF(szBuff), ": flags: %lu (", dwContactFlag);
DebugPrintA((LPSTR)szBuff);
if (dwContactFlag&CONTACT_FLAG_REMOVED) DebugPrintA("CONTACT_FLAG_REMOVED, ");
if (dwContactFlag&CONTACT_FLAG_GROUP) DebugPrintA("CONTACT_FLAG_GROUP, ");
@@ -1622,78 +1429,74 @@ DWORD MraCommandDispather(mrim_packet_header_t *pmaHeader,DWORD *pdwPingPeriod,D
if (dwContactFlag&CONTACT_FLAG_PHONE) DebugPrintA("CONTACT_FLAG_PHONE, ");
DebugPrintA(")");
- mir_snprintf((LPSTR)szBuff,SIZEOF(szBuff),": server flags: %lu (",dwContactSeverFlags);
+ mir_snprintf((LPSTR)szBuff, SIZEOF(szBuff), ": server flags: %lu (", dwContactSeverFlags);
DebugPrintA((LPSTR)szBuff);
if (dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED) DebugPrintA("CONTACT_INTFLAG_NOT_AUTHORIZED, ");
DebugPrintCRLFA(")");
- #endif//*/
+ #endif
-
// add/modify contact
- if (dwGroupID!=103)//***deb filtering phone/sms contats
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsEMail.lpszData,lpsEMail.dwSize,"phone",5)!=CSTR_EQUAL)
+ if (dwGroupID != 103)//***deb filtering phone/sms contats
+ if ( _strnicmp(lpsEMail.lpszData, "phone", 5))
if (dwControlParam>5)// все параметры правильно инициализированны!
- if ((dwContactFlag&(CONTACT_FLAG_GROUP|CONTACT_FLAG_REMOVED))==0)
- {
- hContact=MraHContactFromEmail(lpsEMail.lpszData,lpsEMail.dwSize,TRUE,FALSE,&bAdded);
- if (hContact)
- {
- if (GetContactBasicInfoW(hContact,&dwTemp,NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,NULL,0,NULL)==NO_ERROR && dwTemp!=-1)
- {//deb контакт уже в списке, нахуй дубликата!!!!
- dwTemp=dwTemp;
- //MraSendCommand_ModifyContactW(hContact,dwID,CONTACT_FLAG_REMOVED,dwGroupID,lpsEMail.lpszData,lpsEMail.dwSize,mralpsNick.lpszData,mralpsNick.dwSize,mralpsCustomPhones.lpszData,mralpsCustomPhones.dwSize);
+ if ((dwContactFlag&(CONTACT_FLAG_GROUP|CONTACT_FLAG_REMOVED)) == 0) {
+ hContact = MraHContactFromEmail(lpsEMail.lpszData, lpsEMail.dwSize, TRUE, FALSE, &bAdded);
+ if (hContact) {
+ // already in list, remove the duplicate
+ if (GetContactBasicInfoW(hContact, &dwTemp, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, 0, NULL) == NO_ERROR && dwTemp != -1) {
+ dwTemp = dwTemp;
DebugBreak();
- }else{
- dwTemp=GetMiradaStatusFromMraStatus(dwStatus,GetMraXStatusIDFromMraUriStatus(lpsSpecStatusUri.lpszData,lpsSpecStatusUri.dwSize),&dwXStatus);
- if ((dwContactFlag&CONTACT_FLAG_UNICODE_NAME)) mralpsNick.dwSize/=sizeof(WCHAR);
-
- if (bAdded)
- {// update user info
- SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,(SCBIF_ID|SCBIF_GROUP_ID|SCBIF_FLAG|SCBIF_SERVER_FLAG|SCBIF_STATUS|SCBIF_NICK|SCBIF_PHONES),dwID,dwGroupID,dwContactFlag,dwContactSeverFlags,dwTemp,NULL,0,mralpsNick.lpwszData,mralpsNick.dwSize,mralpsCustomPhones.lpszData,mralpsCustomPhones.dwSize);
+ }
+ else {
+ dwTemp = GetMiradaStatusFromMraStatus(dwStatus, GetMraXStatusIDFromMraUriStatus(lpsSpecStatusUri.lpszData, lpsSpecStatusUri.dwSize), &dwXStatus);
+ if ((dwContactFlag&CONTACT_FLAG_UNICODE_NAME))
+ mralpsNick.dwSize /= sizeof(WCHAR);
+ if (bAdded) { // update user info
+ SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID|SCBIF_GROUP_ID|SCBIF_FLAG|SCBIF_SERVER_FLAG|SCBIF_STATUS|SCBIF_NICK|SCBIF_PHONES), dwID, dwGroupID, dwContactFlag, dwContactSeverFlags, dwTemp, NULL, 0, mralpsNick.lpwszData, mralpsNick.dwSize, mralpsCustomPhones.lpszData, mralpsCustomPhones.dwSize);
// request user info from server
MraUpdateContactInfo(hContact);
- }else{//****deb - check group ID param
- SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,(SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS),dwID,dwGroupID,dwContactFlag,dwContactSeverFlags,dwTemp,NULL,0,mralpsNick.lpwszData,mralpsNick.dwSize,mralpsCustomPhones.lpszData,mralpsCustomPhones.dwSize);
- if (mralpsNick.dwSize==0)
- {// прописываем ник в листе на сервере
- lstrcpynW(szBuff,GetContactNameW(hContact),SIZEOF(szBuff));
- mralpsNick.lpwszData=szBuff;
- mralpsNick.dwSize=lstrlenW(mralpsNick.lpwszData);
-
- MraSendCommand_ModifyContactW(hContact,dwID,dwContactFlag,dwGroupID,lpsEMail.lpszData,lpsEMail.dwSize,mralpsNick.lpwszData,mralpsNick.dwSize,mralpsCustomPhones.lpszData,mralpsCustomPhones.dwSize);
+ }
+ else { //****deb - check group ID param
+ SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS), dwID, dwGroupID, dwContactFlag, dwContactSeverFlags, dwTemp, NULL, 0, mralpsNick.lpwszData, mralpsNick.dwSize, mralpsCustomPhones.lpszData, mralpsCustomPhones.dwSize);
+ if (mralpsNick.dwSize == 0) { // set the server-side nick
+ lstrcpynW(szBuff, GetContactNameW(hContact), SIZEOF(szBuff));
+ mralpsNick.lpwszData = szBuff;
+ mralpsNick.dwSize = lstrlenW(mralpsNick.lpwszData);
+
+ MraModifyContactW(hContact, dwID, dwContactFlag, dwGroupID, lpsEMail.lpszData, lpsEMail.dwSize, mralpsNick.lpwszData, mralpsNick.dwSize, mralpsCustomPhones.lpszData, mralpsCustomPhones.dwSize);
}
}
- MraContactCapabilitiesSet(hContact,dwFutureFlags);
- DB_Mra_SetByte(hContact,DBSETTING_XSTATUSID,(BYTE)dwXStatus);
- DB_Mra_SetLPSStringW(hContact,DBSETTING_XSTATUSNAME,&lpsStatusTitle);
- DB_Mra_SetLPSStringW(hContact,DBSETTING_XSTATUSMSG,&lpsStatusDesc);
- DB_Mra_SetDword(hContact,DBSETTING_BLOGSTATUSTIME,dwBlogStatusTime);
- DB_Mra_WriteContactSettingBlob(hContact,DBSETTING_BLOGSTATUSID,&dwBlogStatusID.QuadPart,sizeof(DWORDLONG));
- DB_Mra_SetLPSStringW(hContact,DBSETTING_BLOGSTATUS,&lpsBlogStatus);
- DB_Mra_SetLPSStringW(hContact,DBSETTING_BLOGSTATUSMUSIC,&lpsBlogStatusMusic);
- if (IsXStatusValid(dwXStatus)) SetExtraIcons(hContact);
+ MraContactCapabilitiesSet(hContact, dwFutureFlags);
+ mraSetByte(hContact, DBSETTING_XSTATUSID, (BYTE)dwXStatus);
+ mraSetLPSStringW(hContact, DBSETTING_XSTATUSNAME, &lpsStatusTitle);
+ mraSetLPSStringW(hContact, DBSETTING_XSTATUSMSG, &lpsStatusDesc);
+ mraSetDword(hContact, DBSETTING_BLOGSTATUSTIME, dwBlogStatusTime);
+ mraWriteContactSettingBlob(hContact, DBSETTING_BLOGSTATUSID, &dwBlogStatusID.QuadPart, sizeof(DWORDLONG));
+ mraSetLPSStringW(hContact, DBSETTING_BLOGSTATUS, &lpsBlogStatus);
+ mraSetLPSStringW(hContact, DBSETTING_BLOGSTATUSMUSIC, &lpsBlogStatusMusic);
+ if ( IsXStatusValid(dwXStatus))
+ SetExtraIcons(hContact);
- if (dwTemp!=ID_STATUS_OFFLINE)// пишем клиента только если юзер не отключён, иначе не затираем старое
- {
- if (lpsUserAgentFormated.dwSize)
- {// есть чё писать
- if (DB_Mra_GetByte(NULL,"MirVerRaw",MRA_DEFAULT_MIRVER_RAW)==FALSE)
- {
- MraGetVersionStringFromFormated(lpsUserAgentFormated.lpszData,lpsUserAgentFormated.dwSize,(LPSTR)szBuff,SIZEOF(szBuff),&dwStringSize);
- lpsUserAgentFormated.lpszData=(LPSTR)szBuff;
- lpsUserAgentFormated.dwSize=dwStringSize;
+ if (dwTemp != ID_STATUS_OFFLINE) { // пишем клиента только если юзер не отключён, иначе не затираем старое
+ if (lpsUserAgentFormated.dwSize) {
+ if (mraGetByte(NULL, "MirVerRaw", MRA_DEFAULT_MIRVER_RAW) == FALSE) {
+ MraGetVersionStringFromFormatted(lpsUserAgentFormated.lpszData, lpsUserAgentFormated.dwSize, (LPSTR)szBuff, SIZEOF(szBuff), &dwStringSize);
+ lpsUserAgentFormated.lpszData = (LPSTR)szBuff;
+ lpsUserAgentFormated.dwSize = dwStringSize;
}
- }else{// хз чё за клиент
- lpsUserAgentFormated.lpszData=MIRVER_UNKNOWN;
- lpsUserAgentFormated.dwSize=(sizeof(MIRVER_UNKNOWN)-1);
}
- DB_Mra_SetLPSStringA(hContact,"MirVer",&lpsUserAgentFormated);
+ else {
+ lpsUserAgentFormated.lpszData = MIRVER_UNKNOWN;
+ lpsUserAgentFormated.dwSize = (sizeof(MIRVER_UNKNOWN)-1);
+ }
+ mraSetLPSStringA(hContact, "MirVer", &lpsUserAgentFormated);
}
- if (dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED)
- if (DB_Mra_GetByte(NULL,"AutoAuthRequestOnLogon",MRA_DEFAULT_AUTO_AUTH_REQ_ON_LOGON)) CallProtoService(PROTOCOL_NAMEA,MRA_REQ_AUTH,(WPARAM)hContact,0);
+ if (dwContactSeverFlags & CONTACT_INTFLAG_NOT_AUTHORIZED)
+ if (mraGetByte(NULL, "AutoAuthRequestOnLogon", MRA_DEFAULT_AUTO_AUTH_REQ_ON_LOGON))
+ CallProtoService(m_szModuleName, MRA_REQ_AUTH, (WPARAM)hContact, 0);
}
}
}
@@ -1702,38 +1505,33 @@ DWORD MraCommandDispather(mrim_packet_header_t *pmaHeader,DWORD *pdwPingPeriod,D
// post processing contact list
{
- CHAR szEMail[MAX_EMAIL_LEN],szPhones[MAX_EMAIL_LEN];
- WCHAR wszAuthMessage[MAX_PATH],wszNick[MAX_EMAIL_LEN];
- SIZE_T dwEMailSize,dwNickSize,dwPhonesSize,dwAuthMessageSize;
-
- if (DB_Mra_GetStaticStringW(NULL,"AuthMessage",wszAuthMessage,SIZEOF(wszAuthMessage),&dwAuthMessageSize)==FALSE)
- {// def auth message
- lstrcpynW(wszAuthMessage,TranslateW(MRA_DEFAULT_AUTH_MESSAGE),SIZEOF(wszAuthMessage));
- dwAuthMessageSize=lstrlenW(wszAuthMessage);
+ CHAR szEMail[MAX_EMAIL_LEN], szPhones[MAX_EMAIL_LEN];
+ WCHAR wszAuthMessage[MAX_PATH], wszNick[MAX_EMAIL_LEN];
+ size_t dwEMailSize, dwNickSize, dwPhonesSize, dwAuthMessageSize;
+
+ if (mraGetStaticStringW(NULL, "AuthMessage", wszAuthMessage, SIZEOF(wszAuthMessage), &dwAuthMessageSize) == FALSE) { // def auth message
+ lstrcpynW(wszAuthMessage, TranslateW(MRA_DEFAULT_AUTH_MESSAGE), SIZEOF(wszAuthMessage));
+ dwAuthMessageSize = lstrlenW(wszAuthMessage);
}
- for(hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
- {
- if (GetContactBasicInfoW(hContact,&dwID,NULL,NULL,NULL,NULL,szEMail,SIZEOF(szEMail),&dwEMailSize,NULL,0,NULL,NULL,0,NULL)==NO_ERROR)
- if (dwID==-1)
- {
- if (IsEMailChatAgent(szEMail,dwEMailSize))
- {// чат: ещё раз запросим авторизацию, пометим как видимый в списке, постоянный
- DBDeleteContactSetting(hContact,"CList","Hidden");
- DBDeleteContactSetting(hContact,"CList","NotOnList");
+ for (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) {
+ if (GetContactBasicInfoW(hContact, &dwID, NULL, NULL, NULL, NULL, szEMail, SIZEOF(szEMail), &dwEMailSize, NULL, 0, NULL, NULL, 0, NULL) == NO_ERROR)
+ if (dwID == -1) {
+ if (IsEMailChatAgent(szEMail, dwEMailSize)) {// чат: ещё раз запросим авторизацию, пометим как видимый в списке, постоянный
+ DBDeleteContactSetting(hContact, "CList", "Hidden");
+ DBDeleteContactSetting(hContact, "CList", "NotOnList");
SetExtraIcons(hContact);
- MraSetContactStatus(hContact,ID_STATUS_ONLINE);
+ MraSetContactStatus(hContact, ID_STATUS_ONLINE);
- lstrcpynW(szBuff,GetContactNameW(hContact),SIZEOF(szBuff));
- MraSendCommand_AddContactW(hContact,(CONTACT_FLAG_VISIBLE|CONTACT_FLAG_MULTICHAT|CONTACT_FLAG_UNICODE_NAME),-1,szEMail,dwEMailSize,szBuff,lstrlenW(szBuff),NULL,0,NULL,0,0);
- }else{
- if (DBGetContactSettingByte(hContact,"CList","NotOnList",0)==0)
- {// set extra icons and upload contact
+ lstrcpynW(szBuff, GetContactNameW(hContact), SIZEOF(szBuff));
+ MraAddContactW(hContact, (CONTACT_FLAG_VISIBLE|CONTACT_FLAG_MULTICHAT|CONTACT_FLAG_UNICODE_NAME), -1, szEMail, dwEMailSize, szBuff, lstrlenW(szBuff), NULL, 0, NULL, 0, 0);
+ }
+ else {
+ if (db_get_b(hContact, "CList", "NotOnList", 0) == 0) { // set extra icons and upload contact
SetExtraIcons(hContact);
- if (DB_Mra_GetByte(NULL,"AutoAddContactsToServer",MRA_DEFAULT_AUTO_ADD_CONTACTS_TO_SERVER))
- {//add all contacts to server
- GetContactBasicInfoW(hContact,NULL,&dwGroupID,NULL,NULL,NULL,NULL,0,NULL,wszNick,SIZEOF(wszNick),&dwNickSize,szPhones,SIZEOF(szPhones),&dwPhonesSize);
- MraSendCommand_AddContactW(hContact,(CONTACT_FLAG_VISIBLE|CONTACT_FLAG_UNICODE_NAME),dwGroupID,szEMail,dwEMailSize,wszNick,dwNickSize,szPhones,dwPhonesSize,wszAuthMessage,dwAuthMessageSize,0);
+ if (mraGetByte(NULL, "AutoAddContactsToServer", MRA_DEFAULT_AUTO_ADD_CONTACTS_TO_SERVER)) { //add all contacts to server
+ GetContactBasicInfoW(hContact, NULL, &dwGroupID, NULL, NULL, NULL, NULL, 0, NULL, wszNick, SIZEOF(wszNick), &dwNickSize, szPhones, SIZEOF(szPhones), &dwPhonesSize);
+ MraAddContactW(hContact, (CONTACT_FLAG_VISIBLE|CONTACT_FLAG_UNICODE_NAME), dwGroupID, szEMail, dwEMailSize, wszNick, dwNickSize, szPhones, dwPhonesSize, wszAuthMessage, dwAuthMessageSize, 0);
}
}
}
@@ -1741,116 +1539,108 @@ DWORD MraCommandDispather(mrim_packet_header_t *pmaHeader,DWORD *pdwPingPeriod,D
}
}
}
- }else{// контакт лист почемуто не получили
+ }
+ else { // контакт лист почемуто не получили
// всех в offline и id в нестандарт
- for(HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
- {// функция сама проверяет принадлежность контакта к MRA
- SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,(SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS),-1,-2,0,0,ID_STATUS_OFFLINE,NULL,0,NULL,0,NULL,0);
+ for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) {
+ SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS), -1, -2, 0, 0, ID_STATUS_OFFLINE, NULL, 0, NULL, 0, NULL, 0);
// request user info from server
MraUpdateContactInfo(hContact);
}
- if (dwTemp==GET_CONTACTS_ERROR)
- {// найденный контакт-лист некорректен
- ShowFormatedErrorMessage(L"MRIM_CS_CONTACT_LIST2: bad contact list",NO_ERROR);
- }else
- if (dwTemp==GET_CONTACTS_INTERR)
- {// произошла внутренняя ошибка
- ShowFormatedErrorMessage(L"MRIM_CS_CONTACT_LIST2: internal server error",NO_ERROR);
- }else{
- mir_sntprintf(szBuff,SIZEOF(szBuff),TranslateW(L"MRIM_CS_CONTACT_LIST2: unknown server error, code: %lu"),dwTemp);
- MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG,0,szBuff);
+ if (dwTemp == GET_CONTACTS_ERROR) // найденный контакт-лист некорректен
+ ShowFormattedErrorMessage(L"MRIM_CS_CONTACT_LIST2: bad contact list", NO_ERROR);
+ else if (dwTemp == GET_CONTACTS_INTERR) // произошла внутренняя ошибка
+ ShowFormattedErrorMessage(L"MRIM_CS_CONTACT_LIST2: internal server error", NO_ERROR);
+ else {
+ mir_sntprintf(szBuff, SIZEOF(szBuff), TranslateW(L"MRIM_CS_CONTACT_LIST2: unknown server error, code: %lu"), dwTemp);
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, szBuff);
}
}
break;
+
case MRIM_CS_SMS_ACK:
- dwTemp=GetUL(&lpbDataCurrent);
- if (MraSendQueueFind(masMraSettings.hSendQueueHandle,pmaHeader->seq,NULL,&hContact,&dwAckType,(LPBYTE*)&lpsString.lpszData,&lpsString.dwSize)==NO_ERROR)
- {
+ dwTemp = GetUL(&lpbDataCurrent);
+ if ( MraSendQueueFind(hSendQueueHandle, pmaHeader->seq, NULL, &hContact, &dwAckType, (LPBYTE*)&lpsString.lpszData, &lpsString.dwSize) == NO_ERROR) {
char szEMail[MAX_EMAIL_LEN];
LPSTR lpszPhone;
LPWSTR lpwszMessage;
- SIZE_T dwEMailSize,dwPhoneSize,dwMessageSize;
+ size_t dwEMailSize, dwPhoneSize, dwMessageSize;
- if (DB_Mra_GetStaticStringA(NULL,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- dwPhoneSize=(*(DWORD*)lpsString.lpszData);
- dwMessageSize=lpsString.dwSize-(dwPhoneSize+sizeof(DWORD)+2);
- lpszPhone=(lpsString.lpszData+sizeof(DWORD));
- lpwszMessage=(LPWSTR)(lpszPhone+dwPhoneSize+1);
+ if (mraGetStaticStringA(NULL, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize)) {
+ dwPhoneSize = (*(DWORD*)lpsString.lpszData);
+ dwMessageSize = lpsString.dwSize-(dwPhoneSize+sizeof(DWORD)+2);
+ lpszPhone = (lpsString.lpszData+sizeof(DWORD));
+ lpwszMessage = (LPWSTR)(lpszPhone+dwPhoneSize+1);
- dwTemp=mir_snprintf((LPSTR)szBuff,SIZEOF(szBuff),"<sms_response><source>Mail.ru</source><deliverable>Yes</deliverable><network>Mail.ru, Russia</network><message_id>%s-1-1955988055-%s</message_id><destination>%s</destination><messages_left>0</messages_left></sms_response>\r\n",szEMail,lpszPhone,lpszPhone);
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,NULL,dwAckType,ACKRESULT_SENTREQUEST,(HANDLE)pmaHeader->seq,(LPARAM)szBuff,dwTemp);
+ dwTemp = mir_snprintf((LPSTR)szBuff, SIZEOF(szBuff), "<sms_response><source>Mail.ru</source><deliverable>Yes</deliverable><network>Mail.ru, Russia</network><message_id>%s-1-1955988055-%s</message_id><destination>%s</destination><messages_left>0</messages_left></sms_response>\r\n", szEMail, lpszPhone, lpszPhone);
+ ProtoBroadcastAckAsynchEx(NULL, dwAckType, ACKRESULT_SENTREQUEST, (HANDLE)pmaHeader->seq, (LPARAM)szBuff, dwTemp);
}
- MEMFREE(lpsString.lpszData);
- MraSendQueueFree(masMraSettings.hSendQueueHandle,pmaHeader->seq);
- }else{// not found in queue
- MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG,0,TranslateW(L"MRIM_CS_SMS_ACK: not found in queue"));
+ mir_free(lpsString.lpszData);
+ MraSendQueueFree(hSendQueueHandle, pmaHeader->seq);
}
+ else MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, TranslateW(L"MRIM_CS_SMS_ACK: not found in queue"));
break;
+
case MRIM_CS_PROXY:
{
DWORD dwIDRequest;
- MRA_LPS lpsAddreses={0};
+ MRA_LPS lpsAddreses = {0};
MRA_GUID mguidSessionID;
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsEMail);// LPS to
- dwIDRequest=GetUL(&lpbDataCurrent);// DWORD id_request
- dwAckType=GetUL(&lpbDataCurrent);// DWORD data_type
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);// LPS user_data
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsAddreses);// LPS lps_ip_port
- mguidSessionID=GetGUID(&lpbDataCurrent);// DWORD session_id[4]
-
- if (dwAckType==MRIM_PROXY_TYPE_FILES)
- {// файлы, on file recv
- if (MraMrimProxySetData(MraFilesQueueItemProxyByID(masMraSettings.hFilesQueueHandle,dwIDRequest),lpsEMail.lpszData,lpsEMail.dwSize,dwIDRequest,dwAckType,lpsString.lpszData,lpsString.dwSize,lpsAddreses.lpszData,lpsAddreses.dwSize,&mguidSessionID)==NO_ERROR)
- {// сессия передачи ещё жива/proxy enabled// set proxy info to file transfer context
- MraFilesQueueStartMrimProxy(masMraSettings.hFilesQueueHandle,dwIDRequest);
- }else{// дохлая сессия/не существующая
- MraSendCommand_ProxyAck(PROXY_STATUS_ERROR,lpsEMail.lpszData,lpsEMail.dwSize,dwIDRequest,dwAckType,lpsString.lpszData,lpsString.dwSize,lpsAddreses.lpszData,lpsAddreses.dwSize,mguidSessionID);
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsEMail);// LPS to
+ dwIDRequest = GetUL(&lpbDataCurrent);// DWORD id_request
+ dwAckType = GetUL(&lpbDataCurrent);// DWORD data_type
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);// LPS user_data
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsAddreses);// LPS lps_ip_port
+ mguidSessionID = GetGUID(&lpbDataCurrent);// DWORD session_id[4]
+
+ if (dwAckType == MRIM_PROXY_TYPE_FILES) { // файлы, on file recv
+ // set proxy info to file transfer context
+ if ( !MraMrimProxySetData(MraFilesQueueItemProxyByID(hFilesQueueHandle, dwIDRequest), lpsEMail.lpszData, lpsEMail.dwSize, dwIDRequest, dwAckType, lpsString.lpszData, lpsString.dwSize, lpsAddreses.lpszData, lpsAddreses.dwSize, &mguidSessionID))
+ MraFilesQueueStartMrimProxy(hFilesQueueHandle, dwIDRequest);
+ else { // empty/invalid session
+ MraProxyAck(PROXY_STATUS_ERROR, lpsEMail.lpszData, lpsEMail.dwSize, dwIDRequest, dwAckType, lpsString.lpszData, lpsString.dwSize, lpsAddreses.lpszData, lpsAddreses.dwSize, mguidSessionID);
DebugBreak();
}
}
- //DebugBreak();
}
break;
+
case MRIM_CS_PROXY_ACK:
{
DWORD dwIDRequest;
HANDLE hMraMrimProxyData;
- MRA_LPS lpsAddreses={0};
+ MRA_LPS lpsAddreses = {0};
MRA_GUID mguidSessionID;
- dwTemp=GetUL(&lpbDataCurrent);// DWORD status
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsEMail);// LPS to
- dwIDRequest=GetUL(&lpbDataCurrent);// DWORD id_request
- dwAckType=GetUL(&lpbDataCurrent);// DWORD data_type
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);// LPS user_data
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsAddreses);// LPS lps_ip_port
- mguidSessionID=GetGUID(&lpbDataCurrent);// DWORD session_id[4]
-
- if (dwAckType==MRIM_PROXY_TYPE_FILES)
- {// файлы, on file send
- if ((hMraMrimProxyData=MraFilesQueueItemProxyByID(masMraSettings.hFilesQueueHandle,dwIDRequest)))
- {// сессия передачи ещё жива/proxy enabled
- switch(dwTemp){
+ dwTemp = GetUL(&lpbDataCurrent);// DWORD status
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsEMail);// LPS to
+ dwIDRequest = GetUL(&lpbDataCurrent);// DWORD id_request
+ dwAckType = GetUL(&lpbDataCurrent);// DWORD data_type
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);// LPS user_data
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsAddreses);// LPS lps_ip_port
+ mguidSessionID = GetGUID(&lpbDataCurrent);// DWORD session_id[4]
+
+ if (dwAckType == MRIM_PROXY_TYPE_FILES) { // on file send
+ if ((hMraMrimProxyData = MraFilesQueueItemProxyByID(hFilesQueueHandle, dwIDRequest))) {
+ switch (dwTemp) {
case PROXY_STATUS_DECLINE:
- MraFilesQueueCancel(masMraSettings.hFilesQueueHandle,dwIDRequest,FALSE);
+ MraFilesQueueCancel(hFilesQueueHandle, dwIDRequest, FALSE);
break;
case PROXY_STATUS_OK:
- if (MraMrimProxySetData(hMraMrimProxyData,lpsEMail.lpszData,lpsEMail.dwSize,dwIDRequest,dwAckType,lpsString.lpszData,lpsString.dwSize,lpsAddreses.lpszData,lpsAddreses.dwSize,&mguidSessionID)==NO_ERROR)
- {// set proxy info to file transfer context
- MraFilesQueueStartMrimProxy(masMraSettings.hFilesQueueHandle,dwIDRequest);
- }
+ // set proxy info to file transfer context
+ if ( !MraMrimProxySetData(hMraMrimProxyData, lpsEMail.lpszData, lpsEMail.dwSize, dwIDRequest, dwAckType, lpsString.lpszData, lpsString.dwSize, lpsAddreses.lpszData, lpsAddreses.dwSize, &mguidSessionID))
+ MraFilesQueueStartMrimProxy(hFilesQueueHandle, dwIDRequest);
break;
case PROXY_STATUS_ERROR:
- ShowFormatedErrorMessage(L"Proxy File transfer: error",NO_ERROR);
- MraFilesQueueCancel(masMraSettings.hFilesQueueHandle,dwIDRequest,FALSE);
+ ShowFormattedErrorMessage(L"Proxy File transfer: error", NO_ERROR);
+ MraFilesQueueCancel(hFilesQueueHandle, dwIDRequest, FALSE);
break;
case PROXY_STATUS_INCOMPATIBLE_VERS:
- ShowFormatedErrorMessage(L"Proxy File transfer: incompatible versions",NO_ERROR);
- MraFilesQueueCancel(masMraSettings.hFilesQueueHandle,dwIDRequest,FALSE);
+ ShowFormattedErrorMessage(L"Proxy File transfer: incompatible versions", NO_ERROR);
+ MraFilesQueueCancel(hFilesQueueHandle, dwIDRequest, FALSE);
break;
case PROXY_STATUS_NOHARDWARE:
case PROXY_STATUS_MIRROR:
@@ -1859,723 +1649,573 @@ DWORD MraCommandDispather(mrim_packet_header_t *pmaHeader,DWORD *pdwPingPeriod,D
DebugBreak();
break;
}
- }else{// дохлая сессия/не существующая
- DebugBreak();
}
+ else DebugBreak();
}
-
- /*if (dwTemp!=2)
- if ((hContact=MraHContactFromEmail(lpsEMail.lpszData,lpsEMail.dwSize,FALSE,TRUE,NULL)))
- if (MraGetContactStatus(hContact)==ID_STATUS_OFFLINE)
- {
- MraSetContactStatus(hContact,ID_STATUS_INVISIBLE);
- }*/
-
- //DebugBreak();
}
break;
+
case MRIM_CS_PROXY_HELLO:
// DWORD[4] Session_id
DebugBreak();
break;
+
case MRIM_CS_PROXY_HELLO_ACK:
DebugBreak();
break;
+
case MRIM_CS_NEW_MAIL:
{
- DWORD dwDate,dwUIDL;
+ DWORD dwDate, dwUIDL;
- dwTemp=GetUL(&lpbDataCurrent);// UL unread count
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsEMail);// LPS from
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);// LPS subject
- dwDate=GetUL(&lpbDataCurrent);// UL date
- dwUIDL=GetUL(&lpbDataCurrent);// UL uidl
+ dwTemp = GetUL(&lpbDataCurrent);// UL unread count
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsEMail);// LPS from
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);// LPS subject
+ dwDate = GetUL(&lpbDataCurrent);// UL date
+ dwUIDL = GetUL(&lpbDataCurrent);// UL uidl
- if (dwTemp > masMraSettings.dwEmailMessagesTotal) masMraSettings.dwEmailMessagesTotal+=(dwTemp-masMraSettings.dwEmailMessagesUnRead);
+ if (dwTemp > dwEmailMessagesTotal)
+ dwEmailMessagesTotal += (dwTemp-dwEmailMessagesUnread);
- dwAckType=masMraSettings.dwEmailMessagesUnRead;// save old value
- masMraSettings.dwEmailMessagesUnRead=dwTemp;// store new value
- if (DB_Mra_GetByte(NULL,"IncrementalNewMailNotify",MRA_DEFAULT_INC_NEW_MAIL_NOTIFY)==0 || dwAckType<dwTemp || dwTemp==0)
- {
- MraUpdateEmailStatus(lpsEMail.lpszData,lpsEMail.dwSize,lpsString.lpszData,lpsString.dwSize,dwDate,dwUIDL);
- }
+ dwAckType = dwEmailMessagesUnread;// save old value
+ dwEmailMessagesUnread = dwTemp;// store new value
+ if (mraGetByte(NULL, "IncrementalNewMailNotify", MRA_DEFAULT_INC_NEW_MAIL_NOTIFY) == 0 || dwAckType<dwTemp || dwTemp == 0)
+ MraUpdateEmailStatus(lpsEMail.lpszData, lpsEMail.dwSize, lpsString.lpszData, lpsString.dwSize, dwDate, dwUIDL);
}
break;
+
case MRIM_CS_USER_BLOG_STATUS:
{
- DWORD dwTime,dwFlags;
+ DWORD dwTime, dwFlags;
MRA_LPS lpsText;
- LPBYTE lpbBuff=NULL;
+ LPBYTE lpbBuff = NULL;
DWORDLONG dwBlogStatusID;
- dwFlags=GetUL(&lpbDataCurrent);// UL flags
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsEMail);// LPS user
- dwBlogStatusID=GetUIDL(&lpbDataCurrent);// UINT64 id
- dwTime=GetUL(&lpbDataCurrent);// UL time
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsText);// LPS text (MRIM_BLOG_STATUS_MUSIC: track)
- GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);// LPS reply_user_nick
-
- if ((hContact=MraHContactFromEmail(lpsEMail.lpszData,lpsEMail.dwSize,FALSE,TRUE,NULL)))
- {
- if (dwFlags&MRIM_BLOG_STATUS_MUSIC)
- {
- DB_Mra_SetLPSStringW(hContact,DBSETTING_BLOGSTATUSMUSIC,&lpsText);
- }else{
- DB_Mra_SetDword(hContact,DBSETTING_BLOGSTATUSTIME,dwTime);
- DB_Mra_WriteContactSettingBlob(hContact,DBSETTING_BLOGSTATUSID,&dwBlogStatusID,sizeof(DWORDLONG));
- DB_Mra_SetLPSStringW(hContact,DBSETTING_BLOGSTATUS,&lpsText);
+ dwFlags = GetUL(&lpbDataCurrent);// UL flags
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsEMail);// LPS user
+ dwBlogStatusID = GetUIDL(&lpbDataCurrent);// UINT64 id
+ dwTime = GetUL(&lpbDataCurrent);// UL time
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsText);// LPS text (MRIM_BLOG_STATUS_MUSIC: track)
+ GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsString);// LPS reply_user_nick
+
+ if ((hContact = MraHContactFromEmail(lpsEMail.lpszData, lpsEMail.dwSize, FALSE, TRUE, NULL))) {
+ if (dwFlags & MRIM_BLOG_STATUS_MUSIC)
+ mraSetLPSStringW(hContact, DBSETTING_BLOGSTATUSMUSIC, &lpsText);
+ else {
+ mraSetDword(hContact, DBSETTING_BLOGSTATUSTIME, dwTime);
+ mraWriteContactSettingBlob(hContact, DBSETTING_BLOGSTATUSID, &dwBlogStatusID, sizeof(DWORDLONG));
+ mraSetLPSStringW(hContact, DBSETTING_BLOGSTATUS, &lpsText);
}
}
}
break;
case MRIM_CS_UNKNOWN:
- /*{
- BYTE btBuff[8192]={0};
- memmove(btBuff,lpbData,dwDataSize);
- DebugBreak();
- }*/
- break;
case MRIM_CS_USER_GEO:
- /*{
- BYTE btBuff[8192]={0};
- memmove(btBuff,lpbData,dwDataSize);
- DebugBreak();
- }*/
- break;
case MRIM_CS_SERVER_SETTINGS:
- /*{
- BYTE btBuff[8192]={0};
- memmove(btBuff,lpbData,dwDataSize);
- DebugBreak();
- }*/
break;
- default:
-#ifdef _DEBUG
- /*{
- HANDLE hFile=CreateFile("C:\\Documents and Settings\\Ivan\\Рабочий стол\\MRIM_CS_CONTACT_LIST2.txt",GENERIC_WRITE,FILE_SHARE_READ,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
- if (hFile!=INVALID_HANDLE_VALUE)
- {
- WriteFile(hFile,lpbData,dwDataSize,&dwTemp,NULL);
- CloseHandle(hFile);
- }
- }//*/
- {
- BYTE btBuff[8192]={0};
- memmove(btBuff,lpbData,dwDataSize);
+ default:
+ #ifdef _DEBUG
+ BYTE btBuff[8192] = {0};
+ memmove(btBuff, lpbData, dwDataSize);
DebugBreak();
- }
-#endif
+ #endif
break;
}
-return(0);
+ return 0;
}
-
-DWORD MraRecvCommand_Message(DWORD dwTime,DWORD dwFlags,MRA_LPS *plpsFrom,MRA_LPS *plpsText,MRA_LPS *plpsRFTText,MRA_LPS *plpsMultiChatData)
+DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, MRA_LPS *plpsFrom, MRA_LPS *plpsText, MRA_LPS *plpsRFTText, MRA_LPS *plpsMultiChatData)
{// Сообщение
BOOL bAdded;
- DWORD dwRetErrorCode=NO_ERROR,dwBackColour;
- LPSTR lpszMessageExt=NULL;
- LPWSTR lpwszMessage=NULL;
- SIZE_T dwMessageSize=0,dwMessageExtSize=0;
- CCSDATA ccs={0};
- PROTORECVEVENT pre={0};
+ DWORD dwRetErrorCode = NO_ERROR, dwBackColour;
+ LPSTR lpszMessageExt = NULL;
+ LPWSTR lpwszMessage = NULL;
+ size_t dwMessageSize = 0, dwMessageExtSize = 0;
+ CCSDATA ccs = {0};
+ PROTORECVEVENT pre = {0};
- //ccs.wParam=0;
- ccs.lParam=(LPARAM)&pre;
- pre.timestamp=dwTime;
+ //ccs.wParam = 0;
+ ccs.lParam = (LPARAM)&pre;
+ pre.timestamp = dwTime;
// check flags and datas
- if (dwFlags&MESSAGE_FLAG_RTF)
- {
- if (plpsRFTText)
- {
- if (plpsRFTText->lpszData==NULL || plpsRFTText->dwSize==0) dwFlags&=~MESSAGE_FLAG_RTF;
- }else{
- dwFlags&=~MESSAGE_FLAG_RTF;
+ if (dwFlags & MESSAGE_FLAG_RTF) {
+ if (plpsRFTText) {
+ if (plpsRFTText->lpszData == NULL || plpsRFTText->dwSize == 0)
+ dwFlags &= ~MESSAGE_FLAG_RTF;
}
+ else dwFlags &= ~MESSAGE_FLAG_RTF;
}
- if (dwFlags&MESSAGE_FLAG_MULTICHAT)
- {
- if (plpsMultiChatData)
- {
- if (plpsMultiChatData->lpszData==NULL || plpsMultiChatData->dwSize==0) dwFlags&=~MESSAGE_FLAG_MULTICHAT;
- }else{
- dwFlags&=~MESSAGE_FLAG_MULTICHAT;
+ if (dwFlags & MESSAGE_FLAG_MULTICHAT) {
+ if (plpsMultiChatData) {
+ if (plpsMultiChatData->lpszData == NULL || plpsMultiChatData->dwSize == 0)
+ dwFlags &= ~MESSAGE_FLAG_MULTICHAT;
}
+ else dwFlags &= ~MESSAGE_FLAG_MULTICHAT;
}
-
// pre processing - extracting/decoding
- if (dwFlags&MESSAGE_FLAG_AUTHORIZE)
- {// extract auth message из обычного текста
- SIZE_T dwAuthPartsCount,dwAuthBuffSize=(plpsText->dwSize+32),dwAuthDataSize;
- LPBYTE lpbAuthData,lpbDataCurrent;
- MRA_LPS lpsAuthFrom,lpsAuthMessage;
-
- lpbAuthData=(LPBYTE)MEMALLOC(dwAuthBuffSize);
- if (lpbAuthData)
- {
- BASE64DecodeFormated(plpsText->lpszData,plpsText->dwSize,lpbAuthData,dwAuthBuffSize,&dwAuthDataSize);
-
- lpbDataCurrent=lpbAuthData;
- dwAuthPartsCount=GetUL(&lpbDataCurrent);
- if (GetLPS(lpbAuthData,dwAuthDataSize,&lpbDataCurrent,&lpsAuthFrom)==NO_ERROR)
- if (GetLPS(lpbAuthData,dwAuthDataSize,&lpbDataCurrent,&lpsAuthMessage)==NO_ERROR)
- {
- if (dwFlags&MESSAGE_FLAG_v1p16 && (dwFlags&MESSAGE_FLAG_CP1251)==0)
- {// unicode text
- memmove(lpbAuthData,lpsAuthMessage.lpszData,lpsAuthMessage.dwSize);
- lpwszMessage=(LPWSTR)lpbAuthData;
- dwMessageSize=(lpsAuthMessage.dwSize/sizeof(WCHAR));
- }else{// преобразуем в юникод текст только если он в АНСИ и если это не Флэш мультик и будильник тоже не нуждается в этом
- lpwszMessage=(LPWSTR)MEMALLOC(((lpsAuthMessage.dwSize+MAX_PATH)*sizeof(WCHAR)));
- if (lpwszMessage)
- {
- dwMessageSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpsAuthMessage.lpszData,lpsAuthMessage.dwSize,lpwszMessage,(lpsAuthMessage.dwSize+MAX_PATH));
- (*(lpwszMessage+dwMessageSize))=0;
- }else{// не удалось выделить память
- dwRetErrorCode=GetLastError();
+ if (dwFlags & MESSAGE_FLAG_AUTHORIZE) { // extract auth message из обычного текста
+ size_t dwAuthPartsCount, dwAuthBuffSize = (plpsText->dwSize+32), dwAuthDataSize;
+ LPBYTE lpbAuthData, lpbDataCurrent;
+ MRA_LPS lpsAuthFrom, lpsAuthMessage;
+
+ lpbAuthData = (LPBYTE)mir_calloc(dwAuthBuffSize);
+ if (lpbAuthData) {
+ BASE64DecodeFormated(plpsText->lpszData, plpsText->dwSize, lpbAuthData, dwAuthBuffSize, &dwAuthDataSize);
+
+ lpbDataCurrent = lpbAuthData;
+ dwAuthPartsCount = GetUL(&lpbDataCurrent);
+ if ( !GetLPS(lpbAuthData, dwAuthDataSize, &lpbDataCurrent, &lpsAuthFrom))
+ if ( !GetLPS(lpbAuthData, dwAuthDataSize, &lpbDataCurrent, &lpsAuthMessage)) {
+ if (dwFlags&MESSAGE_FLAG_v1p16 && (dwFlags&MESSAGE_FLAG_CP1251) == 0) { // unicode text
+ memmove(lpbAuthData, lpsAuthMessage.lpszData, lpsAuthMessage.dwSize);
+ lpwszMessage = (LPWSTR)lpbAuthData;
+ dwMessageSize = (lpsAuthMessage.dwSize/sizeof(WCHAR));
+ }
+ else { // преобразуем в юникод текст только если он в АНСИ и если это не Флэш мультик и будильник тоже не нуждается в этом
+ lpwszMessage = (LPWSTR)mir_calloc(((lpsAuthMessage.dwSize+MAX_PATH)*sizeof(WCHAR)));
+ if (lpwszMessage) {
+ dwMessageSize = MultiByteToWideChar(MRA_CODE_PAGE, 0, lpsAuthMessage.lpszData, lpsAuthMessage.dwSize, lpwszMessage, (lpsAuthMessage.dwSize+MAX_PATH));
+ (*(lpwszMessage+dwMessageSize)) = 0;
}
+ else dwRetErrorCode = GetLastError();
}
}
- if (lpwszMessage!=(LPWSTR)lpbAuthData) MEMFREE(lpbAuthData);
+ if (lpwszMessage != (LPWSTR)lpbAuthData)
+ mir_free(lpbAuthData);
}
- }else{
- /*// пупер затычка
- if (dwFlags&MESSAGE_FLAG_v1p16 && dwFlags&MESSAGE_FLAG_CP1251)
- {// и какая же кодировка у текста...мммм...бум гадать!
- DebugPrintW(L"Unknown message encoding: ");
- if (MemoryFindByte(0,plpsText->lpszData,(plpsText->dwSize-1),0))
- {//ооо похоже это юникод!
- dwFlags&=~MESSAGE_FLAG_CP1251;
- DebugPrintCRLFW(plpsText->lpwszData);
- }else{// наверное анси
- dwFlags&=~MESSAGE_FLAG_v1p16;
- DebugPrintCRLFA(plpsText->lpszData);
- }
- }*/
-
- if (dwFlags&(MESSAGE_FLAG_ALARM|MESSAGE_FLAG_FLASH|MESSAGE_FLAG_v1p16) && (dwFlags&MESSAGE_FLAG_CP1251)==0)
- {// unicode text
- lpwszMessage=plpsText->lpwszData;
- dwMessageSize=(plpsText->dwSize/sizeof(WCHAR));
- }else{// преобразуем в юникод текст только если он в АНСИ и если это не Флэш мультик и будильник тоже не нуждается в этом
- lpwszMessage=(LPWSTR)MEMALLOC(((plpsText->dwSize+MAX_PATH)*sizeof(WCHAR)));
- if (lpwszMessage)
- {
- dwMessageSize=MultiByteToWideChar(MRA_CODE_PAGE,0,plpsText->lpszData,plpsText->dwSize,lpwszMessage,(plpsText->dwSize+MAX_PATH));
- (*(lpwszMessage+dwMessageSize))=0;
- }else{// не удалось выделить память
- dwRetErrorCode=GetLastError();
+ }
+ else {
+ // unicode text
+ if ((dwFlags & (MESSAGE_FLAG_ALARM|MESSAGE_FLAG_FLASH|MESSAGE_FLAG_v1p16)) && (dwFlags & MESSAGE_FLAG_CP1251) == 0) {
+ lpwszMessage = plpsText->lpwszData;
+ dwMessageSize = (plpsText->dwSize/sizeof(WCHAR));
+ }
+ else {
+ lpwszMessage = (LPWSTR)mir_calloc(((plpsText->dwSize+MAX_PATH)*sizeof(WCHAR)));
+ if (lpwszMessage) {
+ dwMessageSize = MultiByteToWideChar(MRA_CODE_PAGE, 0, plpsText->lpszData, plpsText->dwSize, lpwszMessage, (plpsText->dwSize+MAX_PATH));
+ (*(lpwszMessage+dwMessageSize)) = 0;
}
+ else dwRetErrorCode = GetLastError();
}
- if (dwFlags&(MESSAGE_FLAG_CONTACT|MESSAGE_FLAG_NOTIFY|MESSAGE_FLAG_SMS|MESSAGE_SMS_DELIVERY_REPORT|MESSAGE_FLAG_ALARM))
- {
- // ничего не делаем, сообщение не содержит расширенной части или её содержимое игнорируется
- }else{
- if ((dwFlags&MESSAGE_FLAG_RTF) && plpsRFTText) //MESSAGE_FLAG_FLASH there
+ if (dwFlags & (MESSAGE_FLAG_CONTACT|MESSAGE_FLAG_NOTIFY|MESSAGE_FLAG_SMS|MESSAGE_SMS_DELIVERY_REPORT|MESSAGE_FLAG_ALARM))
+ ; // do nothing; there's no extra part in a message
+ else {
+ if ((dwFlags & MESSAGE_FLAG_RTF) && plpsRFTText) //MESSAGE_FLAG_FLASH there
if (masMraSettings.lpfnUncompress)// only if uncompress function exist
- if (plpsRFTText->lpszData && plpsRFTText->dwSize)
- {// decode RTF
- SIZE_T dwRTFPartsCount,dwCompressedSize,dwRFTBuffSize=((plpsRFTText->dwSize*16)+8192),dwRTFDataSize;
- LPBYTE lpbRTFData,lpbCompressed,lpbDataCurrent;
- MRA_LPS lpsRTFString,lpsBackColour,lpsString;
-
- lpbRTFData=(LPBYTE)MEMALLOC(dwRFTBuffSize);
- lpbCompressed=(LPBYTE)MEMALLOC((plpsRFTText->dwSize+32));
- if (lpbRTFData && lpbCompressed)
- {
- BASE64DecodeFormated(plpsRFTText->lpszData,plpsRFTText->dwSize,lpbCompressed,(plpsRFTText->dwSize+32),&dwCompressedSize);
- dwRTFDataSize=dwRFTBuffSize;
- if ((PUNCOMPRESS(masMraSettings.lpfnUncompress))(lpbRTFData,(DWORD*)&dwRTFDataSize,lpbCompressed,dwCompressedSize)==Z_OK)
- {
- lpbDataCurrent=lpbRTFData;
- dwRTFPartsCount=GetUL(&lpbDataCurrent);// колличество частей в некоторых случаях больше 2, тогда нужно игнорировать первый текст, тк там сообщения об ущербности
- if (GetLPS(lpbRTFData,dwRTFDataSize,&lpbDataCurrent,&lpsRTFString)==NO_ERROR)
- if (GetLPS(lpbRTFData,dwRTFDataSize,&lpbDataCurrent,&lpsBackColour)==NO_ERROR)
- {
- dwBackColour=(*(DWORD*)lpsBackColour.lpszData);
- if (dwFlags&MESSAGE_FLAG_FLASH)
- {// Флэш мультик в обычный текст// затирем lpwszMessage=plpsText->lpwszData, тк там затычка с текстом об ущербности
- if (dwRTFPartsCount==3)
- {// только анси текст с мультиком
- DebugBreak();// наверное это уже не должно приходить, ну разве что от совсем старых клиентов, 2008
- GetLPS(lpbRTFData,dwRTFDataSize,&lpbDataCurrent,&lpsString);
- lpwszMessage=(LPWSTR)MEMALLOC(((lpsString.dwSize+MAX_PATH)*sizeof(WCHAR)));
- if (lpwszMessage)
- {
- memmove(lpwszMessage,lpsString.lpszData,lpsString.dwSize);
- dwMessageSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpsString.lpszData,lpsString.dwSize,lpwszMessage,(lpsString.dwSize+MAX_PATH));
- (*(lpwszMessage+dwMessageSize))=0;
- }else{// не удалось выделить память
- dwRetErrorCode=GetLastError();
+ if (plpsRFTText->lpszData && plpsRFTText->dwSize) { // decode RTF
+ size_t dwRTFPartsCount, dwCompressedSize, dwRFTBuffSize = ((plpsRFTText->dwSize*16)+8192), dwRTFDataSize;
+ LPBYTE lpbRTFData, lpbCompressed, lpbDataCurrent;
+ MRA_LPS lpsRTFString, lpsBackColour, lpsString;
+
+ lpbRTFData = (LPBYTE)mir_calloc(dwRFTBuffSize);
+ lpbCompressed = (LPBYTE)mir_calloc((plpsRFTText->dwSize+32));
+ if (lpbRTFData && lpbCompressed) {
+ BASE64DecodeFormated(plpsRFTText->lpszData, plpsRFTText->dwSize, lpbCompressed, (plpsRFTText->dwSize+32), &dwCompressedSize);
+ dwRTFDataSize = dwRFTBuffSize;
+ if ((PUNCOMPRESS(masMraSettings.lpfnUncompress))(lpbRTFData, (DWORD*)&dwRTFDataSize, lpbCompressed, dwCompressedSize) == Z_OK) {
+ lpbDataCurrent = lpbRTFData;
+ dwRTFPartsCount = GetUL(&lpbDataCurrent);// колличество частей в некоторых случаях больше 2, тогда нужно игнорировать первый текст, тк там сообщения об ущербности
+ if (GetLPS(lpbRTFData, dwRTFDataSize, &lpbDataCurrent, &lpsRTFString) == NO_ERROR)
+ if (GetLPS(lpbRTFData, dwRTFDataSize, &lpbDataCurrent, &lpsBackColour) == NO_ERROR) {
+ dwBackColour = (*(DWORD*)lpsBackColour.lpszData);
+ if (dwFlags & MESSAGE_FLAG_FLASH) {
+ if (dwRTFPartsCount == 3) { // ansi text only
+ GetLPS(lpbRTFData, dwRTFDataSize, &lpbDataCurrent, &lpsString);
+ lpwszMessage = (LPWSTR)mir_calloc(((lpsString.dwSize+MAX_PATH)*sizeof(WCHAR)));
+ if (lpwszMessage) {
+ memmove(lpwszMessage, lpsString.lpszData, lpsString.dwSize);
+ dwMessageSize = MultiByteToWideChar(MRA_CODE_PAGE, 0, lpsString.lpszData, lpsString.dwSize, lpwszMessage, (lpsString.dwSize+MAX_PATH));
+ (*(lpwszMessage+dwMessageSize)) = 0;
}
- }else
- if (dwRTFPartsCount==4)
- {
- GetLPS(lpbRTFData,dwRTFDataSize,&lpbDataCurrent,&lpsString);
- GetLPS(lpbRTFData,dwRTFDataSize,&lpbDataCurrent,&lpsString);
- lpwszMessage=(LPWSTR)MEMALLOC(lpsString.dwSize);
- if (lpwszMessage)
- {
- memmove(lpwszMessage,lpsString.lpszData,lpsString.dwSize);
- dwMessageSize=lpsString.dwSize;
- }else{// не удалось выделить память
- dwRetErrorCode=GetLastError();
+ else dwRetErrorCode = GetLastError();
+ }
+ else if (dwRTFPartsCount == 4) {
+ GetLPS(lpbRTFData, dwRTFDataSize, &lpbDataCurrent, &lpsString);
+ GetLPS(lpbRTFData, dwRTFDataSize, &lpbDataCurrent, &lpsString);
+ lpwszMessage = (LPWSTR)mir_calloc(lpsString.dwSize);
+ if (lpwszMessage) {
+ memmove(lpwszMessage, lpsString.lpszData, lpsString.dwSize);
+ dwMessageSize = lpsString.dwSize;
}
- }else{
- DebugBreak();
+ else dwRetErrorCode = GetLastError();
}
- }else{// РТФ текст
- if (dwRTFPartsCount>2)
- {
- GetLPS(lpbRTFData,dwRTFDataSize,&lpbDataCurrent,&lpsString);
+ else DebugBreak();
+ }
+ else { // RTF text
+ if (dwRTFPartsCount > 2) {
+ GetLPS(lpbRTFData, dwRTFDataSize, &lpbDataCurrent, &lpsString);
DebugBreak();
}
- lpszMessageExt=(LPSTR)MEMALLOC(lpsRTFString.dwSize);
- if (lpszMessageExt)
- {
- memmove(lpszMessageExt,lpsRTFString.lpszData,lpsRTFString.dwSize);
- dwMessageExtSize=lpsRTFString.dwSize;
- }else{// не удалось выделить память
- //dwRetErrorCode=GetLastError(); // не смертельно!
- DebugBreak();
+ lpszMessageExt = (LPSTR)mir_calloc(lpsRTFString.dwSize);
+ if (lpszMessageExt) {
+ memmove(lpszMessageExt, lpsRTFString.lpszData, lpsRTFString.dwSize);
+ dwMessageExtSize = lpsRTFString.dwSize;
}
+ else DebugBreak();
}
}
- }else{
- MEMFREE(lpszMessageExt);
- dwMessageExtSize=0;
+ }else {
+ mir_free(lpszMessageExt);
+ dwMessageExtSize = 0;
DebugBreak();
}
}
- MEMFREE(lpbCompressed);
- MEMFREE(lpbRTFData);
+ mir_free(lpbCompressed);
+ mir_free(lpbRTFData);
}
}
}
-
// processing
- if (dwRetErrorCode==NO_ERROR)
- if (MraAntiSpamReceivedMessageW(plpsFrom->lpszData,plpsFrom->dwSize,dwFlags,lpwszMessage,dwMessageSize)==MESSAGE_NOT_SPAM)
- {
- if (dwFlags&(MESSAGE_FLAG_SMS|MESSAGE_SMS_DELIVERY_REPORT))
- {// SMS //if (IsPhone(plpsFrom->lpszData,plpsFrom->dwSize))
- char szPhone[MAX_EMAIL_LEN],szEMail[MAX_EMAIL_LEN],szTime[MAX_PATH];
- LPSTR lpszMessageUTF,lpszBuff;
+ if (dwRetErrorCode == NO_ERROR)
+ if (MraAntiSpamReceivedMessageW(plpsFrom->lpszData, plpsFrom->dwSize, dwFlags, lpwszMessage, dwMessageSize) == MESSAGE_NOT_SPAM) {
+ if (dwFlags & (MESSAGE_FLAG_SMS | MESSAGE_SMS_DELIVERY_REPORT)) {// SMS //if (IsPhone(plpsFrom->lpszData, plpsFrom->dwSize))
+ char szPhone[MAX_EMAIL_LEN], szEMail[MAX_EMAIL_LEN], szTime[MAX_PATH];
+ LPSTR lpszMessageUTF, lpszBuff;
LPWSTR lpwszMessageXMLEncoded;
- SIZE_T dwBuffLen,dwMessageXMLEncodedSize;
+ size_t dwBuffLen, dwMessageXMLEncodedSize;
INTERNET_TIME itTime;
- dwBuffLen=((dwMessageSize+MAX_PATH)*6);
- lpszMessageUTF=(LPSTR)MEMALLOC(dwBuffLen);
- lpwszMessageXMLEncoded=(LPWSTR)MEMALLOC((dwBuffLen*sizeof(WCHAR)));
- if (lpszMessageUTF && lpwszMessageXMLEncoded)
- {
+ dwBuffLen = ((dwMessageSize+MAX_PATH)*6);
+ lpszMessageUTF = (LPSTR)mir_calloc(dwBuffLen);
+ lpwszMessageXMLEncoded = (LPWSTR)mir_calloc((dwBuffLen*sizeof(WCHAR)));
+ if (lpszMessageUTF && lpwszMessageXMLEncoded) {
InternetTimeGetCurrentTime(&itTime);
- InternetTimeGetString(&itTime,szTime,SIZEOF(szTime),NULL);
- CopyNumber(szPhone,plpsFrom->lpszData,plpsFrom->dwSize);
- DB_Mra_GetStaticStringA(NULL,"e-mail",szEMail,SIZEOF(szEMail),NULL);
-
- EncodeXML(lpwszMessage,dwMessageSize,lpwszMessageXMLEncoded,dwBuffLen,&dwMessageXMLEncodedSize);
- WideCharToMultiByte(CP_UTF8,0,lpwszMessageXMLEncoded,dwMessageXMLEncodedSize,lpszMessageUTF,dwBuffLen,NULL,NULL);
- lpszBuff=(LPSTR)lpwszMessageXMLEncoded;
-
- if (dwFlags&MESSAGE_SMS_DELIVERY_REPORT)
- {// отчёт о неудаче доставки смс
- dwBuffLen=mir_snprintf(lpszBuff,(dwBuffLen*sizeof(WCHAR)),"<sms_delivery_receipt><message_id>%s-1-1955988055-%s</message_id><destination>%s</destination><delivered>No</delivered><submition_time>%s</submition_time><error_code>0</error_code><error><id>15</id><params><param>%s</param></params></error></sms_delivery_receipt>",szEMail,szPhone,szPhone,szTime,lpszMessageUTF);
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,NULL,ICQACKTYPE_SMS,ACKRESULT_FAILED,(HANDLE)0,(LPARAM)lpszBuff,dwBuffLen);
- }else{// новое смс!!!
- dwBuffLen=mir_snprintf(lpszBuff,(dwBuffLen*sizeof(WCHAR)),"<sms_message><source>Mail.ru</source><destination_UIN>%s</destination_UIN><sender>%s</sender><senders_network>Mail.ru</senders_network><text>%s</text><time>%s</time></sms_message>",szEMail,szPhone,lpszMessageUTF,szTime);
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,NULL,ICQACKTYPE_SMS,ACKRESULT_SUCCESS,(HANDLE)0,(LPARAM)lpszBuff,dwBuffLen);
+ InternetTimeGetString(&itTime, szTime, SIZEOF(szTime), NULL);
+ CopyNumber(szPhone, plpsFrom->lpszData, plpsFrom->dwSize);
+ mraGetStaticStringA(NULL, "e-mail", szEMail, SIZEOF(szEMail), NULL);
+
+ EncodeXML(lpwszMessage, dwMessageSize, lpwszMessageXMLEncoded, dwBuffLen, &dwMessageXMLEncodedSize);
+ WideCharToMultiByte(CP_UTF8, 0, lpwszMessageXMLEncoded, dwMessageXMLEncodedSize, lpszMessageUTF, dwBuffLen, NULL, NULL);
+ lpszBuff = (LPSTR)lpwszMessageXMLEncoded;
+
+ if (dwFlags & MESSAGE_SMS_DELIVERY_REPORT) {
+ dwBuffLen = mir_snprintf(lpszBuff, (dwBuffLen*sizeof(WCHAR)), "<sms_delivery_receipt><message_id>%s-1-1955988055-%s</message_id><destination>%s</destination><delivered>No</delivered><submition_time>%s</submition_time><error_code>0</error_code><error><id>15</id><params><param>%s</param></params></error></sms_delivery_receipt>", szEMail, szPhone, szPhone, szTime, lpszMessageUTF);
+ ProtoBroadcastAckAsynchEx(NULL, ICQACKTYPE_SMS, ACKRESULT_FAILED, (HANDLE)0, (LPARAM)lpszBuff, dwBuffLen);
+ }
+ else { // new sms
+ dwBuffLen = mir_snprintf(lpszBuff, (dwBuffLen*sizeof(WCHAR)), "<sms_message><source>Mail.ru</source><destination_UIN>%s</destination_UIN><sender>%s</sender><senders_network>Mail.ru</senders_network><text>%s</text><time>%s</time></sms_message>", szEMail, szPhone, lpszMessageUTF, szTime);
+ ProtoBroadcastAckAsynchEx(NULL, ICQACKTYPE_SMS, ACKRESULT_SUCCESS, (HANDLE)0, (LPARAM)lpszBuff, dwBuffLen);
}
- }else{// не удалось выделить память
- dwRetErrorCode=GetLastError();
}
- MEMFREE(lpwszMessageXMLEncoded);
- MEMFREE(lpszMessageUTF);
- }else{
- ccs.hContact=MraHContactFromEmail(plpsFrom->lpszData,plpsFrom->dwSize,TRUE,TRUE,&bAdded);
- if (bAdded) MraUpdateContactInfo(ccs.hContact);
-
- if (dwFlags&MESSAGE_FLAG_NOTIFY)
- {// user typing
- CallService(MS_PROTO_CONTACTISTYPING,(WPARAM)ccs.hContact,MAILRU_CONTACTISTYPING_TIMEOUT);
- }else{// text/contact/auth // typing OFF
- CallService(MS_PROTO_CONTACTISTYPING,(WPARAM)ccs.hContact,PROTOTYPE_CONTACTTYPING_OFF);
-
- if (dwFlags&MESSAGE_FLAG_MULTICHAT)
- {// MULTICHAT
- LPBYTE lpbMultiChatData,lpbDataCurrent;
- SIZE_T dwMultiChatDataSize;
+ else dwRetErrorCode = GetLastError();
+
+ mir_free(lpwszMessageXMLEncoded);
+ mir_free(lpszMessageUTF);
+ }
+ else {
+ ccs.hContact = MraHContactFromEmail(plpsFrom->lpszData, plpsFrom->dwSize, TRUE, TRUE, &bAdded);
+ if (bAdded)
+ MraUpdateContactInfo(ccs.hContact);
+
+ // user typing
+ if (dwFlags & MESSAGE_FLAG_NOTIFY)
+ CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)ccs.hContact, MAILRU_CONTACTISTYPING_TIMEOUT);
+ else { // text/contact/auth // typing OFF
+ CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)ccs.hContact, PROTOTYPE_CONTACTTYPING_OFF);
+
+ if (dwFlags & MESSAGE_FLAG_MULTICHAT) {
+ LPBYTE lpbMultiChatData, lpbDataCurrent;
+ size_t dwMultiChatDataSize;
DWORD dwMultiChatEventType;
- MRA_LPS lpsEMailInMultiChat,lpsString,lpsMultichatName;
+ MRA_LPS lpsEMailInMultiChat, lpsString, lpsMultichatName;
- lpbMultiChatData=(LPBYTE)plpsMultiChatData->lpszData;
- dwMultiChatDataSize=plpsMultiChatData->dwSize;
- lpbDataCurrent=lpbMultiChatData;
+ lpbMultiChatData = (LPBYTE)plpsMultiChatData->lpszData;
+ dwMultiChatDataSize = plpsMultiChatData->dwSize;
+ lpbDataCurrent = lpbMultiChatData;
- dwMultiChatEventType=GetUL(&lpbDataCurrent);// type
- GetLPS(lpbMultiChatData,dwMultiChatDataSize,&lpbDataCurrent,&lpsMultichatName);// multichat_name
- GetLPS(lpbMultiChatData,dwMultiChatDataSize,&lpbDataCurrent,&lpsEMailInMultiChat);
+ dwMultiChatEventType = GetUL(&lpbDataCurrent);// type
+ GetLPS(lpbMultiChatData, dwMultiChatDataSize, &lpbDataCurrent, &lpsMultichatName);// multichat_name
+ GetLPS(lpbMultiChatData, dwMultiChatDataSize, &lpbDataCurrent, &lpsEMailInMultiChat);
- switch(dwMultiChatEventType){
+ switch (dwMultiChatEventType) {
case MULTICHAT_MESSAGE:
- MraChatSessionMessageAdd(ccs.hContact,lpsEMailInMultiChat.lpszData,lpsEMailInMultiChat.dwSize,lpwszMessage,dwMessageSize,dwTime);// LPS sender
+ MraChatSessionMessageAdd(ccs.hContact, lpsEMailInMultiChat.lpszData, lpsEMailInMultiChat.dwSize, lpwszMessage, dwMessageSize, dwTime);// LPS sender
break;
case MULTICHAT_ADD_MEMBERS:
- MraChatSessionMembersAdd(ccs.hContact,lpsEMailInMultiChat.lpszData,lpsEMailInMultiChat.dwSize,dwTime);// LPS sender
- GetLPS(lpbMultiChatData,dwMultiChatDataSize,&lpbDataCurrent,&lpsString);// CLPS members
- MraChatSessionSetIviter(ccs.hContact,lpsEMailInMultiChat.lpszData,lpsEMailInMultiChat.dwSize);
+ MraChatSessionMembersAdd(ccs.hContact, lpsEMailInMultiChat.lpszData, lpsEMailInMultiChat.dwSize, dwTime);// LPS sender
+ GetLPS(lpbMultiChatData, dwMultiChatDataSize, &lpbDataCurrent, &lpsString);// CLPS members
+ MraChatSessionSetIviter(ccs.hContact, lpsEMailInMultiChat.lpszData, lpsEMailInMultiChat.dwSize);
case MULTICHAT_MEMBERS:
{
- LPBYTE lpbMultiChatDataLocal,lpbDataCurrentLocal;
- SIZE_T i,dwMultiChatMembersCount,dwMultiChatDataLocalSize;
+ LPBYTE lpbMultiChatDataLocal, lpbDataCurrentLocal;
+ size_t i, dwMultiChatMembersCount, dwMultiChatDataLocalSize;
- if (dwMultiChatEventType==MULTICHAT_MEMBERS) lpsString=lpsEMailInMultiChat;
+ if (dwMultiChatEventType == MULTICHAT_MEMBERS) lpsString = lpsEMailInMultiChat;
- lpbMultiChatDataLocal=(LPBYTE)lpsString.lpszData;
- dwMultiChatDataLocalSize=lpsString.dwSize;
- lpbDataCurrentLocal=lpbMultiChatDataLocal;
+ lpbMultiChatDataLocal = (LPBYTE)lpsString.lpszData;
+ dwMultiChatDataLocalSize = lpsString.dwSize;
+ lpbDataCurrentLocal = lpbMultiChatDataLocal;
- dwMultiChatMembersCount=GetUL(&lpbDataCurrentLocal);// count
- for (i=0;i<dwMultiChatMembersCount;i++)
- {
- if (GetLPS(lpbMultiChatDataLocal,dwMultiChatDataLocalSize,&lpbDataCurrentLocal,&lpsString)==NO_ERROR)
- {// CLPS members
- MraChatSessionJoinUser(ccs.hContact,lpsString.lpszData,lpsString.dwSize,((dwMultiChatEventType==MULTICHAT_MEMBERS)? 0:dwTime));
- }
- }
+ dwMultiChatMembersCount = GetUL(&lpbDataCurrentLocal);// count
+ for (i = 0; i < dwMultiChatMembersCount; i++)
+ if (GetLPS(lpbMultiChatDataLocal, dwMultiChatDataLocalSize, &lpbDataCurrentLocal, &lpsString) == NO_ERROR)
+ MraChatSessionJoinUser(ccs.hContact, lpsString.lpszData, lpsString.dwSize, ((dwMultiChatEventType == MULTICHAT_MEMBERS)? 0:dwTime));
- if (dwMultiChatEventType==MULTICHAT_MEMBERS)
- {
- GetLPS(lpbMultiChatData,dwMultiChatDataSize,&lpbDataCurrent,&lpsEMailInMultiChat);// [ LPS owner ]
- MraChatSessionSetOwner(ccs.hContact,lpsEMailInMultiChat.lpszData,lpsEMailInMultiChat.dwSize);
+ if (dwMultiChatEventType == MULTICHAT_MEMBERS) {
+ GetLPS(lpbMultiChatData, dwMultiChatDataSize, &lpbDataCurrent, &lpsEMailInMultiChat);// [ LPS owner ]
+ MraChatSessionSetOwner(ccs.hContact, lpsEMailInMultiChat.lpszData, lpsEMailInMultiChat.dwSize);
}
}
break;
case MULTICHAT_ATTACHED:
- MraChatSessionJoinUser(ccs.hContact,lpsEMailInMultiChat.lpszData,lpsEMailInMultiChat.dwSize,dwTime);// LPS member
+ MraChatSessionJoinUser(ccs.hContact, lpsEMailInMultiChat.lpszData, lpsEMailInMultiChat.dwSize, dwTime);// LPS member
break;
case MULTICHAT_DETACHED:
- MraChatSessionLeftUser(ccs.hContact,lpsEMailInMultiChat.lpszData,lpsEMailInMultiChat.dwSize,dwTime);// LPS member
+ MraChatSessionLeftUser(ccs.hContact, lpsEMailInMultiChat.lpszData, lpsEMailInMultiChat.dwSize, dwTime);// LPS member
break;
case MULTICHAT_INVITE:
- MraChatSessionInvite(ccs.hContact,lpsEMailInMultiChat.lpszData,lpsEMailInMultiChat.dwSize,dwTime);// LPS sender
- MraSendCommand_AddContactW(ccs.hContact,(CONTACT_FLAG_VISIBLE|CONTACT_FLAG_MULTICHAT|CONTACT_FLAG_UNICODE_NAME),-1,plpsFrom->lpszData,plpsFrom->dwSize,lpsMultichatName.lpwszData,(lpsMultichatName.dwSize/sizeof(WCHAR)),NULL,0,NULL,0,0);
+ MraChatSessionInvite(ccs.hContact, lpsEMailInMultiChat.lpszData, lpsEMailInMultiChat.dwSize, dwTime);// LPS sender
+ MraAddContactW(ccs.hContact, (CONTACT_FLAG_VISIBLE|CONTACT_FLAG_MULTICHAT|CONTACT_FLAG_UNICODE_NAME), -1, plpsFrom->lpszData, plpsFrom->dwSize, lpsMultichatName.lpwszData, (lpsMultichatName.dwSize/sizeof(WCHAR)), NULL, 0, NULL, 0, 0);
break;
default:
DebugBreak();
break;
}
- }else
- if (dwFlags&MESSAGE_FLAG_AUTHORIZE)
- {// auth request
+ }
+ else if (dwFlags & MESSAGE_FLAG_AUTHORIZE) { // auth request
BYTE btBuff[BUFF_SIZE_BLOB];
- BOOL bAutoGrandAuth=FALSE;
-
- if (IsEMailChatAgent(plpsFrom->lpszData,plpsFrom->dwSize))
- {
- bAutoGrandAuth=FALSE;
- }else{
- if (DBGetContactSettingByte(ccs.hContact,"CList","NotOnList",0))
- {// временный контакт
- if (DB_Mra_GetByte(NULL,"AutoAuthGrandNewUsers",MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS)) bAutoGrandAuth=TRUE;
- }else{// постоянный контакт
- if (DB_Mra_GetByte(NULL,"AutoAuthGrandUsersInCList",MRA_DEFAULT_AUTO_AUTH_GRAND_IN_CLIST)) bAutoGrandAuth=TRUE;
+ BOOL bAutoGrantAuth = FALSE;
+
+ if ( IsEMailChatAgent(plpsFrom->lpszData, plpsFrom->dwSize))
+ bAutoGrantAuth = FALSE;
+ else {
+ // temporary contact
+ if (db_get_b(ccs.hContact, "CList", "NotOnList", 0)) {
+ if (mraGetByte(NULL, "AutoAuthGrandNewUsers", MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS))
+ bAutoGrantAuth = TRUE;
}
+ else if (mraGetByte(NULL, "AutoAuthGrandUsersInCList", MRA_DEFAULT_AUTO_AUTH_GRAND_IN_CLIST))
+ bAutoGrantAuth = TRUE;
}
- if (bAdded) DBWriteContactSettingByte(ccs.hContact,"CList","Hidden",1);
- if (bAutoGrandAuth)
- {// auto grand auth
- DBEVENTINFO dbei={0};
-
- dbei.cbSize=sizeof(dbei);
- dbei.szModule=PROTOCOL_NAMEA;
- dbei.timestamp=_time32(NULL);
- dbei.flags=DBEF_READ;
- dbei.eventType=EVENTTYPE_AUTHREQUEST;
- dbei.pBlob=(PBYTE)btBuff;
-
- CreateBlobFromContact(ccs.hContact,lpwszMessage,dwMessageSize,btBuff,SIZEOF(btBuff),(SIZE_T*)&dbei.cbBlob);
- CallService(MS_DB_EVENT_ADD,(WPARAM)NULL,(LPARAM)&dbei);
- MraSendCommand_Authorize(plpsFrom->lpszData,plpsFrom->dwSize);
- }else{
- ccs.szProtoService=PSR_AUTH;
- pre.szMessage=(LPSTR)btBuff;
- CreateBlobFromContact(ccs.hContact,lpwszMessage,dwMessageSize,btBuff,SIZEOF(btBuff),(SIZE_T*)&pre.lParam);
- CallService(MS_PROTO_CHAINRECV,0,(LPARAM)&ccs);
- }
- }else{
- DBDeleteContactSetting(ccs.hContact,"CList","Hidden");
+ if (bAdded)
+ DBWriteContactSettingByte(ccs.hContact, "CList", "Hidden", 1);
- if (dwFlags&MESSAGE_FLAG_CONTACT)
- {// contacts received
- LPBYTE lpbBuffer,lpbBufferCurPos;
+ if (bAutoGrantAuth) { // auto grant auth
+ DBEVENTINFO dbei = {0};
- lpbBuffer=(LPBYTE)MEMALLOC((dwMessageSize+MAX_PATH));
- if (lpbBuffer)
- {
- ccs.szProtoService=PSR_CONTACTS;
- pre.flags=0;
- pre.szMessage=(LPSTR)lpbBuffer;
- pre.lParam=WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszMessage,dwMessageSize,(LPSTR)lpbBuffer,(dwMessageSize+MAX_PATH),NULL,NULL);
+ dbei.cbSize = sizeof(dbei);
+ dbei.szModule = m_szModuleName;
+ dbei.timestamp = _time32(NULL);
+ dbei.flags = DBEF_READ;
+ dbei.eventType = EVENTTYPE_AUTHREQUEST;
+ dbei.pBlob = (PBYTE)btBuff;
+
+ CreateBlobFromContact(ccs.hContact, lpwszMessage, dwMessageSize, btBuff, SIZEOF(btBuff), (size_t*)&dbei.cbBlob);
+ CallService(MS_DB_EVENT_ADD, (WPARAM)NULL, (LPARAM)&dbei);
+ MraAuthorize(plpsFrom->lpszData, plpsFrom->dwSize);
+ }
+ else {
+ ccs.szProtoService = PSR_AUTH;
+ pre.szMessage = (LPSTR)btBuff;
+ CreateBlobFromContact(ccs.hContact, lpwszMessage, dwMessageSize, btBuff, SIZEOF(btBuff), (size_t*)&pre.lParam);
+ CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ }
+ }
+ else {
+ DBDeleteContactSetting(ccs.hContact, "CList", "Hidden");
+
+ if (dwFlags & MESSAGE_FLAG_CONTACT) { // contacts received
+ LPBYTE lpbBuffer, lpbBufferCurPos;
+
+ lpbBuffer = (LPBYTE)mir_calloc((dwMessageSize+MAX_PATH));
+ if (lpbBuffer) {
+ ccs.szProtoService = PSR_CONTACTS;
+ pre.flags = 0;
+ pre.szMessage = (LPSTR)lpbBuffer;
+ pre.lParam = WideCharToMultiByte(MRA_CODE_PAGE, 0, lpwszMessage, dwMessageSize, (LPSTR)lpbBuffer, (dwMessageSize+MAX_PATH), NULL, NULL);
- lpbBufferCurPos=lpbBuffer;
- while(TRUE)
- {// цикл замены ; на 0
- lpbBufferCurPos=(LPBYTE)MemoryFindByte((lpbBufferCurPos-lpbBuffer),lpbBuffer,pre.lParam,';');
- if (lpbBufferCurPos)
- {// founded
- (*lpbBufferCurPos)=0;
- lpbBufferCurPos++;
- }else{
+ lpbBufferCurPos = lpbBuffer;
+ while(TRUE) { // цикл замены ; на 0
+ lpbBufferCurPos = (LPBYTE)MemoryFindByte((lpbBufferCurPos-lpbBuffer), lpbBuffer, pre.lParam, ';');
+ if (!lpbBufferCurPos)
break;
- }
+
+ // found
+ (*lpbBufferCurPos) = 0;
+ lpbBufferCurPos++;
}
- CallService(MS_PROTO_CHAINRECV,0,(LPARAM)&ccs);
- MEMFREE(lpbBuffer);
- }else{// не удалось выделить память
- dwRetErrorCode=GetLastError();
+ CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ mir_free(lpbBuffer);
}
- }else
- if (dwFlags&MESSAGE_FLAG_ALARM)
- {// alarm
- if (masMraSettings.heNudgeReceived)
- {
- NotifyEventHooks(masMraSettings.heNudgeReceived,(WPARAM)ccs.hContact,NULL);
- }else{
- pre.flags=0;
- pre.szMessage=(LPSTR)TranslateTS(MRA_ALARM_MESSAGE);
- //pre.lParam=lstrlenA(pre.szMessage);
- ccs.szProtoService=PSR_MESSAGE;
- CallService(MS_PROTO_CHAINRECV,0,(LPARAM)&ccs);
+ else dwRetErrorCode = GetLastError();
+ }
+ else if (dwFlags & MESSAGE_FLAG_ALARM) { // alarm
+ if (heNudgeReceived)
+ NotifyEventHooks(heNudgeReceived, (WPARAM)ccs.hContact, NULL);
+ else {
+ pre.flags = 0;
+ pre.szMessage = (LPSTR)TranslateTS(MRA_ALARM_MESSAGE);
+ //pre.lParam = lstrlenA(pre.szMessage);
+ ccs.szProtoService = PSR_MESSAGE;
+ CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
}
- }else{// standart message// flash animation
- if ((dwFlags&MESSAGE_FLAG_RTF) && (dwFlags&MESSAGE_FLAG_FLASH)==0 && lpszMessageExt && dwMessageExtSize && DB_Mra_GetByte(NULL,"RTFReceiveEnable",MRA_DEFAULT_RTF_RECEIVE_ENABLE))
- {// пишем в ANSI, всё равно RTF
- pre.flags=0;
- pre.szMessage=lpszMessageExt;
- //pre.lParam=dwMessageExtSize;
- ccs.szProtoService=PSR_MESSAGE;
- CallService(MS_PROTO_CHAINRECV,0,(LPARAM)&ccs);
- }else{
- LPSTR lpszMessageUTF;// some plugins can change pre.szMessage pointer and we failed to free it
-
- lpszMessageUTF=(LPSTR)MEMALLOC(((dwMessageSize+MAX_PATH)*sizeof(WCHAR)));
- if (lpszMessageUTF)
- {
- pre.szMessage=lpszMessageUTF;
- pre.flags=PREF_UTF;
- //pre.lParam=
- WideCharToMultiByte(CP_UTF8,0,lpwszMessage,dwMessageSize,lpszMessageUTF,((dwMessageSize+MAX_PATH)*sizeof(WCHAR)),NULL,NULL);
- ccs.szProtoService=PSR_MESSAGE;
- CallService(MS_PROTO_CHAINRECV,0,(LPARAM)&ccs);
- MEMFREE(lpszMessageUTF);
- }else{// не удалось выделить память
- dwRetErrorCode=GetLastError();
- }
+ }
+ else { // standart message// flash animation
+ // пишем в ANSI, всё равно RTF
+ if ((dwFlags & MESSAGE_FLAG_RTF) && (dwFlags & MESSAGE_FLAG_FLASH) == 0 && lpszMessageExt && dwMessageExtSize && mraGetByte(NULL, "RTFReceiveEnable", MRA_DEFAULT_RTF_RECEIVE_ENABLE)) {
+ pre.flags = 0;
+ pre.szMessage = lpszMessageExt;
+ //pre.lParam = dwMessageExtSize;
+ ccs.szProtoService = PSR_MESSAGE;
+ CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
}
- if (dwFlags&MESSAGE_FLAG_SYSTEM)
- {
- MraPopupShowW(ccs.hContact,MRA_POPUP_TYPE_INFORMATION,0,TranslateW(L"Mail.ru System notify"),(LPWSTR)pre.szMessage);
+ else {
+ // some plugins can change pre.szMessage pointer and we failed to free it
+ LPSTR lpszMessageUTF = (LPSTR)mir_calloc(((dwMessageSize+MAX_PATH)*sizeof(WCHAR)));
+ if (lpszMessageUTF) {
+ pre.szMessage = lpszMessageUTF;
+ pre.flags = PREF_UTF;
+ WideCharToMultiByte(CP_UTF8, 0, lpwszMessage, dwMessageSize, lpszMessageUTF, ((dwMessageSize+MAX_PATH)*sizeof(WCHAR)), NULL, NULL);
+ ccs.szProtoService = PSR_MESSAGE;
+ CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ mir_free(lpszMessageUTF);
+ }
+ else dwRetErrorCode = GetLastError();
}
+
+ if (dwFlags & MESSAGE_FLAG_SYSTEM)
+ MraPopupShowW(ccs.hContact, MRA_POPUP_TYPE_INFORMATION, 0, TranslateW(L"Mail.ru System notify"), (LPWSTR)pre.szMessage);
}
}
}
}
- }else{// spam blocked
- if (DB_Mra_GetByte(NULL,"AntiSpamSendSpamReportToSrv",MRA_ANTISPAM_DEFAULT_SEND_SPAM_REPORT_TO_SERVER))
- {// рапортуем о спаме
- //MraSendCommand_MessageAskW(1,(dwFlags|MESSAGE_FLAG_SPAMF_SPAM),plpsFrom->lpszData,plpsFrom->dwSize,plpsText->lpwszData,plpsText->dwSize,plpsRFTText->lpszData,plpsRFTText->dwSize);
- }
- dwRetErrorCode=ERROR_ACCESS_DENIED;
}
+ else dwRetErrorCode = ERROR_ACCESS_DENIED;
- if (lpwszMessage!=plpsText->lpwszData && lpwszMessage!=(LPWSTR)lpszMessageExt) MEMFREE(lpwszMessage);
- MEMFREE(lpszMessageExt);
+ if (lpwszMessage != plpsText->lpwszData && lpwszMessage != (LPWSTR)lpszMessageExt)
+ mir_free(lpwszMessage);
+ mir_free(lpszMessageExt);
-return(dwRetErrorCode);
+ return dwRetErrorCode;
}
-
-
-
-
-DWORD GetMraXStatusIDFromMraUriStatus(LPSTR lpszStatusUri,SIZE_T dwStatusUriSize)
+DWORD GetMraXStatusIDFromMraUriStatus(LPSTR lpszStatusUri, size_t dwStatusUriSize)
{
- DWORD dwRet=MRA_XSTATUS_UNKNOWN;
-
if (lpszStatusUri)
- {
- for(SIZE_T i=0;lpcszStatusUri[i];i++)
- {
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpcszStatusUri[i],-1,lpszStatusUri,dwStatusUriSize)==CSTR_EQUAL)
- {
- dwRet=i;
- break;
- }
- }
- }
-return(dwRet);
-}
+ for (size_t i = 0; lpcszStatusUri[i]; i++)
+ if ( !_strnicmp(lpcszStatusUri[i], lpszStatusUri, dwStatusUriSize))
+ return i;
+ return MRA_XSTATUS_UNKNOWN;
+}
-DWORD GetMraStatusFromMiradaStatus(DWORD dwMirandaStatus,DWORD dwXStatusMir,DWORD *pdwXStatusMra)
+DWORD GetMraStatusFromMiradaStatus(DWORD dwMirandaStatus, DWORD dwXStatusMir, DWORD *pdwXStatusMra)
{
- DWORD dwRet;
-
- if (IsXStatusValid(dwXStatusMir))
- {
- if (pdwXStatusMra) (*pdwXStatusMra)=(dwXStatusMir+MRA_XSTATUS_INDEX_OFFSET-1);
- dwRet=STATUS_USER_DEFINED;
- }else{
- switch(dwMirandaStatus){
- case ID_STATUS_OFFLINE:
- if (pdwXStatusMra) (*pdwXStatusMra)=MRA_XSTATUS_OFFLINE;
- dwRet=STATUS_OFFLINE;
- break;
- case ID_STATUS_ONLINE:
- if (pdwXStatusMra) (*pdwXStatusMra)=MRA_XSTATUS_ONLINE;
- dwRet=STATUS_ONLINE;
- break;
- case ID_STATUS_AWAY:
- case ID_STATUS_NA:
- case ID_STATUS_ONTHEPHONE:
- case ID_STATUS_OUTTOLUNCH:
- if (pdwXStatusMra) (*pdwXStatusMra)=MRA_XSTATUS_AWAY;
- dwRet=STATUS_AWAY;
- break;
- case ID_STATUS_DND:
- case ID_STATUS_OCCUPIED:
- if (pdwXStatusMra) (*pdwXStatusMra)=MRA_XSTATUS_DND;
- dwRet=STATUS_USER_DEFINED;
- break;
- case ID_STATUS_FREECHAT:
- if (pdwXStatusMra) (*pdwXStatusMra)=MRA_XSTATUS_CHAT;
- dwRet=STATUS_USER_DEFINED;
- break;
- case ID_STATUS_INVISIBLE:
- if (pdwXStatusMra) (*pdwXStatusMra)=MRA_XSTATUS_INVISIBLE;
- dwRet=(STATUS_ONLINE|STATUS_FLAG_INVISIBLE);
- break;
- default:
- if (pdwXStatusMra) (*pdwXStatusMra)=MRA_XSTATUS_OFFLINE;
- dwRet=STATUS_OFFLINE;
- break;
- }
+ if ( IsXStatusValid(dwXStatusMir)) {
+ if (pdwXStatusMra)
+ *pdwXStatusMra = (dwXStatusMir+MRA_XSTATUS_INDEX_OFFSET-1);
+ return STATUS_USER_DEFINED;
}
-return(dwRet);
+
+ switch (dwMirandaStatus) {
+ case ID_STATUS_OFFLINE:
+ if (pdwXStatusMra) *pdwXStatusMra = MRA_XSTATUS_OFFLINE;
+ return STATUS_OFFLINE;
+
+ case ID_STATUS_ONLINE:
+ if (pdwXStatusMra) *pdwXStatusMra = MRA_XSTATUS_ONLINE;
+ return STATUS_ONLINE;
+
+ case ID_STATUS_AWAY:
+ case ID_STATUS_NA:
+ case ID_STATUS_ONTHEPHONE:
+ case ID_STATUS_OUTTOLUNCH:
+ if (pdwXStatusMra) *pdwXStatusMra = MRA_XSTATUS_AWAY;
+ return STATUS_AWAY;
+
+ case ID_STATUS_DND:
+ case ID_STATUS_OCCUPIED:
+ if (pdwXStatusMra) *pdwXStatusMra = MRA_XSTATUS_DND;
+ return STATUS_USER_DEFINED;
+
+ case ID_STATUS_FREECHAT:
+ if (pdwXStatusMra) *pdwXStatusMra = MRA_XSTATUS_CHAT;
+ return STATUS_USER_DEFINED;
+
+ case ID_STATUS_INVISIBLE:
+ if (pdwXStatusMra) *pdwXStatusMra = MRA_XSTATUS_INVISIBLE;
+ return (STATUS_ONLINE|STATUS_FLAG_INVISIBLE);
+ }
+
+ if (pdwXStatusMra) *pdwXStatusMra = MRA_XSTATUS_OFFLINE;
+ return STATUS_OFFLINE;
}
-DWORD GetMiradaStatusFromMraStatus(DWORD dwMraStatus,DWORD dwXStatusMra,DWORD *pdwXStatusMir)
+DWORD GetMiradaStatusFromMraStatus(DWORD dwMraStatus, DWORD dwXStatusMra, DWORD *pdwXStatusMir)
{
- DWORD dwRet;
-
- if (pdwXStatusMir) (*pdwXStatusMir)=0;
-
- switch(dwMraStatus){
- case STATUS_OFFLINE:
- dwRet=ID_STATUS_OFFLINE;
- break;
- case STATUS_ONLINE:
- dwRet=ID_STATUS_ONLINE;
- break;
- case STATUS_AWAY:
- dwRet=ID_STATUS_AWAY;
- break;
- case STATUS_UNDETERMINATED:
- dwRet=ID_STATUS_OFFLINE;
- break;
- case STATUS_USER_DEFINED:
- switch(dwXStatusMra){
- //case MRA_XSTATUS_OFFLINE: dwRet=ID_STATUS_OFFLINE; break;
- //case MRA_XSTATUS_ONLINE: dwRet=ID_STATUS_ONLINE; break;
- //case MRA_XSTATUS_AWAY: dwRet=ID_STATUS_AWAY; break;
- //case MRA_XSTATUS_INVISIBLE: dwRet=ID_STATUS_INVISIBLE; break;
- case MRA_XSTATUS_DND: dwRet=ID_STATUS_DND; break;
- case MRA_XSTATUS_CHAT: dwRet=ID_STATUS_FREECHAT; break;
- case MRA_XSTATUS_UNKNOWN:
- if (pdwXStatusMir) (*pdwXStatusMir)=MRA_MIR_XSTATUS_UNKNOWN;
- dwRet=ID_STATUS_ONLINE;
- break;
- default:
- if (pdwXStatusMir) (*pdwXStatusMir)=(dwXStatusMra-MRA_XSTATUS_INDEX_OFFSET+1);
- dwRet=ID_STATUS_ONLINE;
- break;
- }
- break;
- default:// STATUS_FLAG_INVISIBLE
- if (dwMraStatus&STATUS_FLAG_INVISIBLE)
- {
- dwRet=ID_STATUS_INVISIBLE;
- }else{
- dwRet=ID_STATUS_OFFLINE;
- DebugBreak();
+ if (pdwXStatusMir) *pdwXStatusMir = 0;
+
+ switch (dwMraStatus) {
+ case STATUS_OFFLINE: return ID_STATUS_OFFLINE;
+ case STATUS_ONLINE: return ID_STATUS_ONLINE;
+ case STATUS_AWAY: return ID_STATUS_AWAY;
+ case STATUS_UNDETERMINATED: return ID_STATUS_OFFLINE;
+ case STATUS_USER_DEFINED:
+ switch (dwXStatusMra) {
+ case MRA_XSTATUS_DND: return ID_STATUS_DND;
+ case MRA_XSTATUS_CHAT: return ID_STATUS_FREECHAT;
+ case MRA_XSTATUS_UNKNOWN:
+ if (pdwXStatusMir) *pdwXStatusMir = MRA_MIR_XSTATUS_UNKNOWN;
+ return ID_STATUS_ONLINE;
}
- break;
+ if (pdwXStatusMir) *pdwXStatusMir = dwXStatusMra-MRA_XSTATUS_INDEX_OFFSET+1;
+ return ID_STATUS_ONLINE;
}
-return(dwRet);
-}
+ if (dwMraStatus & STATUS_FLAG_INVISIBLE)
+ return ID_STATUS_INVISIBLE;
+
+ return ID_STATUS_OFFLINE;
+}
DWORD GetUL(LPBYTE *plpData)
{
- DWORD dwRet=(*(DWORD*)(*plpData));
- (*plpData)+=sizeof(DWORD);
-return(dwRet);
+ DWORD dwRet = *(DWORD*)(*plpData);
+ plpData[0] += sizeof(DWORD);
+ return dwRet;
}
-
DWORDLONG GetUIDL(LPBYTE *plpData)
{
- DWORDLONG dwRet=(*(DWORDLONG*)(*plpData));
- (*plpData)+=sizeof(DWORDLONG);
-return(dwRet);
+ DWORDLONG dwRet = *(DWORDLONG*)(*plpData);
+ plpData[0] += sizeof(DWORDLONG);
+ return dwRet;
}
-
MRA_GUID GetGUID(LPBYTE *plpData)
{
- MRA_GUID guidRet=(*(MRA_GUID*)(*plpData));
- (*plpData)+=sizeof(MRA_GUID);
-return(guidRet);
+ MRA_GUID guidRet = *(MRA_GUID*)(*plpData);
+ plpData[0] += sizeof(MRA_GUID);
+ return guidRet;
}
-
-DWORD GetLPS(LPBYTE lpbData,DWORD dwDataSize,LPBYTE *plpCurrentData,MRA_LPS *plpsString)
+DWORD GetLPS(LPBYTE lpbData, DWORD dwDataSize, LPBYTE *plpCurrentData, MRA_LPS *plpsString)
{
- DWORD dwRetErrorCode;
- LPBYTE lpbDataEnd=(lpbData+dwDataSize);
-
- if (lpbDataEnd>=((*plpCurrentData)+sizeof(DWORD)))
- {// хотябы длинна данных есть
- if (lpbDataEnd>=((*plpCurrentData)+sizeof(DWORD)+(*(DWORD*)(*plpCurrentData))))
- {// все длинна данных в буфере равна или меньше размера буфера
- plpsString->dwSize=(*(DWORD*)(*plpCurrentData));
- plpsString->lpszData=(LPSTR)((*plpCurrentData)+sizeof(DWORD));
- (*plpCurrentData)+=(sizeof(DWORD)+plpsString->dwSize);
- dwRetErrorCode=NO_ERROR;
- }else{
- plpsString->dwSize=0;
- plpsString->lpszData=NULL;
- dwRetErrorCode=ERROR_INVALID_USER_BUFFER;
+ LPBYTE lpbDataEnd = (lpbData+dwDataSize);
+
+ // хотябы длинна данных есть
+ if (lpbDataEnd >= ((*plpCurrentData)+sizeof(DWORD))) {
+ // все длинна данных в буфере равна или меньше размера буфера
+ if (lpbDataEnd >= ((*plpCurrentData)+sizeof(DWORD)+(*(DWORD*)(*plpCurrentData)))) {
+ plpsString->dwSize = (*(DWORD*)(*plpCurrentData));
+ plpsString->lpszData = (LPSTR)((*plpCurrentData)+sizeof(DWORD));
+ (*plpCurrentData) += (sizeof(DWORD)+plpsString->dwSize);
+ return NO_ERROR;
}
- }else{
- plpsString->dwSize=0;
- plpsString->lpszData=NULL;
- dwRetErrorCode=ERROR_INVALID_USER_BUFFER;
}
-return(dwRetErrorCode);
-}
-
+ plpsString->dwSize = 0;
+ plpsString->lpszData = NULL;
+ return ERROR_INVALID_USER_BUFFER;
+}
diff --git a/protocols/MRA/Mra_svcs.cpp b/protocols/MRA/Mra_svcs.cpp
index 5834da5f7f..2c10934b7e 100644
--- a/protocols/MRA/Mra_svcs.cpp
+++ b/protocols/MRA/Mra_svcs.cpp
@@ -1,2288 +1,1179 @@
#include "Mra.h"
#include "proto.h"
-
-
-
-
-INT_PTR MraXStatusMenu (WPARAM wParam,LPARAM lParam,LPARAM param);
-
-int MraContactDeleted (WPARAM wParam,LPARAM lParam);
-int MraDbSettingChanged (WPARAM wParam,LPARAM lParam);
-int MraRebuildContactMenu (WPARAM wParam,LPARAM lParam);
-int MraExtraIconsApply (WPARAM wParam,LPARAM lParam);
-int MraExtraIconsRebuild (WPARAM wParam,LPARAM lParam);
-int MraRebuildStatusMenu (WPARAM wParam,LPARAM lParam);
-int MraMusicChanged (WPARAM wParam,LPARAM lParam);
-
-DWORD MraSendNewStatus (DWORD dwStatusMir,DWORD dwXStatusMir,LPWSTR lpwszStatusTitle,SIZE_T dwStatusTitleSize,LPWSTR lpwszStatusDesc,SIZE_T dwStatusDescSize);
-
-
-HANDLE AddToListByEmail (MRA_LPS *plpsEMail,MRA_LPS *plpsNick,MRA_LPS *plpsFirstName,MRA_LPS *plpsLastName,DWORD dwFlags);
-
-
-
-INT_PTR LoadServices(void)
-{
- CHAR szServiceFunction[MAX_PATH],*pszServiceFunctionName;
-
- memmove(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
- pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN;
-
- // Service creation
- for (SIZE_T i=0;i<SIZEOF(siPluginServices);i++) {
- memmove(pszServiceFunctionName,siPluginServices[i].lpszName,(lstrlenA(siPluginServices[i].lpszName)+1));
- CreateServiceFunction(szServiceFunction,siPluginServices[i].lpFunc);
- }
-
- DebugPrintCRLFW(L"MRA/LoadServices - DONE");
-return(0);
-}
-
-
-INT_PTR LoadModules(void)
-{
- CHAR szServiceFunction[MAX_PATH],*pszServiceFunctionName;
-
- memmove(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
- pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN;
-
- IconsLoad();
- masMraSettings.hExtraXstatusIcon=ExtraIcon_Register("MRAXstatus","Mail.ru Xstatus","MRA_xstatus25",MraExtraIconsRebuild,MraExtraIconsApply,NULL,NULL);
- masMraSettings.hExtraInfo=ExtraIcon_Register("MRAStatus","Mail.ru extra info","MRA_xstatus49",MraExtraIconsRebuild,MraExtraIconsApply,NULL,NULL);
-
-
- masMraSettings.hHookOptInitialize=HookEvent(ME_OPT_INITIALISE,OptInit);
- masMraSettings.hHookContactDeleted=HookEvent(ME_DB_CONTACT_DELETED,MraContactDeleted);
- masMraSettings.hHookSettingChanged=HookEvent(ME_DB_CONTACT_SETTINGCHANGED,MraDbSettingChanged);
- masMraSettings.hHookRebuildCMenu=HookEvent(ME_CLIST_PREBUILDCONTACTMENU,MraRebuildContactMenu);
- if (ServiceExists(MS_NUDGE_SEND))
- {
- memmove(pszServiceFunctionName,MS_NUDGE,sizeof(MS_NUDGE));
- masMraSettings.heNudgeReceived=CreateHookableEvent(szServiceFunction);
- }
- masMraSettings.hHookExtraIconsApply=HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY,MraExtraIconsApply);
- masMraSettings.hHookExtraIconsRebuild=HookEvent(ME_CLIST_EXTRA_LIST_REBUILD,MraExtraIconsRebuild);
-
- // Main menu initialization
- HICON hMainIcon = (HICON)LoadImage(masMraSettings.hInstance,MAKEINTRESOURCE(IDI_MRA),IMAGE_ICON,0,0,LR_SHARED);
- CListCreateMenu(200001,500085000,hMainIcon,NULL,TRUE,gdiMenuItems,masMraSettings.hMainMenuIcons,SIZEOF(gdiMenuItems),masMraSettings.hMainMenuItems);
-
- // Contact menu initialization
- CListCreateMenu(2000060000,-500050000,NULL,NULL,FALSE,gdiContactMenuItems,masMraSettings.hContactMenuIcons,(SIZEOF(gdiContactMenuItems) - ((masMraSettings.heNudgeReceived==NULL)? 0:1)),masMraSettings.hContactMenuItems);
-
- // xstatus menu
- InitXStatusIcons();
- for(SIZE_T i=0;i<MRA_XSTATUS_COUNT;i++) {
- mir_snprintf(pszServiceFunctionName,(SIZEOF(szServiceFunction)-PROTOCOL_NAME_LEN),"/menuXStatus%ld",i);
- CreateServiceFunctionParam(szServiceFunction,MraXStatusMenu,i);
- }
-
- masMraSettings.bHideXStatusUI=FALSE;
- masMraSettings.dwXStatusMode=DB_Mra_GetByte(NULL,DBSETTING_XSTATUSID,MRA_MIR_XSTATUS_NONE);
- if (IsXStatusValid(masMraSettings.dwXStatusMode)==FALSE) masMraSettings.dwXStatusMode=MRA_MIR_XSTATUS_NONE;
-
- masMraSettings.hHookRebuildStatusMenu=HookEvent(ME_CLIST_PREBUILDSTATUSMENU,MraRebuildStatusMenu);
- MraRebuildStatusMenu(0,0);
-
- MraExtraIconsRebuild(0,0);
-
- masMraSettings.hWATrack=HookEvent(ME_WAT_NEWSTATUS,MraMusicChanged);
-
-
- mir_snprintf(masMraSettings.szNewMailSound,SIZEOF(masMraSettings.szNewMailSound),"%s: %s",PROTOCOL_NAMEA,MRA_SOUND_NEW_EMAIL);
- SkinAddNewSoundEx(masMraSettings.szNewMailSound,PROTOCOL_NAMEA,MRA_SOUND_NEW_EMAIL);
-
- masMraSettings.bChatExist=MraChatRegister();
-
-
- DebugPrintCRLFW(L"MRA/LoadModules - DONE");
-return(0);
-}
-
-
-void UnloadModules()
-{
- CHAR szServiceFunction[MAX_PATH],*pszServiceFunctionName;
-
- memmove(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
- pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN;
-
- if (masMraSettings.bChatExist)
- {// destroy all chat sessions
- MraChatSessionDestroy(NULL);
+const GUI_DISPLAY_ITEM gdiMenuItems[] =
+{
+ { MRA_GOTO_INBOX, MRA_GOTO_INBOX_STR, IDI_INBOX, &CMraProto::MraGotoInbox },
+ { MRA_SHOW_INBOX_STATUS, MRA_SHOW_INBOX_STATUS_STR, IDI_MAIL_NOTIFY, &CMraProto::MraShowInboxStatus },
+ { MRA_EDIT_PROFILE, MRA_EDIT_PROFILE_STR, IDI_PROFILE, &CMraProto::MraEditProfile },
+ { MRA_MY_ALBUM, MRA_MY_ALBUM_STR, IDI_MRA_PHOTO, &CMraProto::MyAlbum },
+ { MRA_MY_BLOG, MRA_MY_BLOG_STR, IDI_MRA_BLOGS, &CMraProto::MyBlog },
+ { MRA_MY_BLOGSTATUS, MRA_MY_BLOGSTATUS_STR, IDI_BLOGSTATUS, &CMraProto::MyBlogStatus },
+ { MRA_MY_VIDEO, MRA_MY_VIDEO_STR, IDI_MRA_VIDEO, &CMraProto::MyVideo },
+ { MRA_MY_ANSWERS, MRA_MY_ANSWERS_STR, IDI_MRA_ANSWERS, &CMraProto::MyAnswers },
+ { MRA_MY_WORLD, MRA_MY_WORLD_STR, IDI_MRA_WORLD, &CMraProto::MyWorld },
+ { MRA_ZHUKI, MRA_ZHUKI_STR, IDI_MRA_ZHUKI, &CMraProto::MraZhuki },
+ { MRA_CHAT, MRA_CHAT_STR, IDI_MRA_CHAT, &CMraProto::MraChat },
+ { MRA_WEB_SEARCH, MRA_WEB_SEARCH_STR, IDI_MRA_WEB_SEARCH, &CMraProto::MraWebSearch },
+ { MRA_UPD_ALL_USERS_INFO, MRA_UPD_ALL_USERS_INFO_STR, IDI_PROFILE, &CMraProto::MraUpdateAllUsersInfo },
+ { MRA_CHK_USERS_AVATARS, MRA_CHK_USERS_AVATARS_STR, IDI_PROFILE, &CMraProto::MraCheckUpdatesUsersAvt },
+ { MRA_REQ_AUTH_FOR_ALL, MRA_REQ_AUTH_FOR_ALL_STR, IDI_AUTHRUGUEST, &CMraProto::MraRequestAuthForAll }
+};
+
+const int gdiMenuItemsCount = SIZEOF(gdiMenuItems);
+
+const GUI_DISPLAY_ITEM gdiContactMenuItems[] =
+{
+ { MRA_REQ_AUTH, MRA_REQ_AUTH_STR, IDI_AUTHRUGUEST, &CMraProto::MraRequestAuthorization },
+ { MRA_GRANT_AUTH, MRA_GRANT_AUTH_STR, IDI_AUTHGRANT, &CMraProto::MraGrantAuthorization },
+ { MRA_SEND_POSTCARD, MRA_SEND_POSTCARD_STR, IDI_MRA_POSTCARD, &CMraProto::MraSendPostcard },
+ { MRA_VIEW_ALBUM, MRA_VIEW_ALBUM_STR, IDI_MRA_PHOTO, &CMraProto::MraViewAlbum },
+ { MRA_READ_BLOG, MRA_READ_BLOG_STR , IDI_MRA_BLOGS, &CMraProto::MraReadBlog },
+ { MRA_REPLY_BLOG_STATUS, MRA_REPLY_BLOG_STATUS_STR, IDI_BLOGSTATUS, &CMraProto::MraReplyBlogStatus },
+ { MRA_VIEW_VIDEO, MRA_VIEW_VIDEO_STR, IDI_MRA_VIDEO, &CMraProto::MraViewVideo },
+ { MRA_ANSWERS, MRA_ANSWERS_STR, IDI_MRA_ANSWERS, &CMraProto::MraAnswers },
+ { MRA_WORLD, MRA_WORLD_STR, IDI_MRA_WORLD, &CMraProto::MraWorld },
+ { MRA_SEND_NUDGE, MRA_SENDNUDGE_STR, IDI_MRA_ALARM, NULL }
+};
+
+const int gdiContactMenuItemsCount = SIZEOF(gdiContactMenuItems);
+
+const GUI_DISPLAY_ITEM gdiExtraStatusIconsItems[] =
+{
+ { ADV_ICON_DELETED_ID, ADV_ICON_DELETED_STR, (INT_PTR)IDI_ERROR, NULL },
+ { ADV_ICON_NOT_ON_SERVER_ID, ADV_ICON_NOT_ON_SERVER_STR, IDI_AUTHGRANT, NULL },
+ { ADV_ICON_NOT_AUTHORIZED_ID, ADV_ICON_NOT_AUTHORIZED_STR, IDI_AUTHRUGUEST, NULL },
+ { ADV_ICON_PHONE_ID, ADV_ICON_PHONE_STR, IDI_MRA_PHONE, NULL },
+ { ADV_ICON_BLOGSTATUS_ID, ADV_ICON_BLOGSTATUS_STR, IDI_BLOGSTATUS, NULL },
+};
+
+const int gdiExtraStatusIconsItemsCount = SIZEOF(gdiExtraStatusIconsItems);
+
+const LPSTR lpcszStatusUri[] =
+{
+ "", // offline // "status_0",
+ "STATUS_ONLINE", // "status_1",
+ "STATUS_AWAY", // "status_2",
+ "STATUS_INVISIBLE", // "status_3",
+ "status_dnd",
+ "status_chat",
+ "status_4",
+ "status_5",
+ "status_6",
+ "status_7",
+ "status_8",
+ "status_9",
+ "status_10",
+ "status_11",
+ "status_12",
+ "status_13",
+ "status_14",
+ "status_15",
+ "status_16",
+ "status_17",
+ "status_18",
+ "status_19",
+ "status_20",
+ "status_21",
+ "status_22",
+ "status_23",
+ "status_24",
+ //"status_25", // chat/dnd
+ "status_26",
+ "status_27",
+ "status_28",
+ "status_29",
+ "status_30",
+ //"status_31", // chat/dnd
+ "status_32",
+ "status_33",
+ "status_34",
+ "status_35",
+ "status_36",
+ "status_37",
+ "status_38",
+ "status_39",
+ "status_40",
+ "status_41",
+ "status_42",
+ "status_43",
+ "status_44",
+ "status_45",
+ "status_46",
+ "status_47",
+ "status_48",
+ "status_49",
+ "status_50",
+ "status_51",
+ "status_52",
+ "status_53",
+ "status_dating",
+ //"status_127", 145, 154
+ NULL
+};
+
+const LPWSTR lpcszXStatusNameDef[] =
+{
+ L"None",
+ L"Sick",
+ L"Home",
+ L"Eating",
+ L"Compass",
+ L"On WC",
+ L"Cooking",
+ L"Walking",
+ L"Alien",
+ L"Shrimp",
+ L"Got lost",
+ L"Crazy",
+ L"Duck",
+ L"Playing",
+ L"Smoking",
+ L"Office",
+ L"Meeting",
+ L"Beer",
+ L"Coffee",
+ L"Working",
+ L"Relaxing",
+ L"On the phone",
+ L"In institute",
+ L"At school",
+ L"Wrong number",
+ L"Laughing",
+ L"Malicious",
+ L"Imp",
+ L"Blind",
+ L"Disappointed",
+ L"Almost crying",
+ L"Fearful",
+ L"Angry",
+ L"Vampire",
+ L"Ass",
+ L"Love",
+ L"Sleeping",
+ L"Cool!",
+ L"Peace!",
+ L"Cock a snook",
+ L"Get out",
+ L"Death",
+ L"Rocket",
+ L"Devil-fish",
+ L"Heavy metal",
+ L"Things look bad",
+ L"Squirrel",
+ L"Star",
+ L"Music",
+ L"Dating",
+ NULL
+};
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+void CMraProto::SetExtraIcons(HANDLE hContact)
+{
+ if (!hHookExtraIconsApply)
+ return;
+
+ DWORD dwID, dwGroupID, dwContactSeverFlags;
+ if ( GetContactBasicInfoW(hContact, &dwID, &dwGroupID, NULL, &dwContactSeverFlags, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, 0, NULL))
+ return;
+
+ DWORD dwIconID = -1;
+ DWORD dwXStatus = MRA_MIR_XSTATUS_NONE;
+
+ if (m_bLoggedIn) {
+ dwXStatus = mraGetByte(hContact, DBSETTING_XSTATUSID, MRA_MIR_XSTATUS_NONE);
+ if (dwID == -1)
+ dwIconID = (dwContactSeverFlags == -1) ? ADV_ICON_DELETED : ADV_ICON_NOT_ON_SERVER;
+ else {
+ if (dwGroupID == 103)
+ dwIconID = ADV_ICON_PHONE;
+ else {
+ if (dwContactSeverFlags)
+ if (dwContactSeverFlags == -1)
+ dwIconID = ADV_ICON_DELETED;
+ else
+ dwIconID = ADV_ICON_NOT_AUTHORIZED;
+ }
+ }
}
- // xstatus menu destroy
- if (masMraSettings.hHookRebuildStatusMenu) {
- UnhookEvent(masMraSettings.hHookRebuildStatusMenu);
- masMraSettings.hHookRebuildStatusMenu=NULL;
- }
+ if (dwIconID == -1) {
+ size_t dwBlogStatusMsgSize = 0;
- bzero(masMraSettings.hXStatusMenuItems,sizeof(masMraSettings.hXStatusMenuItems));
-
- // Service deletion
- for(SIZE_T i=0;i<MRA_XSTATUS_COUNT;i++) {
- mir_snprintf(pszServiceFunctionName,(SIZEOF(szServiceFunction)-PROTOCOL_NAME_LEN),"/menuXStatus%ld",i);
- DestroyServiceFunction(szServiceFunction);
+ mraGetStaticStringW(hContact, DBSETTING_BLOGSTATUS, NULL, 0, &dwBlogStatusMsgSize);
+ if (dwBlogStatusMsgSize) dwIconID = ADV_ICON_BLOGSTATUS;
}
- DestroyXStatusIcons();
-
- // Main menu destroy
- CListDestroyMenu(gdiMenuItems,SIZEOF(gdiMenuItems));
- bzero(masMraSettings.hMainMenuItems,sizeof(masMraSettings.hMainMenuItems));
-
- // Contact menu destroy
- CListDestroyMenu(gdiContactMenuItems,(SIZEOF(gdiContactMenuItems) - ((masMraSettings.heNudgeReceived==NULL)? 0:1)));
- bzero(masMraSettings.hContactMenuItems,sizeof(masMraSettings.hContactMenuItems));
-
- if (masMraSettings.heNudgeReceived) {DestroyHookableEvent(masMraSettings.heNudgeReceived); masMraSettings.heNudgeReceived=NULL;}
- if (masMraSettings.hWATrack) {UnhookEvent(masMraSettings.hWATrack); masMraSettings.hWATrack=NULL;}
- if (masMraSettings.hHookIconsChanged) {UnhookEvent(masMraSettings.hHookIconsChanged); masMraSettings.hHookIconsChanged=NULL;}
- if (masMraSettings.hHookExtraIconsRebuild) {UnhookEvent(masMraSettings.hHookExtraIconsRebuild); masMraSettings.hHookExtraIconsRebuild=NULL;}
- if (masMraSettings.hHookExtraIconsApply) {UnhookEvent(masMraSettings.hHookExtraIconsApply); masMraSettings.hHookExtraIconsApply=NULL;}
- if (masMraSettings.hHookRebuildCMenu) {UnhookEvent(masMraSettings.hHookRebuildCMenu); masMraSettings.hHookRebuildCMenu=NULL;}
- if (masMraSettings.hHookSettingChanged) {UnhookEvent(masMraSettings.hHookSettingChanged); masMraSettings.hHookSettingChanged=NULL;}
- if (masMraSettings.hHookContactDeleted) {UnhookEvent(masMraSettings.hHookContactDeleted); masMraSettings.hHookContactDeleted=NULL;}
- if (masMraSettings.hHookOptInitialize) {UnhookEvent(masMraSettings.hHookOptInitialize); masMraSettings.hHookOptInitialize=NULL;}
-
- IconsUnLoad();
-
-
- DebugPrintCRLFW(L"MRA/UnloadModules - DONE");
-}
-
-
-void UnloadServices()
-{
- CHAR szServiceFunction[MAX_PATH],*pszServiceFunctionName;
-
- memmove(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
- pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN;
-
-
- // destroy plugin services
- for (SIZE_T i=0;i<SIZEOF(siPluginServices);i++)
- {
- memmove(pszServiceFunctionName,siPluginServices[i].lpszName,(lstrlenA(siPluginServices[i].lpszName)+1));
- DestroyServiceFunction(szServiceFunction);
- }
-
- DebugPrintCRLFW(L"MRA/UnloadServices - DONE");
-}
-
-
-
-void SetExtraIcons(HANDLE hContact)
-{
- if(masMraSettings.hHookExtraIconsApply)
- {
- DWORD dwID,dwGroupID,dwContactSeverFlags;
-
- if (GetContactBasicInfoW(hContact,&dwID,&dwGroupID,NULL,&dwContactSeverFlags,NULL,NULL,0,NULL,NULL,0,NULL,NULL,0,NULL)==NO_ERROR)
- {
- DWORD dwIconID=-1;
- DWORD dwXStatus=MRA_MIR_XSTATUS_NONE;
-
- if(masMraSettings.bLoggedIn)
- {
- dwXStatus=DB_Mra_GetByte(hContact,DBSETTING_XSTATUSID,MRA_MIR_XSTATUS_NONE);
-
- if(dwID==-1)
- {
- if(dwContactSeverFlags==-1)
- {
- dwIconID=ADV_ICON_DELETED;
- }else{
- dwIconID=ADV_ICON_NOT_ON_SERVER;
- }
- }else{
- if (dwGroupID==103)
- {//***deb
- dwIconID=ADV_ICON_PHONE;
- }else{
- if(dwContactSeverFlags)
- if(dwContactSeverFlags==-1)
- {
- dwIconID=ADV_ICON_DELETED;
- }else{
- dwIconID=ADV_ICON_NOT_AUTHORIZED;
- }
- }
- }
- }
-
- if (dwIconID==-1)
- {
- SIZE_T dwBlogStatusMsgSize=0;
- DB_Mra_GetStaticStringW(hContact,DBSETTING_BLOGSTATUS,NULL,0,&dwBlogStatusMsgSize);
- if (dwBlogStatusMsgSize) dwIconID=ADV_ICON_BLOGSTATUS;
- }
-
- ExtraSetIcon(masMraSettings.hExtraXstatusIcon,hContact,((IsXStatusValid(dwXStatus) || dwXStatus==MRA_MIR_XSTATUS_UNKNOWN)? masMraSettings.hXStatusAdvancedStatusItems[dwXStatus]:NULL),EXTRA_ICON_ADV1);
- ExtraSetIcon(masMraSettings.hExtraInfo,hContact,((dwIconID!=-1)? masMraSettings.hAdvancedStatusItems[dwIconID]:NULL),EXTRA_ICON_ADV2);
- }
- }
+ ExtraSetIcon(hExtraXstatusIcon, hContact, (( IsXStatusValid(dwXStatus) || dwXStatus == MRA_MIR_XSTATUS_UNKNOWN)? hXStatusAdvancedStatusItems[dwXStatus]:NULL), EXTRA_ICON_ADV1);
+ ExtraSetIcon(hExtraInfo, hContact, ((dwIconID != -1) ? hAdvancedStatusItems[dwIconID]:NULL), EXTRA_ICON_ADV2);
}
-
-
-INT_PTR MraXStatusMenu(WPARAM wParam,LPARAM lParam,LPARAM param)
+INT_PTR CMraProto::MraXStatusMenu(WPARAM wParam, LPARAM lParam, LPARAM param)
{
- if (MraRequestXStatusDetails(param)==FALSE) MraSetXStatusInternal(param);
-return(0);
+ if ( MraRequestXStatusDetails(param) == FALSE)
+ MraSetXStatusInternal(param);
+ return 0;
}
-
-INT_PTR MraGotoInbox(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraGotoInbox(WPARAM wParam, LPARAM lParam)
{
- MraMPopSessionQueueAddUrl(masMraSettings.hMPopSessionQueue,MRA_WIN_INBOX_URL,sizeof(MRA_WIN_INBOX_URL));
-return(0);
+ MraMPopSessionQueueAddUrl(hMPopSessionQueue, MRA_WIN_INBOX_URL, sizeof(MRA_WIN_INBOX_URL));
+ return 0;
}
-INT_PTR MraShowInboxStatus(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraShowInboxStatus(WPARAM wParam, LPARAM lParam)
{
- MraUpdateEmailStatus(NULL,0,NULL,0,0,0);
-return(0);
+ MraUpdateEmailStatus(NULL, 0, NULL, 0, 0, 0);
+ return 0;
}
-INT_PTR MraSendSMS(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraSendSMS(WPARAM wParam, LPARAM lParam)
{
- INT_PTR iRet=0;
+ if (!m_bLoggedIn || !wParam || !lParam)
+ return 0;
- if (masMraSettings.bLoggedIn && wParam && lParam)
- {
- LPSTR lpszMessageUTF;
- LPWSTR lpwszMessageXMLEncoded,lpwszMessageXMLDecoded;
- SIZE_T dwMessageUTFSize,dwBuffLen,dwMessageXMLEncodedSize,dwMessageXMLDecodedSize;
-
- lpszMessageUTF=(LPSTR)lParam;
- dwMessageUTFSize=lstrlenA(lpszMessageUTF);
- dwBuffLen=(dwMessageUTFSize+MAX_PATH);
- lpwszMessageXMLEncoded=(LPWSTR)MEMALLOC((dwBuffLen*sizeof(WCHAR)));
- lpwszMessageXMLDecoded=(LPWSTR)MEMALLOC((dwBuffLen*sizeof(WCHAR)));
- if (lpwszMessageXMLEncoded && lpwszMessageXMLDecoded)
- {
- dwMessageXMLEncodedSize=MultiByteToWideChar(CP_UTF8,0,lpszMessageUTF,dwMessageUTFSize,lpwszMessageXMLEncoded,dwBuffLen);
- DecodeXML(lpwszMessageXMLEncoded,dwMessageXMLEncodedSize,lpwszMessageXMLDecoded,dwBuffLen,&dwMessageXMLDecodedSize);
-
- if (dwMessageXMLDecodedSize)
- {
- iRet=MraSendCommand_SMSW(NULL,(LPSTR)wParam,lstrlenA((LPSTR)wParam),lpwszMessageXMLDecoded,dwMessageXMLDecodedSize);
- /*{// имитируем получение смс
- char szBuff[16384];
- DWORD dwFlags;
- MRA_LPS lpsEMail,lpsText,lpsRTFText={0};
-
- dwFlags=(MESSAGE_FLAG_SMS|MESSAGE_FLAG_CP1251);
- lpsEMail.lpszData=(LPSTR)wParam;
- lpsEMail.dwSize=lstrlenA(lpsEMail.lpszData);
- lpsText.lpszData=szBuff;//LPS ## message ## текстовая версия сообщения
- lpsText.dwSize=WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszMessageXMLDecoded,dwMessageXMLDecodedSize,szBuff,sizeof(szBuff),NULL,NULL);
-
- MraRecvCommand_Message((DWORD)_time32(NULL),dwFlags,&lpsEMail,&lpsText,&lpsRTFText,NULL);
- }//*/
- }else{// conversion failed?
- DebugBreak();
- }
- }
- MEMFREE(lpwszMessageXMLDecoded);
- MEMFREE(lpwszMessageXMLEncoded);
+ mir_ptr<WCHAR> lpwszMessageXMLEncoded( mir_utf8decodeW((LPSTR)lParam));
+ size_t dwBuffLen = lstrlenA((LPSTR)lParam) + MAX_PATH;
+ LPWSTR lpwszMessageXMLDecoded = (LPWSTR)mir_calloc((dwBuffLen*sizeof(WCHAR)));
+ if (lpwszMessageXMLEncoded && lpwszMessageXMLDecoded) {
+ size_t dwMessageXMLDecodedSize;
+ DecodeXML(lpwszMessageXMLEncoded, lstrlen(lpwszMessageXMLEncoded), lpwszMessageXMLDecoded, dwBuffLen, &dwMessageXMLDecodedSize);
+ if (dwMessageXMLDecodedSize)
+ MraSMSW(NULL, (LPSTR)wParam , lstrlenA((LPSTR)wParam), lpwszMessageXMLDecoded, dwMessageXMLDecodedSize);
}
-return(iRet);
+ mir_free(lpwszMessageXMLDecoded);
+ return 0;
}
-INT_PTR MraEditProfile(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraEditProfile(WPARAM wParam, LPARAM lParam)
{
- MraMPopSessionQueueAddUrl(masMraSettings.hMPopSessionQueue,MRA_EDIT_PROFILE_URL,sizeof(MRA_EDIT_PROFILE_URL));
-return(0);
+ MraMPopSessionQueueAddUrl(hMPopSessionQueue, MRA_EDIT_PROFILE_URL, sizeof(MRA_EDIT_PROFILE_URL));
+ return 0;
}
-INT_PTR MyAlbum(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MyAlbum(WPARAM wParam, LPARAM lParam)
{
-return(MraViewAlbum(0,0));
+ return MraViewAlbum(0, 0);
}
-INT_PTR MyBlog(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MyBlog(WPARAM wParam, LPARAM lParam)
{
-return(MraReadBlog(0,0));
+ return MraReadBlog(0, 0);
}
-INT_PTR MyBlogStatus(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MyBlogStatus(WPARAM wParam, LPARAM lParam)
{
-return(MraReplyBlogStatus(0,0));
+ return MraReplyBlogStatus(0, 0);
}
-INT_PTR MyVideo(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MyVideo(WPARAM wParam, LPARAM lParam)
{
-return(MraViewVideo(0,0));
+ return MraViewVideo(0, 0);
}
-INT_PTR MyAnswers(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MyAnswers(WPARAM wParam, LPARAM lParam)
{
-return(MraAnswers(0,0));
+ return MraAnswers(0, 0);
}
-INT_PTR MyWorld(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MyWorld(WPARAM wParam, LPARAM lParam)
{
-return(MraWorld(0,0));
+ return MraWorld(0, 0);
}
-INT_PTR MraZhuki(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraZhuki(WPARAM wParam, LPARAM lParam)
{
- MraMPopSessionQueueAddUrl(masMraSettings.hMPopSessionQueue,MRA_ZHUKI_URL,sizeof(MRA_ZHUKI_URL));
-return(0);
+ MraMPopSessionQueueAddUrl(hMPopSessionQueue, MRA_ZHUKI_URL, sizeof(MRA_ZHUKI_URL));
+ return 0;
}
-INT_PTR MraChat(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraChat(WPARAM wParam, LPARAM lParam)
{
- MraMPopSessionQueueAddUrl(masMraSettings.hMPopSessionQueue,MRA_CHAT_URL,sizeof(MRA_CHAT_URL));
-return(0);
+ MraMPopSessionQueueAddUrl(hMPopSessionQueue, MRA_CHAT_URL, sizeof(MRA_CHAT_URL));
+ return 0;
}
-INT_PTR MraWebSearch(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraWebSearch(WPARAM wParam, LPARAM lParam)
{
- CallService(MS_UTILS_OPENURL,TRUE,(LPARAM)MRA_SEARCH_URL);
-return(0);
+ CallService(MS_UTILS_OPENURL, TRUE, (LPARAM)MRA_SEARCH_URL);
+ return 0;
}
-INT_PTR MraUpdateAllUsersInfo(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraUpdateAllUsersInfo(WPARAM wParam, LPARAM lParam)
{
- if (MessageBox(NULL,TranslateW(L"Are you sure?"),TranslateW(MRA_UPD_ALL_USERS_INFO_STR),(MB_YESNO|MB_ICONQUESTION))==IDYES)
- {
- CHAR szEMail[MAX_EMAIL_LEN];
- SIZE_T dwEMailSize;
- HANDLE hContact;
-
- for(hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
- {
- if (IsContactMra(hContact))
- if (DB_Mra_GetStaticStringA(hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- MraSendCommand_WPRequestByEMail(hContact,ACKTYPE_GETINFO,szEMail,dwEMailSize);
- }
+ if ( MessageBox(NULL, TranslateT("Are you sure?"), TranslateW(MRA_UPD_ALL_USERS_INFO_STR), MB_YESNO | MB_ICONQUESTION) == IDYES ) {
+ for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact != NULL;
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) {
+ size_t dwEMailSize;
+ CHAR szEMail[MAX_EMAIL_LEN];
+ if ( IsContactMra(hContact))
+ if ( mraGetStaticStringA(hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize))
+ MraWPRequestByEMail(hContact, ACKTYPE_GETINFO, szEMail, dwEMailSize);
}
}
- return(0);
+ return 0;
}
-INT_PTR MraCheckUpdatesUsersAvt(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraCheckUpdatesUsersAvt(WPARAM wParam, LPARAM lParam)
{
- if (MessageBox(NULL,TranslateW(L"Are you sure?"),TranslateW(MRA_CHK_UPDATES_USERS_AVATARS_STR),(MB_YESNO|MB_ICONQUESTION))==IDYES)
- {
- CHAR szEMail[MAX_EMAIL_LEN];
- SIZE_T dwEMailSize;
- HANDLE hContact;
+ if ( MessageBox(NULL, TranslateT("Are you sure?"), TranslateW(MRA_CHK_USERS_AVATARS_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) {
+ for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact != NULL;
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) {
+ size_t dwEMailSize;
+ CHAR szEMail[MAX_EMAIL_LEN];
- for(hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
- {
if (IsContactMra(hContact))
- if (DB_Mra_GetStaticStringA(hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
- if (IsEMailChatAgent(szEMail,dwEMailSize)==FALSE)// только для оптимизации, MraAvatarsQueueGetAvatarSimple сама умеет фильтровать чатконтакты
- MraAvatarsQueueGetAvatarSimple(masMraSettings.hAvatarsQueueHandle,0/*GAIF_FORCE*/,hContact,0);
+ if (mraGetStaticStringA(hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize))
+ if (IsEMailChatAgent(szEMail, dwEMailSize) == FALSE)// только для оптимизации, MraAvatarsQueueGetAvatarSimple сама умеет фильтровать чатконтакты
+ MraAvatarsQueueGetAvatarSimple(hAvatarsQueueHandle, 0/*GAIF_FORCE*/, hContact, 0);
}
}
- return(0);
+ return 0;
}
-INT_PTR MraRequestAuthForAll(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraRequestAuthForAll(WPARAM wParam, LPARAM lParam)
{
- if (MessageBox(NULL,TranslateW(L"Are you sure?"),TranslateW(MRA_REQ_AUTH_FOR_ALL_STR),(MB_YESNO|MB_ICONQUESTION))==IDYES)
- {
- DWORD dwContactSeverFlags;
- HANDLE hContact;
-
- for(hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
- {
- if (GetContactBasicInfoW(hContact,NULL,NULL,NULL,&dwContactSeverFlags,NULL,NULL,0,NULL,NULL,0,NULL,NULL,0,NULL)==NO_ERROR)
- if (dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED && dwContactSeverFlags!=-1)
- {
- MraRequestAuthorization((WPARAM)hContact,0);
- }
-
- /*if (IsContactMra(hContact))// inviz check
- //if ((MraContactCapabilitiesGet(hContact)&MRACCF_INVIS_ALLOWED)==0)
- if (MraGetContactStatus(hContact)==ID_STATUS_OFFLINE || MraGetContactStatus(hContact)==ID_STATUS_INVISIBLE)
- {
- CHAR szEMail[MAX_EMAIL_LEN];
- SIZE_T dwEMailSize;
-
- if (DB_Mra_GetStaticStringA(hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- MraSetContactStatus(hContact,ID_STATUS_OFFLINE);
- MraSendCommand_Game(szEMail,dwEMailSize,111,GAME_CONNECTION_INVITE,222,NULL,0);
- }
- }*/
+ if ( MessageBox(NULL, TranslateT("Are you sure?"), TranslateW(MRA_REQ_AUTH_FOR_ALL_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) {
+ for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact != NULL;
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) {
+ DWORD dwContactSeverFlags;
+ if (GetContactBasicInfoW(hContact, NULL, NULL, NULL, &dwContactSeverFlags, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, 0, NULL) == NO_ERROR)
+ if (dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED && dwContactSeverFlags != -1)
+ MraRequestAuthorization((WPARAM)hContact, 0);
}
}
-return(0);
+ return 0;
}
-
-
-
-INT_PTR MraRequestAuthorization(WPARAM wParam,LPARAM lParam)
-{//**deb add dialog?
- INT_PTR iRet=0;
-
- if (wParam)
- {
+INT_PTR CMraProto::MraRequestAuthorization(WPARAM wParam, LPARAM lParam)
+{
+ if (wParam) {
WCHAR wszAuthMessage[MAX_PATH];
- CCSDATA cs={0};
- if (DB_Mra_GetStaticStringW(NULL,"AuthMessage",wszAuthMessage,SIZEOF(wszAuthMessage),NULL)==FALSE)
- {// def auth message
- lstrcpynW(wszAuthMessage,TranslateW(MRA_DEFAULT_AUTH_MESSAGE),SIZEOF(wszAuthMessage));
- }
+ if (mraGetStaticStringW(NULL, "AuthMessage", wszAuthMessage, SIZEOF(wszAuthMessage), NULL) == FALSE)
+ lstrcpynW(wszAuthMessage, TranslateW(MRA_DEFAULT_AUTH_MESSAGE), SIZEOF(wszAuthMessage));
- cs.hContact=(HANDLE)wParam;
- cs.szProtoService=PSS_AUTHREQUESTW;
- cs.wParam=PREF_UNICODE;
- cs.lParam=(LPARAM)wszAuthMessage;
- iRet=MraSendAuthRequest(0,(LPARAM)&cs);
+ return AuthRequest((HANDLE)wParam, wszAuthMessage);
}
-return(iRet);
+ return 0;
}
-INT_PTR MraGrantAuthorization(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraGrantAuthorization(WPARAM wParam, LPARAM lParam)
{
- if (masMraSettings.bLoggedIn && wParam)
- {
- CHAR szEMail[MAX_EMAIL_LEN];
- SIZE_T dwEMailSize;
-
- if (DB_Mra_GetStaticStringA((HANDLE)wParam,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
- {// send without reason, do we need any ?
- MraSendCommand_Authorize(szEMail,dwEMailSize);
-
- //MraChatSessionJoinUser((HANDLE)wParam,"123",3,(DWORD)_time32(NULL));
-
- /*//if ((MraContactCapabilitiesGet((HANDLE)wParam)&MRACCF_INVIS_ALLOWED)==0)
- if (MraGetContactStatus((HANDLE)wParam)==ID_STATUS_OFFLINE || MraGetContactStatus((HANDLE)wParam)==ID_STATUS_INVISIBLE)
- {// inviz check
- MraSetContactStatus((HANDLE)wParam,ID_STATUS_OFFLINE);
- MraSendCommand_Game(szEMail,dwEMailSize,111,GAME_CONNECTION_INVITE,222,NULL,0);
- }*/
-
- /*MRA_GUID mguidSessionID={0};
- for(DWORD i=0;i<8;i++)
- {
- MraSendCommand_Proxy(szEMail,dwEMailSize,211+i,MRIM_PROXY_TYPE_FILES,"1.txt;111;",10,"172.0.0.1:111;",15,mguidSessionID);
- MraSendCommand_ProxyAck(j,szEMail,dwEMailSize,111+i,MRIM_PROXY_TYPE_FILES,"1.txt;111;",10,"127.0.0.1:111;",15,mguidSessionID);
- }//*/
- }
- }
-return(0);
+ if (!m_bLoggedIn || !wParam)
+ return 0;
+
+ CHAR szEMail[MAX_EMAIL_LEN];
+ size_t dwEMailSize;
+
+ // send without reason, do we need any ?
+ if (mraGetStaticStringA((HANDLE)wParam, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize))
+ MraAuthorize(szEMail, dwEMailSize);
+
+ return 0;
}
-INT_PTR MraSendPostcard(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraSendPostcard(WPARAM wParam, LPARAM lParam)
{
- if (masMraSettings.bLoggedIn)
- {
- DWORD dwContactEMailCount=GetContactEMailCount((HANDLE)wParam,FALSE);
-
- if (dwContactEMailCount)
- if (dwContactEMailCount==1)
- {
- SIZE_T dwUrlSize,dwEMailSize;
- CHAR szUrl[BUFF_SIZE_URL],szEMail[MAX_EMAIL_LEN];
-
- if (GetContactFirstEMail((HANDLE)wParam,FALSE,szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- BuffToLowerCase(szEMail,szEMail,dwEMailSize);
- dwUrlSize=mir_snprintf(szUrl,SIZEOF(szUrl),"http://cards.mail.ru/event.html?rcptname=%s&rcptemail=%s",GetContactNameA((HANDLE)wParam),szEMail);
- MraMPopSessionQueueAddUrl(masMraSettings.hMPopSessionQueue,szUrl,dwUrlSize);
+ if (!m_bLoggedIn)
+ return 0;
+
+ DWORD dwContactEMailCount = GetContactEMailCount((HANDLE)wParam, FALSE);
+ if (dwContactEMailCount) {
+ if (dwContactEMailCount == 1) {
+ size_t dwUrlSize, dwEMailSize;
+ CHAR szUrl[BUFF_SIZE_URL], szEMail[MAX_EMAIL_LEN];
+
+ if ( GetContactFirstEMail((HANDLE)wParam, FALSE, szEMail, SIZEOF(szEMail), &dwEMailSize)) {
+ BuffToLowerCase(szEMail, szEMail, dwEMailSize);
+ dwUrlSize = mir_snprintf(szUrl, SIZEOF(szUrl), "http://cards.mail.ru/event.html?rcptname = %s&rcptemail = %s", GetContactNameA((HANDLE)wParam), szEMail);
+ MraMPopSessionQueueAddUrl(hMPopSessionQueue, szUrl, dwUrlSize);
}
- }else{// show dialog box
- MraSelectEMailDlgShow((HANDLE)wParam,MRA_SELECT_EMAIL_TYPE_SEND_POSTCARD);
}
+ else MraSelectEMailDlgShow((HANDLE)wParam, MRA_SELECT_EMAIL_TYPE_SEND_POSTCARD);
}
-return(0);
+ return 0;
}
-INT_PTR MraViewAlbum(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraViewAlbum(WPARAM wParam, LPARAM lParam)
{
- if (masMraSettings.bLoggedIn)
- {
- DWORD dwContactEMailMRCount=GetContactEMailCount((HANDLE)wParam,TRUE);
-
- if (dwContactEMailMRCount)
- if (dwContactEMailMRCount==1)
- {
- SIZE_T dwEMailSize;
- CHAR szEMail[MAX_EMAIL_LEN];
+ if (!m_bLoggedIn)
+ return 0;
- if (GetContactFirstEMail((HANDLE)wParam,TRUE,szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- MraMPopSessionQueueAddUrlAndEMail(masMraSettings.hMPopSessionQueue,MRA_FOTO_URL,sizeof(MRA_FOTO_URL),szEMail,dwEMailSize);
- }
- }else{// show dialog box
- MraSelectEMailDlgShow((HANDLE)wParam,MRA_SELECT_EMAIL_TYPE_VIEW_ALBUM);
+ DWORD dwContactEMailMRCount = GetContactEMailCount((HANDLE)wParam, TRUE);
+ if (dwContactEMailMRCount) {
+ if (dwContactEMailMRCount == 1) {
+ size_t dwEMailSize;
+ CHAR szEMail[MAX_EMAIL_LEN];
+ if (GetContactFirstEMail((HANDLE)wParam, TRUE, szEMail, SIZEOF(szEMail), &dwEMailSize))
+ MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_FOTO_URL, sizeof(MRA_FOTO_URL), szEMail, dwEMailSize);
}
+ else MraSelectEMailDlgShow((HANDLE)wParam, MRA_SELECT_EMAIL_TYPE_VIEW_ALBUM);
}
-return(0);
+ return 0;
}
-INT_PTR MraReadBlog(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraReadBlog(WPARAM wParam, LPARAM lParam)
{
- if (masMraSettings.bLoggedIn)
- {
- DWORD dwContactEMailMRCount=GetContactEMailCount((HANDLE)wParam,TRUE);
-
- if (dwContactEMailMRCount)
- if (dwContactEMailMRCount==1)
- {
- CHAR szEMail[MAX_EMAIL_LEN];
- SIZE_T dwEMailSize;
+ if (!m_bLoggedIn)
+ return 0;
- if (GetContactFirstEMail((HANDLE)wParam,TRUE,szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- MraMPopSessionQueueAddUrlAndEMail(masMraSettings.hMPopSessionQueue,MRA_BLOGS_URL,sizeof(MRA_BLOGS_URL),szEMail,dwEMailSize);
- }
- }else{// show dialog box
- MraSelectEMailDlgShow((HANDLE)wParam,MRA_SELECT_EMAIL_TYPE_READ_BLOG);
- }
+ DWORD dwContactEMailMRCount = GetContactEMailCount((HANDLE)wParam, TRUE);
+ if (dwContactEMailMRCount)
+ if (dwContactEMailMRCount == 1) {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ size_t dwEMailSize;
+ if (GetContactFirstEMail((HANDLE)wParam, TRUE, szEMail, SIZEOF(szEMail), &dwEMailSize))
+ MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_BLOGS_URL, sizeof(MRA_BLOGS_URL), szEMail, dwEMailSize);
}
-return(0);
+ else MraSelectEMailDlgShow((HANDLE)wParam, MRA_SELECT_EMAIL_TYPE_READ_BLOG);
+
+ return 0;
}
-INT_PTR MraReplyBlogStatus(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraReplyBlogStatus(WPARAM wParam, LPARAM lParam)
{
- if (masMraSettings.bLoggedIn)
- {
- SIZE_T dwBlogStatusMsgSize=0;
-
- DB_Mra_GetStaticStringW((HANDLE)wParam,DBSETTING_BLOGSTATUS,NULL,0,&dwBlogStatusMsgSize);
- if (dwBlogStatusMsgSize || wParam==0)
- {
- MraSendReplyBlogStatus((HANDLE)wParam);
- }
- }
-return(0);
+ if (!m_bLoggedIn)
+ return 0;
+
+ size_t dwBlogStatusMsgSize = 0;
+ mraGetStaticStringW((HANDLE)wParam, DBSETTING_BLOGSTATUS, NULL, 0, &dwBlogStatusMsgSize);
+ if (dwBlogStatusMsgSize || wParam == 0)
+ MraSendReplyBlogStatus((HANDLE)wParam);
+
+ return 0;
}
-INT_PTR MraViewVideo(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraViewVideo(WPARAM wParam, LPARAM lParam)
{
- if (masMraSettings.bLoggedIn)
- {
- DWORD dwContactEMailMRCount=GetContactEMailCount((HANDLE)wParam,TRUE);
-
- if (dwContactEMailMRCount)
- if (dwContactEMailMRCount==1)
- {
- CHAR szEMail[MAX_EMAIL_LEN];
- SIZE_T dwEMailSize;
+ if (!m_bLoggedIn)
+ return 0;
- if (GetContactFirstEMail((HANDLE)wParam,TRUE,szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- MraMPopSessionQueueAddUrlAndEMail(masMraSettings.hMPopSessionQueue,MRA_VIDEO_URL,sizeof(MRA_VIDEO_URL),szEMail,dwEMailSize);
- }
- }else{// show dialog box
- MraSelectEMailDlgShow((HANDLE)wParam,MRA_SELECT_EMAIL_TYPE_VIEW_VIDEO);
+ DWORD dwContactEMailMRCount = GetContactEMailCount((HANDLE)wParam, TRUE);
+ if (dwContactEMailMRCount) {
+ if (dwContactEMailMRCount == 1) {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ size_t dwEMailSize;
+ if (GetContactFirstEMail((HANDLE)wParam, TRUE, szEMail, SIZEOF(szEMail), &dwEMailSize))
+ MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_VIDEO_URL, sizeof(MRA_VIDEO_URL), szEMail, dwEMailSize);
}
+ else MraSelectEMailDlgShow((HANDLE)wParam, MRA_SELECT_EMAIL_TYPE_VIEW_VIDEO);
}
-return(0);
+ return 0;
}
-INT_PTR MraAnswers(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraAnswers(WPARAM wParam, LPARAM lParam)
{
- if (masMraSettings.bLoggedIn)
- {
- DWORD dwContactEMailMRCount=GetContactEMailCount((HANDLE)wParam,TRUE);
-
- if (dwContactEMailMRCount)
- if (dwContactEMailMRCount==1)
- {
- CHAR szEMail[MAX_EMAIL_LEN];
- SIZE_T dwEMailSize;
+ if (!m_bLoggedIn)
+ return 0;
- if (GetContactFirstEMail((HANDLE)wParam,TRUE,szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- MraMPopSessionQueueAddUrlAndEMail(masMraSettings.hMPopSessionQueue,MRA_ANSWERS_URL,sizeof(MRA_ANSWERS_URL),szEMail,dwEMailSize);
- }
- }else{// show dialog box
- MraSelectEMailDlgShow((HANDLE)wParam,MRA_SELECT_EMAIL_TYPE_ANSWERS);
+ DWORD dwContactEMailMRCount = GetContactEMailCount((HANDLE)wParam, TRUE);
+ if (dwContactEMailMRCount) {
+ if (dwContactEMailMRCount == 1) {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ size_t dwEMailSize;
+ if (GetContactFirstEMail((HANDLE)wParam, TRUE, szEMail, SIZEOF(szEMail), &dwEMailSize))
+ MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_ANSWERS_URL, sizeof(MRA_ANSWERS_URL), szEMail, dwEMailSize);
}
+ else MraSelectEMailDlgShow((HANDLE)wParam, MRA_SELECT_EMAIL_TYPE_ANSWERS);
}
-return(0);
+ return 0;
}
-INT_PTR MraWorld(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraWorld(WPARAM wParam, LPARAM lParam)
{
- if (masMraSettings.bLoggedIn)
- {
- DWORD dwContactEMailMRCount=GetContactEMailCount((HANDLE)wParam,TRUE);
-
- if (dwContactEMailMRCount)
- if (dwContactEMailMRCount==1)
- {
- CHAR szEMail[MAX_EMAIL_LEN];
- SIZE_T dwEMailSize;
+ if (!m_bLoggedIn)
+ return 0;
- if (GetContactFirstEMail((HANDLE)wParam,TRUE,szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- MraMPopSessionQueueAddUrlAndEMail(masMraSettings.hMPopSessionQueue,MRA_WORLD_URL,sizeof(MRA_WORLD_URL),szEMail,dwEMailSize);
- }
- }else{// show dialog box
- MraSelectEMailDlgShow((HANDLE)wParam,MRA_SELECT_EMAIL_TYPE_WORLD);
+ DWORD dwContactEMailMRCount = GetContactEMailCount((HANDLE)wParam, TRUE);
+ if (dwContactEMailMRCount) {
+ if (dwContactEMailMRCount == 1) {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ size_t dwEMailSize;
+ if (GetContactFirstEMail((HANDLE)wParam, TRUE, szEMail, SIZEOF(szEMail), &dwEMailSize))
+ MraMPopSessionQueueAddUrlAndEMail(hMPopSessionQueue, MRA_WORLD_URL, sizeof(MRA_WORLD_URL), szEMail, dwEMailSize);
}
+ else MraSelectEMailDlgShow((HANDLE)wParam, MRA_SELECT_EMAIL_TYPE_WORLD);
}
-return(0);
+ return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-int MraContactDeleted(WPARAM wParam,LPARAM lParam)
+int CMraProto::MraContactDeleted(WPARAM wParam, LPARAM lParam)
{
- if (masMraSettings.bLoggedIn && wParam)
- {
- HANDLE hContact=(HANDLE)wParam;
- if (IsContactMra(hContact))
- {
- CHAR szEMail[MAX_EMAIL_LEN];
- DWORD dwID,dwGroupID;
- SIZE_T dwEMailSize;
+ HANDLE hContact = (HANDLE)wParam;
+ if (!m_bLoggedIn || !hContact)
+ return 0;
- GetContactBasicInfoW(hContact,&dwID,&dwGroupID,NULL,NULL,NULL,szEMail,SIZEOF(szEMail),&dwEMailSize,NULL,0,NULL,NULL,0,NULL);
+ if ( IsContactMra(hContact)) {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ DWORD dwID, dwGroupID;
+ size_t dwEMailSize;
+ GetContactBasicInfoW(hContact, &dwID, &dwGroupID, NULL, NULL, NULL, szEMail, SIZEOF(szEMail), &dwEMailSize, NULL, 0, NULL, NULL, 0, NULL);
- MraSetContactStatus(hContact,ID_STATUS_OFFLINE);
- if (DBGetContactSettingByte(hContact,"CList","NotOnList",0)==0 || dwID!=-1) MraSendCommand_ModifyContactW(hContact,dwID,CONTACT_FLAG_REMOVED,dwGroupID,szEMail,dwEMailSize,NULL,0,NULL,0);
- MraAvatarsDeleteContactAvatarFile(masMraSettings.hAvatarsQueueHandle,hContact);
- }
+ MraSetContactStatus(hContact, ID_STATUS_OFFLINE);
+ if ( !db_get_b(hContact, "CList", "NotOnList", 0) || dwID != -1)
+ MraModifyContactW(hContact, dwID, CONTACT_FLAG_REMOVED, dwGroupID, szEMail, dwEMailSize, NULL, 0, NULL, 0);
+ MraAvatarsDeleteContactAvatarFile(hAvatarsQueueHandle, hContact);
}
-return(0);
+ return 0;
}
-
-int MraDbSettingChanged(WPARAM wParam,LPARAM lParam)
+int CMraProto::MraDbSettingChanged(WPARAM wParam, LPARAM lParam)
{
- if (masMraSettings.bLoggedIn && lParam)
- {
- HANDLE hContact=(HANDLE)wParam;
- DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
+ if (!m_bLoggedIn || !lParam)
+ return 0;
- if (hContact)
- {
- if (IsContactMra(hContact) && DBGetContactSettingByte(hContact,"CList","NotOnList",0)==0 && DB_Mra_GetDword(hContact,"HooksLocked",FALSE)==FALSE)
- {// это наш контакт, он не временный (есть в списке на сервере) и его обновление разрешено
- CHAR szEMail[MAX_EMAIL_LEN],szPhones[MAX_EMAIL_LEN];
- WCHAR wszNick[MAX_EMAIL_LEN];
- DWORD dwID,dwGroupID,dwContactFlag;
- SIZE_T dwEMailSize,dwNickSize,dwPhonesSize;
-
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szModule,-1,"CList",5)==CSTR_EQUAL)
- {// CList section
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szSetting,-1,"MyHandle",8)==CSTR_EQUAL)
- {// MyHandle setting
- LPWSTR lpwszNewNick;
-
- if (cws->value.type==DBVT_DELETED)
- {// allways store custom nick
- lstrcpynW(wszNick,GetContactNameW(hContact),SIZEOF(wszNick));
- lpwszNewNick=wszNick;
- dwNickSize=lstrlenW(lpwszNewNick);
- DB_SetStringExW(hContact,"CList","MyHandle",lpwszNewNick,dwNickSize);
- }else{
- if (cws->value.pszVal)
- {
- switch(cws->value.type){
- case DBVT_WCHAR:
- lpwszNewNick=cws->value.pwszVal;
- dwNickSize=lstrlenW(lpwszNewNick);
- break;
- case DBVT_UTF8:
- lpwszNewNick=wszNick;
- dwNickSize=MultiByteToWideChar(CP_UTF8,0,cws->value.pszVal,-1,wszNick,SIZEOF(wszNick));
- break;
- case DBVT_ASCIIZ:
- lpwszNewNick=wszNick;
- dwNickSize=MultiByteToWideChar(MRA_CODE_PAGE,0,cws->value.pszVal,-1,wszNick,SIZEOF(wszNick));
- break;
- default:
- lpwszNewNick=NULL;
- dwNickSize=0;
- break;
- }
- if (lpwszNewNick)
- if (GetContactBasicInfoW(hContact,&dwID,&dwGroupID,&dwContactFlag,NULL,NULL,szEMail,SIZEOF(szEMail),&dwEMailSize,NULL,0,NULL,szPhones,SIZEOF(szPhones),&dwPhonesSize)==NO_ERROR)
- {
- MraSendCommand_ModifyContactW(hContact,dwID,dwContactFlag,dwGroupID,szEMail,dwEMailSize,lpwszNewNick,dwNickSize,szPhones,dwPhonesSize);
- }
- }
- }
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szSetting,-1,"Group",5)==CSTR_EQUAL)
- {// Group setting //***deb
- if (TRUE)
- {// manage group on server
- switch(cws->value.type){
- case DBVT_ASCIIZ:
-
- break;
- case DBVT_DELETED:
-
- break;
- }
- }
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szSetting,-1,"NotOnList",9)==CSTR_EQUAL)
- {// NotOnList setting // Has a temporary contact just been added permanently?
- if (cws->value.type==DBVT_DELETED || (cws->value.type==DBVT_BYTE && cws->value.bVal==0))
- {
- WCHAR wszAuthMessage[MAX_PATH];
- SIZE_T dwAuthMessageSize;
-
- if (DB_Mra_GetStaticStringW(NULL,"AuthMessage",wszAuthMessage,SIZEOF(wszAuthMessage),&dwAuthMessageSize)==FALSE)
- {// def auth message
- lstrcpynW(wszAuthMessage,TranslateW(MRA_DEFAULT_AUTH_MESSAGE),SIZEOF(wszAuthMessage));
- dwAuthMessageSize=lstrlenW(wszAuthMessage);
- }
-
- DBDeleteContactSetting(hContact,"CList","Hidden");
- GetContactBasicInfoW(hContact,NULL,&dwGroupID,&dwContactFlag,NULL,NULL,szEMail,SIZEOF(szEMail),&dwEMailSize,wszNick,SIZEOF(wszNick),&dwNickSize,szPhones,SIZEOF(szPhones),&dwPhonesSize);
- MraSendCommand_AddContactW(hContact,dwContactFlag,dwGroupID,szEMail,dwEMailSize,wszNick,dwNickSize,szPhones,dwPhonesSize,wszAuthMessage,dwAuthMessageSize,0);
- }
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szSetting,-1,"Hidden",6)==CSTR_EQUAL)
- {// Hidden setting
- GetContactBasicInfoW(hContact,&dwID,&dwGroupID,&dwContactFlag,NULL,NULL,szEMail,SIZEOF(szEMail),&dwEMailSize,wszNick,SIZEOF(wszNick),&dwNickSize,szPhones,SIZEOF(szPhones),&dwPhonesSize);
- if(cws->value.type==DBVT_DELETED || (cws->value.type==DBVT_BYTE && cws->value.bVal==0))
- {
- dwContactFlag&=~CONTACT_FLAG_SHADOW;
- }else{
- dwContactFlag|=CONTACT_FLAG_SHADOW;
- }
- MraSendCommand_ModifyContactW(hContact,dwID,dwContactFlag,dwGroupID,szEMail,dwEMailSize,wszNick,dwNickSize,szPhones,dwPhonesSize);
+ HANDLE hContact = (HANDLE)wParam;
+ DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
+
+ if (hContact) {
+ // это наш контакт, он не временный (есть в списке на сервере) и его обновление разрешено
+ if ( IsContactMra(hContact) && !db_get_b(hContact, "CList", "NotOnList", 0) && mraGetDword(hContact, "HooksLocked", FALSE) == FALSE) {
+ CHAR szEMail[MAX_EMAIL_LEN], szPhones[MAX_EMAIL_LEN];
+ WCHAR wszNick[MAX_EMAIL_LEN];
+ DWORD dwID, dwGroupID, dwContactFlag;
+ size_t dwEMailSize, dwNickSize, dwPhonesSize;
+
+ if ( CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, cws->szModule, -1, "CList", 5) == CSTR_EQUAL) {
+ // MyHandle setting
+ if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, cws->szSetting, -1, "MyHandle", 8) == CSTR_EQUAL) {
+ LPWSTR lpwszNewNick;
+
+ // allways store custom nick
+ if (cws->value.type == DBVT_DELETED) {
+ lstrcpynW(wszNick, GetContactNameW(hContact), SIZEOF(wszNick));
+ lpwszNewNick = wszNick;
+ dwNickSize = lstrlenW(lpwszNewNick);
+ DB_SetStringExW(hContact, "CList", "MyHandle", lpwszNewNick, dwNickSize);
}
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szModule,-1,"Ignore",6)==CSTR_EQUAL)
- {// Ignore section
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szSetting,-1,"Mask1",5)==CSTR_EQUAL)
- {
- GetContactBasicInfoW(hContact,&dwID,&dwGroupID,&dwContactFlag,NULL,NULL,szEMail,SIZEOF(szEMail),&dwEMailSize,wszNick,SIZEOF(wszNick),&dwNickSize,szPhones,SIZEOF(szPhones),&dwPhonesSize);
- if(cws->value.type==DBVT_DELETED || (cws->value.type==DBVT_DWORD && cws->value.dVal&IGNOREEVENT_MESSAGE)==0)
- {
- dwContactFlag&=~CONTACT_FLAG_IGNORE;
- }else{
- dwContactFlag|=CONTACT_FLAG_IGNORE;
- }
- MraSendCommand_ModifyContactW(hContact,dwID,dwContactFlag,dwGroupID,szEMail,dwEMailSize,wszNick,dwNickSize,szPhones,dwPhonesSize);
- }
- }else
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szModule,-1,"UserInfo",8)==CSTR_EQUAL)
- {// User info section
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szSetting,-1,"MyPhone0",8)==CSTR_EQUAL
- || CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szSetting,-1,"MyPhone1",8)==CSTR_EQUAL
- || CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szSetting,-1,"MyPhone2",8)==CSTR_EQUAL)
- {
- //if(cws->value.type!=DBVT_DELETED)
- {
- GetContactBasicInfoW(hContact,&dwID,&dwGroupID,&dwContactFlag,NULL,NULL,szEMail,SIZEOF(szEMail),&dwEMailSize,wszNick,SIZEOF(wszNick),&dwNickSize,szPhones,SIZEOF(szPhones),&dwPhonesSize);
- MraSendCommand_ModifyContactW(hContact,dwID,dwContactFlag,dwGroupID,szEMail,dwEMailSize,wszNick,dwNickSize,szPhones,dwPhonesSize);
+ else if (cws->value.pszVal) {
+ switch (cws->value.type) {
+ case DBVT_WCHAR:
+ lpwszNewNick = cws->value.pwszVal;
+ dwNickSize = lstrlenW(lpwszNewNick);
+ break;
+ case DBVT_UTF8:
+ lpwszNewNick = wszNick;
+ dwNickSize = MultiByteToWideChar(CP_UTF8, 0, cws->value.pszVal, -1, wszNick, SIZEOF(wszNick));
+ break;
+ case DBVT_ASCIIZ:
+ lpwszNewNick = wszNick;
+ dwNickSize = MultiByteToWideChar(MRA_CODE_PAGE, 0, cws->value.pszVal, -1, wszNick, SIZEOF(wszNick));
+ break;
+ default:
+ lpwszNewNick = NULL;
+ dwNickSize = 0;
+ break;
}
+ if (lpwszNewNick)
+ if (GetContactBasicInfoW(hContact, &dwID, &dwGroupID, &dwContactFlag, NULL, NULL, szEMail, SIZEOF(szEMail), &dwEMailSize, NULL, 0, NULL, szPhones, SIZEOF(szPhones), &dwPhonesSize) == NO_ERROR)
+ MraModifyContactW(hContact, dwID, dwContactFlag, dwGroupID, szEMail, dwEMailSize, lpwszNewNick, dwNickSize, szPhones, dwPhonesSize);
}
}
- }
- }else{// not contact
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szModule,-1,"CListGroups",11)==CSTR_EQUAL)
- {// CList section //***deb
- if (TRUE)
- {// manage group on server
- switch(cws->value.type){
+ // Group setting
+ else if ( CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, cws->szSetting, -1, "Group", 5) == CSTR_EQUAL ) {
+ // manage group on server
+ switch (cws->value.type) {
case DBVT_ASCIIZ:
-
break;
case DBVT_DELETED:
-
break;
}
}
- }
- }
-
+ // NotOnList setting. Has a temporary contact just been added permanently?
+ else if ( CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, cws->szSetting, -1, "NotOnList", 9) == CSTR_EQUAL) {
+ if (cws->value.type == DBVT_DELETED || (cws->value.type == DBVT_BYTE && cws->value.bVal == 0)) {
+ WCHAR wszAuthMessage[MAX_PATH];
+ size_t dwAuthMessageSize;
+ if ( mraGetStaticStringW(NULL, "AuthMessage", wszAuthMessage, SIZEOF(wszAuthMessage), &dwAuthMessageSize) == FALSE) {
+ lstrcpynW(wszAuthMessage, TranslateW(MRA_DEFAULT_AUTH_MESSAGE), SIZEOF(wszAuthMessage));
+ dwAuthMessageSize = lstrlenW(wszAuthMessage);
+ }
- /*if ( hContact == NULL && MyOptions.ManageServer && !strcmp( cws->szModule, "CListGroups" )) {
- int iNumber = atol( cws->szSetting );
- LPCSTR szId = MSN_GetGroupByNumber( iNumber );
- if ( szId != NULL ) {
- if ( cws->value.type == DBVT_DELETED ) {
- msnNsThread->sendPacket( "RMG", szId );
- }
- else if ( cws->value.type == DBVT_ASCIIZ ) {
- LPCSTR oldId = MSN_GetGroupByName( cws->value.pszVal+1 );
- if ( oldId == NULL ) {
- CHAR* p = Utf8Encode( cws->value.pszVal+1 ), szNewName[ 200 ];
- UrlEncode( p, szNewName, sizeof szNewName );
- msnNsThread->sendPacket( "REG", "%s %s", szId, szNewName );
- free( p );
+ DBDeleteContactSetting(hContact, "CList", "Hidden");
+ GetContactBasicInfoW(hContact, NULL, &dwGroupID, &dwContactFlag, NULL, NULL, szEMail, SIZEOF(szEMail), &dwEMailSize, wszNick, SIZEOF(wszNick), &dwNickSize, szPhones, SIZEOF(szPhones), &dwPhonesSize);
+ MraAddContactW(hContact, dwContactFlag, dwGroupID, szEMail, dwEMailSize, wszNick, dwNickSize, szPhones, dwPhonesSize, wszAuthMessage, dwAuthMessageSize, 0);
}
- else MSN_SetGroupNumber( oldId, iNumber );
- } }
- else if ( cws->value.type == DBVT_ASCIIZ )
- MSN_AddServerGroup( cws->value.pszVal+1 );
-
- return 0;
- }
-
- if ( !strcmp( cws->szModule, "CList" ) && MyOptions.ManageServer ) {
- CHAR* szProto = ( CHAR* )MSN_CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM ) hContact, 0 );
- if ( szProto == NULL || strcmp( szProto, msnProtocolName ))
- return 0;
-
- if ( !strcmp( cws->szSetting, "Group" )) {
- if ( cws->value.type == DBVT_DELETED )
- MSN_MoveContactToGroup( hContact, NULL );
- else if ( cws->value.type == DBVT_ASCIIZ ) {
- LPCSTR p = MSN_GetGroupByName( cws->value.pszVal );
- if ( p == NULL )
- MSN_AddServerGroup( cws->value.pszVal );
-
- MSN_MoveContactToGroup( hContact, cws->value.pszVal );
}
- return 0;
+ // Hidden setting
+ else if ( CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, cws->szSetting, -1, "Hidden" , 6) == CSTR_EQUAL) {
+ GetContactBasicInfoW(hContact, &dwID, &dwGroupID, &dwContactFlag, NULL, NULL, szEMail, SIZEOF(szEMail), &dwEMailSize, wszNick, SIZEOF(wszNick), &dwNickSize, szPhones, SIZEOF(szPhones), &dwPhonesSize);
+ if (cws->value.type == DBVT_DELETED || (cws->value.type == DBVT_BYTE && cws->value.bVal == 0))
+ dwContactFlag &= ~CONTACT_FLAG_SHADOW;
+ else
+ dwContactFlag |= CONTACT_FLAG_SHADOW;
+
+ MraModifyContactW(hContact, dwID, dwContactFlag, dwGroupID, szEMail, dwEMailSize, wszNick, dwNickSize, szPhones, dwPhonesSize);
+ }
}
-
- } }*/
-
+ // Ignore section
+ else if ( CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, cws->szModule, -1, "Ignore", 6) == CSTR_EQUAL) {
+ if ( CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, cws->szSetting, -1, "Mask1", 5) == CSTR_EQUAL) {
+ GetContactBasicInfoW(hContact, &dwID, &dwGroupID, &dwContactFlag, NULL, NULL, szEMail, SIZEOF(szEMail), &dwEMailSize, wszNick, SIZEOF(wszNick), &dwNickSize, szPhones, SIZEOF(szPhones), &dwPhonesSize);
+ if (cws->value.type == DBVT_DELETED || (cws->value.type == DBVT_DWORD && cws->value.dVal&IGNOREEVENT_MESSAGE) == 0)
+ dwContactFlag &= ~CONTACT_FLAG_IGNORE;
+ else
+ dwContactFlag |= CONTACT_FLAG_IGNORE;
+
+ MraModifyContactW(hContact, dwID, dwContactFlag, dwGroupID, szEMail, dwEMailSize, wszNick, dwNickSize, szPhones, dwPhonesSize);
+ }
+ }
+ // User info section
+ else if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, cws->szModule, -1, "UserInfo", 8) == CSTR_EQUAL) {
+ if ( CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, cws->szSetting, -1, "MyPhone0", 8) == CSTR_EQUAL ||
+ CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, cws->szSetting, -1, "MyPhone1", 8) == CSTR_EQUAL ||
+ CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, cws->szSetting, -1, "MyPhone2", 8) == CSTR_EQUAL) {
+ GetContactBasicInfoW(hContact, &dwID, &dwGroupID, &dwContactFlag, NULL, NULL, szEMail, SIZEOF(szEMail), &dwEMailSize, wszNick, SIZEOF(wszNick), &dwNickSize, szPhones, SIZEOF(szPhones), &dwPhonesSize);
+ MraModifyContactW(hContact, dwID, dwContactFlag, dwGroupID, szEMail, dwEMailSize, wszNick, dwNickSize, szPhones, dwPhonesSize);
+ }
+ }
+ }
+ }
+ // not contact
+ else {
+ if ( CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, cws->szModule, -1, "CListGroups", 11) == CSTR_EQUAL) {
+ // manage group on server
+ switch (cws->value.type) {
+ case DBVT_ASCIIZ:
+ break;
+ case DBVT_DELETED:
+ break;
+ }
+ }
}
-return(0);
-}
+ return 0;
+}
-int MraRebuildContactMenu(WPARAM wParam,LPARAM lParam)
+int CMraProto::MraRebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
- BOOL bIsContactMRA,bHasEMail,bHasEMailMR,bChatAgent;
- DWORD dwContactSeverFlags=0;
- SIZE_T dwBlogStatusMsgSize=0;
- HANDLE hContact=(HANDLE)wParam;
-
- bIsContactMRA=IsContactMra(hContact);
- if (bIsContactMRA)//**deb телефонные контакты!
- {// proto own contact
- bHasEMail=TRUE;
- bHasEMailMR=TRUE;
- bChatAgent=IsContactChatAgent(hContact);
- GetContactBasicInfoW(hContact,NULL,NULL,NULL,&dwContactSeverFlags,NULL,NULL,0,NULL,NULL,0,NULL,NULL,0,NULL);
- DB_Mra_GetStaticStringW(hContact,DBSETTING_BLOGSTATUS,NULL,0,&dwBlogStatusMsgSize);
- }else{// non proto contact
- bHasEMail=FALSE;
- bHasEMailMR=FALSE;
- bChatAgent=FALSE;
- if (DB_Mra_GetByte(NULL,"HideMenuItemsForNonMRAContacts",MRA_DEFAULT_HIDE_MENU_ITEMS_FOR_NON_MRA)==FALSE)
- if (IsContactMraProto(hContact)==FALSE)// избегаем добавления менюшек в контакты других копий MRA
- if (GetContactEMailCount(hContact,FALSE))
- {
- bHasEMail=TRUE;
- if (GetContactEMailCount(hContact,TRUE)) bHasEMailMR=TRUE;
+ BOOL bIsContactMRA, bHasEMail, bHasEMailMR, bChatAgent;
+ DWORD dwContactSeverFlags = 0;
+ size_t dwBlogStatusMsgSize = 0;
+ HANDLE hContact = (HANDLE)wParam;
+
+ // proto own contact
+ bIsContactMRA = IsContactMra(hContact);
+ if (bIsContactMRA) {
+ bHasEMail = TRUE;
+ bHasEMailMR = TRUE;
+ bChatAgent = IsContactChatAgent(hContact);
+ GetContactBasicInfoW(hContact, NULL, NULL, NULL, &dwContactSeverFlags, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, 0, NULL);
+ mraGetStaticStringW(hContact, DBSETTING_BLOGSTATUS, NULL, 0, &dwBlogStatusMsgSize);
+ }
+ // non proto contact
+ else {
+ bHasEMail = FALSE;
+ bHasEMailMR = FALSE;
+ bChatAgent = FALSE;
+ if (mraGetByte(NULL, "HideMenuItemsForNonMRAContacts", MRA_DEFAULT_HIDE_MENU_ITEMS_FOR_NON_MRA) == FALSE)
+ if (IsContactMraProto(hContact) == FALSE)// избегаем добавления менюшек в контакты других копий MRA
+ if (GetContactEMailCount(hContact, FALSE)) {
+ bHasEMail = TRUE;
+ if (GetContactEMailCount(hContact, TRUE)) bHasEMailMR = TRUE;
}
}
//"Request authorization"
- CListShowMenuItem(masMraSettings.hContactMenuItems[0],(masMraSettings.bLoggedIn && bIsContactMRA));// && (dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED)
+ CListShowMenuItem(hContactMenuItems[0], (m_bLoggedIn && bIsContactMRA));// && (dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED)
//"Grant authorization"
- CListShowMenuItem(masMraSettings.hContactMenuItems[1],(masMraSettings.bLoggedIn && bIsContactMRA && bChatAgent==FALSE));
+ CListShowMenuItem(hContactMenuItems[1], (m_bLoggedIn && bIsContactMRA && bChatAgent == FALSE));
//"&Send postcard"
- CListShowMenuItem(masMraSettings.hContactMenuItems[2],(masMraSettings.bLoggedIn && bHasEMail && bChatAgent==FALSE));
+ CListShowMenuItem(hContactMenuItems[2], (m_bLoggedIn && bHasEMail && bChatAgent == FALSE));
//"&View Album"
- CListShowMenuItem(masMraSettings.hContactMenuItems[3],(masMraSettings.bLoggedIn && bHasEMailMR && bChatAgent==FALSE));
+ CListShowMenuItem(hContactMenuItems[3], (m_bLoggedIn && bHasEMailMR && bChatAgent == FALSE));
//"&Read Blog"
- CListShowMenuItem(masMraSettings.hContactMenuItems[4],(masMraSettings.bLoggedIn && bHasEMailMR && bChatAgent==FALSE));
+ CListShowMenuItem(hContactMenuItems[4], (m_bLoggedIn && bHasEMailMR && bChatAgent == FALSE));
//"Reply Blog Status"
- CListShowMenuItem(masMraSettings.hContactMenuItems[5],(masMraSettings.bLoggedIn && dwBlogStatusMsgSize && bChatAgent==FALSE));
+ CListShowMenuItem(hContactMenuItems[5], (m_bLoggedIn && dwBlogStatusMsgSize && bChatAgent == FALSE));
//"View Video"
- CListShowMenuItem(masMraSettings.hContactMenuItems[6],(masMraSettings.bLoggedIn && bHasEMailMR && bChatAgent==FALSE));
+ CListShowMenuItem(hContactMenuItems[6], (m_bLoggedIn && bHasEMailMR && bChatAgent == FALSE));
//"Answers"
- CListShowMenuItem(masMraSettings.hContactMenuItems[7],(masMraSettings.bLoggedIn && bHasEMailMR && bChatAgent==FALSE));
+ CListShowMenuItem(hContactMenuItems[7], (m_bLoggedIn && bHasEMailMR && bChatAgent == FALSE));
//"World"
- CListShowMenuItem(masMraSettings.hContactMenuItems[8],(masMraSettings.bLoggedIn && bHasEMailMR && bChatAgent==FALSE));
+ CListShowMenuItem(hContactMenuItems[8], (m_bLoggedIn && bHasEMailMR && bChatAgent == FALSE));
//"Send &Nudge"
- if (masMraSettings.heNudgeReceived==NULL)
- {
- CListShowMenuItem(masMraSettings.hContactMenuItems[9],(masMraSettings.bLoggedIn && bIsContactMRA));
- }
+ if (heNudgeReceived == NULL)
+ CListShowMenuItem(hContactMenuItems[9], (m_bLoggedIn && bIsContactMRA));
-return(0);
+ return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+// Extra icons
-int MraExtraIconsApply(WPARAM wParam,LPARAM lParam)
+int CMraProto::MraExtraIconsApply(WPARAM wParam, LPARAM lParam)
{
SetExtraIcons((HANDLE)wParam);
-return(0);
+ return 0;
}
-
-int MraExtraIconsRebuild(WPARAM wParam,LPARAM lParam)
+int CMraProto::MraExtraIconsRebuild(WPARAM wParam, LPARAM lParam)
{
- for(SIZE_T i=0;i<ADV_ICON_MAX;i++) masMraSettings.hAdvancedStatusItems[i]=(HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON,(WPARAM)IconLibGetIcon(masMraSettings.hAdvancedStatusIcons[i]),0);
- for(SIZE_T i=0;i<(MRA_XSTATUS_COUNT+1);i++) masMraSettings.hXStatusAdvancedStatusItems[i]=(HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON,(WPARAM)IconLibGetIcon(masMraSettings.hXStatusAdvancedStatusIcons[i]),0);
+ for (size_t i = 0; i < ADV_ICON_MAX; i++)
+ hAdvancedStatusItems[i] = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)IconLibGetIcon(hAdvancedStatusIcons[i]), 0);
+
+ for (size_t i = 0; i < MRA_XSTATUS_COUNT+1; i++)
+ hXStatusAdvancedStatusItems[i] = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)IconLibGetIcon(hXStatusAdvancedStatusIcons[i]), 0);
-return(0);
+ return 0;
}
-int MraRebuildStatusMenu(WPARAM wParam,LPARAM lParam)
+/////////////////////////////////////////////////////////////////////////////////////////
+
+int CMraProto::MraRebuildStatusMenu(WPARAM wParam, LPARAM lParam)
{
- CHAR szServiceFunction[MAX_PATH*2],*pszServiceFunctionName,szValueName[MAX_PATH];
- WCHAR szItem[MAX_PATH+64],szStatusTitle[STATUS_TITLE_MAX+4];
- CLISTMENUITEM mi={0};
-
- memmove(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
- pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN;
- //memmove(pszServiceFunctionName,MRA_XSTATUS_MENU,sizeof(MRA_XSTATUS_MENU));
-
- mir_sntprintf(szItem,SIZEOF(szItem),L"%s Custom Status",PROTOCOL_NAMEW);
- mi.cbSize=sizeof(mi);
- mi.position=2000060000;
- mi.popupPosition=500085000;
- mi.ptszPopupName=szItem;
- //mi.ptszName=szStatusTitle;
- mi.flags=(CMIF_UNICODE|CMIF_ICONFROMICOLIB);
- mi.pszService=szServiceFunction;
- mi.pszContactOwner=PROTOCOL_NAMEA;
-
- for(SIZE_T i=0;i<MRA_XSTATUS_COUNT;i++)
- {
- mir_snprintf(pszServiceFunctionName,(SIZEOF(szServiceFunction)-PROTOCOL_NAME_LEN),"/menuXStatus%ld",i);
+ CHAR szServiceFunction[MAX_PATH*2], *pszServiceFunctionName, szValueName[MAX_PATH];
+ strncpy(szServiceFunction, m_szModuleName, sizeof(szServiceFunction));
+ pszServiceFunctionName = szServiceFunction + strlen(m_szModuleName);
+
+ WCHAR szItem[MAX_PATH+64], szStatusTitle[STATUS_TITLE_MAX+4];
+ mir_sntprintf(szItem, SIZEOF(szItem), L"%s Custom Status", m_tszUserName);
+
+ CLISTMENUITEM mi = {0};
+ mi.cbSize = sizeof(mi);
+ mi.position = 2000060000;
+ mi.popupPosition = 500085000;
+ mi.ptszPopupName = szItem;
+ mi.flags = (CMIF_UNICODE|CMIF_ICONFROMICOLIB);
+ mi.pszService = szServiceFunction;
+ mi.pszContactOwner = m_szModuleName;
+
+ for (size_t i = 0; i < MRA_XSTATUS_COUNT; i++) {
+ mir_snprintf(pszServiceFunctionName, 100, "/menuXStatus%ld", i);
mi.position++;
- if (i)
- {
- mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldName",i);
- if (DB_Mra_GetStaticStringW(NULL,szValueName,szStatusTitle,(STATUS_TITLE_MAX+1),NULL))
- {
- szStatusTitle[STATUS_TITLE_MAX]=0;
- mi.ptszName=szStatusTitle;
- }else{// default xstatus name
- mi.ptszName=lpcszXStatusNameDef[i];
+ if (i) {
+ mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldName", i);
+ if (mraGetStaticStringW(NULL, szValueName, szStatusTitle, (STATUS_TITLE_MAX+1), NULL)) {
+ szStatusTitle[STATUS_TITLE_MAX] = 0;
+ mi.ptszName = szStatusTitle;
}
- mi.icolibItem=masMraSettings.hXStatusAdvancedStatusIcons[i];
- }else{
- mi.ptszName=lpcszXStatusNameDef[i];
- mi.hIcon=NULL;
+ else mi.ptszName = lpcszXStatusNameDef[i];
+
+ mi.icolibItem = hXStatusAdvancedStatusIcons[i];
+ }
+ else {
+ mi.ptszName = lpcszXStatusNameDef[i];
+ mi.hIcon = NULL;
}
- masMraSettings.hXStatusMenuItems[i] = Menu_AddStatusMenuItem(&mi);
+ hXStatusMenuItems[i] = Menu_AddStatusMenuItem(&mi);
}
-return(0);
+ return 0;
}
-
-INT_PTR MraSetListeningTo(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraSetListeningTo(WPARAM wParam, LPARAM lParam)
{
- LISTENINGTOINFO *pliInfo=(LISTENINGTOINFO*)lParam;
+ LISTENINGTOINFO *pliInfo = (LISTENINGTOINFO*)lParam;
- if ( pliInfo == NULL || pliInfo->cbSize != sizeof(LISTENINGTOINFO))
- {
- MraSendCommand_ChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC,NULL,0,0);
- DB_Mra_DeleteValue(NULL,DBSETTING_BLOGSTATUSMUSIC);
- }else
- if (pliInfo->dwFlags & LTI_UNICODE)
+ if (pliInfo == NULL || pliInfo->cbSize != sizeof(LISTENINGTOINFO))
{
+ MraChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC, NULL, 0, 0);
+ mraDelValue(NULL, DBSETTING_BLOGSTATUSMUSIC);
+ }
+ else if (pliInfo->dwFlags & LTI_UNICODE) {
LPWSTR pwszListeningTo;
WCHAR wszListeningTo[MICBLOG_STATUS_MAX+4];
- SIZE_T dwListeningToSize;
+ size_t dwListeningToSize;
- if (ServiceExists(MS_LISTENINGTO_GETPARSEDTEXT))
- {
- pwszListeningTo=(LPWSTR)CallService(MS_LISTENINGTO_GETPARSEDTEXT,(WPARAM)L"%track%. %title% - %artist% - %player%",(LPARAM)pliInfo);
- dwListeningToSize=lstrlenW(pwszListeningTo);
- }else{
- pwszListeningTo=wszListeningTo;
- dwListeningToSize=mir_sntprintf(pwszListeningTo,SIZEOF(wszListeningTo),L"%s. %s - %s - %s", pliInfo->ptszTrack?pliInfo->ptszTrack:L"", pliInfo->ptszTitle?pliInfo->ptszTitle:L"", pliInfo->ptszArtist?pliInfo->ptszArtist:L"", pliInfo->ptszPlayer?pliInfo->ptszPlayer:L"");
+ if ( ServiceExists(MS_LISTENINGTO_GETPARSEDTEXT)) {
+ pwszListeningTo = (LPWSTR)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)L"%track%. %title% - %artist% - %player%", (LPARAM)pliInfo);
+ dwListeningToSize = lstrlenW(pwszListeningTo);
+ }
+ else {
+ pwszListeningTo = wszListeningTo;
+ dwListeningToSize = mir_sntprintf(pwszListeningTo, SIZEOF(wszListeningTo), L"%s. %s - %s - %s", pliInfo->ptszTrack?pliInfo->ptszTrack:L"", pliInfo->ptszTitle?pliInfo->ptszTitle:L"", pliInfo->ptszArtist?pliInfo->ptszArtist:L"", pliInfo->ptszPlayer?pliInfo->ptszPlayer:L"");
}
- DB_Mra_SetStringExW(NULL,DBSETTING_BLOGSTATUSMUSIC,pwszListeningTo,dwListeningToSize);
- MraSendCommand_ChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC,pwszListeningTo,dwListeningToSize,0);
+ mraSetStringExW(NULL, DBSETTING_BLOGSTATUSMUSIC, pwszListeningTo, dwListeningToSize);
+ MraChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC, pwszListeningTo, dwListeningToSize, 0);
- if (pwszListeningTo!=wszListeningTo) mir_free(pwszListeningTo);
+ if (pwszListeningTo != wszListeningTo)
+ mir_free(pwszListeningTo);
}
-return(0);
+ return 0;
}
-
-int MraMusicChanged(WPARAM wParam,LPARAM lParam)
+int CMraProto::MraMusicChanged(WPARAM wParam, LPARAM lParam)
{
- switch (wParam){
+ switch (wParam) {
case WAT_EVENT_PLAYERSTATUS:
- if (1==lParam)
- {// stopped
- DB_Mra_DeleteValue(NULL,DBSETTING_BLOGSTATUSMUSIC);
- MraSendCommand_ChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC,NULL,0,0);
+ // stopped
+ if (1 == lParam) {
+ mraDelValue(NULL, DBSETTING_BLOGSTATUSMUSIC);
+ MraChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC, NULL, 0, 0);
}
break;
+
case WAT_EVENT_NEWTRACK:
{
SONGINFO *psiSongInfo;
-
- if (WAT_RES_OK==CallService(MS_WAT_GETMUSICINFO,WAT_INF_UNICODE,(LPARAM)&psiSongInfo))
- {
+ if (WAT_RES_OK == CallService(MS_WAT_GETMUSICINFO, WAT_INF_UNICODE, (LPARAM)&psiSongInfo)) {
WCHAR wszMusic[MICBLOG_STATUS_MAX+4];
- SIZE_T dwMusicSize;
+ size_t dwMusicSize;
- dwMusicSize=mir_sntprintf(wszMusic,SIZEOF(wszMusic),L"%ld. %s - %s - %s",psiSongInfo->track,psiSongInfo->artist,psiSongInfo->title,psiSongInfo->player);
- DB_Mra_SetStringExW(NULL,DBSETTING_BLOGSTATUSMUSIC,wszMusic,dwMusicSize);
- MraSendCommand_ChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC,wszMusic,dwMusicSize,0);
+ dwMusicSize = mir_sntprintf(wszMusic, SIZEOF(wszMusic), L"%ld. %s - %s - %s", psiSongInfo->track, psiSongInfo->artist, psiSongInfo->title, psiSongInfo->player);
+ mraSetStringExW(NULL, DBSETTING_BLOGSTATUSMUSIC, wszMusic, dwMusicSize);
+ MraChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC, wszMusic, dwMusicSize, 0);
}
}
break;
- default:
- break;
- }
-
-return(0);
-}
-
-
-INT_PTR MraGetCaps(WPARAM wParam,LPARAM lParam)
-{
- INT_PTR iRet;
-
- switch(wParam){
- case PFLAGNUM_1:
- iRet=PF1_IM|PF1_FILE|PF1_MODEMSG|PF1_SERVERCLIST|PF1_AUTHREQ|PF1_ADDED|PF1_VISLIST|PF1_INVISLIST|PF1_INDIVSTATUS|PF1_PEER2PEER|/*PF1_NEWUSER|*/PF1_CHAT|PF1_BASICSEARCH|PF1_EXTSEARCH|PF1_CANRENAMEFILE|PF1_FILERESUME|PF1_ADDSEARCHRES|PF1_CONTACT|PF1_SEARCHBYEMAIL|PF1_USERIDISEMAIL|PF1_SEARCHBYNAME|PF1_EXTSEARCHUI;
- break;
- case PFLAGNUM_2:
- iRet=PF2_ONLINE|PF2_INVISIBLE|PF2_SHORTAWAY|PF2_HEAVYDND|PF2_FREECHAT;
- break;
- case PFLAGNUM_3:
- iRet=PF2_ONLINE|PF2_INVISIBLE|PF2_SHORTAWAY|PF2_HEAVYDND|PF2_FREECHAT;
- break;
- case PFLAGNUM_4:
- iRet=PF4_FORCEAUTH|PF4_FORCEADDED|/*PF4_NOCUSTOMAUTH|*/PF4_SUPPORTTYPING|PF4_AVATARS|PF4_IMSENDUTF;
- break;
- case PFLAG_UNIQUEIDTEXT:
- iRet=(INT_PTR)Translate("E-mail address");
- break;
- case PFLAG_MAXCONTACTSPERPACKET:
- iRet=MRA_MAXCONTACTSPERPACKET;
- break;
- case PFLAG_UNIQUEIDSETTING:
- iRet=(INT_PTR)"e-mail";
- break;
- case PFLAG_MAXLENOFMESSAGE:
- iRet=MRA_MAXLENOFMESSAGE;
- break;
- default:
- iRet=0;
- break;
- }
-return(iRet);
-}
-
-
-INT_PTR MraGetName(WPARAM wParam,LPARAM lParam)
-{
- lstrcpynA((LPSTR)lParam,PROTOCOL_DISPLAY_NAMEA,wParam);
-return(0);
-}
-
-
-INT_PTR MraLoadIcon(WPARAM wParam,LPARAM lParam)
-{
- UINT id;
-
- switch(wParam&0xFFFF){
- case PLI_PROTOCOL:id=IDI_MRA;break;// IDI_TM is the main icon for the protocol
- default:return(0);
- }
-return((INT_PTR)LoadImage(masMraSettings.hInstance,MAKEINTRESOURCE(id),IMAGE_ICON,GetSystemMetrics((wParam&PLIF_SMALL)?SM_CXSMICON:SM_CXICON),GetSystemMetrics((wParam&PLIF_SMALL)?SM_CYSMICON:SM_CYICON),0));
-}
-
-
-INT_PTR MraSetStatus(WPARAM wParam,LPARAM lParam)
-{
- // remap global statuses to local supported
- switch(wParam){
- case ID_STATUS_OFFLINE:
- wParam=ID_STATUS_OFFLINE;
- break;
- case ID_STATUS_ONLINE:
- wParam=ID_STATUS_ONLINE;
- break;
- case ID_STATUS_AWAY:
- wParam=ID_STATUS_AWAY;
- break;
- case ID_STATUS_DND:
- case ID_STATUS_OCCUPIED:
- wParam=ID_STATUS_DND;
- break;
- case ID_STATUS_FREECHAT:
- wParam=ID_STATUS_FREECHAT;
- break;
- case ID_STATUS_INVISIBLE:
- wParam=ID_STATUS_INVISIBLE;
- break;
- case ID_STATUS_NA:
- case ID_STATUS_ONTHEPHONE:
- case ID_STATUS_OUTTOLUNCH:
- wParam=ID_STATUS_AWAY;
- break;
- default:
- wParam=ID_STATUS_OFFLINE;
- break;
}
-
- if (InterlockedExchangeAdd((volatile LONG*)&masMraSettings.dwStatusMode,0)==wParam && wParam!=lParam)
- {// nothink to change
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,NULL,ACKTYPE_STATUS,ACKRESULT_SUCCESS,(HANDLE)wParam,wParam,0);
- }else{
- DWORD dwOldStatusMode;
-
- if ((masMraSettings.dwDesiredStatusMode=wParam)==ID_STATUS_OFFLINE)
- {//set all contacts to offline
- masMraSettings.bLoggedIn=FALSE;
- dwOldStatusMode=InterlockedExchange((volatile LONG*)&masMraSettings.dwStatusMode,masMraSettings.dwDesiredStatusMode);
-
- if (dwOldStatusMode>ID_STATUS_OFFLINE)
- {// всех в offline, только если мы бывали подключены
- for(HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
- {// функция сама проверяет принадлежность контакта к MRA
- SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,(SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS),-1,-1,0,0,ID_STATUS_OFFLINE,NULL,0,NULL,0,NULL,0);
- }
- }
- Netlib_CloseHandle(masMraSettings.hConnection);
- }else{
- // если offline то сразу ставим connecting, но обработка как offline
- dwOldStatusMode=InterlockedCompareExchange((volatile LONG*)&masMraSettings.dwStatusMode,ID_STATUS_CONNECTING,ID_STATUS_OFFLINE);
-
- switch(dwOldStatusMode){
- case ID_STATUS_OFFLINE:// offline, connecting
- if (StartConnect()!=NO_ERROR)
- {//err
- masMraSettings.bLoggedIn=FALSE;
- masMraSettings.dwDesiredStatusMode=ID_STATUS_OFFLINE;
- dwOldStatusMode=InterlockedExchange((volatile LONG*)&masMraSettings.dwStatusMode,masMraSettings.dwDesiredStatusMode);
- }
- break;
- case ID_STATUS_ONLINE:// connected, change status
- case ID_STATUS_AWAY:
- case ID_STATUS_DND:
- case ID_STATUS_FREECHAT:
- case ID_STATUS_INVISIBLE:
- MraSendNewStatus(masMraSettings.dwDesiredStatusMode,MraGetXStatusInternal(),NULL,0,NULL,0);
- case ID_STATUS_CONNECTING:
- if (dwOldStatusMode==ID_STATUS_CONNECTING && wParam!=lParam)
- {// предотвращаем переход в любой статус (кроме offline) из статуса connecting, если он не вызван самим плагином
- break;
- }
- default:
- dwOldStatusMode=InterlockedExchange((volatile LONG*)&masMraSettings.dwStatusMode,masMraSettings.dwDesiredStatusMode);
- //MraSendNewStatus(masMraSettings.dwDesiredStatusMode,MraGetXStatusInternal(),NULL,0,NULL,0);
- break;
- }
- }
- MraSetContactStatus(NULL,masMraSettings.dwStatusMode);
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,NULL,ACKTYPE_STATUS,ACKRESULT_SUCCESS,(HANDLE)dwOldStatusMode,masMraSettings.dwStatusMode,0);
- }
-return(0);
+ return 0;
}
-
-INT_PTR MraGetStatus(WPARAM wParam,LPARAM lParam)
-{
-return(InterlockedExchangeAdd((volatile LONG*)&masMraSettings.dwStatusMode,0));
-}
-
-
-DWORD MraSetXStatusInternal(DWORD dwXStatus)
+DWORD CMraProto::MraSetXStatusInternal(DWORD dwXStatus)
{
DWORD dwOldStatusMode;
- if (IsXStatusValid(dwXStatus))
- {
+ if ( IsXStatusValid(dwXStatus)) {
CHAR szValueName[MAX_PATH];
WCHAR szBuff[4096];
- SIZE_T dwBuffSize;
+ size_t dwBuffSize;
// obsolete (TODO: remove in next version)
- mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldName",dwXStatus);
- if (DB_Mra_GetStaticStringW(NULL,szValueName,szBuff,SIZEOF(szBuff),&dwBuffSize)==FALSE)
- {// default xstatus name
- lstrcpynW(szBuff,lpcszXStatusNameDef[dwXStatus],SIZEOF(szBuff));
- dwBuffSize=lstrlenW(szBuff);
+ mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldName", dwXStatus);
+ if (mraGetStaticStringW(NULL, szValueName, szBuff, SIZEOF(szBuff), &dwBuffSize) == FALSE) {
+ lstrcpynW(szBuff, lpcszXStatusNameDef[dwXStatus], SIZEOF(szBuff));
+ dwBuffSize = lstrlenW(szBuff);
}
- if (dwBuffSize>STATUS_TITLE_MAX) dwBuffSize=STATUS_TITLE_MAX;
- DB_Mra_SetStringExW(NULL,DBSETTING_XSTATUSNAME,szBuff,dwBuffSize);
+ if (dwBuffSize>STATUS_TITLE_MAX) dwBuffSize = STATUS_TITLE_MAX;
+ mraSetStringExW(NULL, DBSETTING_XSTATUSNAME, szBuff, dwBuffSize);
// obsolete (TODO: remove in next version)
- mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldMsg",dwXStatus);
- if (DB_Mra_GetStaticStringW(NULL,szValueName,szBuff,SIZEOF(szBuff),&dwBuffSize))
- {// custom xstatus description
- if (dwBuffSize>STATUS_DESC_MAX) dwBuffSize=STATUS_DESC_MAX;
- DB_Mra_SetStringExW(NULL,DBSETTING_XSTATUSMSG,szBuff,dwBuffSize);
- }else{// default xstatus description
- DB_Mra_DeleteValue(NULL,DBSETTING_XSTATUSMSG);
+ mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldMsg", dwXStatus);
+ if (mraGetStaticStringW(NULL, szValueName, szBuff, SIZEOF(szBuff), &dwBuffSize)) {
+ if (dwBuffSize>STATUS_DESC_MAX) dwBuffSize = STATUS_DESC_MAX;
+ mraSetStringExW(NULL, DBSETTING_XSTATUSMSG, szBuff, dwBuffSize);
}
- }else{
- DB_Mra_DeleteValue(NULL,DBSETTING_XSTATUSNAME);
- DB_Mra_DeleteValue(NULL,DBSETTING_XSTATUSMSG);
- dwXStatus=MRA_MIR_XSTATUS_NONE;
+ else mraDelValue(NULL, DBSETTING_XSTATUSMSG);
+ }
+ else {
+ mraDelValue(NULL, DBSETTING_XSTATUSNAME);
+ mraDelValue(NULL, DBSETTING_XSTATUSMSG);
+ dwXStatus = MRA_MIR_XSTATUS_NONE;
}
- dwOldStatusMode=InterlockedExchange((volatile LONG*)&masMraSettings.dwXStatusMode,dwXStatus);
- DB_Mra_SetByte(NULL,DBSETTING_XSTATUSID,(BYTE)dwXStatus);
+ dwOldStatusMode = InterlockedExchange((volatile LONG*)&m_iXStatus, dwXStatus);
+ mraSetByte(NULL, DBSETTING_XSTATUSID, (BYTE)dwXStatus);
- MraSendNewStatus(MraGetStatus(0,0),dwXStatus,NULL,0,NULL,0);
+ MraSendNewStatus(m_iStatus, dwXStatus, NULL, 0, NULL, 0);
-return(dwOldStatusMode);
+ return dwOldStatusMode;
}
-DWORD MraGetXStatusInternal()
+// obsolete (TODO: remove in next version)
+INT_PTR CMraProto::MraSetXStatus(WPARAM wParam, LPARAM lParam)
{
-return(InterlockedExchangeAdd((volatile LONG*)&masMraSettings.dwXStatusMode,0));
-}
-
-
-
-INT_PTR MraSetXStatus(WPARAM wParam,LPARAM lParam)
-{// obsolete (TODO: remove in next version)
- INT_PTR iRet=0;
-
- if (IsXStatusValid(wParam) || wParam==MRA_MIR_XSTATUS_NONE)
- {
+ INT_PTR iRet = 0;
+ if ( IsXStatusValid(wParam) || wParam == MRA_MIR_XSTATUS_NONE) {
MraSetXStatusInternal(wParam);
- iRet=wParam;
+ iRet = wParam;
}
-return(iRet);
+ return iRet;
}
-INT_PTR MraSetXStatusEx(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraSetXStatusEx(WPARAM wParam, LPARAM lParam)
{
- INT_PTR iRet=1;
+ INT_PTR iRet = 1;
DWORD dwXStatus;
- ICQ_CUSTOM_STATUS *pData=(ICQ_CUSTOM_STATUS*)lParam;
+ ICQ_CUSTOM_STATUS *pData = (ICQ_CUSTOM_STATUS*)lParam;
- if (pData->cbSize>=sizeof(ICQ_CUSTOM_STATUS))
- {
- iRet=0;
-
- if (pData->flags&CSSF_MASK_STATUS)
- {// fill status member
- dwXStatus=(*pData->status);
- if (IsXStatusValid(dwXStatus)==FALSE && dwXStatus!=MRA_MIR_XSTATUS_NONE) iRet=1;
- }else{
- dwXStatus=MraGetXStatusInternal();
+ if (pData->cbSize >= sizeof(ICQ_CUSTOM_STATUS)) {
+ iRet = 0;
+
+ if (pData->flags & CSSF_MASK_STATUS) {
+ dwXStatus = *pData->status;
+ if ( IsXStatusValid(dwXStatus) == FALSE && dwXStatus != MRA_MIR_XSTATUS_NONE)
+ iRet = 1;
}
+ else dwXStatus = m_iXStatus;
- if (pData->flags&(CSSF_MASK_NAME|CSSF_MASK_MESSAGE) && iRet==0)
- {//
- if (IsXStatusValid(dwXStatus) || dwXStatus==MRA_MIR_XSTATUS_NONE)
- {
+ if (pData->flags & (CSSF_MASK_NAME|CSSF_MASK_MESSAGE) && iRet == 0) {
+ if ( IsXStatusValid(dwXStatus) || dwXStatus == MRA_MIR_XSTATUS_NONE) {
CHAR szValueName[MAX_PATH];
- SIZE_T dwBuffSize;
-
- if (pData->flags&CSSF_MASK_NAME)
- {// set custom status name
- mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldName",dwXStatus);
- if (pData->flags&CSSF_UNICODE)
- {
- dwBuffSize=lstrlenW(pData->pwszName);
- if (dwBuffSize>STATUS_TITLE_MAX) dwBuffSize=STATUS_TITLE_MAX;
-
- DB_Mra_SetStringExW(NULL,szValueName,pData->pwszName,dwBuffSize);
- DB_Mra_SetStringExW(NULL,DBSETTING_XSTATUSNAME,pData->pwszName,dwBuffSize);
- }else{
- dwBuffSize=lstrlenA(pData->pszName);
- if (dwBuffSize>STATUS_TITLE_MAX) dwBuffSize=STATUS_TITLE_MAX;
-
- DB_Mra_SetStringExA(NULL,szValueName,pData->pszName,dwBuffSize);
- DB_Mra_SetStringExA(NULL,DBSETTING_XSTATUSNAME,pData->pszName,dwBuffSize);
+ size_t dwBuffSize;
+
+ // set custom status name
+ if (pData->flags & CSSF_MASK_NAME) {
+ mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldName", dwXStatus);
+ if (pData->flags & CSSF_UNICODE) {
+ dwBuffSize = lstrlenW(pData->pwszName);
+ if (dwBuffSize>STATUS_TITLE_MAX) dwBuffSize = STATUS_TITLE_MAX;
+
+ mraSetStringExW(NULL, szValueName, pData->pwszName, dwBuffSize);
+ mraSetStringExW(NULL, DBSETTING_XSTATUSNAME, pData->pwszName, dwBuffSize);
}
- }
+ else {
+ dwBuffSize = lstrlenA(pData->pszName);
+ if (dwBuffSize > STATUS_TITLE_MAX)
+ dwBuffSize = STATUS_TITLE_MAX;
- if (pData->flags&CSSF_MASK_MESSAGE)
- {// set custom status message
- mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldMsg",dwXStatus);
- if (pData->flags&CSSF_UNICODE)
- {
- dwBuffSize=lstrlenW(pData->pwszMessage);
- if (dwBuffSize>STATUS_TITLE_MAX) dwBuffSize=STATUS_DESC_MAX;
-
- DB_Mra_SetStringExW(NULL,szValueName,pData->pwszMessage,dwBuffSize);
- DB_Mra_SetStringExW(NULL,DBSETTING_XSTATUSMSG,pData->pwszMessage,dwBuffSize);
- }else{
- dwBuffSize=lstrlenA(pData->pszMessage);
- if (dwBuffSize>STATUS_TITLE_MAX) dwBuffSize=STATUS_DESC_MAX;
-
- DB_Mra_SetStringExA(NULL,szValueName,pData->pszMessage,dwBuffSize);
- DB_Mra_SetStringExA(NULL,DBSETTING_XSTATUSMSG,pData->pszMessage,dwBuffSize);
+ mraSetStringExA(NULL, szValueName, pData->pszName, dwBuffSize);
+ mraSetStringExA(NULL, DBSETTING_XSTATUSNAME, pData->pszName, dwBuffSize);
}
}
- }else{// неудача только если мы не ставили Хстатус и попытались записать сообщения для "нет" статуса
- if ((pData->flags&CSSF_MASK_STATUS)==0) iRet=1;
- }
- }
-
- if (pData->flags&(CSSF_MASK_STATUS|CSSF_MASK_NAME|CSSF_MASK_MESSAGE) && iRet==0)
- {// set/update xstatus code and/or message
- MraSetXStatusInternal(dwXStatus);
- }
- if (pData->flags&CSSF_DISABLE_UI)
- {// hide menu items
- masMraSettings.bHideXStatusUI=(*pData->wParam)? FALSE:TRUE;
- for (DWORD i=0;i<MRA_XSTATUS_COUNT;i++) CListShowMenuItem(masMraSettings.hXStatusMenuItems[i],!masMraSettings.bHideXStatusUI);
- }
- }
-return(iRet);
-}
+ // set custom status message
+ if (pData->flags & CSSF_MASK_MESSAGE) {
+ mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldMsg", dwXStatus);
+ if (pData->flags & CSSF_UNICODE) {
+ dwBuffSize = lstrlenW(pData->pwszMessage);
+ if (dwBuffSize>STATUS_TITLE_MAX) dwBuffSize = STATUS_DESC_MAX;
-INT_PTR MraGetXStatus(WPARAM wParam,LPARAM lParam)
-{
- INT_PTR iRet;
-
- if (masMraSettings.bLoggedIn)
- {
- if (wParam) *((CHAR**)wParam)=DBSETTING_XSTATUSNAME;
- if (lParam) *((CHAR**)lParam)=DBSETTING_XSTATUSMSG;
- iRet=MraGetXStatusInternal();
- }else{
- iRet=0;
- }
-
-return(iRet);
-}
-
-INT_PTR MraGetXStatusEx(WPARAM wParam,LPARAM lParam)
-{
- INT_PTR iRet=1;
- HANDLE hContact=(HANDLE)wParam;
- ICQ_CUSTOM_STATUS *pData=(ICQ_CUSTOM_STATUS*)lParam;
-
- if (pData->cbSize>=sizeof(ICQ_CUSTOM_STATUS))
- {
- DWORD dwXStatus;
-
- iRet=0;
-
- if (pData->flags&CSSF_MASK_STATUS)
- {// fill status member
- *pData->status=MraGetXStatusInternal();
- }
+ mraSetStringExW(NULL, szValueName, pData->pwszMessage, dwBuffSize);
+ mraSetStringExW(NULL, DBSETTING_XSTATUSMSG, pData->pwszMessage, dwBuffSize);
+ }
+ else {
+ dwBuffSize = lstrlenA(pData->pszMessage);
+ if (dwBuffSize>STATUS_TITLE_MAX) dwBuffSize = STATUS_DESC_MAX;
- if (pData->flags&CSSF_MASK_NAME)
- {// fill status name member
- if (pData->flags&CSSF_DEFAULT_NAME)
- {
- dwXStatus=(*pData->wParam);
- if (IsXStatusValid(dwXStatus))
- {
- if (pData->flags&CSSF_UNICODE)
- {
- lstrcpynW(pData->pwszName,lpcszXStatusNameDef[dwXStatus],(STATUS_TITLE_MAX+1));
- }else{
- SIZE_T dwStatusTitleSize;
-
- dwStatusTitleSize=lstrlenW(lpcszXStatusNameDef[dwXStatus]);
- if (dwStatusTitleSize>STATUS_TITLE_MAX) dwStatusTitleSize=STATUS_TITLE_MAX;
-
- WideCharToMultiByte(MRA_CODE_PAGE,0,lpcszXStatusNameDef[dwXStatus],dwStatusTitleSize,pData->pszName,MAX_PATH,NULL,NULL );
- (*((CHAR*)(pData->pszName+dwStatusTitleSize)))=0;
+ mraSetStringExA(NULL, szValueName, pData->pszMessage, dwBuffSize);
+ mraSetStringExA(NULL, DBSETTING_XSTATUSMSG, pData->pszMessage, dwBuffSize);
}
- }else{// failure
- iRet=1;
- }
- }else{
- if (pData->flags&CSSF_UNICODE)
- {
- DB_Mra_GetStaticStringW(hContact,DBSETTING_XSTATUSNAME,pData->pwszName,(STATUS_TITLE_MAX+1),NULL);
- }else{
- DB_Mra_GetStaticStringA(hContact,DBSETTING_XSTATUSNAME,pData->pszName,(STATUS_TITLE_MAX+1),NULL);
}
}
+ // неудача только если мы не ставили Хстатус и попытались записать сообщения для "нет" статуса
+ else if ( !(pData->flags & CSSF_MASK_STATUS))
+ iRet = 1;
}
- if (pData->flags&CSSF_MASK_MESSAGE)
- {// fill status message member
- if (pData->flags&CSSF_UNICODE)
- {
- DB_Mra_GetStaticStringW(hContact,DBSETTING_XSTATUSMSG,pData->pwszMessage,(STATUS_DESC_MAX+1),NULL);
- }else{
- DB_Mra_GetStaticStringA(hContact,DBSETTING_XSTATUSMSG,pData->pszMessage,(STATUS_DESC_MAX+1),NULL);
- }
- }
-
- if (pData->flags&CSSF_DISABLE_UI)
- {
- if (pData->wParam) (*pData->wParam)=masMraSettings.bHideXStatusUI;
- }
-
- if (pData->flags&CSSF_STATUSES_COUNT)
- {
- if (pData->wParam) (*pData->wParam)=(MRA_XSTATUS_COUNT-1);
- }
-
- if (pData->flags&CSSF_STR_SIZES)
- {//**deb можно оптимизировать, данный параметр возможно уже был вычислен при получении самих текстов
- if (pData->wParam) DB_Mra_GetStaticStringW(hContact,DBSETTING_XSTATUSNAME,NULL,0,(SIZE_T*)pData->wParam);
- if (pData->lParam) DB_Mra_GetStaticStringW(hContact,DBSETTING_XSTATUSMSG,NULL,0,(SIZE_T*)pData->lParam);
- }
- }
-return(iRet);
-}
-
-INT_PTR MraGetXStatusIcon(WPARAM wParam,LPARAM lParam)
-{
- INT_PTR iRet;
-
- if (wParam==0) wParam=MraGetXStatusInternal();
- iRet=(INT_PTR)IconLibGetIconEx(masMraSettings.hXStatusAdvancedStatusIcons[wParam],lParam);
-
-return(iRet);
-}
-
-
-DWORD MraSendNewStatus(DWORD dwStatusMir,DWORD dwXStatusMir,LPWSTR lpwszStatusTitle,SIZE_T dwStatusTitleSize,LPWSTR lpwszStatusDesc,SIZE_T dwStatusDescSize)
-{
- if (masMraSettings.bLoggedIn)
- {
- CHAR szValueName[MAX_PATH];
- WCHAR wszStatusTitle[STATUS_TITLE_MAX+4],wszStatusDesc[STATUS_DESC_MAX+4];
- DWORD dwStatus,dwXStatus;
-
- dwStatus=GetMraStatusFromMiradaStatus(dwStatusMir,dwXStatusMir,&dwXStatus);
- if (IsXStatusValid(dwXStatusMir))
- {// xstatuses
- if (lpwszStatusTitle==NULL || dwStatusTitleSize==0)
- {
- mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldName",dwXStatusMir);
- if (DB_Mra_GetStaticStringW(NULL,szValueName,wszStatusTitle,(STATUS_TITLE_MAX+1),&dwStatusTitleSize))
- {// custom xstatus name
- lpwszStatusTitle=wszStatusTitle;
- }else{// default xstatus name
- lpwszStatusTitle=TranslateW(lpcszXStatusNameDef[dwXStatusMir]);
- dwStatusTitleSize=lstrlenW(lpwszStatusTitle);
- }
- }
+ // set/update xstatus code and/or message
+ if (pData->flags & (CSSF_MASK_STATUS|CSSF_MASK_NAME|CSSF_MASK_MESSAGE) && iRet == 0)
+ MraSetXStatusInternal(dwXStatus);
- if (lpwszStatusDesc==NULL || dwStatusDescSize==0)
- {
- mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldMsg",dwXStatusMir);
- if (DB_Mra_GetStaticStringW(NULL,szValueName,wszStatusDesc,(STATUS_DESC_MAX+1),&dwStatusDescSize))
- {// custom xstatus description
- lpwszStatusDesc=wszStatusDesc;
- }else{// default xstatus description
- lpwszStatusDesc=NULL;
- dwStatusDescSize=0;
- }
- }
- }else{// not xstatuses
- if (lpwszStatusTitle==NULL || dwStatusTitleSize==0)
- {
- lpwszStatusTitle=GetStatusModeDescriptionW(dwStatusMir);
- dwStatusTitleSize=lstrlenW(lpwszStatusTitle);
- }
+ // hide menu items
+ if (pData->flags & CSSF_DISABLE_UI) {
+ bHideXStatusUI = (*pData->wParam)? FALSE:TRUE;
+ for (DWORD i = 0; i < MRA_XSTATUS_COUNT; i++)
+ CListShowMenuItem(hXStatusMenuItems[i], !bHideXStatusUI);
}
-
- MraSendCommand_ChangeStatusW(dwStatus,lpcszStatusUri[dwXStatus],lstrlenA(lpcszStatusUri[dwXStatus]),lpwszStatusTitle,dwStatusTitleSize,lpwszStatusDesc,dwStatusDescSize,((DB_Mra_GetByte(NULL,"RTFReceiveEnable",MRA_DEFAULT_RTF_RECEIVE_ENABLE)? FEATURE_FLAG_RTF_MESSAGE:0)|MRA_FEATURE_FLAGS));
}
-
-return(0);
+ return iRet;
}
-
-
-INT_PTR MraSetAwayMsgA(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraGetXStatus(WPARAM wParam, LPARAM lParam)
{
- INT_PTR iRet=1;
-
- if (masMraSettings.bLoggedIn)
- {
- WCHAR wszStatusDesc[STATUS_DESC_MAX+1];
- SIZE_T dwStatusDescSize;
-
- if (lParam)
- {
- dwStatusDescSize=MultiByteToWideChar(MRA_CODE_PAGE,0,(LPSTR)lParam,-1,wszStatusDesc,(SIZEOF(wszStatusDesc)-1));
- }else{
- dwStatusDescSize=0;
- }
- wszStatusDesc[dwStatusDescSize]=0;
-
- iRet=MraSetAwayMsg(wParam,(LPARAM)wszStatusDesc);
+ if (m_bLoggedIn) {
+ if (wParam) *((CHAR**)wParam) = DBSETTING_XSTATUSNAME;
+ if (lParam) *((CHAR**)lParam) = DBSETTING_XSTATUSMSG;
+ return m_iXStatus;
}
-return(iRet);
-}
-
-INT_PTR MraSetAwayMsg(WPARAM wParam,LPARAM lParam)
-{
- INT_PTR iRet=1;
- if (masMraSettings.bLoggedIn)
- {
- LPWSTR lpwszStatusDesc;
- DWORD dwStatus,dwXStatus;
- SIZE_T dwStatusDescSize;
-
- lpwszStatusDesc=(LPWSTR)lParam;
- dwStatusDescSize=lstrlenW(lpwszStatusDesc);
- dwStatus=MraGetStatus(0,0);
- dwXStatus=MraGetXStatusInternal();
-
- if (dwStatus!=ID_STATUS_ONLINE || IsXStatusValid(dwXStatus)==FALSE)
- {// не отправляем новый статусный текст для хстатусов, для хстатусов только эвей сообщения
- dwStatusDescSize=min(dwStatusDescSize,STATUS_DESC_MAX);
- MraSendNewStatus(dwStatus,dwXStatus,NULL,0,lpwszStatusDesc,dwStatusDescSize);
- }
- iRet=0;
- }
-return(iRet);
+ return 0;
}
-
-INT_PTR MraGetAwayMsg(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraGetXStatusEx(WPARAM wParam, LPARAM lParam)
{
- INT_PTR iRet=0;
-
- if (masMraSettings.bLoggedIn && lParam)
- {
- CHAR szStatusDesc[MICBLOG_STATUS_MAX+MICBLOG_STATUS_MAX+MAX_PATH],szBlogStatus[MICBLOG_STATUS_MAX+4],szTime[64];
- DWORD dwTime;
- SIZE_T dwStatusDescSize;
- CCSDATA* ccs=(CCSDATA*)lParam;
- SYSTEMTIME stBlogStatusTime={0};
+ INT_PTR iRet = 1;
+ HANDLE hContact = (HANDLE)wParam;
+ ICQ_CUSTOM_STATUS *pData = (ICQ_CUSTOM_STATUS*)lParam;
- if (DB_Mra_GetStaticStringA(ccs->hContact,DBSETTING_BLOGSTATUS,szBlogStatus,SIZEOF(szBlogStatus),NULL))
- {
- dwTime=DB_Mra_GetDword(ccs->hContact,DBSETTING_BLOGSTATUSTIME,0);
- if (dwTime && MakeLocalSystemTimeFromTime32(dwTime,&stBlogStatusTime))
- {
- mir_snprintf(szTime,SIZEOF(szTime),"%04ld.%02ld.%02ld %02ld:%02ld: ",stBlogStatusTime.wYear,stBlogStatusTime.wMonth,stBlogStatusTime.wDay,stBlogStatusTime.wHour,stBlogStatusTime.wMinute);
- }else{
- szTime[0]=0;
- }
-
- dwStatusDescSize=mir_snprintf(szStatusDesc,SIZEOF(szStatusDesc),"%s%s",szTime,szBlogStatus);
-
- iRet=GetTickCount();
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,ccs->hContact,ACKTYPE_AWAYMSG,ACKRESULT_SUCCESS,(HANDLE)iRet,(LPARAM)szStatusDesc,dwStatusDescSize);
- }
- }
-return(iRet);
-}
+ if (pData->cbSize >= sizeof(ICQ_CUSTOM_STATUS)) {
+ DWORD dwXStatus;
+ iRet = 0;
-INT_PTR MraAuthAllow(WPARAM wParam,LPARAM lParam)
-{
- INT_PTR iRet=1;
+ // fill status member
+ if (pData->flags & CSSF_MASK_STATUS)
+ *pData->status = m_iXStatus;
- if (masMraSettings.bLoggedIn)
- {
- DBEVENTINFO dbei={0};
+ // fill status name member
+ if (pData->flags & CSSF_MASK_NAME) {
+ if (pData->flags & CSSF_DEFAULT_NAME) {
+ dwXStatus = (*pData->wParam);
+ if ( IsXStatusValid(dwXStatus)) {
+ if (pData->flags & CSSF_UNICODE) {
+ lstrcpynW(pData->pwszName, lpcszXStatusNameDef[dwXStatus], (STATUS_TITLE_MAX+1));
+ }
+ else {
+ size_t dwStatusTitleSize = lstrlenW( lpcszXStatusNameDef[dwXStatus] );
+ if (dwStatusTitleSize>STATUS_TITLE_MAX) dwStatusTitleSize = STATUS_TITLE_MAX;
- dbei.cbSize=sizeof(dbei);
- if ((dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE,wParam,0))!=-1)
- {
- dbei.pBlob=(PBYTE)MEMALLOC(dbei.cbBlob);
- if (dbei.pBlob)
- {
- if (CallService(MS_DB_EVENT_GET,wParam,(LPARAM)&dbei)==0)
- if (dbei.eventType==EVENTTYPE_AUTHREQUEST)
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,dbei.szModule,-1,PROTOCOL_NAMEA,PROTOCOL_NAME_LEN)==CSTR_EQUAL)
- {
- LPSTR lpszNick,lpszFirstName,lpszLastName,lpszEMail,lpszRequestReason;
-
- lpszNick=(LPSTR)(dbei.pBlob+sizeof(DWORD)*2);
- lpszFirstName=lpszNick+lstrlenA(lpszNick)+1;
- lpszLastName=lpszFirstName+lstrlenA(lpszFirstName)+1;
- lpszEMail=lpszLastName+lstrlenA(lpszLastName)+1;
- lpszRequestReason=lpszEMail+lstrlenA(lpszEMail)+1;
-
- MraSendCommand_Authorize(lpszEMail,lstrlenA(lpszEMail));
- iRet=0;
+ WideCharToMultiByte(MRA_CODE_PAGE, 0, lpcszXStatusNameDef[dwXStatus], (DWORD)dwStatusTitleSize, pData->pszName, MAX_PATH, NULL, NULL );
+ (*((CHAR*)(pData->pszName+dwStatusTitleSize))) = 0;
+ }
}
- MEMFREE(dbei.pBlob);
+ else iRet = 1;
}
- }
- }
-return(iRet);
-}
-
-
-INT_PTR MraAuthDeny(WPARAM wParam,LPARAM lParam)
-{
- INT_PTR iRet=1;
-
- if (lParam && masMraSettings.bLoggedIn)
- {
- DBEVENTINFO dbei={0};
-
- dbei.cbSize=sizeof(dbei);
- if ((dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE,wParam,0))!=-1)
- {
- dbei.pBlob=(PBYTE)MEMALLOC(dbei.cbBlob);
- if (dbei.pBlob)
- {
- if (CallService(MS_DB_EVENT_GET,wParam,(LPARAM)&dbei)==0)
- if (dbei.eventType==EVENTTYPE_AUTHREQUEST)
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,dbei.szModule,-1,PROTOCOL_NAMEA,PROTOCOL_NAME_LEN)==CSTR_EQUAL)
- {
- LPSTR lpszNick,lpszFirstName,lpszLastName,lpszEMail,lpszRequestReason;
- SIZE_T dwEMailSize,dwRequestReasonSize;
- //HANDLE hContact;
-
- lpszNick=(LPSTR)(dbei.pBlob+sizeof(DWORD)*2);
- lpszFirstName=lpszNick+lstrlenA(lpszNick)+1;
- lpszLastName=lpszFirstName+lstrlenA(lpszFirstName)+1;
- lpszEMail=lpszLastName+lstrlenA(lpszLastName)+1;
- dwEMailSize=lstrlenA(lpszEMail);
- lpszRequestReason=(LPSTR)lParam;
- dwRequestReasonSize=lstrlenA(lpszRequestReason);
-
- if (dwRequestReasonSize) MraSendCommand_MessageW(FALSE,NULL,0,0,lpszEMail,dwEMailSize,(LPWSTR)lpszRequestReason,dwRequestReasonSize,NULL,0);
- //hContact=MraHContactFromEmail(lpszEMail,dwEMailSize,FALSE,TRUE,NULL);
- //if (DBGetContactSettingByte(hContact,"CList","NotOnList",0)) CallService(MS_DB_CONTACT_DELETE,(WPARAM)hContact,0);
-
- iRet=0;
- }
- MEMFREE(dbei.pBlob);
+ else {
+ if (pData->flags & CSSF_UNICODE)
+ mraGetStaticStringW(hContact, DBSETTING_XSTATUSNAME, pData->pwszName, (STATUS_TITLE_MAX+1), NULL);
+ else
+ mraGetStaticStringA(hContact, DBSETTING_XSTATUSNAME, pData->pszName, (STATUS_TITLE_MAX+1), NULL);
}
}
- }
-return(iRet);
-}
-
-
-
-HANDLE AddToListByEmail(MRA_LPS *plpsEMail,MRA_LPS *plpsNick,MRA_LPS *plpsFirstName,MRA_LPS *plpsLastName,DWORD dwFlags)
-{
- HANDLE hContact=NULL;
-
- if (plpsEMail)
- if (plpsEMail->dwSize)
- {
- BOOL bAdded;
-
- hContact=MraHContactFromEmail(plpsEMail->lpszData,plpsEMail->dwSize,TRUE,TRUE,&bAdded);
- if (hContact)
- {
- if (plpsNick)
- if (plpsNick->dwSize)
- {
- DB_Mra_SetLPSStringA(hContact,"Nick",plpsNick);
- if (bAdded)
- {// впервые добавляется контакт в базу///***deb
- //SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,SCBIF_NICK,0,0,0,0,0,NULL,0,plpsNick->lpszData,plpsNick->dwSize,NULL,0);
- }
- }
-
- if (plpsFirstName)
- if (plpsFirstName->dwSize) DB_Mra_SetLPSStringA(hContact,"FirstName",plpsFirstName);
-
- if (plpsLastName)
- if (plpsLastName->dwSize) DB_Mra_SetLPSStringA(hContact,"LastName",plpsLastName);
-
- if (dwFlags&PALF_TEMPORARY)
- {
- DBWriteContactSettingByte(hContact,"CList","Hidden",1);
- }else{
- DBDeleteContactSetting(hContact,"CList","NotOnList");
- }
- if (bAdded) MraUpdateContactInfo(hContact);
+ // fill status message member
+ if (pData->flags & CSSF_MASK_MESSAGE) {
+ if (pData->flags & CSSF_UNICODE)
+ mraGetStaticStringW(hContact, DBSETTING_XSTATUSMSG, pData->pwszMessage, (STATUS_DESC_MAX+1), NULL);
+ else
+ mraGetStaticStringA(hContact, DBSETTING_XSTATUSMSG, pData->pszMessage, (STATUS_DESC_MAX+1), NULL);
}
- }
-return(hContact);
-}
-
-
-INT_PTR MraAddToList(WPARAM wParam,LPARAM lParam)
-{
- INT_PTR iRet;
- PROTOSEARCHRESULT *psr=(PROTOSEARCHRESULT*)lParam;
-
- if (psr->cbSize==sizeof(PROTOSEARCHRESULT))
- {
- MRA_LPS lpsEMail,lpsNick,lpsFirstName,lpsLastName;
-
- lpsEMail.dwSize=lstrlenA((LPSTR)psr->email);
- lpsEMail.lpwszData=psr->email;
- lpsNick.dwSize=lstrlenA((LPSTR)psr->nick);
- lpsNick.lpwszData=psr->nick;
- lpsFirstName.dwSize=lstrlenA((LPSTR)psr->firstName);
- lpsFirstName.lpwszData=psr->firstName;
- lpsLastName.dwSize=lstrlenA((LPSTR)psr->lastName);
- lpsLastName.lpwszData=psr->lastName;
-
- iRet=(INT_PTR)AddToListByEmail(&lpsEMail,&lpsNick,&lpsFirstName,&lpsLastName,wParam);
- }else{
- iRet=0;
- }
-return(iRet);
-}
+ if (pData->flags & CSSF_DISABLE_UI)
+ if (pData->wParam)
+ *pData->wParam = bHideXStatusUI;
-INT_PTR MraAddToListByEvent(WPARAM wParam,LPARAM lParam)
-{
- INT_PTR iRet=0;
- DBEVENTINFO dbei={0};
+ if (pData->flags & CSSF_STATUSES_COUNT)
+ if (pData->wParam)
+ *pData->wParam = MRA_XSTATUS_COUNT-1;
- dbei.cbSize=sizeof(dbei);
- if ((dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE,lParam,0))!=-1)
- {
- dbei.pBlob=(PBYTE)MEMALLOC(dbei.cbBlob);
- if (dbei.pBlob)
- {
- if (CallService(MS_DB_EVENT_GET,lParam,(LPARAM)&dbei)==0)
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,dbei.szModule,-1,PROTOCOL_NAMEA,PROTOCOL_NAME_LEN)==CSTR_EQUAL)
- if (dbei.eventType==EVENTTYPE_AUTHREQUEST || dbei.eventType==EVENTTYPE_CONTACTS)
- {
- LPSTR lpszRequestReason;
- MRA_LPS lpsEMail,lpsNick,lpsFirstName,lpsLastName;
-
- lpsNick.lpszData=(LPSTR)(dbei.pBlob+ ((dbei.eventType==EVENTTYPE_AUTHREQUEST)?(sizeof(DWORD)*2):0));
- lpsNick.dwSize=lstrlenA(lpsNick.lpszData);
- lpsFirstName.lpszData=lpsNick.lpszData+lpsNick.dwSize+1;
- lpsFirstName.dwSize=lstrlenA(lpsFirstName.lpszData);
- lpsLastName.lpszData=lpsFirstName.lpszData+lpsFirstName.dwSize+1;
- lpsLastName.dwSize=lstrlenA(lpsLastName.lpszData);
- lpsEMail.lpszData=lpsLastName.lpszData+lpsLastName.dwSize+1;
- lpsEMail.dwSize=lstrlenA(lpsEMail.lpszData);
- lpszRequestReason=lpsEMail.lpszData+lpsEMail.dwSize+1;
-
- iRet=(INT_PTR)AddToListByEmail(&lpsEMail,&lpsNick,&lpsFirstName,&lpsLastName,0);
- }else{
- dbei.eventType=dbei.eventType;
- DebugBreak();
- }
- MEMFREE(dbei.pBlob);
+ //**deb можно оптимизировать, данный параметр возможно уже был вычислен при получении самих текстов
+ if (pData->flags & CSSF_STR_SIZES) {
+ if (pData->wParam) mraGetStaticStringW(hContact, DBSETTING_XSTATUSNAME, NULL, 0, (size_t*)pData->wParam);
+ if (pData->lParam) mraGetStaticStringW(hContact, DBSETTING_XSTATUSMSG, NULL, 0, (size_t*)pData->lParam);
}
}
-return(iRet);
+ return iRet;
}
-
-/*
- ---------------------------------
- | Receiving |
- ---------------------------------
-*/
-INT_PTR MraRecvMessage(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraGetXStatusIcon(WPARAM wParam, LPARAM lParam)
{
- CallService(MS_PROTO_RECVMSG,0,(LPARAM)lParam);
-return(0);
-}
+ if (wParam == 0)
+ wParam = m_iXStatus;
-
-INT_PTR MraRecvContacts(WPARAM wParam,LPARAM lParam)
-{
- CCSDATA* ccs=(CCSDATA*)lParam;
- DBEVENTINFO dbei={0};
- PROTORECVEVENT* pre=(PROTORECVEVENT*)ccs->lParam;
-
- dbei.cbSize=sizeof(dbei);
- dbei.szModule=PROTOCOL_NAMEA;
- dbei.timestamp=pre->timestamp;
- dbei.flags=(pre->flags&PREF_CREATEREAD)?DBEF_READ:0;
- dbei.eventType=EVENTTYPE_CONTACTS;
- dbei.cbBlob=pre->lParam;
- dbei.pBlob=(PBYTE)pre->szMessage;
-
- CallService(MS_DB_EVENT_ADD,(WPARAM)ccs->hContact,(LPARAM)&dbei);
-return(0);
+ return (INT_PTR)IconLibGetIconEx(hXStatusAdvancedStatusIcons[wParam], lParam);
}
-
-INT_PTR MraRecvFile(WPARAM wParam,LPARAM lParam)
+DWORD CMraProto::MraSendNewStatus(DWORD dwStatusMir, DWORD dwXStatusMir, LPCWSTR lpwszStatusTitle, size_t dwStatusTitleSize, LPCWSTR lpwszStatusDesc, size_t dwStatusDescSize)
{
- CCSDATA* ccs=(CCSDATA*)lParam;
- PROTORECVFILET* pre=(PROTORECVFILET*)ccs->lParam;
-
- CallService(MS_PROTO_RECVFILET,0,(LPARAM)lParam);
-return(0);
-}
-
-
-INT_PTR MraRecvAuth(WPARAM wParam,LPARAM lParam)
-{
- CCSDATA* ccs=(CCSDATA*)lParam;
- DBEVENTINFO dbei={0};
- PROTORECVEVENT* pre=(PROTORECVEVENT*)ccs->lParam;
-
- dbei.cbSize=sizeof(dbei);
- dbei.szModule=PROTOCOL_NAMEA;
- dbei.timestamp=pre->timestamp;
- dbei.flags=(pre->flags&PREF_CREATEREAD)?DBEF_READ:0;
- dbei.eventType=EVENTTYPE_AUTHREQUEST;
- dbei.cbBlob=pre->lParam;
- dbei.pBlob=(PBYTE)pre->szMessage;
-
- CallService(MS_DB_EVENT_ADD,(WPARAM)NULL,(LPARAM)&dbei);
-return(0);
-}
-
-
-/*
- ---------------------------------
- | Sending |
- ---------------------------------
-*/
-INT_PTR MraSendAuthRequest(WPARAM wParam,LPARAM lParam)
-{// internal only
- INT_PTR iRet=1;
-
- if (masMraSettings.bLoggedIn && lParam)
- {
- BOOL bSlowSend;
- CHAR szEMail[MAX_EMAIL_LEN];
- LPWSTR lpwszMessage;
- SIZE_T dwEMailSize,dwMessageSize;
- CCSDATA* ccs=(CCSDATA*)lParam;
-
- if (ccs->wParam&PREF_UNICODE)//flags
- {
- lpwszMessage=(LPWSTR)ccs->lParam;
- dwMessageSize=lstrlenW(lpwszMessage);
- }else{
- dwEMailSize=lstrlenA((LPSTR)ccs->lParam);
- lpwszMessage=(LPWSTR)MEMALLOC(((dwEMailSize+MAX_PATH)*sizeof(WCHAR)));
- if (lpwszMessage)
- {
- dwMessageSize=MultiByteToWideChar(MRA_CODE_PAGE,0,(LPSTR)ccs->lParam,dwEMailSize,lpwszMessage,(dwEMailSize+MAX_PATH));
- }
- }
+ if (!m_bLoggedIn)
+ return 0;
- if (lpwszMessage)
- {
- if (DB_Mra_GetStaticStringA(ccs->hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- bSlowSend=DB_Mra_GetByte(NULL,"SlowSend",MRA_DEFAULT_SLOW_SEND);
- iRet=MraSendCommand_MessageW(bSlowSend,ccs->hContact,ACKTYPE_AUTHREQ,MESSAGE_FLAG_AUTHORIZE,szEMail,dwEMailSize,lpwszMessage,dwMessageSize,NULL,0);
- if (bSlowSend==FALSE)
- {
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,ccs->hContact,ACKTYPE_AUTHREQ,ACKRESULT_SUCCESS,(HANDLE)iRet,(LPARAM)NULL,0);
- }
- iRet=0;
+ CHAR szValueName[MAX_PATH];
+ WCHAR wszStatusTitle[STATUS_TITLE_MAX+4], wszStatusDesc[STATUS_DESC_MAX+4];
+ DWORD dwStatus, dwXStatus;
+
+ dwStatus = GetMraStatusFromMiradaStatus(dwStatusMir, dwXStatusMir, &dwXStatus);
+ if ( IsXStatusValid(dwXStatusMir)) {
+ if (lpwszStatusTitle == NULL || dwStatusTitleSize == 0) {
+ mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldName", dwXStatusMir);
+ // custom xstatus name
+ if (mraGetStaticStringW(NULL, szValueName, wszStatusTitle, (STATUS_TITLE_MAX+1), &dwStatusTitleSize))
+ lpwszStatusTitle = wszStatusTitle;
+ // default xstatus name
+ else {
+ lpwszStatusTitle = TranslateW(lpcszXStatusNameDef[dwXStatusMir]);
+ dwStatusTitleSize = lstrlenW(lpwszStatusTitle);
}
-
- if (lpwszMessage!=(LPWSTR)ccs->lParam) MEMFREE(lpwszMessage);
}
- }
-return(iRet);
-}
-
-
-INT_PTR MraSendMessage(WPARAM wParam,LPARAM lParam)
-{
- INT_PTR iRet=0;
- CCSDATA* ccs=(CCSDATA*)lParam;
- if (masMraSettings.bLoggedIn)
- {
- BOOL bSlowSend,bMemAllocated=FALSE;
- CHAR szEMail[MAX_EMAIL_LEN];
- DWORD dwFlags=0;
- LPSTR lpszMessage;
- LPWSTR lpwszMessage=NULL;
- SIZE_T dwEMailSize,dwMessageSize=0;
-
- lpszMessage=(LPSTR)ccs->lParam;
- dwMessageSize=lstrlenA(lpszMessage);
- if (ccs->wParam&PREF_UNICODE)//flags
- {
- lpwszMessage=(LPWSTR)(lpszMessage+dwMessageSize+1);
- }else
- if (ccs->wParam&PREF_UTF){// convert to unicode from utf8
- lpwszMessage=(LPWSTR)MEMALLOC(((dwMessageSize+MAX_PATH)*sizeof(WCHAR)));
- if (lpwszMessage)
- {
- dwMessageSize=MultiByteToWideChar(CP_UTF8,0,lpszMessage,dwMessageSize,lpwszMessage,(dwMessageSize+MAX_PATH));
- bMemAllocated=TRUE;
- }
- }else{// convert to unicode from ansi
- MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG,0,TranslateW(L"Send ANSI"));
- lpwszMessage=(LPWSTR)MEMALLOC(((dwMessageSize+MAX_PATH)*sizeof(WCHAR)));
- if (lpwszMessage)
- {
- dwMessageSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpszMessage,dwMessageSize,lpwszMessage,(dwMessageSize+MAX_PATH));
- bMemAllocated=TRUE;
+ if (lpwszStatusDesc == NULL || dwStatusDescSize == 0) {
+ mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldMsg", dwXStatusMir);
+ // custom xstatus description
+ if (mraGetStaticStringW(NULL, szValueName, wszStatusDesc, (STATUS_DESC_MAX+1), &dwStatusDescSize))
+ lpwszStatusDesc = wszStatusDesc;
+ // default xstatus description
+ else {
+ lpwszStatusDesc = NULL;
+ dwStatusDescSize = 0;
}
}
-
- if (lpwszMessage)
- {
- if (DB_Mra_GetStaticStringA(ccs->hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- bSlowSend=DB_Mra_GetByte(NULL,"SlowSend",MRA_DEFAULT_SLOW_SEND);
-
- if (DB_Mra_GetByte(NULL,"RTFSendEnable",MRA_DEFAULT_RTF_SEND_ENABLE) && (MraContactCapabilitiesGet(ccs->hContact)&FEATURE_FLAG_RTF_MESSAGE))
- {
- dwFlags|=MESSAGE_FLAG_RTF;
- }
-
- iRet=MraSendCommand_MessageW(bSlowSend,ccs->hContact,ACKTYPE_MESSAGE,dwFlags,szEMail,dwEMailSize,lpwszMessage,dwMessageSize,NULL,0);
- if (bSlowSend==FALSE)
- {
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,ccs->hContact,ACKTYPE_MESSAGE,ACKRESULT_SUCCESS,(HANDLE)iRet,(LPARAM)NULL,0);
- }
- }
-
- if (bMemAllocated) MEMFREE(lpwszMessage);
- }else{
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,ccs->hContact,ACKTYPE_MESSAGE,ACKRESULT_FAILED,NULL,(LPARAM)"Cant allocate buffer for convert to unicode.",-1);
- }
- }else{
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,ccs->hContact,ACKTYPE_MESSAGE,ACKRESULT_FAILED,NULL,(LPARAM)"You cannot send when you are offline.",-1);
}
-return(iRet);
-}
-
-
-INT_PTR MraSendContacts(WPARAM wParam,LPARAM lParam)
-{
- INT_PTR iRet=0;
- CCSDATA* ccs=(CCSDATA*)lParam;
-
- if (masMraSettings.bLoggedIn && lParam)
- {
- BOOL bSlowSend;
- CHAR szEMail[MAX_EMAIL_LEN];
- LPWSTR lpwszData,lpwszDataCurrent,lpwszNick;
- SIZE_T i,dwContacts,dwDataBuffSize,dwEMailSize,dwStringSize,dwNickSize;
- HANDLE *hContactsList=(HANDLE*)ccs->lParam;
-
- dwContacts=HIWORD(ccs->wParam);
- dwDataBuffSize=(dwContacts*(MAX_EMAIL_LEN*2));
- lpwszData=(LPWSTR)MEMALLOC((dwDataBuffSize*sizeof(WCHAR)));
- if (lpwszData)
- {
- lpwszDataCurrent=lpwszData;
- if (DB_Mra_GetStaticStringA(ccs->hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- for(i=0;i<dwContacts;i++)
- {
- if (IsContactMra(hContactsList[i]))
- if (DB_Mra_GetStaticStringW(hContactsList[i],"e-mail",lpwszDataCurrent,(dwDataBuffSize-(lpwszDataCurrent-lpwszData)),&dwStringSize))
- {
- lpwszDataCurrent+=dwStringSize;
- (*lpwszDataCurrent)=';';
- lpwszDataCurrent++;
-
- lpwszNick=GetContactNameW(hContactsList[i]);
- dwNickSize=lstrlenW(lpwszNick);
- memmove(lpwszDataCurrent,lpwszNick,(dwNickSize*sizeof(WCHAR)));
- lpwszDataCurrent+=dwNickSize;
- (*lpwszDataCurrent)=';';
- lpwszDataCurrent++;
- }
- }
-
- bSlowSend=DB_Mra_GetByte(NULL,"SlowSend",MRA_DEFAULT_SLOW_SEND);
- iRet=MraSendCommand_MessageW(bSlowSend,ccs->hContact,ACKTYPE_CONTACTS,MESSAGE_FLAG_CONTACT,szEMail,dwEMailSize,lpwszData,(lpwszDataCurrent-lpwszData),NULL,0);
- if (bSlowSend==FALSE)
- {
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,ccs->hContact,ACKTYPE_CONTACTS,ACKRESULT_SUCCESS,(HANDLE)iRet,(LPARAM)NULL,0);
- }
- }
- MEMFREE(lpwszData);
+ else {
+ if (lpwszStatusTitle == NULL || dwStatusTitleSize == 0) {
+ lpwszStatusTitle = GetStatusModeDescriptionW(dwStatusMir);
+ dwStatusTitleSize = lstrlenW(lpwszStatusTitle);
}
- }else{
- ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,ccs->hContact,ACKTYPE_CONTACTS,ACKRESULT_FAILED,NULL,(LPARAM)"You cannot send when you are offline.",-1);
}
-return(iRet);
-}
-
-INT_PTR MraSendUserIsTyping(WPARAM wParam,LPARAM lParam)
-{
- INT_PTR iRet=1;
-
- if (masMraSettings.bLoggedIn && wParam && lParam!=PROTOTYPE_SELFTYPING_OFF)
- {
- CHAR szEMail[MAX_EMAIL_LEN];
- SIZE_T dwEMailSize;
- HANDLE hContact=(HANDLE)wParam;
-
- if (MraGetContactStatus(hContact)!=ID_STATUS_OFFLINE && MraGetStatus(0,0)!=ID_STATUS_INVISIBLE)
- if (DB_Mra_GetStaticStringA(hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- if (MraSendCommand_MessageW(FALSE,hContact,0,MESSAGE_FLAG_NOTIFY,szEMail,dwEMailSize,L" ",1,NULL,0)) iRet=0;
- }
- }
-return(iRet);
+ MraChangeStatusW(dwStatus, lpcszStatusUri[dwXStatus], lstrlenA(lpcszStatusUri[dwXStatus]), lpwszStatusTitle, dwStatusTitleSize, lpwszStatusDesc, dwStatusDescSize, ((mraGetByte(NULL, "RTFReceiveEnable", MRA_DEFAULT_RTF_RECEIVE_ENABLE)? FEATURE_FLAG_RTF_MESSAGE:0)|MRA_FEATURE_FLAGS));
+ return 0;
}
-
-INT_PTR MraSendNudge(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraSendNudge(WPARAM wParam, LPARAM lParam)
{
- INT_PTR iRet=1;
-
- if (masMraSettings.bLoggedIn && wParam)
- {
+ if (m_bLoggedIn && wParam) {
CHAR szEMail[MAX_EMAIL_LEN];
- LPWSTR lpwszAlarmMessage=TranslateW(MRA_ALARM_MESSAGE);
- SIZE_T dwEMailSize;
- HANDLE hContact=(HANDLE)wParam;
-
- if (DB_Mra_GetStaticStringA(hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
- {
- if (MraSendCommand_MessageW(FALSE,hContact,0,(MESSAGE_FLAG_RTF|MESSAGE_FLAG_ALARM),szEMail,dwEMailSize,lpwszAlarmMessage,lstrlenW(lpwszAlarmMessage),NULL,0)) iRet=0;
- }
- }
-return(iRet);
-}
-
+ LPWSTR lpwszAlarmMessage = TranslateW(MRA_ALARM_MESSAGE);
+ size_t dwEMailSize;
+ HANDLE hContact = (HANDLE)wParam;
-INT_PTR MraSetApparentMode(WPARAM wParam,LPARAM lParam)
-{
- INT_PTR iRet=1;
-
- if (masMraSettings.bLoggedIn && lParam)
- {
- CCSDATA *ccs=(CCSDATA*)lParam;
-
- if (ccs->hContact && ccs->wParam==0 || ccs->wParam==ID_STATUS_ONLINE || ccs->wParam==ID_STATUS_OFFLINE)
- {// Only 3 modes are supported
- DWORD dwOldMode=DB_Mra_GetWord(ccs->hContact,"ApparentMode",0);
-
- // Dont send redundant updates
- if (ccs->wParam!=dwOldMode)
- {
- CHAR szEMail[MAX_EMAIL_LEN],szPhones[MAX_EMAIL_LEN];
- WCHAR wszNick[MAX_EMAIL_LEN];
- DWORD dwID,dwGroupID,dwContactFlag=0;
- SIZE_T dwEMailSize,dwNickSize,dwPhonesSize;
-
- GetContactBasicInfoW(ccs->hContact,&dwID,&dwGroupID,&dwContactFlag,NULL,NULL,szEMail,SIZEOF(szEMail),&dwEMailSize,wszNick,SIZEOF(wszNick),&dwNickSize,szPhones,SIZEOF(szPhones),&dwPhonesSize);
-
- dwContactFlag&=~(CONTACT_FLAG_INVISIBLE|CONTACT_FLAG_VISIBLE);
- switch(ccs->wParam){
- case ID_STATUS_OFFLINE:
- dwContactFlag|=CONTACT_FLAG_INVISIBLE;
- break;
- case ID_STATUS_ONLINE:
- dwContactFlag|=CONTACT_FLAG_VISIBLE;
- break;
- }
-
- if (MraSendCommand_ModifyContactW(ccs->hContact,dwID,dwContactFlag,dwGroupID,szEMail,dwEMailSize,wszNick,dwNickSize,szPhones,dwPhonesSize))
- {
- SetContactBasicInfoW(ccs->hContact,0,SCBIF_FLAG,0,0,dwContactFlag,0,0,NULL,0,NULL,0,NULL,0);
- iRet=0;// Success
- }
- }
- }
- }
-return(iRet);
-}
-
-
-INT_PTR MraGetInfo(WPARAM wParam,LPARAM lParam)
-{
- INT_PTR iRet=1;
-
- if (MraUpdateContactInfo(((CCSDATA*)lParam)->hContact))
- {
- iRet=0;
+ if (mraGetStaticStringA(hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize))
+ if (MraMessageW(FALSE, hContact, 0, (MESSAGE_FLAG_RTF|MESSAGE_FLAG_ALARM), szEMail, dwEMailSize, lpwszAlarmMessage, lstrlenW(lpwszAlarmMessage), NULL, 0))
+ return 0;
}
-return(iRet);
+ return 1;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+// Avatars
-INT_PTR MraGetAvatarCaps(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraGetAvatarCaps(WPARAM wParam, LPARAM lParam)
{
- INT_PTR iRet=0;
-
- switch(wParam){
+ switch (wParam) {
case AF_MAXSIZE:
- iRet=-1;
- break;
+ return -1;
+
case AF_PROPORTION:
- iRet=PIP_NONE;
- break;
+ return PIP_NONE;
+
case AF_FORMATSUPPORTED:
- iRet=0;// no formats to set
- break;
+ return 0; // no formats to set
+
case AF_ENABLED:
- iRet=1;// allways on
- break;
+ return 1; // allways on
+
case AF_DONTNEEDDELAYS:
- iRet=0;// need delay
- break;
+ return 0; // need delay
+
case AF_MAXFILESIZE:
- iRet=0;//
- break;
+ return 0;
+
case AF_DELAYAFTERFAIL:
- iRet=5000;
- break;
+ return 5000;
}
- return iRet;
+ return 0;
}
-INT_PTR MraGetAvatarInfo(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraGetAvatarInfo(WPARAM wParam, LPARAM lParam)
{
if (lParam) {
PROTO_AVATAR_INFORMATIONT *ppai = (PROTO_AVATAR_INFORMATIONT*)lParam;
- return (INT_PTR)MraAvatarsQueueGetAvatar(masMraSettings.hAvatarsQueueHandle,(DWORD)wParam,ppai->hContact,NULL,(DWORD*)&ppai->format,ppai->filename);
+ return (INT_PTR)MraAvatarsQueueGetAvatar(hAvatarsQueueHandle, (DWORD)wParam, ppai->hContact, NULL, (DWORD*)&ppai->format, ppai->filename);
}
return GAIR_NOAVATAR;
}
-INT_PTR MraGetMyAvatar(WPARAM wParam,LPARAM lParam)
+INT_PTR CMraProto::MraGetMyAvatar(WPARAM wParam, LPARAM lParam)
{
- if ( MraAvatarsGetFileName(masMraSettings.hAvatarsQueueHandle, NULL, GetContactAvatarFormat(NULL, PA_FORMAT_DEFAULT), (LPTSTR)wParam, (SIZE_T)lParam, NULL) == NO_ERROR) {
+ if ( MraAvatarsGetFileName(hAvatarsQueueHandle, NULL, GetContactAvatarFormat(NULL, PA_FORMAT_DEFAULT), (LPTSTR)wParam, (size_t)lParam, NULL) == NO_ERROR) {
LPSTR lpsz = (LPSTR)wParam;
return 0;
}
return 1;
}
+////////////////////////////////////////////////////////////////////////////////////////////////
-INT_PTR MraBasicSearch(WPARAM wParam,LPARAM lParam)
-{
- return(MraSearchByEmail(wParam,lParam));
-}
-
-INT_PTR MraSearchByEmail(WPARAM wParam,LPARAM lParam)
-{
- INT_PTR iRet=0;
-
- if (masMraSettings.bLoggedIn && lParam)
- {
- CHAR szEMail[MAX_EMAIL_LEN]={0};
- SIZE_T dwEMailSize;
-
- dwEMailSize=(WideCharToMultiByte(MRA_CODE_PAGE,0,(LPWSTR)lParam,-1,szEMail,SIZEOF(szEMail),NULL,NULL)-1);
- iRet=MraSendCommand_WPRequestByEMail(NULL,ACKTYPE_SEARCH,szEMail,dwEMailSize);
- }
-return(iRet);
-}
-
-INT_PTR MraSearchByName(WPARAM wParam,LPARAM lParam)
-{
- INT_PTR iRet=0;
-
- if (masMraSettings.bLoggedIn && lParam)
- {
- PROTOSEARCHBYNAME *psbn=(PROTOSEARCHBYNAME*)lParam;
-
- if (psbn->pszNick || psbn->pszFirstName || psbn->pszLastName)
- {
- DWORD dwRequestFlags=0;
- SIZE_T dwNickSize=0,dwFirstNameSize=0,dwLastNameSize=0;
-
- if (psbn->pszNick) dwNickSize=lstrlenW(psbn->pszNick);
- if (psbn->pszFirstName) dwFirstNameSize=lstrlenW(psbn->pszFirstName);
- if (psbn->pszLastName) dwLastNameSize=lstrlenW(psbn->pszLastName);
-
- if (dwNickSize) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_NICKNAME);
- if (dwFirstNameSize) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME);
- if (dwLastNameSize) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_LASTNAME);
-
- iRet=MraSendCommand_WPRequestW(NULL,ACKTYPE_SEARCH,dwRequestFlags,NULL,0,NULL,0,psbn->pszNick,dwNickSize,psbn->pszFirstName,dwFirstNameSize,psbn->pszLastName,dwLastNameSize,0,0,0,0,0,0,0,0,0);
- }
- }
-return(iRet);
-}
-
-INT_PTR MraCreateAdvSearchUI(WPARAM wParam,LPARAM lParam)
-{
- INT_PTR iRet=0;
-
- if (masMraSettings.hInstance && lParam)
- {
- iRet=(INT_PTR)CreateDialogParam(masMraSettings.hInstance,MAKEINTRESOURCE(IDD_MRAADVANCEDSEARCH),(HWND)lParam,AdvancedSearchDlgProc,0);
- }
-return(iRet);
-}
-
-INT_PTR MraSearchByAdvanced(WPARAM wParam,LPARAM lParam)
-{
- INT_PTR iRet=0;
-
- if (masMraSettings.bLoggedIn && lParam)
- {
- iRet=(INT_PTR)AdvancedSearchFromDlg((HWND)lParam);
- }
-return(iRet);
-}
-
-
-
-
-
-INT_PTR MraFileResume(WPARAM wParam,LPARAM lParam)
-{
- INT_PTR iRet=1;
-
- if (wParam && lParam)
- {
- PROTOFILERESUME *pfr=(PROTOFILERESUME*)lParam;
- //icq_sendFileResume((filetransfer*)wParam,pfr->action,pfr->szFilename);
- iRet=0;// Success
- }
-return(iRet);
-}
-
-INT_PTR MraFileAllow(WPARAM wParam,LPARAM lParam)
-{
- INT_PTR iRet=0;
-
- if (lParam)
- if (((CCSDATA*)lParam)->wParam)
- {
- LPWSTR lpwszPath;
- SIZE_T dwPathSize;
- CCSDATA *pcds=(CCSDATA*)lParam;
- PROTORECVEVENT *prce=(PROTORECVEVENT*)pcds->lParam;
- PROTORECVFILET *prcf=(PROTORECVFILET*)pcds->lParam;
-
- lpwszPath=(LPWSTR)((CCSDATA*)lParam)->lParam;
- dwPathSize=lstrlenW(lpwszPath);
-
- if (MraFilesQueueAccept(masMraSettings.hFilesQueueHandle,((CCSDATA*)lParam)->wParam,lpwszPath,dwPathSize)==NO_ERROR)
- {
- iRet=((CCSDATA*)lParam)->wParam; // Success
- }
- }
-return(iRet);
-}
-
-INT_PTR MraFileDenyCancel(WPARAM wParam,LPARAM lParam)
+INT_PTR LoadModules(void)
{
- INT_PTR iRet=1;
-
- if (lParam)
- if (((CCSDATA*)lParam)->wParam)
- {// description: (LPSTR)((CCSDATA*)lParam)->lParam
- MraFilesQueueCancel(masMraSettings.hFilesQueueHandle,((CCSDATA*)lParam)->wParam,TRUE);
- iRet=0; // Success
- }
-return(iRet);
+ DebugPrintCRLFW(L"MRA/LoadModules - DONE");
+ return 0;
}
-
-
-INT_PTR MraFileSend(WPARAM wParam,LPARAM lParam)
+void UnloadModules()
{
- INT_PTR iRet=0;
-
- if (masMraSettings.bLoggedIn && wParam && lParam)
- if (((CCSDATA*)lParam)->hContact && ((CCSDATA*)lParam)->lParam)
- {// (LPSTR)((CCSDATA*)lParam)->wParam,lstrlenA((LPSTR)((CCSDATA*)lParam)->wParam) - description
- LPWSTR *plpwszFiles=(LPWSTR*)((CCSDATA*)lParam)->lParam;
- SIZE_T dwFilesCount;
-
- for(dwFilesCount=0;plpwszFiles[dwFilesCount];dwFilesCount++);
-
- MraFilesQueueAddSend(masMraSettings.hFilesQueueHandle,0,((CCSDATA*)lParam)->hContact,plpwszFiles,dwFilesCount,(DWORD*)&iRet);
- }
-return(iRet);
+ DebugPrintCRLFW(L"MRA/UnloadModules - DONE");
}
diff --git a/protocols/MRA/Readme_MRA.txt b/protocols/MRA/Readme_MRA.txt
index d94ee81399..5135a8b338 100644
--- a/protocols/MRA/Readme_MRA.txt
+++ b/protocols/MRA/Readme_MRA.txt
@@ -8,7 +8,7 @@ Copyright (C) 2006-2011 Рожук Иван
ВНИМАНИЕ!
В плагине добавляющая синхронизация!
- Если вы загрузили в свой профиль список а потом поменяли логин и пароль, то
+ Если вы загрузили в свой профиль список а потом поменяли логин и пароль, то
к вам скачается список второго акаунта, а на сервер скачается список первого, и
авторизация будет автоматически запрошенна у всех, кого дабавили на сервер.
@@ -43,7 +43,7 @@ Copyright (C) 2006-2011 Рожук Иван
В настройках look-in плагина укажите использовать для MRA шаблон от ICQ.
При передаче файлов можно указать описание к файлу, но пользователи агента его не увидят ;)
-
+
Расширенный поиск позволяет искать не только по России, но и по другим странам, с возможностью выбора города/штата.
Также желательно иметь Updater для своевременного автоматического обновления.
@@ -279,7 +279,7 @@ Version 1.16.0.3 // 2008.09.16
- Исправлен недочёт: когда происходила ошибка при передаче файла миранда не сообщала об ошибке и продолжала находится в состоянии установления подключения
- Оптимизирована обработка сообщений
- Полностью обновлён алгоритм получения оффлайновых сообщений
-
+
Version 1.14.0.6 // 2008.02
- Поддержка Unicode плагином
@@ -320,7 +320,7 @@ Version 1.13.29.1 // 2007.08.10
- Уменьшена нагрузка на основной поток миранды
- Пополнен спам фильтр
- Исправлена ошибка: иногда протокол повторно не переподключался до перезапуска миранды
-
+
Version 1.8.0.27 // 2007.02.24
- Улучшена поддержка RTF на передачу
@@ -340,7 +340,7 @@ Version 1.8.0.25 // 2007.02.20
- Корректно записывается версия миранды, плагина собеседника и наличие Secure IM
- Исправлено падение при обмене файлами
- и другие добавления, изменения и исправления
-
+
Version 1.8.0.23
- Добавлен антиспам
- Добавлена поддержка RTF на приём, см http://community.livejournal.com/ru_mirandaim/494383.html
@@ -452,10 +452,10 @@ Version 1.0.0.25 // 2006.01.17
- Пустой аватар больше не скачивается, показывается: MRA\_default.jpg
- По умолчанию файл аватара удаляется при удалении контакта
- Убрана зависимость от msvcr70.dll
-
+
Version 1.0.0.23 // 2006.01.16
- Исправлено преобразование смайлов в теги.
-
+
Version 1.0.0.21 // 2006.01.15
- Добавлено прозрачное преобразование смайлов в теги и обратно, в тч для обычного текста
diff --git a/protocols/MRA/Sdk/Base64.h b/protocols/MRA/Sdk/Base64.h
index 24d7605c47..d3cce03e9a 100644
--- a/protocols/MRA/Sdk/Base64.h
+++ b/protocols/MRA/Sdk/Base64.h
@@ -55,7 +55,7 @@ static BYTE btDeCodingTableBASE64[256]={64,64,64,64,64,64,64,64,64,64,64,64,64,6
-__inline void BASE64CopyUnSafe(LPCVOID lpcSource,LPCVOID lpcDestination,SIZE_T dwSize,SIZE_T *pdwCopyedSize)
+__inline void BASE64CopyUnSafe(LPCVOID lpcSource,LPCVOID lpcDestination,size_t dwSize,size_t *pdwCopyedSize)
{// копируем только б64 символы
LPBYTE lpbSource,lpbDestination;
@@ -66,15 +66,15 @@ __inline void BASE64CopyUnSafe(LPCVOID lpcSource,LPCVOID lpcDestination,SIZE_T d
if ((*lpbSource)>32 && (*lpbSource)<128) (*lpbDestination++)=(*lpbSource);
lpbSource++;
}
- if (pdwCopyedSize) (*pdwCopyedSize)=((SIZE_T)lpbDestination-(SIZE_T)lpcDestination);
+ if (pdwCopyedSize) (*pdwCopyedSize)=((size_t)lpbDestination-(size_t)lpcDestination);
}
-__inline DWORD BASE64EncodeUnSafe(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID lpcDestination,SIZE_T dwDestinationSize,SIZE_T *pdwEncodedSize)
+__inline DWORD BASE64EncodeUnSafe(LPCVOID lpcSource,size_t dwSourceSize,LPCVOID lpcDestination,size_t dwDestinationSize,size_t *pdwEncodedSize)
{// BASE64 кодирование
DWORD dwRetErrorCode;
- SIZE_T dwEncodedSize=((dwSourceSize*4+11)/12*4+1);//(((dwSourceSize+2)/3)*4);
+ size_t dwEncodedSize=((dwSourceSize*4+11)/12*4+1);//(((dwSourceSize+2)/3)*4);
if ((dwDestinationSize<dwEncodedSize))
{// выходной буффер слишком мал
@@ -85,7 +85,7 @@ __inline DWORD BASE64EncodeUnSafe(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID
{
#ifdef _WIN64
LPBYTE lpbtSource=(LPBYTE)lpcSource,lpbtDestination=(LPBYTE)lpcDestination;
- SIZE_T i;
+ size_t i;
for (i=0;i<dwSourceSize;i+=3)
{
@@ -230,7 +230,7 @@ return(dwRetErrorCode);
}
-__inline DWORD BASE64Encode(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID lpcDestination,SIZE_T dwDestinationSize,SIZE_T *pdwEncodedSize)
+__inline DWORD BASE64Encode(LPCVOID lpcSource,size_t dwSourceSize,LPCVOID lpcDestination,size_t dwDestinationSize,size_t *pdwEncodedSize)
{// BASE64 кодирование
DWORD dwRetErrorCode;
@@ -245,10 +245,10 @@ return(dwRetErrorCode);
-__inline DWORD BASE64DecodeUnSafe(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID lpcDestination,SIZE_T dwDestinationSize,SIZE_T *pdwDecodedSize)
+__inline DWORD BASE64DecodeUnSafe(LPCVOID lpcSource,size_t dwSourceSize,LPCVOID lpcDestination,size_t dwDestinationSize,size_t *pdwDecodedSize)
{// BASE64 декодирование
DWORD dwRetErrorCode;
- SIZE_T dwDecodedSize=((dwSourceSize>>2)*3);// ((dwSourceSize/4)*3);
+ size_t dwDecodedSize=((dwSourceSize>>2)*3);// ((dwSourceSize/4)*3);
if ((dwDestinationSize<dwDecodedSize))
{// выходной буффер слишком мал
@@ -262,7 +262,7 @@ __inline DWORD BASE64DecodeUnSafe(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID
#ifdef _WIN64
LPBYTE lpbtSource=(LPBYTE)lpcSource,lpbtDestination=(LPBYTE)lpcDestination;
- for(SIZE_T i=0;i<dwSourceSize;i+=4)
+ for(size_t i=0;i<dwSourceSize;i+=4)
{
*(lpbtDestination++)=(unsigned char) (btDeCodingTableBASE64[(*lpbtSource)] << 2 | btDeCodingTableBASE64[lpbtSource[1]] >> 4);
*(lpbtDestination++)=(unsigned char) (btDeCodingTableBASE64[lpbtSource[1]] << 4 | btDeCodingTableBASE64[lpbtSource[2]] >> 2);
@@ -346,7 +346,7 @@ return(dwRetErrorCode);
}
-__inline DWORD BASE64Decode(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID lpcDestination,SIZE_T dwDestinationSize,SIZE_T *pdwDecodedSize)
+__inline DWORD BASE64Decode(LPCVOID lpcSource,size_t dwSourceSize,LPCVOID lpcDestination,size_t dwDestinationSize,size_t *pdwDecodedSize)
{// BASE64 декодирование
DWORD dwRetErrorCode;
@@ -360,7 +360,7 @@ return(dwRetErrorCode);
}
-__inline DWORD BASE64DecodeFormated(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID lpcDestination,SIZE_T dwDestinationSize,SIZE_T *pdwDecodedSize)
+__inline DWORD BASE64DecodeFormated(LPCVOID lpcSource,size_t dwSourceSize,LPCVOID lpcDestination,size_t dwDestinationSize,size_t *pdwDecodedSize)
{// BASE64 декодирование и игнорирование форматирования
DWORD dwRetErrorCode;
diff --git a/protocols/MRA/Sdk/BuffToLowerCase.h b/protocols/MRA/Sdk/BuffToLowerCase.h
index 0cb0eb3cc1..3d7909bf41 100644
--- a/protocols/MRA/Sdk/BuffToLowerCase.h
+++ b/protocols/MRA/Sdk/BuffToLowerCase.h
@@ -35,7 +35,7 @@
-__inline BOOL BuffToLowerCase(LPCVOID lpcOutBuff,LPCVOID lpcBuff,SIZE_T dwLen)
+__inline BOOL BuffToLowerCase(LPCVOID lpcOutBuff,LPCVOID lpcBuff,size_t dwLen)
{
BOOL bRet=TRUE;
@@ -45,7 +45,7 @@ __inline BOOL BuffToLowerCase(LPCVOID lpcOutBuff,LPCVOID lpcBuff,SIZE_T dwLen)
BYTE bt;
LPBYTE lpbtIn=(LPBYTE)lpcBuff,lpbtOut=(LPBYTE)lpcOutBuff;
- for(SIZE_T i=dwLen;i;i--)
+ for(size_t i=dwLen;i;i--)
{
bt=(*(lpbtIn++));
if (bt>='A' && bt<='Z') bt|=32;
diff --git a/protocols/MRA/Sdk/FIFOMT.h b/protocols/MRA/Sdk/FIFOMT.h
index f0776cba1e..d15ae3e596 100644
--- a/protocols/MRA/Sdk/FIFOMT.h
+++ b/protocols/MRA/Sdk/FIFOMT.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- */
+ */
@@ -60,9 +60,9 @@ typedef PCLIST_MT_ITERATOR PCFIFO_MT_ITERATOR, LPCFIFO_MT_ITERATOR;
#define FifoMTDestroy(pcpmtFifoMT) ListMTDestroy(pcpmtFifoMT)
-__inline SIZE_T FifoMTItemPush(PCFIFO_MT pcpmtFifoMT,PCFIFO_MT_ITEM pcffmtiFifoItem,LPVOID lpData)
+__inline size_t FifoMTItemPush(PCFIFO_MT pcpmtFifoMT,PCFIFO_MT_ITEM pcffmtiFifoItem,LPVOID lpData)
{
- SIZE_T dwRet;
+ size_t dwRet;
ListMTLock(pcpmtFifoMT);
dwRet=ListMTItemAdd(pcpmtFifoMT,pcffmtiFifoItem,lpData);
diff --git a/protocols/MRA/Sdk/InternetTime.h b/protocols/MRA/Sdk/InternetTime.h
index 9999119e6a..c6abf16786 100644
--- a/protocols/MRA/Sdk/InternetTime.h
+++ b/protocols/MRA/Sdk/InternetTime.h
@@ -67,15 +67,15 @@ static LPCSTR lpcszenmDayOfWeakEnum[7]= {"Sun","Mon","Tue","Wed","Thu","Fri","Sa
#define SEPARATOR "\r\n\r\n"
-//DWORD InternetTimeGetTime (LPCSTR lpszTime,SIZE_T dwTimeSize,INTERNET_TIME *pitTime);
-//BOOL SkeepSPWSP (LPCSTR lpszBuff,SIZE_T dwBuffSize,LPSTR *plpszRetBuff,SIZE_T *pdwRetBuffSize);
-//BOOL WSP2SP (LPCSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszRetBuff,SIZE_T *pdwRetBuffSize);
+//DWORD InternetTimeGetTime (LPCSTR lpszTime,size_t dwTimeSize,INTERNET_TIME *pitTime);
+//BOOL SkeepSPWSP (LPCSTR lpszBuff,size_t dwBuffSize,LPSTR *plpszRetBuff,size_t *pdwRetBuffSize);
+//BOOL WSP2SP (LPCSTR lpszBuff,size_t dwBuffSize,LPSTR lpszRetBuff,size_t *pdwRetBuffSize);
-__inline BOOL SkeepSPWSP(LPCSTR lpszBuff,SIZE_T dwBuffSize,LPSTR *plpszRetBuff,SIZE_T *pdwRetBuffSize)
+__inline BOOL SkeepSPWSP(LPCSTR lpszBuff,size_t dwBuffSize,LPSTR *plpszRetBuff,size_t *pdwRetBuffSize)
{
BOOL bRet=TRUE;
@@ -96,14 +96,14 @@ return(bRet);
}
-__inline BOOL WSP2SP(LPCSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszRetBuff,SIZE_T *pdwRetBuffSize)
+__inline BOOL WSP2SP(LPCSTR lpszBuff,size_t dwBuffSize,LPSTR lpszRetBuff,size_t *pdwRetBuffSize)
{// WSP->SP
BOOL bRet=TRUE;
if (lpszBuff && dwBuffSize && lpszRetBuff)
{
LPSTR lpszCurReadPos,pCRLF,lpszCurWritePos;
- SIZE_T dwToCopy,dwRetBuffSize;
+ size_t dwToCopy,dwRetBuffSize;
pCRLF=(LPSTR)lpszBuff;
lpszCurReadPos=(LPSTR)lpszBuff;
@@ -144,14 +144,14 @@ return(bRet);
-__inline BOOL HT2SP(LPCSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszRetBuff,SIZE_T *pdwRetBuffSize)
+__inline BOOL HT2SP(LPCSTR lpszBuff,size_t dwBuffSize,LPSTR lpszRetBuff,size_t *pdwRetBuffSize)
{// HT->SP
BOOL bRet=TRUE;
if (lpszBuff && dwBuffSize && lpszRetBuff)
{
LPSTR lpszCurReadPos,pHT,lpszCurWritePos;
- SIZE_T dwToCopy,dwRetBuffSize;
+ size_t dwToCopy,dwRetBuffSize;
pHT=(LPSTR)lpszBuff;
lpszCurReadPos=(LPSTR)lpszBuff;
@@ -189,14 +189,14 @@ return(bRet);
-__inline BOOL CleanUnneededSP(LPCSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszRetBuff,SIZE_T *pdwRetBuffSize)
+__inline BOOL CleanUnneededSP(LPCSTR lpszBuff,size_t dwBuffSize,LPSTR lpszRetBuff,size_t *pdwRetBuffSize)
{// nSP->SP, SPCRLF->CRLF, CRLFSP->CRLF
BOOL bRet=TRUE;
if (lpszBuff && dwBuffSize && lpszRetBuff)
{
LPSTR lpszCurReadPos,pSP,pSPStart,pSPEnd,lpszCurWritePos,pEnd;
- SIZE_T dwToCopy,dwRetBuffSize;
+ size_t dwToCopy,dwRetBuffSize;
pSP=(LPSTR)lpszBuff;
lpszCurReadPos=(LPSTR)lpszBuff;
@@ -252,16 +252,16 @@ return(bRet);
-__inline SIZE_T CopyText(LPVOID lpOutBuff,LPCVOID lpcBuff,SIZE_T dwLen)
+__inline size_t CopyText(LPVOID lpOutBuff,LPCVOID lpcBuff,size_t dwLen)
{
- SIZE_T dwRet=0;
+ size_t dwRet=0;
if (lpOutBuff && lpcBuff && dwLen)
{
BYTE bt;
LPBYTE lpbtIn=(LPBYTE)lpcBuff,lpbtOut=(LPBYTE)lpOutBuff;
- for(SIZE_T i=dwLen;i;i--)
+ for(size_t i=dwLen;i;i--)
{
bt=(*(lpbtIn++));
if (bt<127 && (bt>31 || bt==9 || bt==10 || bt==13))
@@ -284,14 +284,14 @@ __inline void InternetTimeGetCurrentTime(INTERNET_TIME *pitTime)
}
-__inline DWORD InternetTimeGetString(INTERNET_TIME *pitTime,LPSTR lpszBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSizeRet)
+__inline DWORD InternetTimeGetString(INTERNET_TIME *pitTime,LPSTR lpszBuff,size_t dwBuffSize,size_t *pdwBuffSizeRet)
{// Переводит время из MAILTIME в строковое
DWORD dwRet=NO_ERROR;
if (dwBuffSize>31)
{
LPSTR lpszCurPos=lpszBuff;
- SIZE_T dwTimeLen=0,dwtm;
+ size_t dwTimeLen=0,dwtm;
// day of weak// date of mounth// mounth name// year// hours // minutes// seconds
dwtm=wsprintfA(lpszCurPos,"%s, %02lu %s %04lu %02lu:%02lu:%02lu ",lpcszenmDayOfWeakEnum[pitTime->stTime.wDayOfWeek],pitTime->stTime.wDay,lpcszenmMonthEnum[pitTime->stTime.wMonth],pitTime->stTime.wYear,pitTime->stTime.wHour,pitTime->stTime.wMinute,pitTime->stTime.wSecond);
@@ -327,7 +327,7 @@ return(dwRet);
-__inline DWORD InternetTimeGetTime(LPCSTR lpszTime,SIZE_T dwTimeSize,INTERNET_TIME *pitTime)
+__inline DWORD InternetTimeGetTime(LPCSTR lpszTime,size_t dwTimeSize,INTERNET_TIME *pitTime)
{// Переводит время из строкового в INTERNET_TIME
DWORD dwRet=NO_ERROR;
@@ -335,7 +335,7 @@ __inline DWORD InternetTimeGetTime(LPCSTR lpszTime,SIZE_T dwTimeSize,INTERNET_TI
{// = Thu, 21 May 1998 05:33:29 -0700 =
char sztmBuff[4096];
LPSTR lpszCurPos=sztmBuff,lpszTemp;
- SIZE_T i,dwCurSize=4096,dwTemp;
+ size_t i,dwCurSize=4096,dwTemp;
memset(pitTime, 0, sizeof(INTERNET_TIME));
WSP2SP((LPSTR)lpszTime,dwTimeSize,lpszCurPos,&dwCurSize);
diff --git a/protocols/MRA/Sdk/ListMT.h b/protocols/MRA/Sdk/ListMT.h
index 66e118867d..d7ca6e0b12 100644
--- a/protocols/MRA/Sdk/ListMT.h
+++ b/protocols/MRA/Sdk/ListMT.h
@@ -66,7 +66,7 @@ typedef CONST PLIST_MT_ITEM PCLIST_MT_ITEM, LPCLIST_MT_ITEM;
// структура для работы со списком, заголовок списка
typedef struct _LIST_MT
{
- SIZE_T nCount; // *колличество элементов в списке
+ size_t nCount; // *колличество элементов в списке
PLIST_MT_ITEM plmtiFirst; // *указывает на первый элемент в списке
PLIST_MT_ITEM plmtiLast; // *указывает на последний элемент в списке
CRITICAL_SECTION cs; // *section for exclysive access to List
@@ -139,15 +139,15 @@ __inline void ListMTUnLock(PCLIST_MT pclmtListMT)
}
-__inline SIZE_T ListMTGetCount(PCLIST_MT pclmtListMT)
+__inline size_t ListMTGetCount(PCLIST_MT pclmtListMT)
{
- return((SIZE_T)InterlockedCompareExchangePointer((LPVOID*)&pclmtListMT->nCount,NULL,NULL));
+ return((size_t)InterlockedCompareExchangePointer((LPVOID*)&pclmtListMT->nCount,NULL,NULL));
}
-__inline SIZE_T ListMTItemAdd(PCLIST_MT pclmtListMT,PCLIST_MT_ITEM pclmtListMTItem,LPVOID lpData)
+__inline size_t ListMTItemAdd(PCLIST_MT pclmtListMT,PCLIST_MT_ITEM pclmtListMTItem,LPVOID lpData)
{
- SIZE_T dwRet=(SIZE_T)InterlockedIncrementPointer(&pclmtListMT->nCount);//pclmtListMT->nCount++;
+ size_t dwRet=(size_t)InterlockedIncrementPointer(&pclmtListMT->nCount);//pclmtListMT->nCount++;
pclmtListMTItem->lpData=lpData;
pclmtListMTItem->lpListMT=pclmtListMT;
diff --git a/protocols/MRA/Sdk/RC4.h b/protocols/MRA/Sdk/RC4.h
index 82e1da0de4..cb6331a183 100644
--- a/protocols/MRA/Sdk/RC4.h
+++ b/protocols/MRA/Sdk/RC4.h
@@ -36,7 +36,7 @@
-__inline void RC4(LPBYTE lpBuff,SIZE_T dwBuffSize,LPBYTE lpKey,SIZE_T dwKeySize)
+__inline void RC4(LPBYTE lpBuff,size_t dwBuffSize,LPBYTE lpKey,size_t dwKeySize)
{// RC4
// www.codeproject.com/cpp/crypt_routine.asp%3Fdf%3D100%26forumid%3D4418%26exp%3D0%26select%3D251879+RC4+c%2B%2B+source+DWORD&hl=ru&gl=ru&ct=clnk&cd=2
// http://www.thecodeproject.com/cpp/crypt_routine.asp
@@ -46,7 +46,7 @@ __inline void RC4(LPBYTE lpBuff,SIZE_T dwBuffSize,LPBYTE lpKey,SIZE_T dwKeySize)
//(extra byte are only to prevent any mishep just in case)
BYTE temp;
BYTE Sbox[260]={0},Sbox2[260]={0};
- SIZE_T i,j,t,x;
+ size_t i,j,t,x;
i=j=t=x=0;
temp=0;
diff --git a/protocols/MRA/Sdk/SHA1.h b/protocols/MRA/Sdk/SHA1.h
index 9a35d78c85..f7d4643d32 100644
--- a/protocols/MRA/Sdk/SHA1.h
+++ b/protocols/MRA/Sdk/SHA1.h
@@ -121,13 +121,13 @@ __inline DWORD BSWAP(DWORD dwIn)
return((((dwIn<<8) & 0x00ff0000) | (dwIn<<24) | ((dwIn>>8) & 0x0000ff00) | (dwIn>>24)));
}
-__inline void CopyMemoryReverseDWORD(LPCVOID lpcDestination,LPCVOID lpcSource,SIZE_T dwSize)
+__inline void CopyMemoryReverseDWORD(LPCVOID lpcDestination,LPCVOID lpcSource,size_t dwSize)
{
#ifdef _WIN64
BYTE *pDestination=(BYTE*)lpcDestination,*pSource=(BYTE*)lpcSource;
- //for(SIZE_T i=0;i<dwSize;i++) pDestination[i]=pSource[(i&~0x00000003)+(3-(i&0x00000003))];
- for(SIZE_T i=0;i<dwSize;i+=4) (*((DWORD*)(pDestination+i)))=BSWAP((*((DWORD*)(pSource+i))));
+ //for(size_t i=0;i<dwSize;i++) pDestination[i]=pSource[(i&~0x00000003)+(3-(i&0x00000003))];
+ for(size_t i=0;i<dwSize;i+=4) (*((DWORD*)(pDestination+i)))=BSWAP((*((DWORD*)(pSource+i))));
#else
__asm{
@@ -276,7 +276,7 @@ __inline void SHA1PadMessage(SHA1Context *context)
* block, process it, and then continue padding into a second
* block.
*/
- SIZE_T Message_Block_Index=(SIZE_T)((context->Length.LowPart>>3) & 0x3F);
+ size_t Message_Block_Index=(size_t)((context->Length.LowPart>>3) & 0x3F);
context->Message_Block[Message_Block_Index++]=0x80;
if (Message_Block_Index>56)
{
@@ -384,15 +384,15 @@ return(NO_ERROR);
* sha Error Code.
*
*/
-__inline DWORD SHA1Input(SHA1Context *context,const BYTE *message_array,SIZE_T length)
+__inline DWORD SHA1Input(SHA1Context *context,const BYTE *message_array,size_t length)
{
if (context->Computed==TRUE) return(ERROR_INVALID_HANDLE_STATE);
if ((context->Length.QuadPart+(length<<3))>=(length<<3))
{
- SIZE_T i,Message_Block_Index,partLen;
+ size_t i,Message_Block_Index,partLen;
/* Compute number of bytes mod 64 */
- Message_Block_Index=(SIZE_T)((context->Length.LowPart>>3) & 0x3F);
+ Message_Block_Index=(size_t)((context->Length.LowPart>>3) & 0x3F);
/* Update number of bits */
context->Length.QuadPart+=(((ULONGLONG)length)<<3);
partLen=(64-Message_Block_Index);
@@ -418,7 +418,7 @@ return(NO_ERROR);
//////////////////////////////RFC 2104//////////////////////////////
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
-__inline void hmac_sha1(BYTE *text,SIZE_T text_len,BYTE *key,SIZE_T key_len,BYTE *digest)
+__inline void hmac_sha1(BYTE *text,size_t text_len,BYTE *key,size_t key_len,BYTE *digest)
{
//BYTE* text; /* pointer to data stream */
//int text_len; /* length of data stream */
@@ -460,7 +460,7 @@ __inline void hmac_sha1(BYTE *text,SIZE_T text_len,BYTE *key,SIZE_T key_len,BYTE
memset(&k_opad[key_len], 0 , (sizeof(k_opad)-key_len));
/* XOR key with ipad and opad values */
- for (SIZE_T i=0;i<(64/sizeof(ULONGLONG));i++)
+ for (size_t i=0;i<(64/sizeof(ULONGLONG));i++)
{
((ULONGLONG*)k_ipad)[i]^=0x3636363636363636;
((ULONGLONG*)k_opad)[i]^=0x5C5C5C5C5C5C5C5C;
@@ -489,7 +489,7 @@ __inline void SHA1CvtHex(BYTE *Bin,BYTE *Hex)
{
BYTE j;
- for (SIZE_T i=0;i<SHA1HashSize;i++)
+ for (size_t i=0;i<SHA1HashSize;i++)
{
j=(Bin[i]>>4)&0xf;
if(j<=9)
@@ -520,7 +520,7 @@ __inline void SHA1CvtStringA(BYTE *digest,LPSTR lpszDigest)
__inline void SHA1CvtStringW(BYTE *digest,LPWSTR lpszDigest)
{
- SIZE_T i,p=0;
+ size_t i,p=0;
for (i=0;i<SHA1HashSize;i++,p+=2)
{
wsprintfW((LPWSTR)(lpszDigest+p),L"%02x",digest[i]);
@@ -532,13 +532,13 @@ __inline void SHA1CvtStringW(BYTE *digest,LPWSTR lpszDigest)
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
-__inline void SHA1HMACGetDigest(LPVOID lpBuff,SIZE_T dwBuffSize,LPVOID lpKey,SIZE_T dwKeySize,BYTE *digest)
+__inline void SHA1HMACGetDigest(LPVOID lpBuff,size_t dwBuffSize,LPVOID lpKey,size_t dwKeySize,BYTE *digest)
{
hmac_sha1((BYTE*)lpBuff,dwBuffSize,(BYTE*)lpKey,dwKeySize,digest);
}
-__inline void SHA1HMACGetStringA(LPSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszKey,SIZE_T dwKeySize,LPSTR lpszDigest)
+__inline void SHA1HMACGetStringA(LPSTR lpszBuff,size_t dwBuffSize,LPSTR lpszKey,size_t dwKeySize,LPSTR lpszDigest)
{
BYTE digest[SHA1HashSize];
hmac_sha1((BYTE*)lpszBuff,dwBuffSize,(BYTE*)lpszKey,dwKeySize,digest);
@@ -546,7 +546,7 @@ __inline void SHA1HMACGetStringA(LPSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszKey,
}
-__inline void SHA1HMACGetStringW(LPWSTR lpszBuff,SIZE_T dwBuffSize,LPWSTR lpszKey,SIZE_T dwKeySize,LPWSTR lpszDigest)
+__inline void SHA1HMACGetStringW(LPWSTR lpszBuff,size_t dwBuffSize,LPWSTR lpszKey,size_t dwKeySize,LPWSTR lpszDigest)
{
BYTE digest[SHA1HashSize];
hmac_sha1((BYTE*)lpszBuff,dwBuffSize,(BYTE*)lpszKey,dwKeySize,digest);
@@ -555,7 +555,7 @@ __inline void SHA1HMACGetStringW(LPWSTR lpszBuff,SIZE_T dwBuffSize,LPWSTR lpszKe
-__inline void SHA1GetDigest(LPVOID lpBuff,SIZE_T dwBuffSize,BYTE *digest)
+__inline void SHA1GetDigest(LPVOID lpBuff,size_t dwBuffSize,BYTE *digest)
{
SHA1Context sha;
@@ -565,7 +565,7 @@ __inline void SHA1GetDigest(LPVOID lpBuff,SIZE_T dwBuffSize,BYTE *digest)
}
-__inline void SHA1GetStringDigestA(LPSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszDigest)
+__inline void SHA1GetStringDigestA(LPSTR lpszBuff,size_t dwBuffSize,LPSTR lpszDigest)
{
SHA1Context sha;
BYTE digest[SHA1HashSize];
@@ -578,7 +578,7 @@ __inline void SHA1GetStringDigestA(LPSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszDi
}
-__inline void SHA1GetStringDigestW(LPWSTR lpszBuff,SIZE_T dwBuffSize,LPWSTR lpszDigest)
+__inline void SHA1GetStringDigestW(LPWSTR lpszBuff,size_t dwBuffSize,LPWSTR lpszDigest)
{
SHA1Context sha;
BYTE digest[SHA1HashSize];
diff --git a/protocols/MRA/Sdk/SocketFunctions.h b/protocols/MRA/Sdk/SocketFunctions.h
index 480b5beccb..0d609d80f9 100644
--- a/protocols/MRA/Sdk/SocketFunctions.h
+++ b/protocols/MRA/Sdk/SocketFunctions.h
@@ -346,7 +346,7 @@ return(dwRetErrorCode);
////////////////////////////////////////////////////////////////////////
#if(_WIN32_WINNT >= 0x0501)
-__inline DWORD SockAddrInDataSet(LPCVOID lpcsasSockAddrStorage,DWORD dwPort,LPCVOID lpcAddress,SIZE_T dwAddressSize)
+__inline DWORD SockAddrInDataSet(LPCVOID lpcsasSockAddrStorage,DWORD dwPort,LPCVOID lpcAddress,size_t dwAddressSize)
{
DWORD dwRetErrorCode=NO_ERROR;
@@ -398,7 +398,7 @@ return(dwRetErrorCode);
}
-__inline DWORD SockAddrInAddressSet(LPCVOID lpcsasSockAddrStorage,LPCVOID lpcAddress,SIZE_T dwAddressSize)
+__inline DWORD SockAddrInAddressSet(LPCVOID lpcsasSockAddrStorage,LPCVOID lpcAddress,size_t dwAddressSize)
{
DWORD dwRetErrorCode=NO_ERROR;
@@ -424,7 +424,7 @@ return(dwRetErrorCode);
}
-__inline DWORD SockAddrAddressSet(LPCVOID lpcsasSockAddrStorage,LPCVOID lpcAddress,SIZE_T dwAddressSize)
+__inline DWORD SockAddrAddressSet(LPCVOID lpcsasSockAddrStorage,LPCVOID lpcAddress,size_t dwAddressSize)
{
DWORD dwRetErrorCode=NO_ERROR;
@@ -450,9 +450,9 @@ return(dwRetErrorCode);
}
-__inline SIZE_T SockAddrGetSize(LPCVOID lpcsasSockAddrStorage)
+__inline size_t SockAddrGetSize(LPCVOID lpcsasSockAddrStorage)
{
- SIZE_T dwRet;
+ size_t dwRet;
if (lpcsasSockAddrStorage)
{
diff --git a/protocols/MRA/Sdk/StrHexToNum.h b/protocols/MRA/Sdk/StrHexToNum.h
index 60b5801efb..e4a5cc98fa 100644
--- a/protocols/MRA/Sdk/StrHexToNum.h
+++ b/protocols/MRA/Sdk/StrHexToNum.h
@@ -39,9 +39,9 @@
-__inline SIZE_T StrHexToUNum(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline size_t StrHexToUNum(LPCSTR lpcszString,size_t dwStringLen)
{
- SIZE_T dwNum=0;
+ size_t dwNum=0;
BYTE bCurentFigure;
while(dwStringLen)
@@ -74,7 +74,7 @@ __inline SIZE_T StrHexToUNum(LPCSTR lpcszString,SIZE_T dwStringLen)
return(dwNum);
}
-__inline DWORD StrHexToUNum32(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline DWORD StrHexToUNum32(LPCSTR lpcszString,size_t dwStringLen)
{
DWORD dwNum=0;
BYTE bCurentFigure;
@@ -110,7 +110,7 @@ __inline DWORD StrHexToUNum32(LPCSTR lpcszString,SIZE_T dwStringLen)
return(dwNum);
}
-__inline DWORDLONG StrHexToUNum64(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline DWORDLONG StrHexToUNum64(LPCSTR lpcszString,size_t dwStringLen)
{
DWORDLONG dwlNum=0;
BYTE bCurentFigure;
@@ -148,10 +148,10 @@ return(dwlNum);
-__inline DWORD StrHexToUNumEx(LPCSTR lpcszString,SIZE_T dwStringLen,SIZE_T *pdwNum)
+__inline DWORD StrHexToUNumEx(LPCSTR lpcszString,size_t dwStringLen,size_t *pdwNum)
{
DWORD dwRetErrorCode;
- SIZE_T dwNum=0,dwProcessed=0;
+ size_t dwNum=0,dwProcessed=0;
BYTE bCurentFigure;
@@ -199,7 +199,7 @@ return(dwRetErrorCode);
}
-__inline DWORD StrHexToUNumEx32(LPCSTR lpcszString,SIZE_T dwStringLen,DWORD *pdwNum)
+__inline DWORD StrHexToUNumEx32(LPCSTR lpcszString,size_t dwStringLen,DWORD *pdwNum)
{
DWORD dwRetErrorCode;
DWORD dwNum=0,dwProcessed=0;
@@ -250,11 +250,11 @@ return(dwRetErrorCode);
}
-__inline DWORD StrHexToUNumEx64(LPCSTR lpcszString,SIZE_T dwStringLen,DWORDLONG *pdwlNum)
+__inline DWORD StrHexToUNumEx64(LPCSTR lpcszString,size_t dwStringLen,DWORDLONG *pdwlNum)
{
DWORD dwRetErrorCode;
DWORDLONG dwlNum=0;
- SIZE_T dwProcessed=0;
+ size_t dwProcessed=0;
BYTE bCurentFigure;
@@ -304,7 +304,7 @@ return(dwRetErrorCode);
-__inline SSIZE_T StrHexToNum(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline SSIZE_T StrHexToNum(LPCSTR lpcszString,size_t dwStringLen)
{
SSIZE_T lNum=0,lSingn=1;
BYTE bCurentFigure;
@@ -351,7 +351,7 @@ return(lNum);
}
-__inline LONG StrHexToNum32(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline LONG StrHexToNum32(LPCSTR lpcszString,size_t dwStringLen)
{
LONG lNum=0,lSingn=1;
BYTE bCurentFigure;
@@ -398,7 +398,7 @@ return(lNum);
}
-__inline LONGLONG StrHexToNum64(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline LONGLONG StrHexToNum64(LPCSTR lpcszString,size_t dwStringLen)
{
LONGLONG llNum=0,llSingn=1;
BYTE bCurentFigure;
@@ -446,10 +446,10 @@ return(llNum);
-__inline DWORD StrHexToNumEx(LPCSTR lpcszString,SIZE_T dwStringLen,SSIZE_T *plNum)
+__inline DWORD StrHexToNumEx(LPCSTR lpcszString,size_t dwStringLen,SSIZE_T *plNum)
{
DWORD dwRetErrorCode;
- SIZE_T dwProcessed=0;
+ size_t dwProcessed=0;
SSIZE_T lNum=0,lSingn=1;
BYTE bCurentFigure;
@@ -507,10 +507,10 @@ return(dwRetErrorCode);
}
-__inline DWORD StrHexToNumEx32(LPCSTR lpcszString,SIZE_T dwStringLen,LONG *plNum)
+__inline DWORD StrHexToNumEx32(LPCSTR lpcszString,size_t dwStringLen,LONG *plNum)
{
DWORD dwRetErrorCode;
- SIZE_T dwProcessed=0;
+ size_t dwProcessed=0;
LONG lNum=0,lSingn=1;
BYTE bCurentFigure;
@@ -568,10 +568,10 @@ return(dwRetErrorCode);
}
-__inline DWORD StrHexToNumEx64(LPCSTR lpcszString,SIZE_T dwStringLen,LONGLONG *pllNum)
+__inline DWORD StrHexToNumEx64(LPCSTR lpcszString,size_t dwStringLen,LONGLONG *pllNum)
{
DWORD dwRetErrorCode;
- SIZE_T dwProcessed=0;
+ size_t dwProcessed=0;
LONGLONG llNum=0,llSingn=1;
BYTE bCurentFigure;
diff --git a/protocols/MRA/Sdk/StrToNum.h b/protocols/MRA/Sdk/StrToNum.h
index 888b940b7c..6e67ac6be1 100644
--- a/protocols/MRA/Sdk/StrToNum.h
+++ b/protocols/MRA/Sdk/StrToNum.h
@@ -40,9 +40,9 @@
-__inline SIZE_T StrToUNum(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline size_t StrToUNum(LPCSTR lpcszString,size_t dwStringLen)
{
- SIZE_T dwNum=0;
+ size_t dwNum=0;
BYTE bCurentFigure;
@@ -61,7 +61,7 @@ return(dwNum);
}
-__inline DWORD StrToUNum32(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline DWORD StrToUNum32(LPCSTR lpcszString,size_t dwStringLen)
{
DWORD dwNum=0;
BYTE bCurentFigure;
@@ -82,7 +82,7 @@ return(dwNum);
}
-__inline DWORDLONG StrToUNum64(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline DWORDLONG StrToUNum64(LPCSTR lpcszString,size_t dwStringLen)
{
DWORDLONG dwlNum=0;
BYTE bCurentFigure;
@@ -105,10 +105,10 @@ return(dwlNum);
-__inline DWORD StrToUNumEx(LPCSTR lpcszString,SIZE_T dwStringLen,SIZE_T *pdwNum)
+__inline DWORD StrToUNumEx(LPCSTR lpcszString,size_t dwStringLen,size_t *pdwNum)
{
DWORD dwRetErrorCode;
- SIZE_T dwNum=0,dwProcessed=0;
+ size_t dwNum=0,dwProcessed=0;
BYTE bCurentFigure;
@@ -140,7 +140,7 @@ return(dwRetErrorCode);
}
-__inline DWORD StrToUNumEx32(LPCSTR lpcszString,SIZE_T dwStringLen,DWORD *pdwNum)
+__inline DWORD StrToUNumEx32(LPCSTR lpcszString,size_t dwStringLen,DWORD *pdwNum)
{
DWORD dwRetErrorCode;
DWORD dwNum=0,dwProcessed=0;
@@ -175,11 +175,11 @@ return(dwRetErrorCode);
}
-__inline DWORD StrToUNumEx64(LPCSTR lpcszString,SIZE_T dwStringLen,DWORDLONG *pdwlNum)
+__inline DWORD StrToUNumEx64(LPCSTR lpcszString,size_t dwStringLen,DWORDLONG *pdwlNum)
{
DWORD dwRetErrorCode;
DWORDLONG dwlNum=0;
- SIZE_T dwProcessed=0;
+ size_t dwProcessed=0;
BYTE bCurentFigure;
@@ -213,7 +213,7 @@ return(dwRetErrorCode);
-__inline SSIZE_T StrToNum(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline SSIZE_T StrToNum(LPCSTR lpcszString,size_t dwStringLen)
{
SSIZE_T lNum=0,lSingn=1;
BYTE bCurentFigure;
@@ -244,7 +244,7 @@ return(lNum);
}
-__inline LONG StrToNum32(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline LONG StrToNum32(LPCSTR lpcszString,size_t dwStringLen)
{
LONG lNum=0,lSingn=1;
BYTE bCurentFigure;
@@ -275,7 +275,7 @@ return(lNum);
}
-__inline LONGLONG StrToNum64(LPCSTR lpcszString,SIZE_T dwStringLen)
+__inline LONGLONG StrToNum64(LPCSTR lpcszString,size_t dwStringLen)
{
LONGLONG llNum=0,llSingn=1;
BYTE bCurentFigure;
@@ -307,10 +307,10 @@ return(llNum);
-__inline DWORD StrToNumEx(LPCSTR lpcszString,SIZE_T dwStringLen,SSIZE_T *plNum)
+__inline DWORD StrToNumEx(LPCSTR lpcszString,size_t dwStringLen,SSIZE_T *plNum)
{
DWORD dwRetErrorCode;
- SIZE_T dwProcessed=0;
+ size_t dwProcessed=0;
SSIZE_T lNum=0,lSingn=1;
BYTE bCurentFigure;
@@ -352,10 +352,10 @@ return(dwRetErrorCode);
}
-__inline DWORD StrToNumEx32(LPCSTR lpcszString,SIZE_T dwStringLen,LONG *plNum)
+__inline DWORD StrToNumEx32(LPCSTR lpcszString,size_t dwStringLen,LONG *plNum)
{
DWORD dwRetErrorCode;
- SIZE_T dwProcessed=0;
+ size_t dwProcessed=0;
LONG lNum=0,lSingn=1;
BYTE bCurentFigure;
@@ -397,10 +397,10 @@ return(dwRetErrorCode);
}
-__inline DWORD StrToNumEx64(LPCSTR lpcszString,SIZE_T dwStringLen,LONGLONG *pllNum)
+__inline DWORD StrToNumEx64(LPCSTR lpcszString,size_t dwStringLen,LONGLONG *pllNum)
{
DWORD dwRetErrorCode;
- SIZE_T dwProcessed=0;
+ size_t dwProcessed=0;
LONGLONG llNum=0,llSingn=1;
BYTE bCurentFigure;
diff --git a/protocols/MRA/proto.h b/protocols/MRA/proto.h
index bd1664c4ca..d881733480 100644
--- a/protocols/MRA/proto.h
+++ b/protocols/MRA/proto.h
@@ -1,5 +1,5 @@
//***************************************************************************
-// $Id: proto.h,v 1.141 2005/10/24 15:32:33 shingrus Exp $
+// $Id: proto.h, v 1.141 2005/10/24 15:32:33 shingrus Exp $
//***************************************************************************
#ifndef MRIM_PROTO_H
@@ -7,14 +7,7 @@
#include <sys/types.h>
-#define PROTO_VERSION_MAJOR 1
-#define PROTO_VERSION_MINOR 21
-#define PROTO_VERSION ((((u_long)(PROTO_VERSION_MAJOR))<<16)|(u_long)(PROTO_VERSION_MINOR))
-
-
-#define PROTO_MAJOR(p) (((p)&0xFFFF0000)>>16)
-#define PROTO_MINOR(p) ((p)&0x0000FFFF)
-
+#include "version.h"
typedef struct mrim_packet_header_t
{
@@ -30,7 +23,7 @@ mrim_packet_header_t;
#define CS_MAGIC 0xDEADBEEF // Клиентский Magic ( C <-> S )
-// UNICODE = (UTF-16LE) (>=1.17)
+// UNICODE = (UTF-16LE) ( >= 1.17)
/***************************************************************************
@@ -82,8 +75,8 @@ mrim_packet_header_t;
#define MESSAGE_FLAG_CP1251 0x00200000
// LPS to e-mail ANSI
// LPS message ANSI/UNICODE (see flags)
-// LPS rtf-formatted message (>=1.1) ???
-// LPS multichat_data (>=1.20) ???
+// LPS rtf-formatted message ( >= 1.1) ???
+// LPS multichat_data ( >= 1.20) ???
#define MAX_MULTICAST_RECIPIENTS 50
#define MESSAGE_USERFLAGS_MASK 0x000036A8 // Flags that user is allowed to set himself
@@ -94,15 +87,15 @@ mrim_packet_header_t;
// UL flags
// LPS from e-mail ANSI
// LPS message UNICODE
-// LPS rtf-formatted message (>=1.1) - MESSAGE_FLAG_RTF
+// LPS rtf-formatted message ( >= 1.1) - MESSAGE_FLAG_RTF
// //BASE64( - MESSAGE_FLAG_AUTHORIZE
// UL parts count = 2
// LPS auth_sender_nick UNICODE
// LPS auth_request_text UNICODE
-//[ LPS multichat_data ] (>= 1.20) - MESSAGE_FLAG_MULTICHAT
+//[ LPS multichat_data ] ( >= 1.20) - MESSAGE_FLAG_MULTICHAT
// UL type
// LPS multichat_name
-// switch(type) {
+// switch (type) {
// MULTICHAT_MESSAGE {
// LPS sender ANSI
// }
@@ -154,14 +147,14 @@ mrim_packet_header_t;
#define STATUS_UNDETERMINATED 0x00000003
#define STATUS_USER_DEFINED 0x00000004
#define STATUS_FLAG_INVISIBLE 0x80000000
-// LPS spec_status_uri ANSI (>=1.14)
+// LPS spec_status_uri ANSI ( >= 1.14)
#define SPEC_STATUS_URI_MAX 256
-// LPS status_title UNICODE (>=1.14)
+// LPS status_title UNICODE ( >= 1.14)
#define STATUS_TITLE_MAX 16
-// LPS status_desc UNICODE (>=1.14)
+// LPS status_desc UNICODE ( >= 1.14)
#define STATUS_DESC_MAX 64
// LPS user e-mail ANSI
-// UL com_support (>=1.14)
+// UL com_support ( >= 1.14)
#define FEATURE_FLAG_RTF_MESSAGE 0x00000001
#define FEATURE_FLAG_BASE_SMILES 0x00000002
#define FEATURE_FLAG_ADVANCED_SMILES 0x00000004
@@ -174,11 +167,11 @@ mrim_packet_header_t;
#define FEATURE_FLAG_GAMES 0x00000200
#define FEATURE_FLAG_LAST 0x00000200
#define FEATURE_UA_FLAG_MASK ((FEATURE_FLAG_LAST << 1) - 1)
-// LPS user_agent (>=1.14) ANSI
+// LPS user_agent ( >= 1.14) ANSI
#define USER_AGENT_MAX 255
// Format:
// user_agent = param *(param )
- // param = pname "=" pvalue
+ // param = pname " = " pvalue
// pname = token
// pvalue = token / quoted-string
//
@@ -215,8 +208,8 @@ mrim_packet_header_t;
#define CONTACT_FLAG_IGNORE 0x00000010
#define CONTACT_FLAG_SHADOW 0x00000020
#define CONTACT_FLAG_AUTHORIZED 0x00000040 // ( >= 1.15)
- #define CONTACT_FLAG_MULTICHAT 0x00000080 // ( >= 1.20) =128
- #define CONTACT_FLAG_UNICODE_NAME 0x00000200 // =512
+ #define CONTACT_FLAG_MULTICHAT 0x00000080 // ( >= 1.20) = 128
+ #define CONTACT_FLAG_UNICODE_NAME 0x00000200 // = 512
#define CONTACT_FLAG_PHONE 0x00100000
// UL group id (unused if contact is group)
@@ -230,7 +223,7 @@ mrim_packet_header_t;
// )
// UL actions ( >= 1.15)
// [LPS multichat_data]
-// CLPS members (>= 1.20)
+// CLPS members ( >= 1.20)
// [ LPS owner ]
#define ADD_CONTACT_FLAG_MYMAIL_INVITE 0x00000001
#define ADD_CONTACT_FLAG_MULTICHAT_ATTACHE 0x00000002
@@ -249,7 +242,7 @@ mrim_packet_header_t;
#define CONTACT_OPER_USER_EXISTS 0x0005
#define CONTACT_OPER_GROUP_LIMIT 0x6
// UL contact_id or (u_long)-1 if status is not OK
-// [LPS multichat_contact (>= 1.20)]
+// [LPS multichat_contact ( >= 1.20)]
#define MRIM_CS_MODIFY_CONTACT 0x101B // C -> S
@@ -279,10 +272,10 @@ mrim_packet_header_t;
#define MRIM_CS_CHANGE_STATUS 0x1022 // C -> S
// UL new status
-// LPS spec_status_uri ANSI (>=1.14)
-// LPS status_title UNICODE (>=1.14)
-// LPS status_desc UNICODE (>=1.14)
-// UL com_support (>=1.14) (see MRIM_CS_USER_STATUS)
+// LPS spec_status_uri ANSI ( >= 1.14)
+// LPS status_title UNICODE ( >= 1.14)
+// LPS status_desc UNICODE ( >= 1.14)
+// UL com_support ( >= 1.14) (see MRIM_CS_USER_STATUS)
#define MRIM_CS_GET_MPOP_SESSION 0x1024 // C -> S
@@ -329,23 +322,23 @@ mrim_packet_header_t;
// params define
// must be in consecutive order (0..N) to quick check in check_anketa_info_request
enum {
- MRIM_CS_WP_REQUEST_PARAM_USER = 0,// ANSI
- MRIM_CS_WP_REQUEST_PARAM_DOMAIN, // ANSI
- MRIM_CS_WP_REQUEST_PARAM_NICKNAME, // UNICODE
- MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME, // UNICODE
- MRIM_CS_WP_REQUEST_PARAM_LASTNAME, // UNICODE
- MRIM_CS_WP_REQUEST_PARAM_SEX , // ANSI
- MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY, // not used for search
- MRIM_CS_WP_REQUEST_PARAM_DATE1 , // ANSI
- MRIM_CS_WP_REQUEST_PARAM_DATE2 , // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_USER = 0, // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_DOMAIN, // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_NICKNAME, // UNICODE
+ MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME, // UNICODE
+ MRIM_CS_WP_REQUEST_PARAM_LASTNAME, // UNICODE
+ MRIM_CS_WP_REQUEST_PARAM_SEX , // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY, // not used for search
+ MRIM_CS_WP_REQUEST_PARAM_DATE1 , // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_DATE2 , // ANSI
//!!!!!!!!!!!!!!!!!!!online request param must be at end of request!!!!!!!!!!!!!!!
- MRIM_CS_WP_REQUEST_PARAM_ONLINE , // ANSI
- MRIM_CS_WP_REQUEST_PARAM_STATUS , // we do not used it, yet
- MRIM_CS_WP_REQUEST_PARAM_CITY_ID, // ANSI
- MRIM_CS_WP_REQUEST_PARAM_ZODIAC, // ANSI
- MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH,// ANSI
- MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY, // ANSI
- MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID, // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_ONLINE , // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_STATUS , // we do not used it, yet
+ MRIM_CS_WP_REQUEST_PARAM_CITY_ID, // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_ZODIAC, // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH, // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY, // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID, // ANSI
MRIM_CS_WP_REQUEST_PARAM_MAX
};
@@ -373,19 +366,19 @@ mrim_packet_header_t;
// DWORD msg internal game message
enum {
GAME_BASE,
- GAME_CONNECTION_INVITE,
- GAME_CONNECTION_ACCEPT,
- GAME_DECLINE,
- GAME_INC_VERSION,
- GAME_NO_SUCH_GAME,
- GAME_JOIN,
- GAME_CLOSE,
- GAME_SPEED,
- GAME_SYNCHRONIZATION,
- GAME_USER_NOT_FOUND,
- GAME_ACCEPT_ACK,
- GAME_PING,
- GAME_RESULT,
+ GAME_CONNECTION_INVITE,
+ GAME_CONNECTION_ACCEPT,
+ GAME_DECLINE,
+ GAME_INC_VERSION,
+ GAME_NO_SUCH_GAME,
+ GAME_JOIN,
+ GAME_CLOSE,
+ GAME_SPEED,
+ GAME_SYNCHRONIZATION,
+ GAME_USER_NOT_FOUND,
+ GAME_ACCEPT_ACK,
+ GAME_PING,
+ GAME_RESULT,
GAME_MESSAGES_NUMBER
};
// DWORD msg_id id for ack
@@ -420,88 +413,88 @@ mrim_packet_header_t;
// LPS login e-mail ANSI
// LPS password ANSI
// DWORD status
-// LPS spec_status_uri ANSI (>=1.14)
-// LPS status_title UNICODE (>=1.14)
-// LPS status_desc UNICODE (>=1.14)
-// UL com_support (>=1.14) (see MRIM_CS_USER_STATUS)
-// LPS user_agent ANSI (>=1.14) (see MRIM_CS_USER_STATUS)
+// LPS spec_status_uri ANSI ( >= 1.14)
+// LPS status_title UNICODE ( >= 1.14)
+// LPS status_desc UNICODE ( >= 1.14)
+// UL com_support ( >= 1.14) (see MRIM_CS_USER_STATUS)
+// LPS user_agent ANSI ( >= 1.14) (see MRIM_CS_USER_STATUS)
// + statistic packet data:
-// LPS lang (>=1.16)
-// LPS ua session (>=1.20) - шли пустой
-// LPS replaced ua session (>=1.20) - шли пустой
+// LPS lang ( >= 1.16)
+// LPS ua session ( >= 1.20) - шли пустой
+// LPS replaced ua session ( >= 1.20) - шли пустой
// LPS client description ANSI
#define MAX_CLIENT_DESCRIPTION 256
// unknown data
-// LPS unknown id (len=32)
-/* SetUL(&lpbDataCurrent,0);//00 00 00 00
- SetUL(&lpbDataCurrent,0);//02 BA 0A 00
- SetUL(&lpbDataCurrent,0);//00 00 00 03
- SetUL(&lpbDataCurrent,0);//00 00 00 02
-
- SetUL(&lpbDataCurrent,0);//E2 FD 1E 22
- SetUL(&lpbDataCurrent,0);//04 00 00 00
- SetUL(&lpbDataCurrent,0);//02 FF FF FF
- SetUL(&lpbDataCurrent,0);//FF 05 00 00
-
- SetUL(&lpbDataCurrent,0);//00 02 FF FF
- SetUL(&lpbDataCurrent,0);//FF FF 06 00
- SetUL(&lpbDataCurrent,0);//00 00 02 FF
- SetUL(&lpbDataCurrent,0);//FF FF FF 07
-
- SetUL(&lpbDataCurrent,0);//00 00 00 02
- SetUL(&lpbDataCurrent,0);//FF FF FF FF
- SetUL(&lpbDataCurrent,0);//14 00 00 00
- SetUL(&lpbDataCurrent,0);//02 00 00 00
-
- SetUL(&lpbDataCurrent,0);//00 16 00 00
- SetUL(&lpbDataCurrent,0);//00 02 00 00
- SetUL(&lpbDataCurrent,0);//00 00 17 00
- SetUL(&lpbDataCurrent,0);//00 00 02 00
-
- SetUL(&lpbDataCurrent,0);//00 00 00 18
- SetUL(&lpbDataCurrent,0);//00 00 00 02
- SetUL(&lpbDataCurrent,0);//00 00 00 00
- SetUL(&lpbDataCurrent,0);//19 00 00 00
-
- SetUL(&lpbDataCurrent,0);//02 00 00 00
- SetUL(&lpbDataCurrent,0);//00 1A 00 00
- SetUL(&lpbDataCurrent,0);//00 02 00 00
- SetUL(&lpbDataCurrent,0);//00 00 1C 00
-
- SetUL(&lpbDataCurrent,0);//00 00 02 00
- SetUL(&lpbDataCurrent,0);//00 00 00 1D
- SetUL(&lpbDataCurrent,0);//00 00 00 02
- SetUL(&lpbDataCurrent,0);//00 00 00 00
-
- SetUL(&lpbDataCurrent,0);//23 00 00 00
- SetUL(&lpbDataCurrent,0);//02 01 00 00
- SetUL(&lpbDataCurrent,0);//00 24 00 00
- SetUL(&lpbDataCurrent,0);//00 02 01 00
-
- SetUL(&lpbDataCurrent,0);//00 00 25 00
- SetUL(&lpbDataCurrent,0);//00 00 02 01
- SetUL(&lpbDataCurrent,0);//00 00 00 26
- SetUL(&lpbDataCurrent,0);//00 00 00 02
-
- SetUL(&lpbDataCurrent,0);//00 00 00 00
- SetUL(&lpbDataCurrent,0);//27 00 00 00
- SetUL(&lpbDataCurrent,0);//02 00 00 00
- SetUL(&lpbDataCurrent,0);//00 28 00 00
-
- SetUL(&lpbDataCurrent,0);//00 02 00 00
- SetUL(&lpbDataCurrent,0);//00 00 29 00
- SetUL(&lpbDataCurrent,0);//00 00 02 01
- SetUL(&lpbDataCurrent,0);//00 00 00 2A
-
- SetUL(&lpbDataCurrent,0);//00 00 00 02
- SetUL(&lpbDataCurrent,0);//00 00 00 00
- SetUL(&lpbDataCurrent,0);//2B 00 00 00
- SetUL(&lpbDataCurrent,0);//02 00 00 00
-
- SetUL(&lpbDataCurrent,0);//00 2C 00 00
- SetUL(&lpbDataCurrent,0);//00 01
-
- SetLPS(&lpbDataCurrent,"d3a4a3d0c95e5ba24f160a499ec8b4ea",32);
+// LPS unknown id (len = 32)
+/* SetUL(&lpbDataCurrent, 0);//00 00 00 00
+ SetUL(&lpbDataCurrent, 0);//02 BA 0A 00
+ SetUL(&lpbDataCurrent, 0);//00 00 00 03
+ SetUL(&lpbDataCurrent, 0);//00 00 00 02
+
+ SetUL(&lpbDataCurrent, 0);//E2 FD 1E 22
+ SetUL(&lpbDataCurrent, 0);//04 00 00 00
+ SetUL(&lpbDataCurrent, 0);//02 FF FF FF
+ SetUL(&lpbDataCurrent, 0);//FF 05 00 00
+
+ SetUL(&lpbDataCurrent, 0);//00 02 FF FF
+ SetUL(&lpbDataCurrent, 0);//FF FF 06 00
+ SetUL(&lpbDataCurrent, 0);//00 00 02 FF
+ SetUL(&lpbDataCurrent, 0);//FF FF FF 07
+
+ SetUL(&lpbDataCurrent, 0);//00 00 00 02
+ SetUL(&lpbDataCurrent, 0);//FF FF FF FF
+ SetUL(&lpbDataCurrent, 0);//14 00 00 00
+ SetUL(&lpbDataCurrent, 0);//02 00 00 00
+
+ SetUL(&lpbDataCurrent, 0);//00 16 00 00
+ SetUL(&lpbDataCurrent, 0);//00 02 00 00
+ SetUL(&lpbDataCurrent, 0);//00 00 17 00
+ SetUL(&lpbDataCurrent, 0);//00 00 02 00
+
+ SetUL(&lpbDataCurrent, 0);//00 00 00 18
+ SetUL(&lpbDataCurrent, 0);//00 00 00 02
+ SetUL(&lpbDataCurrent, 0);//00 00 00 00
+ SetUL(&lpbDataCurrent, 0);//19 00 00 00
+
+ SetUL(&lpbDataCurrent, 0);//02 00 00 00
+ SetUL(&lpbDataCurrent, 0);//00 1A 00 00
+ SetUL(&lpbDataCurrent, 0);//00 02 00 00
+ SetUL(&lpbDataCurrent, 0);//00 00 1C 00
+
+ SetUL(&lpbDataCurrent, 0);//00 00 02 00
+ SetUL(&lpbDataCurrent, 0);//00 00 00 1D
+ SetUL(&lpbDataCurrent, 0);//00 00 00 02
+ SetUL(&lpbDataCurrent, 0);//00 00 00 00
+
+ SetUL(&lpbDataCurrent, 0);//23 00 00 00
+ SetUL(&lpbDataCurrent, 0);//02 01 00 00
+ SetUL(&lpbDataCurrent, 0);//00 24 00 00
+ SetUL(&lpbDataCurrent, 0);//00 02 01 00
+
+ SetUL(&lpbDataCurrent, 0);//00 00 25 00
+ SetUL(&lpbDataCurrent, 0);//00 00 02 01
+ SetUL(&lpbDataCurrent, 0);//00 00 00 26
+ SetUL(&lpbDataCurrent, 0);//00 00 00 02
+
+ SetUL(&lpbDataCurrent, 0);//00 00 00 00
+ SetUL(&lpbDataCurrent, 0);//27 00 00 00
+ SetUL(&lpbDataCurrent, 0);//02 00 00 00
+ SetUL(&lpbDataCurrent, 0);//00 28 00 00
+
+ SetUL(&lpbDataCurrent, 0);//00 02 00 00
+ SetUL(&lpbDataCurrent, 0);//00 00 29 00
+ SetUL(&lpbDataCurrent, 0);//00 00 02 01
+ SetUL(&lpbDataCurrent, 0);//00 00 00 2A
+
+ SetUL(&lpbDataCurrent, 0);//00 00 00 02
+ SetUL(&lpbDataCurrent, 0);//00 00 00 00
+ SetUL(&lpbDataCurrent, 0);//2B 00 00 00
+ SetUL(&lpbDataCurrent, 0);//02 00 00 00
+
+ SetUL(&lpbDataCurrent, 0);//00 2C 00 00
+ SetUL(&lpbDataCurrent, 0);//00 01
+
+ SetLPS(&lpbDataCurrent, "d3a4a3d0c95e5ba24f160a499ec8b4ea", 32);
*/
@@ -575,7 +568,7 @@ mrim_packet_header_t;
// DWORD flags
// LPS text (MRIM_BLOG_STATUS_MUSIC: track)
#define MICBLOG_STATUS_MAX 500
-// switch(flags) {
+// switch (flags) {
// MRIM_BLOG_STATUS_REPLY:
// UINT64 orig_id
// }
diff --git a/protocols/MRA/proto_mra/Proto_MRA.vcxproj b/protocols/MRA/proto_mra/Proto_MRA.vcxproj
index 93e00d2672..69d39677cb 100644
--- a/protocols/MRA/proto_mra/Proto_MRA.vcxproj
+++ b/protocols/MRA/proto_mra/Proto_MRA.vcxproj
@@ -79,7 +79,7 @@
</Link>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\..\include\msapi</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -91,7 +91,7 @@
</Link>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\..\include\msapi</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -103,7 +103,7 @@
</Link>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\..\include\msapi</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -115,7 +115,7 @@
</Link>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\..\include\msapi</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup>
diff --git a/protocols/MRA/resource.rc b/protocols/MRA/resource.rc
index f4fff9495f..567e030e86 100644
--- a/protocols/MRA/resource.rc
+++ b/protocols/MRA/resource.rc
@@ -58,14 +58,14 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTI
CAPTION "Mail.ru Account Setup"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- EDITTEXT IDC_LOGIN,91,34,102,13,ES_AUTOHSCROLL | NOT WS_BORDER,WS_EX_STATICEDGE
- EDITTEXT IDC_PASSWORD,91,54,102,13,ES_PASSWORD | ES_AUTOHSCROLL | NOT WS_BORDER,WS_EX_STATICEDGE
- DEFPUSHBUTTON "OK",IDOK,87,80,50,14
- PUSHBUTTON "Cancel",IDCANCEL,143,80,50,14
- CONTROL "Create new account",IDC_REGISTER,"Hyperlink",WS_TABSTOP,7,82,74,10
- LTEXT "Please enter your Mail.ru account details to continue:",IDC_STATIC,7,9,186,20
- LTEXT "Mail.ru e-mail:",IDC_STATIC,9,37,77,8
- LTEXT "Password:",IDC_STATIC,9,57,77,8
+ EDITTEXT IDC_LOGIN, 91, 34, 102, 13, ES_AUTOHSCROLL | NOT WS_BORDER, WS_EX_STATICEDGE
+ EDITTEXT IDC_PASSWORD, 91, 54, 102, 13, ES_PASSWORD | ES_AUTOHSCROLL | NOT WS_BORDER, WS_EX_STATICEDGE
+ DEFPUSHBUTTON "OK", IDOK, 87, 80, 50, 14
+ PUSHBUTTON "Cancel", IDCANCEL, 143, 80, 50, 14
+ CONTROL "Create new account", IDC_REGISTER, "Hyperlink", WS_TABSTOP, 7, 82, 74, 10
+ LTEXT "Please enter your Mail.ru account details to continue:", IDC_STATIC, 7, 9, 186, 20
+ LTEXT "Mail.ru e-mail:", IDC_STATIC, 9, 37, 77, 8
+ LTEXT "Password:", IDC_STATIC, 9, 57, 77, 8
END
IDD_OPT_CONNECTIONS DIALOGEX 0, 0, 295, 230
@@ -73,40 +73,40 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Configuration",IDC_GROUPCONFIG,8,7,277,208
- RTEXT "Login Server:",IDC_STATIC,14,19,52,8
- EDITTEXT IDC_SERVER,72,17,140,12,ES_AUTOHSCROLL
- RTEXT "Port:",IDC_STATIC,14,34,52,8
- EDITTEXT IDC_SERVERPORT,72,33,33,12,ES_AUTOHSCROLL | ES_NUMBER
- LTEXT "(2042, 443, 110, 25)",IDC_STATIC,110,35,167,10
- PUSHBUTTON "Default",IDC_BUTTON_DEFAULT,217,17,60,13
- CONTROL "Automatic request authorization on logon",IDC_AUTO_AUTH_REQ_ON_LOGON,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,50,263,8
- CONTROL "Automatic add contacts to server list on logon",IDC_AUTO_ADD_CONTACTS_TO_SERVER,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,61,263,8
- CONTROL "Notify me when a message delivery has failed",IDC_SLOWSEND,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,107,263,8
- CONTROL "Notify about new mail if increment",IDC_INCREMENTAL_NEW_MAIL_NOTIFY,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,118,263,8
- CONTROL "Notify about new mail tray icon",IDC_TRAYICON_NEW_MAIL_NOTIFY,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,129,263,8
- CONTROL "Hide menu items for non MRA contacts",IDC_HIDE_MENU_ITEMS_FOR_NON_MRA,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,151,263,8
- CONTROL "Show received Formated text (RTF receive)",IDC_RTF_RECEIVE_ENABLE,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,162,263,8
- CONTROL "Send Formated text (send RTF)",IDC_RTF_SEND_ENABLE,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,173,263,8
- PUSHBUTTON "Font",IDC_BUTTON_FONT,23,185,42,12
- CONTROL "",IDC_RTF_BGCOLOUR,"ColourPicker",WS_TABSTOP,70,186,38,11
- LTEXT "Background colour",IDC_STATIC,112,188,157,8
- CONTROL "Click to Inbox",IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,140,253,8
- CONTROL "Automatic grand authorization to users in contact list",IDC_AUTO_AUTH_GRAND_IN_CLIST,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,72,263,8
- CONTROL "Automatic grand authorization to new users",IDC_AUTO_AUTH_GRAND_NEW_USERS,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,83,263,8
- CONTROL "Disable spam check",IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,94,253,8
+ GROUPBOX "Configuration", IDC_GROUPCONFIG, 8, 7, 277, 208
+ RTEXT "Login Server:", IDC_STATIC, 14, 19, 52, 8
+ EDITTEXT IDC_SERVER, 72, 17, 140, 12, ES_AUTOHSCROLL
+ RTEXT "Port:", IDC_STATIC, 14, 34, 52, 8
+ EDITTEXT IDC_SERVERPORT, 72, 33, 33, 12, ES_AUTOHSCROLL | ES_NUMBER
+ LTEXT "(2042, 443, 110, 25)", IDC_STATIC, 110, 35, 167, 10
+ PUSHBUTTON "Default", IDC_BUTTON_DEFAULT, 217, 17, 60, 13
+ CONTROL "Automatic request authorization on logon", IDC_AUTO_AUTH_REQ_ON_LOGON,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 14, 50, 263, 8
+ CONTROL "Automatic add contacts to server list on logon", IDC_AUTO_ADD_CONTACTS_TO_SERVER,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 14, 61, 263, 8
+ CONTROL "Notify me when a message delivery has failed", IDC_SLOWSEND,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 14, 107, 263, 8
+ CONTROL "Notify about new mail if increment", IDC_INCREMENTAL_NEW_MAIL_NOTIFY,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 14, 118, 263, 8
+ CONTROL "Notify about new mail tray icon", IDC_TRAYICON_NEW_MAIL_NOTIFY,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 14, 129, 263, 8
+ CONTROL "Hide menu items for non MRA contacts", IDC_HIDE_MENU_ITEMS_FOR_NON_MRA,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 14, 151, 263, 8
+ CONTROL "Show received Formated text (RTF receive)", IDC_RTF_RECEIVE_ENABLE,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 14, 162, 263, 8
+ CONTROL "Send Formated text (send RTF)", IDC_RTF_SEND_ENABLE,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 14, 173, 263, 8
+ PUSHBUTTON "Font", IDC_BUTTON_FONT, 23, 185, 42, 12
+ CONTROL "", IDC_RTF_BGCOLOUR, "ColourPicker", WS_TABSTOP, 70, 186, 38, 11
+ LTEXT "Background colour", IDC_STATIC, 112, 188, 157, 8
+ CONTROL "Click to Inbox", IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 24, 140, 253, 8
+ CONTROL "Automatic grand authorization to users in contact list", IDC_AUTO_AUTH_GRAND_IN_CLIST,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 14, 72, 263, 8
+ CONTROL "Automatic grand authorization to new users", IDC_AUTO_AUTH_GRAND_NEW_USERS,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 14, 83, 263, 8
+ CONTROL "Disable spam check", IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 24, 94, 253, 8
END
IDD_MRAADVANCEDSEARCH DIALOGEX 0, 0, 220, 235
@@ -114,39 +114,39 @@ STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_BORDER
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Summary",IDC_SUMMARYGROUP,8,5,205,147
- LTEXT "Nickname:",IDC_STATIC,15,20,50,8
- EDITTEXT IDC_NICK,65,18,139,12,ES_AUTOHSCROLL
- LTEXT "First name:",IDC_STATIC,15,35,50,8
- EDITTEXT IDC_FIRSTNAME,65,33,139,12,ES_AUTOHSCROLL
- LTEXT "Last name:",IDC_STATIC,15,50,50,8
- EDITTEXT IDC_LASTNAME,65,48,139,12,ES_AUTOHSCROLL
- LTEXT "E-mail:",IDC_STATIC,15,65,50,8
- EDITTEXT IDC_EMAIL_USER,65,63,69,12,ES_AUTOHSCROLL
- CTEXT "@",IDC_STATIC,137,64,9,9
- COMBOBOX IDC_EMAIL_DOMAIN,147,63,57,71,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
- LTEXT "Gender:",IDC_STATIC,15,87,50,8
- COMBOBOX IDC_GENDER,65,85,139,47,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- LTEXT "Age:",IDC_STATIC,15,102,50,8
- RTEXT "from:",IDC_STATIC,65,102,26,9
- COMBOBOX IDC_AGERANGE_FROM,94,100,37,90,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- RTEXT "to:",IDC_STATIC,134,102,30,9
- COMBOBOX IDC_AGERANGE_TO,167,100,37,90,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- LTEXT "Birthday:",IDC_STATIC,15,118,50,8
- COMBOBOX IDC_BIRTHDAY_DAY,65,117,29,204,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- COMBOBOX IDC_BIRTHDAY_MONTH,102,117,59,90,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
- COMBOBOX IDC_BIRTHDAY_YEAR,167,117,37,188,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- LTEXT "Zodiak:",IDC_STATIC,15,134,50,8
- COMBOBOX IDC_ZODIAK,65,133,139,47,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- GROUPBOX "Location",IDC_LOCATIONGROUP,7,157,207,60
- LTEXT "Country:",IDC_STATIC,14,170,50,8
- COMBOBOX IDC_COUNTRY,64,167,143,172,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- LTEXT "State:",IDC_STATIC,14,184,50,8
- COMBOBOX IDC_STATE,64,183,143,172,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
- CONTROL "Search online users only",IDC_ONLINEONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,222,143,8
- LTEXT "City:",IDC_STATIC,14,200,50,8
- COMBOBOX IDC_CITY,64,199,143,172,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
- CONTROL "Remember",IDC_CHK_REMEMBER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,157,222,56,8
+ GROUPBOX "Summary", IDC_SUMMARYGROUP, 8, 5, 205, 147
+ LTEXT "Nickname:", IDC_STATIC, 15, 20, 50, 8
+ EDITTEXT IDC_NICK, 65, 18, 139, 12, ES_AUTOHSCROLL
+ LTEXT "First name:", IDC_STATIC, 15, 35, 50, 8
+ EDITTEXT IDC_FIRSTNAME, 65, 33, 139, 12, ES_AUTOHSCROLL
+ LTEXT "Last name:", IDC_STATIC, 15, 50, 50, 8
+ EDITTEXT IDC_LASTNAME, 65, 48, 139, 12, ES_AUTOHSCROLL
+ LTEXT "E-mail:", IDC_STATIC, 15, 65, 50, 8
+ EDITTEXT IDC_EMAIL_USER, 65, 63, 69, 12, ES_AUTOHSCROLL
+ CTEXT "@", IDC_STATIC, 137, 64, 9, 9
+ COMBOBOX IDC_EMAIL_DOMAIN, 147, 63, 57, 71, CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Gender:", IDC_STATIC, 15, 87, 50, 8
+ COMBOBOX IDC_GENDER, 65, 85, 139, 47, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Age:", IDC_STATIC, 15, 102, 50, 8
+ RTEXT "from:", IDC_STATIC, 65, 102, 26, 9
+ COMBOBOX IDC_AGERANGE_FROM, 94, 100, 37, 90, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ RTEXT "to:", IDC_STATIC, 134, 102, 30, 9
+ COMBOBOX IDC_AGERANGE_TO, 167, 100, 37, 90, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Birthday:", IDC_STATIC, 15, 118, 50, 8
+ COMBOBOX IDC_BIRTHDAY_DAY, 65, 117, 29, 204, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_BIRTHDAY_MONTH, 102, 117, 59, 90, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_BIRTHDAY_YEAR, 167, 117, 37, 188, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Zodiak:", IDC_STATIC, 15, 134, 50, 8
+ COMBOBOX IDC_ZODIAK, 65, 133, 139, 47, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ GROUPBOX "Location", IDC_LOCATIONGROUP, 7, 157, 207, 60
+ LTEXT "Country:", IDC_STATIC, 14, 170, 50, 8
+ COMBOBOX IDC_COUNTRY, 64, 167, 143, 172, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ LTEXT "State:", IDC_STATIC, 14, 184, 50, 8
+ COMBOBOX IDC_STATE, 64, 183, 143, 172, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Search online users only", IDC_ONLINEONLY, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 7, 222, 143, 8
+ LTEXT "City:", IDC_STATIC, 14, 200, 50, 8
+ COMBOBOX IDC_CITY, 64, 199, 143, 172, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Remember", IDC_CHK_REMEMBER, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 157, 222, 56, 8
END
IDD_OPT_AVATRS DIALOGEX 0, 0, 295, 195
@@ -154,21 +154,21 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Configuration",IDC_GROUPCONFIG,8,6,277,110
- CONTROL "Enable avatars support (loading)",IDC_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,18,259,9
- RTEXT "Server:",IDC_STATIC,16,31,53,8
- EDITTEXT IDC_SERVER,72,29,140,12,ES_AUTOHSCROLL
- RTEXT "Port:",IDC_STATIC,16,46,53,8
- EDITTEXT IDC_SERVERPORT,72,44,34,12,ES_AUTOHSCROLL | ES_NUMBER
- LTEXT "(80, 443, 2041)",IDC_STATIC,110,46,103,10
- PUSHBUTTON "Default",IDC_BUTTON_DEFAULT,216,29,60,13
- EDITTEXT IDC_UPD_CHECK_INTERVAL,14,71,34,12,ES_AUTOHSCROLL | ES_NUMBER
- LTEXT "Updates check interval, min",IDC_STATIC,51,72,222,8
- CONTROL "Return absolute path",IDC_RETURN_ABC_PATH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,89,259,9
- CONTROL "Delete avatar file with contact",IDC_DELETE_AVT_ON_CONTACT_DELETE,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,100,259,9
- CONTROL "Use keep-alive connections",IDC_USE_KEEPALIVE_CONN,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,72,59,201,9
+ GROUPBOX "Configuration", IDC_GROUPCONFIG, 8, 6, 277, 110
+ CONTROL "Enable avatars support (loading)", IDC_ENABLE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 13, 18, 259, 9
+ RTEXT "Server:", IDC_STATIC, 16, 31, 53, 8
+ EDITTEXT IDC_SERVER, 72, 29, 140, 12, ES_AUTOHSCROLL
+ RTEXT "Port:", IDC_STATIC, 16, 46, 53, 8
+ EDITTEXT IDC_SERVERPORT, 72, 44, 34, 12, ES_AUTOHSCROLL | ES_NUMBER
+ LTEXT "(80, 443, 2041)", IDC_STATIC, 110, 46, 103, 10
+ PUSHBUTTON "Default", IDC_BUTTON_DEFAULT, 216, 29, 60, 13
+ EDITTEXT IDC_UPD_CHECK_INTERVAL, 14, 71, 34, 12, ES_AUTOHSCROLL | ES_NUMBER
+ LTEXT "Updates check interval, min", IDC_STATIC, 51, 72, 222, 8
+ CONTROL "Return absolute path", IDC_RETURN_ABC_PATH, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 13, 89, 259, 9
+ CONTROL "Delete avatar file with contact", IDC_DELETE_AVT_ON_CONTACT_DELETE,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 13, 100, 259, 9
+ CONTROL "Use keep-alive connections", IDC_USE_KEEPALIVE_CONN,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 72, 59, 201, 9
END
IDD_OPT_FILES DIALOGEX 0, 0, 295, 160
@@ -176,26 +176,26 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Files exchange",IDC_GROUPCONFIG2,8,7,277,143
- CONTROL "No out connection on send",IDC_FILE_SEND_NOOUTCONNECTIONONSEND,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,28,244,8
- CONTROL "No out connection on receive",IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,39,244,8
- CONTROL "Out connections: ignory additional ports (443, 2041)",IDC_FILE_SEND_IGNORYADDITIONALPORTS,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,50,244,8
- CONTROL "Hide my IP addresses",IDC_FILE_SEND_HIDE_MY_ADDRESSES,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,61,244,8
- CONTROL "Add extra address",IDC_FILE_SEND_ADD_EXTRA_ADDRESS,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,72,244,8
- RTEXT "Your host (or router):",IDC_STATIC,13,84,92,8
- EDITTEXT IDC_FILE_SEND_EXTRA_ADDRESS,108,83,170,12,ES_AUTOHSCROLL
- LTEXT "File send block size:",IDC_STATIC,14,112,263,8
- EDITTEXT IDC_FILE_SEND_BLOCK_SIZE,26,123,52,12,ES_AUTOHSCROLL | ES_NUMBER
- LTEXT "512 - 65536 bytes",IDC_STATIC,82,125,97,10
- CONTROL "Enable direct connections",IDC_FILE_SEND_ENABLE_DIRECT_CONN,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,18,263,8
- CONTROL "Enable MRIM proxy connections",IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,98,263,8
+ GROUPBOX "Files exchange", IDC_GROUPCONFIG2, 8, 7, 277, 143
+ CONTROL "No out connection on send", IDC_FILE_SEND_NOOUTCONNECTIONONSEND,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 25, 28, 244, 8
+ CONTROL "No out connection on receive", IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 25, 39, 244, 8
+ CONTROL "Out connections: ignory additional ports (443, 2041)", IDC_FILE_SEND_IGNORYADDITIONALPORTS,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 25, 50, 244, 8
+ CONTROL "Hide my IP addresses", IDC_FILE_SEND_HIDE_MY_ADDRESSES,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 25, 61, 244, 8
+ CONTROL "Add extra address", IDC_FILE_SEND_ADD_EXTRA_ADDRESS,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 25, 72, 244, 8
+ RTEXT "Your host (or router):", IDC_STATIC, 13, 84, 92, 8
+ EDITTEXT IDC_FILE_SEND_EXTRA_ADDRESS, 108, 83, 170, 12, ES_AUTOHSCROLL
+ LTEXT "File send block size:", IDC_STATIC, 14, 112, 263, 8
+ EDITTEXT IDC_FILE_SEND_BLOCK_SIZE, 26, 123, 52, 12, ES_AUTOHSCROLL | ES_NUMBER
+ LTEXT "512 - 65536 bytes", IDC_STATIC, 82, 125, 97, 10
+ CONTROL "Enable direct connections", IDC_FILE_SEND_ENABLE_DIRECT_CONN,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 14, 18, 263, 8
+ CONTROL "Enable MRIM proxy connections", IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 14, 98, 263, 8
END
IDD_OPT_ACCOUNT DIALOGEX 0, 0, 295, 149
@@ -203,16 +203,16 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Mail.ru Agent",IDC_GROUPMAIN,9,5,276,98,WS_GROUP
- RTEXT "Full e-mail:",IDC_STATIC,14,22,52,8
- EDITTEXT IDC_LOGIN,72,18,100,12,ES_AUTOHSCROLL
- LTEXT "Example: Petrov_Ivan@mail.ru",IDC_STATIC,175,19,104,10
- RTEXT "Password:",IDC_STATIC,14,37,52,8
- EDITTEXT IDC_PASSWORD,72,33,100,12,ES_PASSWORD | ES_AUTOHSCROLL
- CONTROL "Create a new Mail.ru account using the Mail.ru website",IDC_NEW_ACCOUNT_LINK,
- "Hyperlink",WS_TABSTOP,18,72,258,9
- CONTROL "Retrieve a lost password",IDC_LOOKUPLINK,"Hyperlink",WS_TABSTOP,18,85,258,9
- LTEXT "Leave empty if you dont want change password",IDC_STATIC,72,48,212,8
+ GROUPBOX "Mail.ru Agent", IDC_GROUPMAIN, 9, 5, 276, 98, WS_GROUP
+ RTEXT "Full e-mail:", IDC_STATIC, 14, 22, 52, 8
+ EDITTEXT IDC_LOGIN, 72, 18, 100, 12, ES_AUTOHSCROLL
+ LTEXT "Example: Petrov_Ivan@mail.ru", IDC_STATIC, 175, 19, 104, 10
+ RTEXT "Password:", IDC_STATIC, 14, 37, 52, 8
+ EDITTEXT IDC_PASSWORD, 72, 33, 100, 12, ES_PASSWORD | ES_AUTOHSCROLL
+ CONTROL "Create a new Mail.ru account using the Mail.ru website", IDC_NEW_ACCOUNT_LINK,
+ "Hyperlink", WS_TABSTOP, 18, 72, 258, 9
+ CONTROL "Retrieve a lost password", IDC_LOOKUPLINK, "Hyperlink", WS_TABSTOP, 18, 85, 258, 9
+ LTEXT "Leave empty if you dont want change password", IDC_STATIC, 72, 48, 212, 8
END
IDD_OPT_POPUPS DIALOGEX 0, 0, 295, 150
@@ -220,18 +220,18 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- RTEXT "PopUp type",IDC_STATIC,9,11,52,8
- COMBOBOX IDC_COMBO_POPUP_TYPE,65,9,220,97,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- GROUPBOX "Popup settings",IDC_GROUPMAIN,9,25,276,90,WS_GROUP
- CONTROL "Enable",IDC_CHK_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,38,260,10
- CONTROL "&Use Windows colors",IDC_CHK_USE_WIN_COLORS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,50,246,10
- RTEXT "Back Color",IDC_STATIC,29,65,57,8
- CONTROL "",IDC_POPUP_BACKCOLOR,"ColourPicker",WS_TABSTOP,92,65,38,10
- RTEXT "Text Color",IDC_STATIC,29,80,57,8
- CONTROL "",IDC_POPUP_TEXTCOLOR,"ColourPicker",WS_TABSTOP,92,80,38,10
- RTEXT "Timeout",IDC_STATIC,29,96,57,8
- EDITTEXT IDC_POPUP_TIMEOUT,92,94,38,12,ES_AUTOHSCROLL | ES_NUMBER
- PUSHBUTTON "Previe&w",IDC_PREVIEW,237,119,46,12
+ RTEXT "PopUp type", IDC_STATIC, 9, 11, 52, 8
+ COMBOBOX IDC_COMBO_POPUP_TYPE, 65, 9, 220, 97, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ GROUPBOX "Popup settings", IDC_GROUPMAIN, 9, 25, 276, 90, WS_GROUP
+ CONTROL "Enable", IDC_CHK_ENABLE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 17, 38, 260, 10
+ CONTROL "&Use Windows colors", IDC_CHK_USE_WIN_COLORS, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 29, 50, 246, 10
+ RTEXT "Back Color", IDC_STATIC, 29, 65, 57, 8
+ CONTROL "", IDC_POPUP_BACKCOLOR, "ColourPicker", WS_TABSTOP, 92, 65, 38, 10
+ RTEXT "Text Color", IDC_STATIC, 29, 80, 57, 8
+ CONTROL "", IDC_POPUP_TEXTCOLOR, "ColourPicker", WS_TABSTOP, 92, 80, 38, 10
+ RTEXT "Timeout", IDC_STATIC, 29, 96, 57, 8
+ EDITTEXT IDC_POPUP_TIMEOUT, 92, 94, 38, 12, ES_AUTOHSCROLL | ES_NUMBER
+ PUSHBUTTON "Previe&w", IDC_PREVIEW, 237, 119, 46, 12
END
IDD_SETXSTATUS DIALOGEX 0, 0, 189, 98
@@ -240,60 +240,20 @@ EXSTYLE WS_EX_CONTROLPARENT
CAPTION "Custom Status ""%s"" Details"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- DEFPUSHBUTTON "Closing in %d",IDOK,49,79,91,14
- LTEXT "Title:",IDC_STATIC,5,0,179,8
- EDITTEXT IDC_XTITLE,5,8,179,13
- LTEXT "Message:",IDC_STATIC,5,22,179,8
- EDITTEXT IDC_XMSG,5,31,179,43,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
+ DEFPUSHBUTTON "Closing in %d", IDOK, 49, 79, 91, 14
+ LTEXT "Title:", IDC_STATIC, 5, 0, 179, 8
+ EDITTEXT IDC_XTITLE, 5, 8, 179, 13
+ LTEXT "Message:", IDC_STATIC, 5, 22, 179, 8
+ EDITTEXT IDC_XMSG, 5, 31, 179, 43, ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
END
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,20,0,1
- PRODUCTVERSION 1,20,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "000004b0"
- BEGIN
- VALUE "About Miranda", "Miranda NG is a new generation IM client, extensible with numerous plugins. Get Miranda NG at http://miranda-ng.org/"
- VALUE "Comments", "Rozhuk_I@mail.ru"
- VALUE "FileDescription", "Miranda Mail.ru Agent protocol plugin"
- VALUE "FileVersion", "1, 20, 0, 1"
- VALUE "LegalCopyright", "Copyright © 2005-2009 Rozhuk Ivan"
- VALUE "OriginalFilename", "Mra.dll"
- VALUE "ProductName", "Plugin for Miranda NG"
- VALUE "ProductVersion", "1, 20, 0, 1"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x0, 1200
- END
-END
-
-
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
+GUIDELINES DESIGNINFO
BEGIN
IDD_MRAADVANCEDSEARCH, DIALOG
BEGIN
@@ -339,39 +299,39 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- GROUPBOX "Configuration",IDC_GROUPCONFIG,8,6,277,197
- CONTROL "Enable Anti Spam",IDC_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,18,259,9
- CONTROL "Check temp contacts",IDC_CHK_TEMP_CONTACTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,29,248,9
- CONTROL "Delete spam bot contacts",IDC_DELETE_SPAMBOT_CONTACT,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,34,40,238,9
- EDITTEXT IDC_MAX_LANG_CHANGES,23,67,33,12,ES_AUTOHSCROLL | ES_NUMBER
- LTEXT "Max. language changes in message (0 - disabled)",IDC_STATIC,59,69,220,11
- CONTROL "Show pop up",IDC_SHOWPOPUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,82,248,9
- CONTROL "Write to system history",IDC_WRITETOSYSTEMHISTORY,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,92,248,9
- CONTROL "Send spam report to server",IDC_SEND_SPAM_REPORT_TO_SERVER,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,102,248,9
- LTEXT "Bad words list",IDC_STATIC,25,115,96,11
- LISTBOX IDC_BAD_WORDS_LIST,25,127,121,71,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
- EDITTEXT IDC_EDIT_BAD_WORD,152,171,129,12,ES_AUTOHSCROLL
- PUSHBUTTON "Add",IDC_BUTTON_ADD,152,186,42,14
- PUSHBUTTON "Remove",IDC_BUTTONREMOVE,198,186,40,14,BS_CENTER
- PUSHBUTTON "Default",IDC_BUTTON_DEFAULT,242,186,40,14,BS_CENTER
- CONTROL "Ignory non AlphaNumeric characters",IDC_CLN_NON_ALPHNUM,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,56,248,9
+ GROUPBOX "Configuration", IDC_GROUPCONFIG, 8, 6, 277, 197
+ CONTROL "Enable Anti Spam", IDC_ENABLE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 13, 18, 259, 9
+ CONTROL "Check temp contacts", IDC_CHK_TEMP_CONTACTS, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 24, 29, 248, 9
+ CONTROL "Delete spam bot contacts", IDC_DELETE_SPAMBOT_CONTACT,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 34, 40, 238, 9
+ EDITTEXT IDC_MAX_LANG_CHANGES, 23, 67, 33, 12, ES_AUTOHSCROLL | ES_NUMBER
+ LTEXT "Max. language changes in message (0 - disabled)", IDC_STATIC, 59, 69, 220, 11
+ CONTROL "Show pop up", IDC_SHOWPOPUP, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 24, 82, 248, 9
+ CONTROL "Write to system history", IDC_WRITETOSYSTEMHISTORY,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 24, 92, 248, 9
+ CONTROL "Send spam report to server", IDC_SEND_SPAM_REPORT_TO_SERVER,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 24, 102, 248, 9
+ LTEXT "Bad words list", IDC_STATIC, 25, 115, 96, 11
+ LISTBOX IDC_BAD_WORDS_LIST, 25, 127, 121, 71, LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
+ EDITTEXT IDC_EDIT_BAD_WORD, 152, 171, 129, 12, ES_AUTOHSCROLL
+ PUSHBUTTON "Add", IDC_BUTTON_ADD, 152, 186, 42, 14
+ PUSHBUTTON "Remove", IDC_BUTTONREMOVE, 198, 186, 40, 14, BS_CENTER
+ PUSHBUTTON "Default", IDC_BUTTON_DEFAULT, 242, 186, 40, 14, BS_CENTER
+ CONTROL "Ignory non AlphaNumeric characters", IDC_CLN_NON_ALPHNUM,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 24, 56, 248, 9
END
IDD_MINIBLOG DIALOGEX 0, 0, 256, 134
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- DEFPUSHBUTTON "OK",IDOK,76,113,50,14,WS_DISABLED
- PUSHBUTTON "Cancel",IDCANCEL,130,113,50,14
- EDITTEXT IDC_USER_BLOG_STATUS_MSG,7,19,242,38,ES_MULTILINE | ES_READONLY
- EDITTEXT IDC_MSG_TO_SEND,7,61,242,38,ES_MULTILINE
- CONTROL "Notify",IDC_CHK_NOTIFY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,102,125,9
- LTEXT "Writed:",IDC_STATIC_WRITED_TIME,7,7,242,11
- LTEXT "0/500",IDC_STATIC_CHARS_COUNTER,211,103,38,11,0,WS_EX_RIGHT
+ DEFPUSHBUTTON "OK", IDOK, 76, 113, 50, 14, WS_DISABLED
+ PUSHBUTTON "Cancel", IDCANCEL, 130, 113, 50, 14
+ EDITTEXT IDC_USER_BLOG_STATUS_MSG, 7, 19, 242, 38, ES_MULTILINE | ES_READONLY
+ EDITTEXT IDC_MSG_TO_SEND, 7, 61, 242, 38, ES_MULTILINE
+ CONTROL "Notify", IDC_CHK_NOTIFY, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 7, 102, 125, 9
+ LTEXT "Writed:", IDC_STATIC_WRITED_TIME, 7, 7, 242, 11
+ LTEXT "0/500", IDC_STATIC_CHARS_COUNTER, 211, 103, 38, 11, 0, WS_EX_RIGHT
END
@@ -381,7 +341,7 @@ END
//
#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
+GUIDELINES DESIGNINFO
BEGIN
IDD_MINIBLOG, DIALOG
BEGIN
@@ -400,12 +360,12 @@ END
// TEXTINCLUDE
//
-1 TEXTINCLUDE
+1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
-2 TEXTINCLUDE
+2 TEXTINCLUDE
BEGIN
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""windows.h""\r\n"
@@ -413,7 +373,7 @@ BEGIN
"\0"
END
-3 TEXTINCLUDE
+3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
@@ -444,9 +404,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION
CAPTION "Select e-mail"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- LISTBOX IDC_LIST_EMAILS,7,7,163,133,LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | NOT WS_BORDER | WS_VSCROLL | WS_TABSTOP,WS_EX_STATICEDGE
- DEFPUSHBUTTON "OK",IDOK,39,147,51,15
- PUSHBUTTON "Cancel",IDCANCEL,93,147,51,15
+ LISTBOX IDC_LIST_EMAILS, 7, 7, 163, 133, LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | NOT WS_BORDER | WS_VSCROLL | WS_TABSTOP, WS_EX_STATICEDGE
+ DEFPUSHBUTTON "OK", IDOK, 39, 147, 51, 15
+ PUSHBUTTON "Cancel", IDCANCEL, 93, 147, 51, 15
END
@@ -456,7 +416,7 @@ END
//
#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
+GUIDELINES DESIGNINFO
BEGIN
IDD_DIALOG_SELECT_EMAIL, DIALOG
BEGIN
@@ -482,4 +442,3 @@ END
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
-
diff --git a/protocols/MRA/version.h b/protocols/MRA/version.h
new file mode 100644
index 0000000000..b7ce1137bf
--- /dev/null
+++ b/protocols/MRA/version.h
@@ -0,0 +1,6 @@
+#define __FILEVERSION_STRING 2, 0, 0, 1
+#define __VERSION_STRING "2.0.0.1"
+#define __VERSION_DWORD PLUGIN_MAKE_VERSION(2, 0, 0, 1)
+
+#define PROTO_VERSION_MAJOR 1
+#define PROTO_VERSION_MINOR 21
diff --git a/protocols/MRA/version.rc b/protocols/MRA/version.rc
new file mode 100644
index 0000000000..7aaaf3f951
--- /dev/null
+++ b/protocols/MRA/version.rc
@@ -0,0 +1,57 @@
+#ifdef APSTUDIO_INVOKED
+#error this file is not editable by Microsoft Visual C++
+#endif //APSTUDIO_INVOKED
+
+#include "version.h"
+#include "resource.h"
+#include "winres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// Neutral resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
+#ifdef _WIN32
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#pragma code_page(1251)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1, 20, 0, 1
+ PRODUCTVERSION 1, 20, 0, 1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "000004b0"
+ BEGIN
+ VALUE "About Miranda", "Miranda NG is a new generation IM client, extensible with numerous plugins. Get Miranda NG at http://miranda-ng.org/"
+ VALUE "Comments", "Rozhuk_I@mail.ru"
+ VALUE "FileDescription", "Miranda Mail.ru Agent protocol plugin"
+ VALUE "FileVersion", "1, 20, 0, 1"
+ VALUE "LegalCopyright", "Copyright © 2005-2009 Rozhuk Ivan"
+ VALUE "OriginalFilename", "Mra.dll"
+ VALUE "ProductName", "Plugin for Miranda NG"
+ VALUE "ProductVersion", "1, 20, 0, 1"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0, 1200
+ END
+END
+
+#endif // Neutral resources
+/////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/MRA/xstatus_MRA/xstatus_MRA.vcxproj b/protocols/MRA/xstatus_MRA/xstatus_MRA.vcxproj
index 8ae609d497..5aefd32a12 100644
--- a/protocols/MRA/xstatus_MRA/xstatus_MRA.vcxproj
+++ b/protocols/MRA/xstatus_MRA/xstatus_MRA.vcxproj
@@ -76,7 +76,7 @@
</Link>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\..\include\msapi</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -88,7 +88,7 @@
</Link>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\..\include\msapi</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -100,7 +100,7 @@
</Link>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\..\include\msapi</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -112,7 +112,7 @@
</Link>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\..\include\msapi</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup>