Index: commonheaders.h =================================================================== --- commonheaders.h (revision 34) +++ commonheaders.h (working copy) @@ -25,7 +25,7 @@ */ #define _WIN32_WINNT 0x0501 -#define MIRANDA_VER 0x0807 +#define MIRANDA_VER 0x0700 #define _USE_32BIT_TIME_T 1 // Standart includes Index: TrafficCounter.c =================================================================== --- TrafficCounter.c (revision 34) +++ TrafficCounter.c (working copy) @@ -69,6 +69,7 @@ /*-------------------------------------------------------------------------------------------------------------------*/ static HANDLE h_AckHook; BYTE online_count = 0; +BOOL g_bNewAccAPI=0; PROTOLIST *ProtoList = NULL; BYTE numProto; @@ -155,6 +156,8 @@ mirandaVer = mirandaVersion; if (mirandaVersion < PLUGIN_MAKE_VERSION(0, 8, 0, 3)) return NULL; + else if (mirandaVersion > PLUGIN_MAKE_VERSION(0, 8, 0, 8)) + g_bNewAccAPI=1; return &pluginInfoEx; } @@ -677,7 +680,7 @@ // Формат всплывающей подсказки #ifdef _UNICODE - EnableWindow(GetDlgItem(hwndDlg,IDC_EDIT_TOOLTIP_FORMAT),ServiceExists("mToolTip/ShowTipW")); + EnableWindow(GetDlgItem(hwndDlg,IDC_EDIT_TOOLTIP_FORMAT),(ServiceExists("mToolTip/ShowTipW")||ServiceExists("mToolTip/ShowTip"))); #else EnableWindow(GetDlgItem(hwndDlg,IDC_EDIT_TOOLTIP_FORMAT),ServiceExists("mToolTip/ShowTip")); #endif @@ -1598,8 +1601,12 @@ ti.cbSize = sizeof( ti ); //mir_sntprintf(TooltipText, 4096-1, Traffic_TooltipFormat); TooltipText = variables_parse(Traffic_TooltipFormat, NULL, NULL); -#ifdef _UNICODE - CallService("mToolTip/ShowTipW", (WPARAM)TooltipText, (LPARAM)&ti); +#ifdef _UNICODE + + if (ServiceExists("mToolTip/ShowTipW")) + CallService("mToolTip/ShowTipW", (WPARAM)TooltipText, (LPARAM)&ti); + else + CallService("mToolTip/ShowTip", (WPARAM)mir_u2a(TooltipText), (LPARAM)&ti); #else CallService("mToolTip/ShowTip", (WPARAM)TooltipText, (LPARAM)&ti); #endif @@ -1949,20 +1956,40 @@ { int numberOfProtocols,i; PROTOCOLDESCRIPTOR **proto; + PROTOACCOUNT** accs; // - CallService(MS_PROTO_ENUMPROTOCOLS,(WPARAM)(int*)&numberOfProtocols,(LPARAM)(PROTOCOLDESCRIPTOR***)&proto); + if(g_bNewAccAPI) + ProtoEnumAccounts( &numberOfProtocols, &accs ); + else + CallService(MS_PROTO_ENUMPROTOCOLS,(WPARAM)(int*)&numberOfProtocols,(LPARAM)(PROTOCOLDESCRIPTOR***)&proto); // numProto = 0; // for (i = 0; i < numberOfProtocols; i++) { - if ( (proto[i]->type & PROTOTYPE_PROTOCOL) != proto[i]->type ) continue; + if(g_bNewAccAPI) + { + if (accs[i]->type != PROTOTYPE_PROTOCOL) continue; + if (!pcli->pfnGetProtocolVisibility(accs[i]->szModuleName)) continue; + } + else + { + if (proto[i]->type != PROTOTYPE_PROTOCOL) continue; if (!pcli->pfnGetProtocolVisibility(proto[i]->szName)) continue; + } // ProtoList = (PROTOLIST*)mir_realloc(ProtoList,sizeof(PROTOLIST)*(numProto+1)); // - ProtoList[numProto].name = mir_alloc(strlen(proto[i]->szName) + 1); - strcpy(ProtoList[numProto].name, proto[i]->szName); + if(g_bNewAccAPI) + { + ProtoList[numProto].name = mir_alloc(strlen(accs[i]->szModuleName) + 1); + strcpy(ProtoList[numProto].name, accs[i]->szModuleName); + } + else + { + ProtoList[numProto].name = mir_alloc(strlen(proto[i]->szName) + 1); + strcpy(ProtoList[numProto].name, proto[i]->szName); + } // ProtoList[numProto].Active = DBGetContactSettingByte(NULL, ProtoList[numProto].name, SETTINGS_PROTO_ACTIVE, 1); ProtoList[numProto].Visible = DBGetContactSettingByte(NULL, ProtoList[numProto].name, SETTINGS_PROTO_VISIBLE, 1);