From c6fb861d7159279b6ee4a4dd678d4693ee56bac6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 7 Oct 2012 12:50:40 +0000 Subject: death of old nasty clutch with MS_PROTO_ENUMPROTOCOLS & PROTOACCOUNT::type git-svn-id: http://svn.miranda-ng.org/main/trunk@1799 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Popup/src/opt_gen.cpp | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) (limited to 'plugins/Popup') diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp index 667ddc7c0f..de54c568cf 100644 --- a/plugins/Popup/src/opt_gen.cpp +++ b/plugins/Popup/src/opt_gen.cpp @@ -217,13 +217,11 @@ INT_PTR CALLBACK DlgProcPopUpGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM { int protocolCount = 0; int i; - PROTOCOLDESCRIPTOR **protocols; - CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&protocolCount, (LPARAM)&protocols); + PROTOACCOUNT **protocols; + ProtoEnumAccounts(&protocolCount, &protocols); DWORD globalFlags = 0; for (i = 0; i < protocolCount; ++i) { - if (protocols[i]->type != PROTOTYPE_PROTOCOL) - continue; - DWORD protoFlags = CallProtoService(protocols[i]->szName, PS_GETCAPS, PFLAGNUM_2, 0); + DWORD protoFlags = CallProtoService(protocols[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0); globalFlags |= protoFlags; statusOptionsCount += CountStatusModes(protoFlags); } @@ -234,13 +232,11 @@ INT_PTR CALLBACK DlgProcPopUpGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM int pos = 0; pos = AddStatusModes(statusOptions, pos, _T("Global Status"), globalFlags); for (i = 0; i < protocolCount; ++i) { - if (protocols[i]->type != PROTOTYPE_PROTOCOL) - continue; - DWORD protoFlags = CallProtoService(protocols[i]->szName, PS_GETCAPS, PFLAGNUM_2, 0); + DWORD protoFlags = CallProtoService(protocols[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0); if (!CountStatusModes(protoFlags)) continue; TCHAR prefix[128]; - wsprintf(prefix, _T("Protocol Status/%hs"), protocols[i]->szName); + wsprintf(prefix, _T("Protocol Status/%hs"), protocols[i]->szModuleName); pos = AddStatusModes(statusOptions, pos, prefix, protoFlags); } @@ -250,13 +246,11 @@ INT_PTR CALLBACK DlgProcPopUpGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM char prefix[128]; LPTSTR pszSettingName = NULL; for (i = 0; i < protocolCount; ++i) { - if (protocols[i]->type != PROTOTYPE_PROTOCOL) - continue; - DWORD protoFlags = CallProtoService(protocols[i]->szName, PS_GETCAPS, PFLAGNUM_2, 0); + DWORD protoFlags = CallProtoService(protocols[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0); if (!CountStatusModes(protoFlags)) continue; - mir_snprintf(prefix, sizeof(prefix), "Protocol Status/%s", protocols[i]->szName); + mir_snprintf(prefix, sizeof(prefix), "Protocol Status/%s", protocols[i]->szModuleName); pszSettingName = mir_a2t(prefix); OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, DBGetContactSettingDword(NULL, MODULNAME, prefix, 0), @@ -560,17 +554,14 @@ INT_PTR CALLBACK DlgProcPopUpGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM //new status options { int protocolCount; - PROTOCOLDESCRIPTOR **protocols; - CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&protocolCount, (LPARAM)&protocols); + PROTOACCOUNT **protocols; + ProtoEnumAccounts(&protocolCount, &protocols); char prefix[128]; LPTSTR pszSettingName = NULL; for (int i = 0; i < protocolCount; ++i) { - if (protocols[i]->type != PROTOTYPE_PROTOCOL) - continue; - - mir_snprintf(prefix, sizeof(prefix), "Protocol Status/%s", protocols[i]->szName); + mir_snprintf(prefix, sizeof(prefix), "Protocol Status/%s", protocols[i]->szModuleName); pszSettingName = mir_a2t(prefix); DBWriteContactSettingDword(NULL, MODULNAME, prefix, OptTree_GetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, pszSettingName)); -- cgit v1.2.3