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/AutoShutdown/src/settingsdlg.cpp | 9 +- plugins/BossKeyPlus/src/BossKey.cpp | 16 ++- plugins/CSList/src/cslist.cpp | 2 +- plugins/CSList/src/cslist.h | 4 - plugins/CmdLine/src/mimcmd_handlers.cpp | 5 - plugins/CrashDumper/src/dumper.cpp | 15 ++- plugins/DbEditorPP/src/icons.cpp | 22 ++-- plugins/IEView/src/Options.cpp | 20 ++-- plugins/Import/src/main.cpp | 14 ++- plugins/KeyboardNotify/src/EnumProc.cpp | 4 +- plugins/KeyboardNotify/src/EnumProc.h | 2 +- plugins/KeyboardNotify/src/main.cpp | 64 ++++++------ plugins/KeyboardNotify/src/options.cpp | 7 +- plugins/KeyboardNotify/src/protolist.h | 2 +- plugins/ListeningTo/src/listeningto.cpp | 4 +- plugins/MetaContacts/src/meta_options.cpp | 34 +++---- plugins/MetaContacts/src/meta_services.cpp | 111 +++------------------ plugins/MirOTR/MirOTR/options.cpp | 14 +-- plugins/Msg_Export/src/options.cpp | 8 +- plugins/MyDetails/src/data.cpp | 7 +- plugins/Popup/src/opt_gen.cpp | 29 ++---- plugins/SecureIM/src/crypt_lists.cpp | 9 +- plugins/SeenPlugin/src/options.cpp | 11 +- plugins/SmileyAdd/src/smileys.cpp | 45 +-------- .../StatusPlugins/AdvancedAutoAway/msgoptions.cpp | 1 - plugins/StopSpamMod/src/options.cpp | 8 +- plugins/TipperYM/src/options.cpp | 2 +- plugins/TooltipNotify/src/TooltipNotify.cpp | 40 +++----- plugins/UserInfoEx/src/classPsTreeItem.cpp | 27 ++--- plugins/UserInfoEx/src/commonheaders.h | 2 +- plugins/UserInfoEx/src/dlg_propsheet.cpp | 82 ++++++--------- plugins/Utils/mir_options.cpp | 3 - plugins/ZeroNotification/src/main.cpp | 13 +-- 33 files changed, 205 insertions(+), 431 deletions(-) (limited to 'plugins') diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index 046ddb322b..aa7ed6678a 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -52,12 +52,11 @@ static BOOL CALLBACK DisplayCpuUsageProc(BYTE nCpuUsage,LPARAM lParam) static BOOL AnyProtoHasCaps(DWORD caps1) { int nProtoCount,i; - PROTOCOLDESCRIPTOR **protos; - if(!CallService(MS_PROTO_ENUMPROTOCOLS,(WPARAM)&nProtoCount,(LPARAM)&protos)) + PROTOACCOUNT **protos; + if(!ProtoEnumAccounts(&nProtoCount, &protos)) for(i=0;itype==PROTOTYPE_PROTOCOL) - if(CallProtoService(protos[i]->szName,PS_GETCAPS,(WPARAM)PFLAGNUM_1,0)&caps1) - return TRUE; /* CALLSERVICE_NOTFOUND also handled gracefully */ + if(CallProtoService(protos[i]->szModuleName,PS_GETCAPS,(WPARAM)PFLAGNUM_1,0)&caps1) + return TRUE; /* CALLSERVICE_NOTFOUND also handled gracefully */ return FALSE; } diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index 8191e6bb6f..042b357a9d 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -43,7 +43,7 @@ bool g_bWindowHidden, g_fKeyPressed, g_fPassRequested, g_TrayIcon; char g_password[MAXPASSLEN + 1]; HKL oldLangID, oldLayout; int protoCount; -PROTOCOLDESCRIPTOR **proto; +PROTOACCOUNT **proto; unsigned *oldStatus; TCHAR **oldStatusMsg; BYTE g_bOldSetting; @@ -257,10 +257,8 @@ static int ChangeAllProtoStatuses(unsigned statusMode, TCHAR *msg) { for (int i=0; i < protoCount; i++) { - unsigned status = CallProtoService(proto[i]->szName,PS_GETSTATUS,0,0); + unsigned status = CallProtoService(proto[i]->szModuleName,PS_GETSTATUS,0,0); if ( - (proto[i]->type == PROTOTYPE_PROTOCOL) - && (g_wMask & OPT_ONLINEONLY) ? // check "Change only if current status is Online" option ((status == ID_STATUS_ONLINE) || (status == ID_STATUS_FREECHAT)) // process only "online" and "free for chat" : @@ -271,7 +269,7 @@ static int ChangeAllProtoStatuses(unsigned statusMode, TCHAR *msg) oldStatus[i] = status; char svc[256]; - mir_snprintf(svc, 256, "%s%s", proto[i]->szName, PS_GETMYAWAYMSG); + mir_snprintf(svc, 256, "%s%s", proto[i]->szModuleName, PS_GETMYAWAYMSG); if (ServiceExists (svc)) { if (ServiceExists (MS_AWAYMSG_GETSTATUSMSGT)) // if core can support unicode status message @@ -284,9 +282,9 @@ static int ChangeAllProtoStatuses(unsigned statusMode, TCHAR *msg) } } else - oldStatusMsg[i] = GetDefStatusMsg(status, proto[i]->szName); + oldStatusMsg[i] = GetDefStatusMsg(status, proto[i]->szModuleName); } - SetStatus(proto[i]->szName, statusMode, msg); + SetStatus(proto[i]->szModuleName, statusMode, msg); } } return 0; @@ -298,7 +296,7 @@ static int BackAllProtoStatuses(void) { if ( oldStatus[i] ) { - SetStatus(proto[i]->szName, oldStatus[i], oldStatusMsg[i]); + SetStatus(proto[i]->szModuleName, oldStatus[i], oldStatusMsg[i]); if (oldStatusMsg[i]) { mir_free(oldStatusMsg[i]); @@ -723,7 +721,7 @@ static TCHAR *VariablesBossKey(ARGUMENTSINFO *ai) { static int EnumProtos(WPARAM wParam, LPARAM lParam) { - CallService(MS_PROTO_ENUMPROTOCOLS,(WPARAM)&protoCount,(LPARAM)&proto); + ProtoEnumAccounts(&protoCount, &proto); delete[] oldStatus; delete[] oldStatusMsg; diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index f4ff862e9c..b8c4175b9b 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -361,7 +361,7 @@ void CSList::ForAllProtocols( pForAllProtosFunc pFunc, void* arg ) { int protoCount; PROTOACCOUNT** pdesc; - CallService( MS_PSEUDO_PROTO_PROTOACCSENUM, ( WPARAM )&protoCount, ( LPARAM )&pdesc ); + ProtoEnumAccounts(&protoCount, &pdesc); for ( int i = 0; i < protoCount; i++ ) { diff --git a/plugins/CSList/src/cslist.h b/plugins/CSList/src/cslist.h index 7a4f0f8e75..c38859fdd9 100644 --- a/plugins/CSList/src/cslist.h +++ b/plugins/CSList/src/cslist.h @@ -93,10 +93,6 @@ #define XSTATUS_COUNT_EXTENDED 37 #define MOODS_COUNT 84 -// ====[ SERVICES ]=========================================================== - -#define MS_PSEUDO_PROTO_PROTOACCSENUM ( CSList::bAccountsSupported ? MS_PROTO_ENUMACCOUNTS : MS_PROTO_ENUMPROTOCOLS ) - // ====[ DEFAULT DB VALUES ]================================================== #define DEFAULT_ICQ_XSTATUS_ENABLED 1 diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 9b2d89b696..05994188ae 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -556,11 +556,6 @@ void HandleStatusCommand(PCommand command, TArgument *argv, int argc, PReply rep } } -void GetProtocols(int *count, PROTOCOLDESCRIPTOR ***protocols) -{ - CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM) count, (LPARAM) protocols); -} - void HandleAwayMsgCommand(PCommand command, TArgument *argv, int argc, PReply reply) { switch (argc) diff --git a/plugins/CrashDumper/src/dumper.cpp b/plugins/CrashDumper/src/dumper.cpp index 4ff1d4722c..b1539a3658 100644 --- a/plugins/CrashDumper/src/dumper.cpp +++ b/plugins/CrashDumper/src/dumper.cpp @@ -322,24 +322,23 @@ struct ProtoCount static void GetProtocolStrings(bkstring& buffer) { PROTOACCOUNT **accList; - int accCount, protoCount; + int accCount; int i, j; - PROTOCOLDESCRIPTOR **protoList; - if (ProtoEnumAccounts(&accCount, &accList) == CALLSERVICE_NOTFOUND || (accCount > 0 && accList[0]->cbSize == 0)) + ProtoEnumAccounts(&accCount, &accList); + if (accCount > 0) { - CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&protoCount, (LPARAM)&protoList); - for (i = 0; i < protoCount; i++) + for (i = 0; i < accCount; i++) { - if (protoList[i]->type != PROTOTYPE_PROTOCOL) continue; - TCHAR* nm; - crsi_a2t(nm, protoList[i]->szName); + crsi_a2t(nm, accList[i]->szModuleName); buffer.appendfmt(TEXT(" 1 - %s\r\n"), nm); } } else { + int protoCount; + PROTOCOLDESCRIPTOR **protoList; CallService(MS_PROTO_ENUMPROTOS, (WPARAM)&protoCount, (LPARAM)&protoList); int protoCountMy = 0; diff --git a/plugins/DbEditorPP/src/icons.cpp b/plugins/DbEditorPP/src/icons.cpp index 6da3723bfe..9ba200a923 100644 --- a/plugins/DbEditorPP/src/icons.cpp +++ b/plugins/DbEditorPP/src/icons.cpp @@ -86,7 +86,7 @@ int AddIconToList(HIMAGELIST hil, HICON hIcon) return 1; } -static PROTOCOLDESCRIPTOR **protocols = NULL; +static PROTOACCOUNT **protocols = NULL; static int protoCount = 0; static int shift = 0; @@ -94,14 +94,11 @@ void AddProtoIconsToList(HIMAGELIST hil, int newshift) { shift = newshift; - CallService(MS_PROTO_ENUMPROTOCOLS,(WPARAM)&protoCount,(LPARAM)&protocols); + ProtoEnumAccounts(&protoCount, &protocols); for (int i = 0; i < protoCount; i++) { - if (protocols[i]->type != PROTOTYPE_PROTOCOL) - continue; - HICON hIcon; - if (hIcon=LoadSkinnedProtoIcon(protocols[i]->szName, ID_STATUS_ONLINE)) + if (hIcon=LoadSkinnedProtoIcon(protocols[i]->szModuleName, ID_STATUS_ONLINE)) AddIconToList(hil, hIcon); else AddIconToList(himl, LoadSkinnedDBEIcon(ICO_ONLINE)); @@ -116,10 +113,7 @@ int GetProtoIcon(char *szProto) int n = 0; for (int i = 0; i < protoCount; i++) { - if (protocols[i]->type != PROTOTYPE_PROTOCOL) - continue; - - if (!mir_strcmp(protocols[i]->szName, szProto)) + if (!mir_strcmp(protocols[i]->szModuleName, szProto)) return n + shift; n++; @@ -131,13 +125,9 @@ int GetProtoIcon(char *szProto) BOOL IsProtocolLoaded(char* pszProtocolName) { if (protoCount) - for(int i = 0; i < protoCount; i++) { - if (protocols[i]->type != PROTOTYPE_PROTOCOL) - continue; - - if (!mir_strcmp(protocols[i]->szName, pszProtocolName)) + for(int i = 0; i < protoCount; i++) + if (!mir_strcmp(protocols[i]->szModuleName, pszProtocolName)) return TRUE; - } return FALSE; } diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp index bc3322e5ed..08d3139304 100644 --- a/plugins/IEView/src/Options.cpp +++ b/plugins/IEView/src/Options.cpp @@ -648,10 +648,10 @@ static INT_PTR CALLBACK IEViewSRMMOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar case UM_CHECKSTATECHANGE: { ProtocolSettings *proto = (ProtocolSettings *)GetItemParam((HWND)wParam, (HTREEITEM) lParam); - if (proto != NULL) { + if (proto != NULL) if (strcmpi(proto->getProtocolName(), "_default_")) proto->setSRMMEnableTemp( TreeView_GetCheckState((HWND)wParam, (HTREEITEM) lParam)); - } + if ((HTREEITEM) lParam != TreeView_GetSelection((HWND)wParam)) { TreeView_SelectItem((HWND)wParam, (HTREEITEM) lParam); } else { @@ -791,11 +791,11 @@ static INT_PTR CALLBACK IEViewHistoryOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w if (strcmpi(proto->getProtocolName(), "_default_")) proto->setHistoryEnableTemp(TreeView_GetCheckState((HWND)wParam, (HTREEITEM) lParam)); - if ((HTREEITEM) lParam != TreeView_GetSelection((HWND)wParam)) { + if ((HTREEITEM) lParam != TreeView_GetSelection((HWND)wParam)) TreeView_SelectItem((HWND)wParam, (HTREEITEM) lParam); - } else { + else UpdateHistoryProtoInfo(hwndDlg, proto); - } + MarkChanges(4, hwndDlg); } break; @@ -1516,9 +1516,9 @@ void Options::init() { /* TODO: move to buildProtocolList method */ int protoCount; - PROTOCOLDESCRIPTOR **pProtos; + PROTOACCOUNT **pProtos; ProtocolSettings *lastProto = NULL; - CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&protoCount, (LPARAM)&pProtos); + ProtoEnumAccounts(&protoCount, &pProtos); for (int i = 0; i < protoCount+1; i++) { ProtocolSettings *proto; char tmpPath[MAX_PATH]; @@ -1526,11 +1526,11 @@ void Options::init() { if (i==0) { proto = new ProtocolSettings("_default_"); proto->setSRMMEnable(true); - } else if ((pProtos[i-1]->type == PROTOTYPE_PROTOCOL) && strcmp(pProtos[i-1]->szName,"MetaContacts")) { - if ((CallProtoService(pProtos[i-1]->szName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM) == 0) { + } else if (strcmp(pProtos[i-1]->szModuleName,"MetaContacts")) { + if ((CallProtoService(pProtos[i-1]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM) == 0) { continue; } - proto = new ProtocolSettings(pProtos[i-1]->szName); + proto = new ProtocolSettings(pProtos[i-1]->szModuleName); } else { continue; } diff --git a/plugins/Import/src/main.cpp b/plugins/Import/src/main.cpp index 025ad8ef4d..f16a875b3a 100644 --- a/plugins/Import/src/main.cpp +++ b/plugins/Import/src/main.cpp @@ -91,14 +91,12 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam) // Only autorun import wizard if at least one protocol is installed int nProtocols = 0; - PROTOCOLDESCRIPTOR **ppProtos = NULL; - CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&nProtocols, (LPARAM)&ppProtos); - for (int n=0; n < nProtocols; n++) { - if (ppProtos[n]->type == PROTOTYPE_PROTOCOL) { - CallService(IMPORT_SERVICE, 0, 0); - DBWriteContactSettingByte(NULL, IMPORT_MODULE, IMP_KEY_FR, 1); - break; - } } + PROTOACCOUNT **ppProtos = NULL; + ProtoEnumAccounts(&nProtocols, &ppProtos); + if (nProtocols > 0) { + CallService(IMPORT_SERVICE, 0, 0); + DBWriteContactSettingByte(NULL, IMPORT_MODULE, IMP_KEY_FR, 1); + } return 0; } diff --git a/plugins/KeyboardNotify/src/EnumProc.cpp b/plugins/KeyboardNotify/src/EnumProc.cpp index 3802569101..8681f7d1ba 100644 --- a/plugins/KeyboardNotify/src/EnumProc.cpp +++ b/plugins/KeyboardNotify/src/EnumProc.cpp @@ -231,9 +231,7 @@ BOOL WINAPI Enum16(DWORD dwThreadId, WORD hMod16, WORD hTask16, TCHAR *szModName BOOL findFilename(TCHAR *fileName) { - unsigned int i; - - for (i=0; i < ProcessList.count; i++) + for (int i=0; i < ProcessList.count; i++) if (ProcessList.szFileName[i] && !_wcsicmp(ProcessList.szFileName[i], fileName)) return TRUE; diff --git a/plugins/KeyboardNotify/src/EnumProc.h b/plugins/KeyboardNotify/src/EnumProc.h index 09b3cba8d6..3770d7b694 100644 --- a/plugins/KeyboardNotify/src/EnumProc.h +++ b/plugins/KeyboardNotify/src/EnumProc.h @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ typedef struct { - unsigned int count; + int count; TCHAR **szFileName; } PROCESS_LIST; diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 53d135252c..d312b35903 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -452,7 +452,7 @@ BOOL checkGlobalStatus() BOOL checkGlobalXstatus() { ICQ_CUSTOM_STATUS xstatus={0}; - unsigned int i, protosSupporting; int status=0; + int i, protosSupporting, status=0; for(i=0, protosSupporting=0; i < ProtoList.protoCount; i++) { if (!ProtoList.protoInfo[i].enabled || !ProtoList.protoInfo[i].xstatus.count) continue; @@ -510,12 +510,10 @@ BOOL checkIgnore(HANDLE hContact, WORD eventType) BOOL checkProtocol(char *szProto) { - unsigned int i; - if (!szProto) return FALSE; - for(i=0; i < ProtoList.protoCount; i++) + for(int i=0; i < ProtoList.protoCount; i++) if (ProtoList.protoInfo[i].szProto && !strcmp(ProtoList.protoInfo[i].szProto, szProto)) return ProtoList.protoInfo[i].enabled; @@ -677,13 +675,13 @@ BOOL checkStatus(char *szProto) BOOL checkXstatus(char *szProto) { - unsigned int i; int status=0; + int status=0; ICQ_CUSTOM_STATUS xstatus={0}; if (!szProto) return checkGlobalXstatus(); - for(i=0; i < ProtoList.protoCount; i++) + for(int i=0; i < ProtoList.protoCount; i++) if (ProtoList.protoInfo[i].szProto && !strcmp(ProtoList.protoInfo[i].szProto, szProto)) { if (!ProtoList.protoInfo[i].xstatus.count) return TRUE; @@ -879,8 +877,6 @@ void destroyProcessList(void) void LoadSettings(void) { - unsigned int i; - bFlashOnMsg = DBGetContactSettingByte(NULL, KEYBDMODULE, "onmsg", DEF_SETTING_ONMSG); bFlashOnURL = DBGetContactSettingByte(NULL, KEYBDMODULE, "onurl", DEF_SETTING_ONURL); bFlashOnFile = DBGetContactSettingByte(NULL, KEYBDMODULE, "onfile", DEF_SETTING_ONFILE); @@ -927,7 +923,7 @@ void LoadSettings(void) DBWriteContactSettingByte(NULL, KEYBDMODULE, "testnum", DEF_SETTING_TESTNUM); if (DBGetContactSettingByte(NULL, KEYBDMODULE, "testsecs", -1) == -1) DBWriteContactSettingByte(NULL, KEYBDMODULE, "testsecs", DEF_SETTING_TESTSECS); - for(i=0; i < ProtoList.protoCount; i++) + for(int i=0; i < ProtoList.protoCount; i++) if (ProtoList.protoInfo[i].visible) { unsigned int j; ProtoList.protoInfo[i].enabled = DBGetContactSettingByte(NULL, KEYBDMODULE, ProtoList.protoInfo[i].szProto, DEF_SETTING_PROTOCOL); @@ -991,39 +987,37 @@ void updateXstatusProto(PROTOCOL_INFO *protoInfo) void createProtocolList(void) { - unsigned int i; - PROTOCOLDESCRIPTOR **proto; + PROTOACCOUNT **proto; if (ServiceExists(MS_MC_GETPROTOCOLNAME)) szMetaProto = (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0); - CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&ProtoList.protoCount, (LPARAM)&proto); + ProtoEnumAccounts(&ProtoList.protoCount, &proto); ProtoList.protoInfo = (PROTOCOL_INFO *)malloc(ProtoList.protoCount * sizeof(PROTOCOL_INFO)); - if (!ProtoList.protoInfo) + if (!ProtoList.protoInfo) { ProtoList.protoCount = 0; - else - for(i=0; i < ProtoList.protoCount; i++) { - ProtoList.protoInfo[i].xstatus.count = 0; - ProtoList.protoInfo[i].xstatus.enabled = NULL; - ProtoList.protoInfo[i].szProto = (char *)malloc(strlen(proto[i]->szName) + 1); - if (!ProtoList.protoInfo[i].szProto) { - ProtoList.protoInfo[i].enabled = FALSE; + return; + } + + for(int i=0; i < ProtoList.protoCount; i++) { + ProtoList.protoInfo[i].xstatus.count = 0; + ProtoList.protoInfo[i].xstatus.enabled = NULL; + ProtoList.protoInfo[i].szProto = (char *)malloc(strlen(proto[i]->szModuleName) + 1); + if (!ProtoList.protoInfo[i].szProto) { + ProtoList.protoInfo[i].enabled = FALSE; + ProtoList.protoInfo[i].visible = FALSE; + } + else { + strcpy(ProtoList.protoInfo[i].szProto, proto[i]->szModuleName); + ProtoList.protoInfo[i].enabled = FALSE; + if (szMetaProto && !strcmp(proto[i]->szModuleName, szMetaProto)) ProtoList.protoInfo[i].visible = FALSE; - } else { - strcpy(ProtoList.protoInfo[i].szProto, proto[i]->szName); - ProtoList.protoInfo[i].enabled = FALSE; - if (proto[i]->type != PROTOTYPE_PROTOCOL) - ProtoList.protoInfo[i].visible = FALSE; - else - if (szMetaProto && !strcmp(proto[i]->szName, szMetaProto)) - ProtoList.protoInfo[i].visible = FALSE; - else { - ProtoList.protoInfo[i].visible = TRUE; - updateXstatusProto(&(ProtoList.protoInfo[i])); - } + else { + ProtoList.protoInfo[i].visible = TRUE; + updateXstatusProto(&(ProtoList.protoInfo[i])); } } - + } } @@ -1123,9 +1117,7 @@ extern "C" __declspec(dllexport) int Load(void) void destroyProtocolList(void) { - unsigned int i; - - for(i=0; i < ProtoList.protoCount; i++) { + for(int i=0; i < ProtoList.protoCount; i++) { if (ProtoList.protoInfo[i].szProto) free(ProtoList.protoInfo[i].szProto); if (ProtoList.protoInfo[i].xstatus.enabled) diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp index ff9c245df7..3fb480a787 100644 --- a/plugins/KeyboardNotify/src/options.cpp +++ b/plugins/KeyboardNotify/src/options.cpp @@ -265,7 +265,6 @@ INT_PTR CALLBACK DlgProcProtoOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR // proto list { - unsigned int i; LVCOLUMN lvCol; LVITEM lvItem; HWND hList = GetDlgItem(hwndDlg, IDC_PROTOCOLLIST); @@ -283,7 +282,7 @@ INT_PTR CALLBACK DlgProcProtoOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR lvItem.cchTextMax = 256; lvItem.iItem = 0; lvItem.iSubItem = 0; - for(i=0; i < ProtoList.protoCount; i++) { + for(int i=0; i < ProtoList.protoCount; i++) { int count; PROTOACCOUNT** protos; ProtoEnumAccounts( &count, &protos ); if(ProtoList.protoInfo[i].visible) { @@ -352,7 +351,7 @@ INT_PTR CALLBACK DlgProcProtoOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR INT_PTR CALLBACK DlgProcBasicOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { - unsigned int i; + int i; static BOOL initDlg=FALSE; switch (msg) { @@ -513,7 +512,7 @@ INT_PTR CALLBACK DlgProcBasicOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case WM_NOTIFY: { - unsigned int j; + int j; BYTE untilMap = 0; WORD statusMap = 0; //Here we have pressed either the OK or the APPLY button. diff --git a/plugins/KeyboardNotify/src/protolist.h b/plugins/KeyboardNotify/src/protolist.h index 5a08d929da..d3f816009d 100644 --- a/plugins/KeyboardNotify/src/protolist.h +++ b/plugins/KeyboardNotify/src/protolist.h @@ -29,6 +29,6 @@ typedef struct { } PROTOCOL_INFO; typedef struct { - unsigned int protoCount; + int protoCount; PROTOCOL_INFO *protoInfo; } PROTOCOL_LIST; diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index de237acb06..1aa54ba0af 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -251,7 +251,7 @@ void RegisterProtocol(char *proto, TCHAR *account) int AccListChanged(WPARAM wParam, LPARAM lParam) { PROTOACCOUNT *proto = (PROTOACCOUNT *) lParam; - if (proto == NULL || proto->type != PROTOTYPE_PROTOCOL) + if (proto == NULL) return 0; ProtocolInfo *info = GetProtoInfo(proto->szModuleName); @@ -382,8 +382,6 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) for (int i = 0; i < count; i++) { - if (protos[i]->type != PROTOTYPE_PROTOCOL) - continue; if (!protos[i]->bIsEnabled) continue; diff --git a/plugins/MetaContacts/src/meta_options.cpp b/plugins/MetaContacts/src/meta_options.cpp index 9b113def92..a5394c5e84 100644 --- a/plugins/MetaContacts/src/meta_options.cpp +++ b/plugins/MetaContacts/src/meta_options.cpp @@ -358,12 +358,12 @@ int GetRealPriority(char *proto, int status) { void ReadPriorities() { int num_protocols; - PROTOCOLDESCRIPTOR **pppDesc; + PROTOACCOUNT **pppDesc; char szSetting[256]; ProtoStatusPrio * current; int i, j; - CallService(MS_PROTO_ENUMPROTOCOLS, (LPARAM)&num_protocols, (WPARAM)&pppDesc); + ProtoEnumAccounts(&num_protocols, &pppDesc); current = priorities = (ProtoStatusPrio *)malloc((num_protocols + 1) * sizeof(ProtoStatusPrio)); for (i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) { @@ -374,7 +374,7 @@ void ReadPriorities() { for (i = 0; i < num_protocols; i++) { current = priorities + (i + 1); for (j = ID_STATUS_OFFLINE; j <= ID_STATUS_OUTTOLUNCH; j++) { - mir_snprintf(szSetting, 256, "ProtoPrio_%s%d", pppDesc[i]->szName, j); + mir_snprintf(szSetting, 256, "ProtoPrio_%s%d", pppDesc[i]->szModuleName, j); current->prio[j - ID_STATUS_OFFLINE] = DBGetContactSettingWord(0, META_PROTO, szSetting, 0xFFFF); current->def[j - ID_STATUS_OFFLINE] = (current->prio[j - ID_STATUS_OFFLINE] == 0xFFFF); } @@ -383,12 +383,12 @@ void ReadPriorities() { void WritePriorities() { int num_protocols; - PROTOCOLDESCRIPTOR **pppDesc; + PROTOACCOUNT **pppDesc; char szSetting[256]; ProtoStatusPrio * current = priorities; int i, j; - CallService(MS_PROTO_ENUMPROTOCOLS, (LPARAM)&num_protocols, (WPARAM)&pppDesc); + ProtoEnumAccounts(&num_protocols, &pppDesc); for (i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) { mir_snprintf(szSetting, 256, "DefaultPrio_%d", i); @@ -400,7 +400,7 @@ void WritePriorities() { for (i = 0; i < num_protocols; i++) { current = priorities + (i + 1); for (j = ID_STATUS_OFFLINE; j <= ID_STATUS_OUTTOLUNCH; j++) { - mir_snprintf(szSetting, 256, "ProtoPrio_%s%d", pppDesc[i]->szName, j); + mir_snprintf(szSetting, 256, "ProtoPrio_%s%d", pppDesc[i]->szModuleName, j); if (!current->def[j - ID_STATUS_OFFLINE]) DBWriteContactSettingWord(0, META_PROTO, szSetting, (WORD)current->prio[j - ID_STATUS_OFFLINE]); else @@ -446,11 +446,11 @@ void SetPriority(int proto_index, int status, BOOL def, int prio) { void ResetPriorities() { int num_protocols; - PROTOCOLDESCRIPTOR **pppDesc; + PROTOACCOUNT **pppDesc; ProtoStatusPrio * current; int i, j; - CallService(MS_PROTO_ENUMPROTOCOLS, (LPARAM)&num_protocols, (WPARAM)&pppDesc); + ProtoEnumAccounts(&num_protocols, &pppDesc); current = priorities; for (i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) { @@ -479,19 +479,17 @@ INT_PTR CALLBACK DlgProcOptsPriorities(HWND hwndDlg, UINT msg, WPARAM wParam, LP ReadPriorities(); { int num_protocols; - PROTOCOLDESCRIPTOR **pppDesc; + PROTOACCOUNT **pppDesc; int i, index; - CallService(MS_PROTO_ENUMPROTOCOLS, (LPARAM)&num_protocols, (WPARAM)&pppDesc); + ProtoEnumAccounts(&num_protocols, &pppDesc); hw = GetDlgItem(hwndDlg, IDC_CMB_PROTOCOL); index = SendMessage(hw, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)Translate("")); SendMessage(hw, CB_SETITEMDATA, (WPARAM)index, -1); for (i = 0; i < num_protocols; i++) { - if (pppDesc[i]->type == PROTOTYPE_PROTOCOL) { - if (strcmp(pppDesc[i]->szName, META_PROTO) != 0) { - index = SendMessage(hw, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)pppDesc[i]->szName); - SendMessage(hw, CB_SETITEMDATA, (WPARAM)index, i); - } + if (strcmp(pppDesc[i]->szModuleName, META_PROTO) != 0) { + index = SendMessage(hw, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)pppDesc[i]->szModuleName); + SendMessage(hw, CB_SETITEMDATA, (WPARAM)index, i); } } @@ -546,10 +544,10 @@ INT_PTR CALLBACK DlgProcOptsPriorities(HWND hwndDlg, UINT msg, WPARAM wParam, LP } } else { int num_protocols, caps, i; - PROTOCOLDESCRIPTOR **pppDesc; - CallService(MS_PROTO_ENUMPROTOCOLS, (LPARAM)&num_protocols, (WPARAM)&pppDesc); + PROTOACCOUNT **pppDesc; + ProtoEnumAccounts(&num_protocols, &pppDesc); - caps = CallProtoService(pppDesc[index]->szName, PS_GETCAPS, PFLAGNUM_2, 0); + caps = CallProtoService(pppDesc[index]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0); for (i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) { if (caps & Proto_Status2Flag(i)) { diff --git a/plugins/MetaContacts/src/meta_services.cpp b/plugins/MetaContacts/src/meta_services.cpp index 94aea51fc9..d4c5ea8a1b 100644 --- a/plugins/MetaContacts/src/meta_services.cpp +++ b/plugins/MetaContacts/src/meta_services.cpp @@ -1086,93 +1086,9 @@ int Meta_MessageWindowEvent(WPARAM wParam, LPARAM lParam) { return 0; } -/* -int Meta_LoadIcons(WPARAM wParam, LPARAM lParam) { - PROTOCOLDESCRIPTOR **protos; - - //MessageBox(0, "LoadIcons", "Event", MB_OK); - - if (ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) { - int index = 0, i; - - CallService(MS_PROTO_ENUMPROTOCOLS,(WPARAM)&proto_count,(LPARAM)&protos); - for (i = 0; i < proto_count && i < MAX_PROTOCOLS; i++) { - if (protos[i]->type!=PROTOTYPE_PROTOCOL || CallProtoService(protos[i]->szName,PS_GETCAPS,PFLAGNUM_2,0)==0) - continue; - - strncpy(proto_names + (index * 128), protos[i]->szName, 128); - hProtoIcons[index * 2] = LoadSkinnedProtoIcon(protos[i]->szName,ID_STATUS_ONLINE); - hProtoIcons[index * 2 + 1] = LoadSkinnedProtoIcon(protos[i]->szName,ID_STATUS_OFFLINE); - hExtraImage[index * 2] = 0; - hExtraImage[index * 2 + 1] = 0; - - //sprintf(buff, "Added icon (hIcon = %d, hImage = %d) for protocol %s.", hProtoIcons[index], hExtraImage[index], protos[i]->szName); - //MessageBox(0, buff, "Added Extra Icon", MB_OK); - - index++; - } - proto_count = index; - - //Meta_CListMW_ExtraIconsRebuild(0, 0); - - } - - - return 0; -} - -int Meta_CListMW_ExtraIconsRebuild(WPARAM wParam, LPARAM lParam) { - int i; - - //MessageBox(0, "IconsRebuild", "Event", MB_OK); - Meta_LoadIcons(0, 0); - - if (ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) { - for (i = 0; i < proto_count; i++) { - hExtraImage[i * 2] = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)hProtoIcons[i * 2], 0); - hExtraImage[i * 2 + 1] = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)hProtoIcons[i * 2 + 1], 0); - } - } - - return 0; -} - -int Meta_CListMW_ExtraIconsApply(WPARAM wParam, LPARAM lParam) { - - //MessageBox(0, "IconsApply", "Event", MB_OK); - - if (DBGetContactSettingDword((HANDLE)wParam, META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1) { - if (ServiceExists(MS_CLIST_EXTRA_SET_ICON)) { - IconExtraColumn iec; - HANDLE most_online_im = Meta_GetMostOnline((HANDLE)wParam); - int i; - - if (most_online_im) { - char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)most_online_im, 0); - if (proto) { - WORD status = DBGetContactSettingWord(most_online_im, proto, "Status", ID_STATUS_OFFLINE); - iec.cbSize = sizeof(iec); - for (i = 0; i < proto_count; i++) { - if (!strcmp((proto_names + i * 128), proto)) { - if (hExtraImage[i * 2 + (status == ID_STATUS_OFFLINE ? 1 : 0)]) { - iec.hImage = hExtraImage[i * 2 + (status == ID_STATUS_OFFLINE ? 1 : 0)]; - iec.ColumnType = EXTRA_ICON_ADV2; - CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)wParam, (LPARAM)&iec); - iec.ColumnType = EXTRA_ICON_PROTO; - CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)wParam, (LPARAM)&iec); - } - break; - } - } - } - } - } - } - return 0; -} -*/ -int Meta_ClistDoubleClicked(WPARAM wParam, LPARAM lParam) { +int Meta_ClistDoubleClicked(WPARAM wParam, LPARAM lParam) +{ if (DBGetContactSettingDword((HANDLE)wParam,META_PROTO,"Default",(WORD)-1) == (WORD)-1) { // This is a simple contact @@ -1377,23 +1293,20 @@ int Meta_ModulesLoaded(WPARAM wParam, LPARAM lParam) int i, numberOfProtocols,ret; char str[MAXMODULELABELLENGTH + 10]; HANDLE hNudgeEvent = NULL; - PROTOCOLDESCRIPTOR ** ppProtocolDescriptors; - ret = CallService(MS_PROTO_ENUMPROTOCOLS,(WPARAM) &numberOfProtocols,(LPARAM)&ppProtocolDescriptors); + PROTOACCOUNT ** ppProtocolDescriptors; + ret = ProtoEnumAccounts(&numberOfProtocols, &ppProtocolDescriptors); if (ret == 0) { for (i = 0; i < numberOfProtocols ; i++) { - if (ppProtocolDescriptors[i]->type == PROTOTYPE_PROTOCOL) - { - if (strcmp(ppProtocolDescriptors[i]->szName, META_PROTO)) { - sprintf(str,"%s/Nudge",ppProtocolDescriptors[i]->szName); - hNudgeEvent = HookEvent(str, NudgeRecieved); - if (hNudgeEvent != NULL) { - ++iNudgeProtos; - hNudgeEvents = (HANDLE *)realloc(hNudgeEvents, sizeof(HANDLE) * iNudgeProtos); - hNudgeEvents[iNudgeProtos - 1] = hNudgeEvent; - } - } + if (strcmp(ppProtocolDescriptors[i]->szModuleName, META_PROTO)) { + sprintf(str,"%s/Nudge",ppProtocolDescriptors[i]->szModuleName); + hNudgeEvent = HookEvent(str, NudgeRecieved); + if (hNudgeEvent != NULL) { + ++iNudgeProtos; + hNudgeEvents = (HANDLE *)realloc(hNudgeEvents, sizeof(HANDLE) * iNudgeProtos); + hNudgeEvents[iNudgeProtos - 1] = hNudgeEvent; + } } } diff --git a/plugins/MirOTR/MirOTR/options.cpp b/plugins/MirOTR/MirOTR/options.cpp index 6a3e338037..91a3cd34df 100644 --- a/plugins/MirOTR/MirOTR/options.cpp +++ b/plugins/MirOTR/MirOTR/options.cpp @@ -384,28 +384,28 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP lv = GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS); ListView_DeleteAllItems(lv); int num_protocols; - PROTOCOLDESCRIPTOR **pppDesc; + PROTOACCOUNT **pppDesc; int ilvItem; LV_ITEM item = {0}; char fprint[45]; TCHAR* temp; //BOOL unicode = ListView_GetUnicodeFormat(lv); - CallService(MS_PROTO_ENUMPROTOCOLS, (LPARAM)&num_protocols, (WPARAM)&pppDesc); + ProtoEnumAccounts(&num_protocols, &pppDesc); for(int i = 0; i < num_protocols; i++) { - if(pppDesc[i]->type == PROTOTYPE_PROTOCOL && (!g_metaproto || strcmp(pppDesc[i]->szName, g_metaproto) != 0) - && (CallProtoService(pppDesc[i]->szName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM) == PF1_IM) + if((!g_metaproto || strcmp(pppDesc[i]->szModuleName, g_metaproto) != 0) + && (CallProtoService(pppDesc[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM) == PF1_IM) { //if (unicode) { item.mask = LVIF_TEXT; - temp = mir_a2t(pppDesc[i]->szName); + temp = mir_a2t(pppDesc[i]->szModuleName); item.pszText = temp; ilvItem = ListView_InsertItem(lv, &item); mir_free(temp); - ListView_SetItemText(lv, ilvItem, 1, (TCHAR*)policy_to_string(db_get_dw(0,MODULENAME"_ProtoPol", pppDesc[i]->szName, CONTACT_DEFAULT_POLICY)) ); - if(otrl_privkey_fingerprint(otr_user_state, fprint, pppDesc[i]->szName, pppDesc[i]->szName)) { + ListView_SetItemText(lv, ilvItem, 1, (TCHAR*)policy_to_string(db_get_dw(0,MODULENAME"_ProtoPol", pppDesc[i]->szModuleName, CONTACT_DEFAULT_POLICY)) ); + if(otrl_privkey_fingerprint(otr_user_state, fprint, pppDesc[i]->szModuleName, pppDesc[i]->szModuleName)) { temp = mir_a2t(fprint); ListView_SetItemText(lv, ilvItem, 2, temp); mir_free(temp); diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 029a21fc45..585b68ff76 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -1339,20 +1339,20 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts2(HWND hwndDlg, UINT msg, WPARAM wPa } { - PROTOCOLDESCRIPTOR **proto; + PROTOACCOUNT **proto; int nCount; LVITEMA sItem = { 0 }; sItem.mask = LVIF_TEXT | LVIF_IMAGE; char szTemp[ 500 ]; - CallService(MS_PROTO_ENUMPROTOCOLS,(WPARAM)&nCount,(LPARAM)&proto); + ProtoEnumAccounts(&nCount, &proto); for( int i=0 ; i < nCount ; i++) { if( proto[i]->type==PROTOTYPE_IGNORE) //PROTOTYPE_PROTOCOL continue; - _snprintf( szTemp , sizeof( szTemp ) , "DisableProt_%s" , proto[i]->szName ); - sItem.pszText = proto[i]->szName; + _snprintf(szTemp , sizeof( szTemp ) , "DisableProt_%s" , proto[i]->szModuleName); + sItem.pszText = proto[i]->szModuleName; sItem.iImage = DBGetContactSettingByte(NULL,MODULE,szTemp,1); ::SendMessage( hMapUser , LVM_INSERTITEMA , 0 ,(LPARAM)&sItem ); sItem.iItem++; diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp index 1bcb004409..ddd96e920c 100644 --- a/plugins/MyDetails/src/data.cpp +++ b/plugins/MyDetails/src/data.cpp @@ -35,9 +35,6 @@ void InitProtocolData() for (int i = 0; i < count; i++) { PROTOACCOUNT* acc = protos[i]; - if (acc->type != PROTOTYPE_PROTOCOL) - continue; - if (acc->szModuleName == NULL || acc->szModuleName[0] == '\0') continue; @@ -195,9 +192,9 @@ void Protocol::SetStatus(int aStatus) PROTOACCOUNT **accs; pCount = 0; - CallService(MS_PROTO_ENUMPROTOCOLS,(WPARAM)&count,(LPARAM)&accs); + ProtoEnumAccounts(&count, &accs); for (i=0; i < count; i++) { - if (accs[i]->type != PROTOTYPE_PROTOCOL || CallProtoService(accs[i]->szModuleName,PS_GETCAPS,PFLAGNUM_2,0)==0) + if ( CallProtoService(accs[i]->szModuleName,PS_GETCAPS,PFLAGNUM_2,0)==0) continue; pCount++; } 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)); diff --git a/plugins/SecureIM/src/crypt_lists.cpp b/plugins/SecureIM/src/crypt_lists.cpp index 7b68fbd250..e34320c971 100644 --- a/plugins/SecureIM/src/crypt_lists.cpp +++ b/plugins/SecureIM/src/crypt_lists.cpp @@ -9,7 +9,7 @@ int clist_inc = 100; void loadSupportedProtocols() { int numberOfProtocols; - PROTOCOLDESCRIPTOR **protos; + PROTOACCOUNT **protos; LPSTR szNames = myDBGetString(0,szModuleName,"protos"); if ( szNames && strchr(szNames,':') == NULL ) { LPSTR tmp = (LPSTR) mir_alloc(2048); int j=0; @@ -24,15 +24,14 @@ void loadSupportedProtocols() { DBWriteContactSettingString(0,szModuleName,"protos",szNames); } - CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&numberOfProtocols, (LPARAM)&protos); + ProtoEnumAccounts(&numberOfProtocols, &protos); for (int i=0;itype == PROTOTYPE_PROTOCOL && protos[i]->szName && (CallProtoService(protos[i]->szName,PS_GETCAPS,PFLAGNUM_2,0)||strcmp(protos[i]->szName,"MetaContacts")==0)) { - if (protos[i]->type == PROTOTYPE_PROTOCOL && protos[i]->szName && CallProtoService(protos[i]->szName,PS_GETCAPS,PFLAGNUM_2,0)) { + if (protos[i]->szModuleName && CallProtoService(protos[i]->szModuleName,PS_GETCAPS,PFLAGNUM_2,0)) { int j = proto_cnt; proto_cnt++; proto = (pSupPro) mir_realloc(proto,sizeof(SupPro)*proto_cnt); memset(&proto[j],0,sizeof(SupPro)); - proto[j].name = mir_strdup(protos[i]->szName); + proto[j].name = mir_strdup(protos[i]->szModuleName); if ( szNames ) { if ( proto[j].name ) { char tmp[128]; strcpy(tmp,proto[j].name); strcat(tmp,":"); diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp index daab1e8ee3..61afc53664 100644 --- a/plugins/SeenPlugin/src/options.cpp +++ b/plugins/SeenPlugin/src/options.cpp @@ -223,7 +223,7 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpa { TVINSERTSTRUCT tvis; int numberOfProtocols,i; - PROTOCOLDESCRIPTOR** protos; + PROTOACCOUNT **protos; char *protoName; char *protoLabel; @@ -232,11 +232,12 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpa tvis.item.mask=TVIF_TEXT | TVIF_HANDLE | TVIF_STATE | TVIF_PARAM; tvis.item.stateMask = TVIS_STATEIMAGEMASK; - CallService(MS_PROTO_ENUMPROTOCOLS,(WPARAM)&numberOfProtocols,(LPARAM)&protos); + ProtoEnumAccounts(&numberOfProtocols, &protos); for (i=0; itype!=PROTOTYPE_PROTOCOL || CallProtoService(protos[i]->szName,PS_GETCAPS,PFLAGNUM_2,0)==0) continue; - protoName = (char *)malloc(strlen(protos[i]->szName)+1); - strcpy(protoName,protos[i]->szName); + if(CallProtoService(protos[i]->szModuleName,PS_GETCAPS,PFLAGNUM_2,0)==0) + continue; + protoName = (char *)malloc(strlen(protos[i]->szModuleName)+1); + strcpy(protoName,protos[i]->szModuleName); //debug(protoName); protoLabel = (char *)malloc(MAXMODULELABELLENGTH+1); CallProtoService(protoName,PS_GETNAME,MAXMODULELABELLENGTH,(LPARAM)protoLabel); diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index 2f16cee51e..2cc8039052 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -994,50 +994,11 @@ void SmileyCategoryListType::AddAllProtocolsAsCategory(void) if (lpcp == CALLSERVICE_NOTFOUND) lpcp = CP_ACP; - PROTOCOLDESCRIPTOR **protoList; PROTOACCOUNT **accList; int protoCount; - - if (ProtoEnumAccounts(&protoCount, &accList) == CALLSERVICE_NOTFOUND || (protoCount > 0 && accList[0]->cbSize == 0)) - { - CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&protoCount, (LPARAM)&protoList); - for (int i = 0; i < protoCount; i++) - { - if (protoList[i]->type != PROTOTYPE_PROTOCOL) continue; - - if (IsSmileyProto(protoList[i]->szName)) - { - const char* packnam = protoList[i]->szName; - if (strcmp(packnam, "JABBER") == 0) - packnam = "JGMail"; - else if (strstr(packnam, "SIP") != NULL) - packnam = "MSN"; - - char path[MAX_PATH]; - mir_snprintf(path, sizeof(path), "Smileys\\nova\\%s.msl", packnam); - - bkstring paths = A2T_SM(path), patha; - pathToAbsolute(paths, patha); - - if (_taccess(patha.c_str(), 0) != 0) - paths = defaultFile; - - char protoName[128]; - CallProtoService(protoList[i]->szName, PS_GETNAME, sizeof(protoName), (LPARAM)protoName); - - - displayName = A2W_SM(protoName, lpcp); - - tname = A2T_SM(protoList[i]->szName); - AddCategory(tname, displayName, smcProto, paths); - } - } - } - else - { - for (int i = 0; i < protoCount; i++) - AddAccountAsCategory(accList[i], defaultFile); - } + ProtoEnumAccounts(&protoCount, &accList); + for (int i = 0; i < protoCount; i++) + AddAccountAsCategory(accList[i], defaultFile); HANDLE hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDFIRST, 0, 0); while (hContact != NULL) diff --git a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp index 5e85f2d841..4075dde869 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp @@ -39,7 +39,6 @@ INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L PROTOACCOUNT** proto; int protoCount; ProtoEnumAccounts(&protoCount, &proto); - CallService(MS_PROTO_ENUMPROTOCOLS,(WPARAM)&protoCount,(LPARAM)&proto); DWORD protoModeMsgFlags = 0; for ( i=0; i < protoCount; i++ ) { diff --git a/plugins/StopSpamMod/src/options.cpp b/plugins/StopSpamMod/src/options.cpp index 76e448e84b..4bd0886a88 100755 --- a/plugins/StopSpamMod/src/options.cpp +++ b/plugins/StopSpamMod/src/options.cpp @@ -173,12 +173,12 @@ INT_PTR CALLBACK ProtoDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { TranslateDialogDefault(hwnd); int n; - PROTOCOLDESCRIPTOR** pppd; - if(!CallService(MS_PROTO_ENUMPROTOCOLS, (LPARAM)&n, (WPARAM)&pppd)) + PROTOACCOUNT **pppd; + if(!ProtoEnumAccounts(&n, &pppd)) for(int i = 0; i < n; ++i) { - SendDlgItemMessageA(hwnd, (ProtoInList(pppd[i]->szName) ? ID_USEDPROTO : ID_ALLPROTO), - LB_ADDSTRING, 0, (LPARAM)pppd[i]->szName); + SendDlgItemMessageA(hwnd, (ProtoInList(pppd[i]->szModuleName) ? ID_USEDPROTO : ID_ALLPROTO), + LB_ADDSTRING, 0, (LPARAM)pppd[i]->szModuleName); } } return TRUE; diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index ceb4a223b5..b106d76fac 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -2211,7 +2211,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA for (i = 0; i < count; i++) { - if (accs[i]->type == PROTOTYPE_PROTOCOL && CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) != 0) + if (CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) != 0) { tvi.item.pszText = accs[i]->tszAccountName; tvi.item.stateMask = TVIS_STATEIMAGEMASK; diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index c6c0b45e79..ab80715591 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -709,39 +709,31 @@ BOOL CTooltipNotify::ProtosDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP // enum protocols currently running int iProtoCount = 0; - PROTOCOLDESCRIPTOR **ppProtos = 0; - ::CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&iProtoCount, (LPARAM)&ppProtos); + PROTOACCOUNT **ppProtos = 0; + ProtoEnumAccounts(&iProtoCount, &ppProtos); // and fill in the list - int iNonProtoCount = 0; for (int i=0; i < iProtoCount; i++) { - if (ppProtos[i]->type == PROTOTYPE_PROTOCOL) - { - LV_ITEM lvi; + LV_ITEM lvi; - lvi.mask = LVIF_TEXT; - lvi.iSubItem = 0; - lvi.iItem = i; - lvi.lParam = i; + lvi.mask = LVIF_TEXT; + lvi.iSubItem = 0; + lvi.iItem = i; + lvi.lParam = i; - WCHAR wszProto[128]; - long lLen = MultiByteToWideChar(CP_ACP, 0, ppProtos[i]->szName, - (int)strlen(ppProtos[i]->szName), wszProto, ARRAY_SIZE(wszProto)); - wszProto[lLen] = L'\0'; + WCHAR wszProto[128]; + long lLen = MultiByteToWideChar(CP_ACP, 0, ppProtos[i]->szModuleName, + (int)strlen(ppProtos[i]->szModuleName), wszProto, ARRAY_SIZE(wszProto)); + wszProto[lLen] = L'\0'; - lvi.pszText = wszProto; + lvi.pszText = wszProto; - int new_item = ListView_InsertItem(GetDlgItem(hDlg,IDC_PROTOS),&lvi); + int new_item = ListView_InsertItem(GetDlgItem(hDlg,IDC_PROTOS),&lvi); - BYTE bProtoState = ReadSettingByte(ppProtos[i]->szName, ProtoUserBit|ProtoIntBit); - BOOL bProtoEnabled = (bProtoState & ProtoUserBit) != 0; - ListView_SetCheckState(GetDlgItem(hDlg,IDC_PROTOS), i-iNonProtoCount, bProtoEnabled); - } - else - { - iNonProtoCount++; - } + BYTE bProtoState = ReadSettingByte(ppProtos[i]->szModuleName, ProtoUserBit|ProtoIntBit); + BOOL bProtoEnabled = (bProtoState & ProtoUserBit) != 0; + ListView_SetCheckState(GetDlgItem(hDlg,IDC_PROTOS), i, bProtoEnabled); } return TRUE; diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp index 4f8b641691..c9da4f453d 100644 --- a/plugins/UserInfoEx/src/classPsTreeItem.cpp +++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp @@ -322,24 +322,17 @@ HICON CPsTreeItem::ProtoIcon() { for (i = 0; i < ProtoCount; i++) { - if (pa[i]->type == PROTOTYPE_PROTOCOL) + if (!mir_tcsnicmp(pa[i]->tszAccountName, _A2T(_pszName), mir_tcslen(pa[i]->tszAccountName))) { - TCHAR *ptszName = mir_a2t(_pszName); - if (!mir_tcsnicmp(pa[i]->tszAccountName, ptszName, mir_tcslen(pa[i]->tszAccountName))) - { - HICON hIco; - CHAR szIconID[MAX_PATH]; - - mir_snprintf(szIconID, SIZEOF(szIconID), "core_status_%s1", pa[i]->szModuleName); - hIco = IcoLib_GetIcon(szIconID); - if (!hIco) - { - hIco = (HICON)CallProtoService(pa[i]->szModuleName, PS_LOADICON, PLI_PROTOCOL, NULL); - } - MIR_FREE (ptszName); - return hIco; - } - MIR_FREE (ptszName); + HICON hIco; + CHAR szIconID[MAX_PATH]; + + mir_snprintf(szIconID, SIZEOF(szIconID), "core_status_%s1", pa[i]->szModuleName); + hIco = IcoLib_GetIcon(szIconID); + if (!hIco) + hIco = (HICON)CallProtoService(pa[i]->szModuleName, PS_LOADICON, PLI_PROTOCOL, NULL); + + return hIco; } } } diff --git a/plugins/UserInfoEx/src/commonheaders.h b/plugins/UserInfoEx/src/commonheaders.h index 849e22eb5e..fa820867fd 100644 --- a/plugins/UserInfoEx/src/commonheaders.h +++ b/plugins/UserInfoEx/src/commonheaders.h @@ -224,7 +224,7 @@ static FORCEINLINE BOOL IsProtoLoaded(LPSTR pszProto) } static FORCEINLINE BOOL IsProtoAccountEnabled(PROTOACCOUNT *pAcc) { - return ((pAcc->type == PROTOTYPE_PROTOCOL) && pAcc->bIsEnabled && IsProtoLoaded(pAcc->szModuleName)); + return (pAcc->bIsEnabled && IsProtoLoaded(pAcc->szModuleName)); } typedef HRESULT (STDAPICALLTYPE *pfnDwmIsCompositionEnabled)(BOOL *); diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index 09537a4b2a..71901c8e7f 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -120,7 +120,7 @@ public: }; private: - PROTOCOLDESCRIPTOR **_pPd; + PROTOACCOUNT **_pPd; INT _numProto; BOOLEAN _bExitAfterUploading; HANDLE _hUploading; @@ -139,11 +139,11 @@ private: CPsTreeItem *pti; // check if icq is online - if (!IsProtoOnline((*_pPd)->szName)) { + if (!IsProtoOnline((*_pPd)->szModuleName)) { TCHAR szMsg[MAX_PATH]; LPTSTR ptszProto; - ptszProto = mir_a2t((*_pPd)->szName); + ptszProto = mir_a2t((*_pPd)->szModuleName); mir_sntprintf(szMsg, SIZEOF(szMsg), TranslateT("Protocol '%s' is offline"), ptszProto); mir_free(ptszProto); @@ -152,7 +152,7 @@ private: } // start uploading process else { - _hUploading = (HANDLE)CallProtoService((*_pPd)->szName, PS_CHANGEINFOEX, CIXT_FULL, NULL); + _hUploading = (HANDLE)CallProtoService((*_pPd)->szModuleName, PS_CHANGEINFOEX, CIXT_FULL, NULL); if (_hUploading && _hUploading != (HANDLE)CALLSERVICE_NOTFOUND) { EnableWindow(_pPs->pTree->Window(), FALSE); if (pti = _pPs->pTree->CurrentItem()) { @@ -160,7 +160,7 @@ private: } EnableWindow(GetDlgItem(_pPs->hDlg, IDOK), FALSE); EnableWindow(GetDlgItem(_pPs->hDlg, IDAPPLY), FALSE); - mir_snprintf(_pPs->szUpdating, SIZEOF(_pPs->szUpdating), "%s (%s)", Translate("Uploading"), (*_pPd)->szName); + mir_snprintf(_pPs->szUpdating, SIZEOF(_pPs->szUpdating), "%s (%s)", Translate("Uploading"), (*_pPd)->szModuleName); ShowWindow(GetDlgItem(_pPs->hDlg, TXT_UPDATING), SW_SHOW); SetTimer(_pPs->hDlg, TIMERID_UPDATING, 100, NULL); return 0; @@ -189,9 +189,9 @@ public: INT UploadFirst() { // create a list of all protocols which support uploading contact information - if (CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&_numProto, (LPARAM)&_pPd)) { + if ( ProtoEnumAccounts(&_numProto, &_pPd)) return _bExitAfterUploading ? UPLOAD_FINISH_CLOSE : UPLOAD_FINISH; - } + return UploadNext(); } @@ -227,13 +227,11 @@ public: { CHAR str[MAXMODULELABELLENGTH]; while (_pPd && *_pPd && _numProto-- > 0) { - if ((*_pPd)->type == PROTOTYPE_PROTOCOL) { - mir_strncpy(str, (*_pPd)->szName, MAXMODULELABELLENGTH); - mir_strncat(str, PS_CHANGEINFOEX, MAXMODULELABELLENGTH); - if (ServiceExists(str) && !Upload()) { - _pPd++; - return UPLOAD_CONTINUE; - } + mir_strncpy(str, (*_pPd)->szModuleName, MAXMODULELABELLENGTH); + mir_strncat(str, PS_CHANGEINFOEX, MAXMODULELABELLENGTH); + if (ServiceExists(str) && !Upload()) { + _pPd++; + return UPLOAD_CONTINUE; } _pPd++; } @@ -575,28 +573,6 @@ static INT InitDetails(WPARAM wParam, LPARAM lParam) odp.hIcon = (HICON)ICONINDEX(IDI_TREE_NOTES); AddPage(wParam, (LPARAM)&odp); } - /* Editing owner details no longer supported due to leak of common interface for all protocols. - else - if (!(pPsh->_dwFlags & PSTVF_INITICONS)) - { - PROTOCOLDESCRIPTOR **pd; - INT ProtoCount, i; - CHAR str[MAXMODULELABELLENGTH]; - - odp.flags |= PSPF_PROTOPREPENDED; - - // create a list of all protocols which support uploading contact information - if (!CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&ProtoCount, (LPARAM)&pd)) { - for (i = 0; i < ProtoCount; i++) { - if (pd[i]->type == PROTOTYPE_PROTOCOL) { - pPsh->_pszProto = pd[i]->szName; - mir_snprintf(str, MAXMODULELABELLENGTH, "%s"PS_CHANGEINFOEX, pd[i]->szName); - if (ServiceExists(str)) AddProtocolPages(odp, wParam, pd[i]->szName); - } - } - } - } - */ } } return 0; @@ -634,31 +610,29 @@ VOID DlgContactInfoInitTreeIcons() // avoid pages from loading doubled if (!(bInitIcons & INIT_ICONS_CONTACT)) { LPCSTR pszContactProto = NULL; - PROTOCOLDESCRIPTOR **pd; + PROTOACCOUNT **pd; INT ProtoCount = 0; psh._dwFlags |= PSF_PROTOPAGESONLY_INIT; // enumerate all protocols - if (!CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&ProtoCount, (LPARAM)&pd)) { + if ( !ProtoEnumAccounts(&ProtoCount, &pd)) { for (i = 0; i < ProtoCount; i++) { - if (pd[i]->type == PROTOTYPE_PROTOCOL) { - // enumerate all contacts - for (psh._hContact = DB::Contact::FindFirst(); - psh._hContact != NULL; - psh._hContact = DB::Contact::FindNext(psh._hContact)) - { - // compare contact's protocol to the current one, to add - pszContactProto = DB::Contact::Proto(psh._hContact); - if ((INT_PTR)pszContactProto != CALLSERVICE_NOTFOUND && !mir_strcmp(pd[i]->szName, pszContactProto)) { - // call a notification for the contact to retrieve all protocol specific tree items - NotifyEventHooks(ghDetailsInitEvent, (WPARAM)&psh, (LPARAM)psh._hContact); - if (psh._pPages) { - psh.Free_pPages(); - psh._dwFlags = PSTVF_INITICONS|PSF_PROTOPAGESONLY; - } - break; + // enumerate all contacts + for (psh._hContact = DB::Contact::FindFirst(); + psh._hContact != NULL; + psh._hContact = DB::Contact::FindNext(psh._hContact)) + { + // compare contact's protocol to the current one, to add + pszContactProto = DB::Contact::Proto(psh._hContact); + if ((INT_PTR)pszContactProto != CALLSERVICE_NOTFOUND && !mir_strcmp(pd[i]->szModuleName, pszContactProto)) { + // call a notification for the contact to retrieve all protocol specific tree items + NotifyEventHooks(ghDetailsInitEvent, (WPARAM)&psh, (LPARAM)psh._hContact); + if (psh._pPages) { + psh.Free_pPages(); + psh._dwFlags = PSTVF_INITICONS|PSF_PROTOPAGESONLY; } + break; } } } diff --git a/plugins/Utils/mir_options.cpp b/plugins/Utils/mir_options.cpp index b08f95a4ed..441fa4cb6a 100644 --- a/plugins/Utils/mir_options.cpp +++ b/plugins/Utils/mir_options.cpp @@ -245,9 +245,6 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha for (int i = 0; i < count; i++) { PROTOACCOUNT *p = protos[i]; - if (p->type != PROTOTYPE_PROTOCOL) - continue; - if (p->szModuleName == NULL || p->szModuleName[0] == '\0') continue; diff --git a/plugins/ZeroNotification/src/main.cpp b/plugins/ZeroNotification/src/main.cpp index e612a636c8..70bda90b6f 100644 --- a/plugins/ZeroNotification/src/main.cpp +++ b/plugins/ZeroNotification/src/main.cpp @@ -132,21 +132,18 @@ static int SetNotify(const long status){ static int ProtoAck(WPARAM wParam, LPARAM lParam) { ACKDATA *ack=(ACKDATA*)lParam; - PROTOCOLDESCRIPTOR **protos; + PROTOACCOUNT **protos; //quit if not status event if ( ack->type == ACKTYPE_STATUS && ack->result == ACKRESULT_SUCCESS ) { long status = 0; - int i, count; - CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM) & count, (LPARAM) & protos); + int count; + ProtoEnumAccounts(&count, &protos); - for (i = 0; i < count; i++) { - status = status | Proto_Status2Flag(CallProtoService(protos[i]->szName, PS_GETSTATUS, 0, 0)); - } + for (int i=0; i < count; i++) + status = status | Proto_Status2Flag(CallProtoService(protos[i]->szModuleName, PS_GETSTATUS, 0, 0)); SetNotify(status); - - return 0; } return 0; -- cgit v1.2.3