diff options
Diffstat (limited to 'plugins')
203 files changed, 720 insertions, 964 deletions
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index 93a2d008e8..d551874527 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -336,14 +336,14 @@ static int ModulesLoaded(WPARAM, LPARAM) int accCount;
PROTOACCOUNT **accs = NULL;
- ProtoEnumAccounts(&accCount, &accs);
+ Proto_EnumAccounts(&accCount, &accs);
if (fei != NULL) {
LoadDefaultInfo();
int protoCount;
PROTOCOLDESCRIPTOR **proto;
- CallService(MS_PROTO_ENUMPROTOS, (WPARAM)&protoCount, (LPARAM)&proto);
+ Proto_EnumProtocols(&protoCount, &proto);
for (int i = 0; i < protoCount; i++)
LoadProtoInfo(proto[i]);
for (int i = 0; i < accCount; i++)
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index 9e1f3a45f3..0f7793b45f 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -75,7 +75,7 @@ static void RemoveProtoPic(const char *szProto) if (p.szProtoname == NULL) continue; - PROTOACCOUNT *pdescr = ProtoGetAccount(p.szProtoname); + PROTOACCOUNT *pdescr = Proto_GetAccount(p.szProtoname); if (pdescr == NULL && mir_strcmp(p.szProtoname, szProto)) continue; @@ -140,7 +140,7 @@ static void SetProtoPic(char *szProto) mir_strncpy(szProtoname, szProto, mir_strlen(szProto) - mir_strlen("accounts")); mir_strcpy(szProtoname, strrchr(szProtoname, ' ') + 1); for (int i = 0; i < g_ProtoPictures.getCount(); i++) { - PROTOACCOUNT* pdescr = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)g_ProtoPictures[i].szProtoname); + PROTOACCOUNT* pdescr = Proto_GetAccount(g_ProtoPictures[i].szProtoname); if (pdescr == NULL && mir_strcmp(g_ProtoPictures[i].szProtoname, szProto)) continue; @@ -1008,7 +1008,7 @@ static INT_PTR CALLBACK DlgProcAvatarProtoInfo(HWND hwndDlg, UINT msg, WPARAM wP PROTOACCOUNT **accs; int count, num = 0; - ProtoEnumAccounts(&count, &accs); + Proto_EnumAccounts(&count, &accs); for (int i = 0; i < count; i++) { if (!ProtoServiceExists(accs[i]->szModuleName, PS_GETMYAVATAR)) continue; diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp index 1f3fd7441b..5162f283f6 100644 --- a/plugins/AVS/src/services.cpp +++ b/plugins/AVS/src/services.cpp @@ -225,7 +225,7 @@ static int InternalRemoveMyAvatar(char *protocol) PROTOACCOUNT **accs;
int i, count;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
for (i = 0; i < count; i++) {
if (!ProtoServiceExists(accs[i]->szModuleName, PS_SETMYAVATAR))
continue;
@@ -528,7 +528,7 @@ static int InternalSetMyAvatar(char *protocol, TCHAR *szFinalName, SetMyAvatarHo else {
int count;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
for (int i = 0; i < count; i++) {
if (!ProtoServiceExists(accs[i]->szModuleName, PS_SETMYAVATAR))
continue;
@@ -635,7 +635,7 @@ INT_PTR avSetMyAvatar(char* protocol, TCHAR* tszPath) int count;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
for (int i = 0; i < count; i++) {
if (!ProtoServiceExists(accs[i]->szModuleName, PS_SETMYAVATAR))
continue;
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index a1863a9f42..030696b7fc 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -99,7 +99,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) MyPathToAbsolute(tszValue, tszFilename);
if (!strstr(szProto, "Global avatar for")) {
- PROTOACCOUNT* pdescr = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)szProto);
+ PROTOACCOUNT* pdescr = Proto_GetAccount(szProto);
if (pdescr == NULL)
return -1;
char key[MAX_PATH];
diff --git a/plugins/Actman/iac_contact.pas b/plugins/Actman/iac_contact.pas index 55afcfba2f..7c17334f15 100644 --- a/plugins/Actman/iac_contact.pas +++ b/plugins/Actman/iac_contact.pas @@ -116,7 +116,7 @@ var is_chat:boolean;
begin
result:=0;
- proto:=GetContactProtoAcc(hContact);
+ proto:=Proto_GetBaseAccountName(hContact);
if proto<>nil then
begin
is_chat:=IsChat(hContact);
diff --git a/plugins/Actman/iac_dbrw.pas b/plugins/Actman/iac_dbrw.pas index 7ddbe0b61c..f9faa18293 100644 --- a/plugins/Actman/iac_dbrw.pas +++ b/plugins/Actman/iac_dbrw.pas @@ -175,7 +175,7 @@ begin IntToStr(sbuf,WorkData.LastResult);
end;
- proto:=GetContactProtoAcc(hContact);
+ proto:=Proto_GetBaseAccountName(hContact);
// now need to process module
if (flags and ACF_RW_MODULE)<>0 then
begin
diff --git a/plugins/Actman/iac_inout.pas b/plugins/Actman/iac_inout.pas index a9930797ab..5ae7a1cedf 100644 --- a/plugins/Actman/iac_inout.pas +++ b/plugins/Actman/iac_inout.pas @@ -268,7 +268,7 @@ begin if hContact=0 then exit;
- p:=GetContactProtoAcc(hContact);
+ p:=Proto_GetBaseAccountName(hContact);
if DBReadByte(hContact,p,'ChatRoom',0)<>1 then
begin
WidetoUTF8(last,blob);
diff --git a/plugins/AddContactPlus/src/addcontact.cpp b/plugins/AddContactPlus/src/addcontact.cpp index b56d2f7ce0..a318776dfe 100644 --- a/plugins/AddContactPlus/src/addcontact.cpp +++ b/plugins/AddContactPlus/src/addcontact.cpp @@ -89,9 +89,9 @@ bool AddContactDlgAccounts(HWND hdlg, AddDialogParam *acs) PROTOACCOUNT** pAccounts;
int iRealAccCount, iAccCount = 0;
- ProtoEnumAccounts(&iRealAccCount, &pAccounts);
+ Proto_EnumAccounts(&iRealAccCount, &pAccounts);
for (int i = 0; i < iRealAccCount; i++) {
- if (!IsAccountEnabled(pAccounts[i]))
+ if (!Proto_IsAccountEnabled(pAccounts[i]))
continue;
DWORD dwCaps = (DWORD)CallProtoService(pAccounts[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
@@ -120,7 +120,7 @@ bool AddContactDlgAccounts(HWND hdlg, AddDialogParam *acs) HDC hdc = GetDC(hdlg);
SelectObject(hdc, (HFONT)SendDlgItemMessage(hdlg, IDC_PROTO, WM_GETFONT, 0, 0));
for (int i = 0; i < iRealAccCount; i++) {
- if (!IsAccountEnabled(pAccounts[i])) continue;
+ if (!Proto_IsAccountEnabled(pAccounts[i])) continue;
DWORD dwCaps = (DWORD)CallProtoService(pAccounts[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
if (!(dwCaps & PF1_BASICSEARCH) && !(dwCaps & PF1_EXTSEARCH) && !(dwCaps & PF1_SEARCHBYEMAIL) && !(dwCaps & PF1_SEARCHBYNAME))
continue;
diff --git a/plugins/AddContactPlus/src/main.cpp b/plugins/AddContactPlus/src/main.cpp index a23b231be3..d134effb4d 100644 --- a/plugins/AddContactPlus/src/main.cpp +++ b/plugins/AddContactPlus/src/main.cpp @@ -76,9 +76,9 @@ static int OnAccListChanged(WPARAM, LPARAM) PROTOACCOUNT** pAccounts;
int iRealAccCount, iAccCount = 0;
- ProtoEnumAccounts(&iRealAccCount, &pAccounts);
+ Proto_EnumAccounts(&iRealAccCount, &pAccounts);
for (int i = 0; i < iRealAccCount; i++) {
- if (!IsAccountEnabled(pAccounts[i]))
+ if (!Proto_IsAccountEnabled(pAccounts[i]))
continue;
DWORD dwCaps = (DWORD)CallProtoService(pAccounts[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
diff --git a/plugins/Alarms/src/stdafx.h b/plugins/Alarms/src/stdafx.h index ca28dbf879..dc0eac1ba0 100644 --- a/plugins/Alarms/src/stdafx.h +++ b/plugins/Alarms/src/stdafx.h @@ -11,7 +11,7 @@ #include <m_utils.h>
#include <m_options.h>
#include <m_skin.h>
-#include <m_protomod.h>
+#include <m_protosvc.h>
#include <m_langpack.h>
#include <m_popup.h>
#include <m_idle.h>
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index 4b0ada0354..207cdbaad2 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -54,10 +54,11 @@ static bool AnyProtoHasCaps(DWORD caps1) {
int nProtoCount;
PROTOACCOUNT **protos;
- if (!ProtoEnumAccounts(&nProtoCount, &protos))
- for(int i=0;i<nProtoCount;++i)
- if (CallProtoService(protos[i]->szModuleName,PS_GETCAPS,(WPARAM)PFLAGNUM_1,0)&caps1)
- return true; /* CALLSERVICE_NOTFOUND also handled gracefully */
+ Proto_EnumAccounts(&nProtoCount, &protos);
+
+ for(int i=0;i<nProtoCount;++i)
+ 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/BasicHistory/src/BasicHistory.cpp b/plugins/BasicHistory/src/BasicHistory.cpp index b77e6cdc18..a52f719a5b 100644 --- a/plugins/BasicHistory/src/BasicHistory.cpp +++ b/plugins/BasicHistory/src/BasicHistory.cpp @@ -185,7 +185,7 @@ void InitIcolib() {
}
-HICON LoadIconEx(int iconId, int big)
+HICON LoadIconEx(int iconId, bool big)
{
for (int i=0; i < SIZEOF(iconList); i++)
if ( iconList[i].defIconID == iconId)
diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp index 6dcb35a69d..c1c707561e 100644 --- a/plugins/BasicHistory/src/EventList.cpp +++ b/plugins/BasicHistory/src/EventList.cpp @@ -434,10 +434,10 @@ std::wstring EventList::GetMyName() inline std::wstring GetProtocolName(MCONTACT hContact)
{
- char* ac = (char *)CallService(MS_PROTO_GETCONTACTBASEACCOUNT, hContact, 0);
+ char* ac = Proto_GetBaseAccountName(hContact);
std::wstring proto1;
if (ac != NULL) {
- PROTOACCOUNT* acnt = ProtoGetAccount(ac);
+ PROTOACCOUNT* acnt = Proto_GetAccount(ac);
if (acnt != NULL && acnt->szModuleName != NULL) {
wchar_t* proto = mir_a2u(acnt->szProtoName);
proto1 = proto;
diff --git a/plugins/BasicHistory/src/stdafx.h b/plugins/BasicHistory/src/stdafx.h index ffeb27e3ed..12d674ff0e 100644 --- a/plugins/BasicHistory/src/stdafx.h +++ b/plugins/BasicHistory/src/stdafx.h @@ -89,4 +89,4 @@ #define HISTORY_HK_IMPDAT 116
#define HISTORY_HK_ALLCONTACTS 117
-HICON LoadIconEx(int iconId, int big = 0);
+HICON LoadIconEx(int iconId, bool big = false);
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index 5f9a7314ac..61bafe3dc6 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -615,7 +615,7 @@ static TCHAR *VariablesBossKey(ARGUMENTSINFO *ai) { static int EnumProtos(WPARAM, LPARAM)
{
- ProtoEnumAccounts(&protoCount, &proto);
+ Proto_EnumAccounts(&protoCount, &proto);
delete[] oldStatus;
delete[] oldStatusMsg;
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index f445d8de7e..6d788ebe4c 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -96,7 +96,7 @@ static int OnCreateMenuItems(WPARAM, LPARAM) { int protoCount; PROTOACCOUNT** pdesc; - ProtoEnumAccounts(&protoCount, &pdesc); + Proto_EnumAccounts(&protoCount, &pdesc); for (int i = 0; i < protoCount; i++) if (ProtoServiceExists(pdesc[i]->szModuleName, PS_SETCUSTOMSTATUSEX)) @@ -179,7 +179,7 @@ void SetStatus(WORD code, StatusItem* item, char *szAccName) if (code == IDCLOSE) return; - PROTOACCOUNT* pdescr = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)szAccName); + PROTOACCOUNT* pdescr = Proto_GetAccount(szAccName); if (pdescr == NULL) return; @@ -225,7 +225,7 @@ INT_PTR showList(WPARAM, LPARAM, LPARAM param) void addProtoStatusMenuItem(char *protoName) { - PROTOACCOUNT *pdescr = ProtoGetAccount(protoName); + PROTOACCOUNT *pdescr = Proto_GetAccount(protoName); if (pdescr == NULL) return; @@ -321,7 +321,7 @@ CSWindow::~CSWindow() void CSWindow::initIcons() { - PROTOACCOUNT *pdescr = ProtoGetAccount(m_protoName); + PROTOACCOUNT *pdescr = Proto_GetAccount(m_protoName); if (pdescr == NULL) return; @@ -471,7 +471,7 @@ void CSAMWindow::exec() void CSAMWindow::setCombo() { - PROTOACCOUNT *pdescr = ProtoGetAccount(m_parent->m_protoName); + PROTOACCOUNT *pdescr = Proto_GetAccount(m_parent->m_protoName); if (pdescr == NULL) return; @@ -567,7 +567,7 @@ void CSAMWindow::checkItemValidity() GetDlgItemText(m_handle, IDC_MESSAGE, tszInputMessage, SIZEOF(tszInputMessage)); - PROTOACCOUNT* pdescr = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)m_parent->m_protoName); + PROTOACCOUNT *pdescr = Proto_GetAccount(m_parent->m_protoName); if (pdescr == NULL) return; diff --git a/plugins/Clist_blind/src/clistopts.cpp b/plugins/Clist_blind/src/clistopts.cpp index 1517723a09..1c5005b26f 100644 --- a/plugins/Clist_blind/src/clistopts.cpp +++ b/plugins/Clist_blind/src/clistopts.cpp @@ -117,9 +117,9 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP int count;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
for (int i = 0; i < count; i++) {
- if (!IsAccountEnabled(accs[i]) || CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
+ if (!Proto_IsAccountEnabled(accs[i]) || CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
continue;
item = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_ADDSTRING, 0, (LPARAM)accs[i]->tszAccountName);
diff --git a/plugins/Clist_blind/src/init.cpp b/plugins/Clist_blind/src/init.cpp index 2b262ff84c..bf67a5b3d8 100644 --- a/plugins/Clist_blind/src/init.cpp +++ b/plugins/Clist_blind/src/init.cpp @@ -474,7 +474,7 @@ TCHAR *GetProtoName(struct ClcContact *item) return proto_name;
}
- acc = ProtoGetAccount(item->proto);
+ acc = Proto_GetAccount(item->proto);
if (acc == NULL)
{
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 3cdf2a23d3..aaf414c3ad 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -482,7 +482,7 @@ static int _GetNetVisibleProtoCount() {
int i, count, netProtoCount;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
for (i = 0, netProtoCount = 0; i < count; i++) {
if (pcli->pfnGetProtocolVisibility(accs[i]->szModuleName) == 0)
continue;
@@ -620,7 +620,7 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L int AccNum, i, siS, siV, item;
PROTOACCOUNT **acc;
- ProtoEnumAccounts(&AccNum, &acc);
+ Proto_EnumAccounts(&AccNum, &acc);
for (siS = siV = -1, i = 0; i < AccNum; i++)
{
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp index 4e30d4d18c..466948d15f 100644 --- a/plugins/Clist_modern/src/modern_clistsettings.cpp +++ b/plugins/Clist_modern/src/modern_clistsettings.cpp @@ -203,7 +203,7 @@ void cliCheckCacheItem(ClcCacheEntry *pdnce) pdnce->getName();
else if (pdnce->isUnknown && pdnce->m_cache_cszProto && pdnce->m_bProtoNotExists == TRUE && g_flag_bOnModulesLoadedCalled) {
- if (ProtoGetAccount(pdnce->m_cache_cszProto) == NULL) {
+ if (Proto_GetAccount(pdnce->m_cache_cszProto) == NULL) {
pdnce->m_bProtoNotExists = FALSE;
pdnce->getName();
}
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index 49725c9527..a0430c6172 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -382,7 +382,7 @@ VOID CALLBACK cliTrayCycleTimerProc(HWND, UINT, UINT_PTR, DWORD) PROTOACCOUNT **acc;
int AccNum;
- ProtoEnumAccounts(&AccNum, &acc);
+ Proto_EnumAccounts(&AccNum, &acc);
// looking for the appropriate account to show its icon
int t = pcli->cycleStep;
@@ -453,7 +453,7 @@ int GetGoodAccNum(bool *bDiffers, bool *bConn) {
PROTOACCOUNT **acc;
int AccNum, i;
- ProtoEnumAccounts(&AccNum, &acc);
+ Proto_EnumAccounts(&AccNum, &acc);
if (bConn)
*bConn = FALSE;
@@ -535,7 +535,7 @@ int cliTrayIconInit(HWND hwnd) if (!szProto)
break;
- PROTOACCOUNT *pa = ProtoGetAccount(szProto);
+ PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (!pa || !pa->ppro)
pcli->pfnTrayIconAdd(hwnd, NULL, NULL, CListTray_GetGlobalStatus(0, 0));
else
@@ -554,7 +554,7 @@ int cliTrayIconInit(HWND hwnd) case TRAY_ICON_MODE_ALL:
PROTOACCOUNT **acc;
int AccNum, i;
- ProtoEnumAccounts(&AccNum, &acc);
+ Proto_EnumAccounts(&AccNum, &acc);
for (i = AccNum; i--;) {
if (!acc[i]->bIsVirtual && acc[i]->bIsVisible && !acc[i]->bDynDisabled && acc[i]->ppro)
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 3f8bc898f0..8c663dfcd0 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -911,7 +911,7 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName) if (szAccoName[0]) {
// second try to find by protocol name
- PROTOACCOUNT *acc = ProtoGetAccount(szAccoName);
+ PROTOACCOUNT *acc = Proto_GetAccount(szAccoName);
if (acc && !acc->bOldProto) {
mir_sntprintf(fileFull, SIZEOF(fileFull), _T("%s\\Icons\\proto_conn_%S.dll"), tszFolderPath, acc->szProtoName);
if (count = ExtractIconEx(fileFull, -1, NULL, NULL, 1))
@@ -953,7 +953,7 @@ static HICON CLUI_GetConnectingIconForProto(char *szAccoName, int idx) if (szAccoName[0]) {
// second try to find by protocol name
- PROTOACCOUNT *acc = ProtoGetAccount(szAccoName);
+ PROTOACCOUNT *acc = Proto_GetAccount(szAccoName);
if (acc && !acc->bOldProto) {
mir_sntprintf(szFullPath, SIZEOF(szFullPath), _T("proto_conn_%S.dll"), acc->szProtoName);
if (hIcon = CLUI_LoadIconFromExternalFile(szFullPath, idx))
@@ -1081,10 +1081,10 @@ void CLUI_DisconnectAll() {
PROTOACCOUNT **accs;
int nProtoCount;
- ProtoEnumAccounts(&nProtoCount, &accs);
+ Proto_EnumAccounts(&nProtoCount, &accs);
for (int nProto = 0; nProto < nProtoCount; nProto++)
- if (IsAccountEnabled(accs[nProto]))
+ if (Proto_IsAccountEnabled(accs[nProto]))
CallProtoService(accs[nProto]->szModuleName, PS_SETSTATUS, ID_STATUS_OFFLINE, 0);
}
diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp index 8cd7237eb1..272daa123c 100644 --- a/plugins/Clist_modern/src/modern_contact.cpp +++ b/plugins/Clist_modern/src/modern_contact.cpp @@ -84,7 +84,7 @@ int GetProtoIndex(char * szName) if (szName) {
PROTOACCOUNT **accs = NULL;
int accCount = 0;
- ProtoEnumAccounts(&accCount, &accs);
+ Proto_EnumAccounts(&accCount, &accs);
for (int i = 0; i < accCount; i++)
if (!mir_strcmpi(szName, accs[i]->szModuleName))
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index 0637c9a3bc..7d785529e3 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -172,7 +172,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) int protoCount;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&protoCount, &accs);
+ Proto_EnumAccounts(&protoCount, &accs);
if (protoCount == 0)
return 0;
@@ -800,7 +800,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa int protoCount;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&protoCount, &accs);
+ Proto_EnumAccounts(&protoCount, &accs);
bool first = true;
for (int pos = 0; pos < protoCount; pos++) {
diff --git a/plugins/Clist_modern/src/modern_statusbar_options.cpp b/plugins/Clist_modern/src/modern_statusbar_options.cpp index acf1c22e7e..7625191703 100644 --- a/plugins/Clist_modern/src/modern_statusbar_options.cpp +++ b/plugins/Clist_modern/src/modern_statusbar_options.cpp @@ -163,7 +163,7 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l int count;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
SendMessage(hwndComboBox, CB_ADDSTRING, 0, (LPARAM)TranslateT("<<Global>>"));
SendMessage(hwndComboBox, CB_SETITEMDATA, 0, 0);
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index 3a73313d86..9da5d24f42 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -216,7 +216,7 @@ static int FillDialog(HWND hwnd) ListView_InsertColumn(GetDlgItem(hwnd, IDC_PROTOCOLS), 0, &lvc);
// fill protocols...
- ProtoEnumAccounts(&protoCount, &accs);
+ Proto_EnumAccounts(&protoCount, &accs);
item.mask = LVIF_TEXT;
item.iItem = 1000;
diff --git a/plugins/Clist_nicer/src/clistopts.cpp b/plugins/Clist_nicer/src/clistopts.cpp index 73f65a6185..291431b238 100644 --- a/plugins/Clist_nicer/src/clistopts.cpp +++ b/plugins/Clist_nicer/src/clistopts.cpp @@ -108,9 +108,9 @@ INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP int count;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
for (int i = 0; i < count; i++) {
- if (!IsAccountEnabled(accs[i]) || CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
+ if (!Proto_IsAccountEnabled(accs[i]) || CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
continue;
item = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_ADDSTRING, 0, (LPARAM)accs[i]->tszAccountName);
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 0b48aae08d..3561a641f8 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -265,9 +265,9 @@ static void InitIcoLib() PROTOACCOUNT **accs = NULL; int p_count = 0; - ProtoEnumAccounts(&p_count, &accs); + Proto_EnumAccounts(&p_count, &accs); for (int k = 0; k < p_count; k++) { - if (!IsAccountEnabled(accs[k]) || CallProtoService(accs[k]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0) + if (!Proto_IsAccountEnabled(accs[k]) || CallProtoService(accs[k]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0) continue; TCHAR szDescr[128]; @@ -1731,7 +1731,7 @@ buttons_done: if (showOpts & 2) { TCHAR szName[64]; - PROTOACCOUNT *pa = ProtoGetAccount(szProto); + PROTOACCOUNT *pa = Proto_GetAccount(szProto); if (pa) { mir_tstrncpy(szName, pa->tszAccountName, SIZEOF(szName)); szName[SIZEOF(szName) - 1] = 0; diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp index 648f2b00f5..906ebbf6aa 100644 --- a/plugins/Clist_nicer/src/cluiservices.cpp +++ b/plugins/Clist_nicer/src/cluiservices.cpp @@ -73,7 +73,7 @@ void CluiProtocolStatusChanged(int, const char*) int protoCount;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&protoCount, &accs);
+ Proto_EnumAccounts(&protoCount, &accs);
if (protoCount == 0)
return;
diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp index cb915bdd73..7f1145226a 100644 --- a/plugins/Clist_nicer/src/contact.cpp +++ b/plugins/Clist_nicer/src/contact.cpp @@ -167,7 +167,7 @@ int __forceinline GetProtoIndex(char * szName) if (!szName)
return -1;
- PROTOACCOUNT *pa = ProtoGetAccount(szName);
+ PROTOACCOUNT *pa = Proto_GetAccount(szName);
return (pa == NULL) ? -1 : pa->iOrder;
}
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index 2c9b7f4e74..4349b1130d 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -280,7 +280,7 @@ void LoadExtBkSettingsFromDB() int protoCount;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&protoCount, &accs);
+ Proto_EnumAccounts(&protoCount, &accs);
for (i = 0; i < protoCount; i++) {
StatusItems_t *p = (StatusItems_t*)mir_alloc(sizeof(StatusItems_t));
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index 4d1414408c..3a89f5c938 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -178,7 +178,7 @@ static int FillDialog(HWND hwnd) // fill protocols...
- ProtoEnumAccounts( &protoCount, &accs );
+ Proto_EnumAccounts( &protoCount, &accs );
item.mask = LVIF_TEXT;
item.iItem = 1000;
for (i = 0; i < protoCount; i++) {
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 64ab262bf7..6931db6137 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -74,7 +74,7 @@ int AccountName2Protocol(const char *accountName, OUT char *uniqueProtocolName, {
int count;
PROTOACCOUNT **accounts = NULL;
- ProtoEnumAccounts(&count, &accounts);
+ Proto_EnumAccounts(&count, &accounts);
strncpy_s(uniqueProtocolName, length, accountName, _TRUNCATE);
@@ -217,7 +217,7 @@ void HandleStatusCommand(PCommand command, TArgument *argv, int argc, PReply rep int count;
PROTOACCOUNT **accounts = NULL;
- ProtoEnumAccounts(&count, &accounts);
+ Proto_EnumAccounts(&count, &accounts);
char pn[128];
@@ -328,7 +328,7 @@ void HandleAwayMsgCommand(PCommand command, TArgument *argv, int argc, PReply re char *awayMsg = argv[2];
int count = 0;
PROTOACCOUNT **accounts = NULL;
- ProtoEnumAccounts(&count, &accounts);
+ Proto_EnumAccounts(&count, &accounts);
CMStringA szReply;
int i;
@@ -1250,7 +1250,7 @@ void HandleProxyCommand(PCommand command, TArgument *argv, int argc, PReply repl int count = 0;
PROTOACCOUNT **accounts = NULL;
- ProtoEnumAccounts(&count, &accounts);
+ Proto_EnumAccounts(&count, &accounts);
int i;
int global = (mir_strcmp(protocol, "GLOBAL") == 0);
diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index 8dc0bc718a..2d458a31d3 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -881,7 +881,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.cbSize = sizeof(pd);
pd.szName = PLUGINNAME;
pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
//set all contacts to offline
for (MCONTACT hContact = db_find_first(PLUGINNAME); hContact != NULL; hContact = db_find_next(hContact, PLUGINNAME))
diff --git a/plugins/ConnectionNotify/src/stdafx.h b/plugins/ConnectionNotify/src/stdafx.h index 75b64b0148..b82329e376 100644 --- a/plugins/ConnectionNotify/src/stdafx.h +++ b/plugins/ConnectionNotify/src/stdafx.h @@ -12,7 +12,6 @@ #include <m_options.h>
#include <m_popup.h>
#include <m_utils.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_system.h>
diff --git a/plugins/CrashDumper/src/dumper.cpp b/plugins/CrashDumper/src/dumper.cpp index 8cd63e612a..35153a6954 100644 --- a/plugins/CrashDumper/src/dumper.cpp +++ b/plugins/CrashDumper/src/dumper.cpp @@ -302,11 +302,11 @@ static void GetProtocolStrings(CMString& buffer) int accCount;
int i, j;
- ProtoEnumAccounts(&accCount, &accList);
+ Proto_EnumAccounts(&accCount, &accList);
int protoCount;
PROTOCOLDESCRIPTOR **protoList;
- CallService(MS_PROTO_ENUMPROTOS, (WPARAM)&protoCount, (LPARAM)&protoList);
+ Proto_EnumProtocols(&protoCount, &protoList);
int protoCountMy = 0;
char** protoListMy = (char**)alloca((protoCount + accCount) * sizeof(char*));
@@ -333,7 +333,7 @@ static void GetProtocolStrings(CMString& buffer) for (i = 0; i < protoCountMy; i++)
if (!mir_strcmp(protoListMy[i], accList[j]->szProtoName)) {
protos[i].nloaded = accList[j]->bDynDisabled != 0;
- if (IsAccountEnabled(accList[j]))
+ if (Proto_IsAccountEnabled(accList[j]))
++protos[i].countse;
else
++protos[i].countsd;
diff --git a/plugins/CryptoPP/src/commonheaders.h b/plugins/CryptoPP/src/commonheaders.h index b5b5a9bb19..3da70a4494 100644 --- a/plugins/CryptoPP/src/commonheaders.h +++ b/plugins/CryptoPP/src/commonheaders.h @@ -36,7 +36,6 @@ #include <m_system.h>
#include <m_utils.h>
#include <m_langpack.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_utils.h>
#include <m_netlib.h>
diff --git a/plugins/CryptoPP/src/main.cpp b/plugins/CryptoPP/src/main.cpp index 8cb9bfa2b9..ebd54b4e21 100644 --- a/plugins/CryptoPP/src/main.cpp +++ b/plugins/CryptoPP/src/main.cpp @@ -57,7 +57,7 @@ extern "C" __declspec(dllexport) int Load() pd.cbSize = sizeof(pd);
pd.szName = (char*)szModuleName;
pd.type = PROTOTYPE_ENCRYPTION;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
// hook events
HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded);
diff --git a/plugins/CyrTranslit/src/TransliterationProtocol.cpp b/plugins/CyrTranslit/src/TransliterationProtocol.cpp index 27940f86ac..52eb90b6ef 100644 --- a/plugins/CyrTranslit/src/TransliterationProtocol.cpp +++ b/plugins/CyrTranslit/src/TransliterationProtocol.cpp @@ -32,7 +32,7 @@ void TransliterationProtocol::initialize() pd.cbSize = sizeof(pd);
pd.szName = MODULE_NAME;
pd.type = PROTOTYPE_TRANSLATION;
- CallService(MS_PROTO_REGISTERMODULE, 0, reinterpret_cast<LPARAM>(&pd));
+ Proto_RegisterModule(&pd);
CreateProtoServiceFunction(MODULE_NAME, PSS_MESSAGE, sendMessage);
}
@@ -62,14 +62,14 @@ INT_PTR TransliterationProtocol::sendMessage(WPARAM wParam, LPARAM lParam) {
CCSDATA *ccs = reinterpret_cast<CCSDATA*>(lParam);
if ( !MirandaContact::bIsActive(ccs->hContact))
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
LPARAM oldlParam = ccs->lParam;
bool msgProcessed = true;
TranslateMessageUTF(wParam, lParam);
- int ret = CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ int ret = Proto_ChainSend(wParam, ccs);
if (msgProcessed) {
mir_free(reinterpret_cast<void*>(ccs->lParam));
diff --git a/plugins/CyrTranslit/src/stdafx.h b/plugins/CyrTranslit/src/stdafx.h index 40f1692b52..ff94bd9471 100644 --- a/plugins/CyrTranslit/src/stdafx.h +++ b/plugins/CyrTranslit/src/stdafx.h @@ -22,7 +22,7 @@ #include <newpluginapi.h>
#include <m_database.h>
-#include <m_protomod.h>
+#include <m_protosvc.h>
#include <m_clist.h>
#include <m_langpack.h>
diff --git a/plugins/DbEditorPP/src/icons.cpp b/plugins/DbEditorPP/src/icons.cpp index e29a84d89d..4bcd1cfc90 100644 --- a/plugins/DbEditorPP/src/icons.cpp +++ b/plugins/DbEditorPP/src/icons.cpp @@ -75,7 +75,7 @@ HIMAGELIST LoadIcons() for(int i = 0; i < SIZEOF(dbeIcons); i++)
ImageList_AddIcon(hil, LoadSkinnedDBEIcon(dbeIcons[i]));
- ProtoEnumAccounts(&protoCount, &protocols);
+ Proto_EnumAccounts(&protoCount, &protocols);
for (int i = 0; i < protoCount; i++) {
if (!Proto_IsProtocolLoaded(protocols[i]->szModuleName))
diff --git a/plugins/DbEditorPP/src/stdafx.h b/plugins/DbEditorPP/src/stdafx.h index d1827fb6c1..8c5cf8eaa8 100644 --- a/plugins/DbEditorPP/src/stdafx.h +++ b/plugins/DbEditorPP/src/stdafx.h @@ -24,7 +24,6 @@ #include <m_clui.h>
#include <m_skin.h>
#include <m_langpack.h>
-#include <m_protomod.h>
#include <m_database.h>
#include <m_db_int.h>
#include <m_system.h>
diff --git a/plugins/Dropbox/src/dropbox.cpp b/plugins/Dropbox/src/dropbox.cpp index 50be4b39cd..02894645a2 100644 --- a/plugins/Dropbox/src/dropbox.cpp +++ b/plugins/Dropbox/src/dropbox.cpp @@ -6,7 +6,7 @@ CDropbox::CDropbox() : transfers(1, HandleKeySortT) pd.cbSize = sizeof(pd);
pd.szName = MODULE;
pd.type = PROTOTYPE_VIRTUAL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
HookEvent(ME_PROTO_ACK, OnProtoAck);
HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
@@ -43,7 +43,7 @@ MCONTACT CDropbox::GetDefaultContact() if (!hDefaultContact)
{
hDefaultContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- if (!CallService(MS_PROTO_ADDTOCONTACT, hDefaultContact, (LPARAM)MODULE))
+ if (!Proto_AddToContact(hDefaultContact, MODULE))
{
db_set_s(NULL, MODULE, "Nick", MODULE);
db_set_s(hDefaultContact, MODULE, "Nick", MODULE);
diff --git a/plugins/Dropbox/src/stdafx.h b/plugins/Dropbox/src/stdafx.h index 3df9e83ad8..cf14580de3 100644 --- a/plugins/Dropbox/src/stdafx.h +++ b/plugins/Dropbox/src/stdafx.h @@ -26,7 +26,6 @@ #include <m_gui.h>
#include <m_protoint.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_dropbox.h>
diff --git a/plugins/FileAsMessage/src/main.cpp b/plugins/FileAsMessage/src/main.cpp index fa6e4ddb6e..6892863329 100644 --- a/plugins/FileAsMessage/src/main.cpp +++ b/plugins/FileAsMessage/src/main.cpp @@ -116,17 +116,17 @@ INT_PTR OnSendFile(WPARAM wParam, LPARAM lParam) INT_PTR OnRecvMessage(WPARAM wParam, LPARAM lParam)
{
- CCSDATA *pccsd = (CCSDATA *)lParam;
- PROTORECVEVENT *ppre = (PROTORECVEVENT *)pccsd->lParam;
+ CCSDATA *ccs = (CCSDATA *)lParam;
+ PROTORECVEVENT *ppre = (PROTORECVEVENT *)ccs->lParam;
if (strncmp(ppre->szMessage, szServicePrefix, mir_strlen(szServicePrefix)))
- return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ return Proto_ChainRecv(wParam, ccs);
- HWND hwnd = WindowList_Find(hFileList, pccsd->hContact);
+ HWND hwnd = WindowList_Find(hFileList, ccs->hContact);
if (!IsWindow(hwnd))
{
if (hwnd != 0) WindowList_Remove(hFileList, hwnd);
- FILEECHO *fe = new FILEECHO(pccsd->hContact);
+ FILEECHO *fe = new FILEECHO(ccs->hContact);
fe->inSend = FALSE;
hwnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_MAIN), NULL, DialogProc, (LPARAM)fe);
if (hwnd == NULL)
@@ -136,7 +136,7 @@ INT_PTR OnRecvMessage(WPARAM wParam, LPARAM lParam) }
}
char *msg = mir_strdup(ppre->szMessage + mir_strlen(szServicePrefix));
- PostMessage(hwnd, WM_FE_MESSAGE, (WPARAM)pccsd->hContact, (LPARAM)msg);
+ PostMessage(hwnd, WM_FE_MESSAGE, (WPARAM)ccs->hContact, (LPARAM)msg);
return 0;
}
@@ -203,7 +203,7 @@ extern "C" __declspec(dllexport) int Load(void) pd.cbSize = sizeof(pd);
pd.szName = SERVICE_NAME;
pd.type = PROTOTYPE_FILTER;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
HookEvent(ME_OPT_INITIALISE, OnOptInitialise);
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
diff --git a/plugins/FileAsMessage/src/main.h b/plugins/FileAsMessage/src/main.h index ee3577a12d..1063fb8668 100644 --- a/plugins/FileAsMessage/src/main.h +++ b/plugins/FileAsMessage/src/main.h @@ -8,7 +8,7 @@ #include <newpluginapi.h>
#include <m_database.h>
-#include <m_protomod.h>
+#include <m_protosvc.h>
#include <m_langpack.h>
#include <m_clist.h>
#include <m_options.h>
diff --git a/plugins/GmailNotifier/src/gmail.h b/plugins/GmailNotifier/src/gmail.h index 9337667f7c..1c56a13e80 100644 --- a/plugins/GmailNotifier/src/gmail.h +++ b/plugins/GmailNotifier/src/gmail.h @@ -11,7 +11,6 @@ #include "m_clui.h"
#include "m_skin.h"
#include "m_langpack.h"
-#include "m_protomod.h"
#include "m_database.h"
#include "m_system.h"
#include "m_protocols.h"
diff --git a/plugins/GmailNotifier/src/main.cpp b/plugins/GmailNotifier/src/main.cpp index 82ebf9e18a..784b4db6ab 100644 --- a/plugins/GmailNotifier/src/main.cpp +++ b/plugins/GmailNotifier/src/main.cpp @@ -95,7 +95,7 @@ extern "C" int __declspec(dllexport) Load() PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
pd.szName = pluginName;
pd.type = PROTOTYPE_VIRTUAL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
CreateProtoServiceFunction(pluginName, PS_GETCAPS, GetCaps);
CreateProtoServiceFunction(pluginName, PS_GETSTATUS, GetStatus);
diff --git a/plugins/GmailNotifier/src/options.cpp b/plugins/GmailNotifier/src/options.cpp index fff4b59f0e..19ce5830ac 100644 --- a/plugins/GmailNotifier/src/options.cpp +++ b/plugins/GmailNotifier/src/options.cpp @@ -150,7 +150,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SetDlgItemTextA(hwndDlg, IDC_PASS, "");
SetFocus(hwndCombo);
acc[curIndex].hContact = CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)acc[curIndex].hContact, (LPARAM)pluginName);
+ Proto_AddToContact(acc[curIndex].hContact, pluginName);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
diff --git a/plugins/HistoryPlusPlus/historypp.dpr b/plugins/HistoryPlusPlus/historypp.dpr index ca12e3596a..ccaaba045d 100644 --- a/plugins/HistoryPlusPlus/historypp.dpr +++ b/plugins/HistoryPlusPlus/historypp.dpr @@ -376,7 +376,7 @@ begin exit;
end;
- szProto := pAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0));
+ szProto := Proto_GetProtoName(wParam);
if (StrComp(cws.szModule, 'CList') <> 0) and
((szProto = nil) or (StrComp(cws.szModule, szProto) <> 0)) then
exit;
diff --git a/plugins/HistoryPlusPlus/hpp_contacts.pas b/plugins/HistoryPlusPlus/hpp_contacts.pas index e2a68e7ac3..fa8b9f6a4e 100644 --- a/plugins/HistoryPlusPlus/hpp_contacts.pas +++ b/plugins/HistoryPlusPlus/hpp_contacts.pas @@ -68,16 +68,16 @@ uses hpp_database, hpp_options; function GetContactProto(hContact: TMCONTACT): AnsiString;
begin
- Result := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0));
+ Result := Proto_GetProtoName(hContact);
end;
function GetContactProto(hContact: TMCONTACT; var SubContact: TMCONTACT; var SubProtocol: AnsiString): AnsiString;
begin
- Result := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0));
+ Result := Proto_GetProtoName(hContact);
if (Result = META_PROTO) then
begin
SubContact := CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0);
- SubProtocol := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, SubContact, 0));
+ SubProtocol := Proto_GetProtoName(SubContact);
end
else
begin
diff --git a/plugins/HistoryStats/src/dlgoption_subglobal.cpp b/plugins/HistoryStats/src/dlgoption_subglobal.cpp index 9df4998661..27d8071290 100644 --- a/plugins/HistoryStats/src/dlgoption_subglobal.cpp +++ b/plugins/HistoryStats/src/dlgoption_subglobal.cpp @@ -241,16 +241,14 @@ void DlgOption::SubGlobal::onWMInitDialog() PROTOACCOUNT **protoList;
int protoCount;
-
- if (mu::proto::enumProtocols(&protoCount, &protoList) == 0) {
- upto_each_(i, protoCount)
- {
- m_hHideContactMenuProtos.push_back(m_Options.insertCheck(
- m_hProtocols,
- Protocol::getDisplayName(protoList[i]->szModuleName).c_str(),
- 0,
- reinterpret_cast<INT_PTR>(protoList[i]->szModuleName)));
- }
+ Proto_EnumAccounts(&protoCount, &protoList);
+ upto_each_(i, protoCount)
+ {
+ m_hHideContactMenuProtos.push_back(m_Options.insertCheck(
+ m_hProtocols,
+ Protocol::getDisplayName(protoList[i]->szModuleName).c_str(),
+ 0,
+ reinterpret_cast<INT_PTR>(protoList[i]->szModuleName)));
}
m_Options.ensureVisible(NULL);
diff --git a/plugins/HistoryStats/src/dlgoption_subinput.cpp b/plugins/HistoryStats/src/dlgoption_subinput.cpp index 68a3a9d2e9..90b9ff8e66 100644 --- a/plugins/HistoryStats/src/dlgoption_subinput.cpp +++ b/plugins/HistoryStats/src/dlgoption_subinput.cpp @@ -103,16 +103,14 @@ void DlgOption::SubInput::onWMInitDialog() PROTOACCOUNT **protoList;
int protoCount;
-
- if (mu::proto::enumProtocols(&protoCount, &protoList) == 0) {
- upto_each_(i, protoCount)
- {
- m_hProtosIgnore.push_back(m_Options.insertCheck(
- m_hProtocols,
- Protocol::getDisplayName(protoList[i]->szModuleName).c_str(),
- 0,
- reinterpret_cast<INT_PTR>(protoList[i]->szModuleName)));
- }
+ Proto_EnumAccounts(&protoCount, &protoList);
+ upto_each_(i, protoCount)
+ {
+ m_hProtosIgnore.push_back(m_Options.insertCheck(
+ m_hProtocols,
+ Protocol::getDisplayName(protoList[i]->szModuleName).c_str(),
+ 0,
+ reinterpret_cast<INT_PTR>(protoList[i]->szModuleName)));
}
// diable filtering raw RTF if 'rtfconv.dll' isn't available
diff --git a/plugins/HistoryStats/src/mirandahistory.cpp b/plugins/HistoryStats/src/mirandahistory.cpp index 498e414d8d..8d703015e2 100644 --- a/plugins/HistoryStats/src/mirandahistory.cpp +++ b/plugins/HistoryStats/src/mirandahistory.cpp @@ -13,16 +13,14 @@ void MirandaHistory::populateProtocols() PROTOACCOUNT **protoList;
int protoCount;
+ Proto_EnumAccounts(&protoCount, &protoList);
+ upto_each_(i, protoCount)
+ {
+ ext::a::string protoName = protoList[i]->szModuleName;
- if (mu::proto::enumProtocols(&protoCount, &protoList) == 0) {
- upto_each_(i, protoCount)
- {
- ext::a::string protoName = protoList[i]->szModuleName;
-
- Protocol& curProto = m_Protocols[protoName];
+ Protocol& curProto = m_Protocols[protoName];
- curProto.displayName = Protocol::getDisplayName(protoName);
- }
+ curProto.displayName = Protocol::getDisplayName(protoName);
}
m_DefaultProtocol.displayName = TranslateT("(Unknown)");
diff --git a/plugins/HistoryStats/src/mu_common.cpp b/plugins/HistoryStats/src/mu_common.cpp index 4587d81ff8..971a525ae3 100644 --- a/plugins/HistoryStats/src/mu_common.cpp +++ b/plugins/HistoryStats/src/mu_common.cpp @@ -179,23 +179,6 @@ namespace mu }
/*
- * proto
- */
-
- namespace proto
- {
- int enumProtocols(int* numProtocols, PROTOACCOUNT*** ppProtoDescriptors)
- {
- return ProtoEnumAccounts(numProtocols, ppProtoDescriptors);
- }
-
- const char* getContactBaseProto(MCONTACT hContact)
- {
- return reinterpret_cast<const char*>(CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0));
- }
- }
-
- /*
* protosvc
*/
diff --git a/plugins/HistoryStats/src/mu_common.h b/plugins/HistoryStats/src/mu_common.h index c249659a1a..6786201805 100644 --- a/plugins/HistoryStats/src/mu_common.h +++ b/plugins/HistoryStats/src/mu_common.h @@ -72,16 +72,6 @@ namespace mu }
/*
- * proto
- */
-
- namespace proto
- {
- int enumProtocols(int* numProtocols, PROTOACCOUNT*** ppProtoDescriptors);
- const char* getContactBaseProto(MCONTACT hContact);
- }
-
- /*
* protosvc
*/
diff --git a/plugins/HistoryStats/src/protocol.cpp b/plugins/HistoryStats/src/protocol.cpp index 8914310740..16374745d3 100644 --- a/plugins/HistoryStats/src/protocol.cpp +++ b/plugins/HistoryStats/src/protocol.cpp @@ -5,6 +5,6 @@ ext::string Protocol::getDisplayName(const ext::a::string& protocol)
{
- PROTOACCOUNT *pa = ProtoGetAccount(protocol.c_str());
+ PROTOACCOUNT *pa = Proto_GetAccount(protocol.c_str());
return (pa == NULL) ? utils::fromA(protocol) : pa->tszAccountName;
}
diff --git a/plugins/HistoryStats/src/stdafx.h b/plugins/HistoryStats/src/stdafx.h index 76b7afa97b..0b8e3d16c6 100644 --- a/plugins/HistoryStats/src/stdafx.h +++ b/plugins/HistoryStats/src/stdafx.h @@ -58,7 +58,6 @@ #include <m_options.h>
#include <m_popup.h> // not used
#include <m_protocols.h>
-#include <m_protomod.h> // not used
#include <m_protosvc.h>
#include <m_skin.h>
#include <m_system.h>
diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp index 65cf519515..16c7e3e020 100644 --- a/plugins/IEView/src/Options.cpp +++ b/plugins/IEView/src/Options.cpp @@ -1477,7 +1477,7 @@ void Options::init() int protoCount;
PROTOACCOUNT **pProtos;
ProtocolSettings *lastProto = NULL;
- ProtoEnumAccounts(&protoCount, &pProtos);
+ Proto_EnumAccounts(&protoCount, &pProtos);
for (int i = 0; i < protoCount + 1; i++) {
ProtocolSettings *proto;
char tmpPath[MAX_PATH];
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index e31a16a8b9..88aadd22ea 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -166,7 +166,7 @@ static MCONTACT HistoryImportFindContact(HWND hdlgProgress, char *szModuleName, return INVALID_CONTACT_ID;
hContact = CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)szModuleName);
+ Proto_AddToContact(hContact, szModuleName);
db_set_dw(hContact, szModuleName, "UIN", uin);
AddMessage(LPGENT("Added contact %u (found in history)"), uin);
return hContact;
@@ -275,7 +275,7 @@ static LRESULT CALLBACK ListWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM int protoCount, iSel = 0;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&protoCount, &accs);
+ Proto_EnumAccounts(&protoCount, &accs);
for (int i = 0; i < protoCount; i++) {
int idx = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)accs[i]->tszAccountName);
SendMessage(hwndCombo, CB_SETITEMDATA, idx, (LPARAM)accs[i]);
@@ -394,7 +394,7 @@ static PROTOACCOUNT* FindMyAccount(const char *szProto, const char *szBaseProto, {
int destProtoCount;
PROTOACCOUNT **destAccs;
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&destProtoCount, (LPARAM)&destAccs);
+ Proto_EnumAccounts(&destProtoCount, &destAccs);
PROTOACCOUNT *pProto = NULL;
for (int i = 0; i < destProtoCount; i++) {
@@ -548,7 +548,7 @@ static MCONTACT MapContact(MCONTACT hSrc) static MCONTACT AddContact(HWND hdlgProgress, char* szProto, char* pszUniqueSetting, DBVARIANT* id, const TCHAR* pszUserID, TCHAR *nick, TCHAR *group)
{
MCONTACT hContact = CallService(MS_DB_CONTACT_ADD, 0, 0);
- if (CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)szProto) != 0) {
+ if (Proto_AddToContact(hContact, szProto) != 0) {
CallService(MS_DB_CONTACT_DELETE, hContact, 0);
AddMessage(LPGENT("Failed to add %S contact %s"), szProto, pszUserID);
return INVALID_CONTACT_ID;
@@ -719,7 +719,7 @@ void ImportMeta(DBCachedContact *ccSrc) // do we need to add a new metacontact?
if (hDest == INVALID_CONTACT_ID) {
hDest = CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hDest, LPARAM(META_PROTO));
+ Proto_AddToContact(hDest, META_PROTO);
CopySettings(ccSrc->contactID, META_PROTO, hDest, META_PROTO);
ccDst = dstDb->m_cache->GetCachedContact(hDest);
@@ -768,7 +768,7 @@ void ImportMeta(DBCachedContact *ccSrc) else AddMessage(LPGENT("Added metacontact"));
}
- PROTOACCOUNT *pa = ProtoGetAccount(META_PROTO);
+ PROTOACCOUNT *pa = Proto_GetAccount(META_PROTO);
if (pa) {
AccountMap pda(META_PROTO, 0, _T(META_PROTO));
ImportContactSettings(&pda, ccSrc->contactID, ccDst->contactID);
@@ -799,7 +799,7 @@ static MCONTACT ImportContact(MCONTACT hSrc) return NULL;
}
- if (!ProtoGetAccount(pda->pa->szModuleName)) {
+ if (!Proto_GetAccount(pda->pa->szModuleName)) {
AddMessage(LPGENT("Skipping contact, %S not installed."), cc->szProto);
return NULL;
}
@@ -1114,7 +1114,7 @@ void MirandaImport(HWND hdlg) int protoCount;
PROTOACCOUNT **accs;
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&protoCount, (LPARAM)&accs);
+ Proto_EnumAccounts(&protoCount, &accs);
if (protoCount > 0)
ImportHistory(NULL, accs, protoCount);
diff --git a/plugins/Import/src/import.h b/plugins/Import/src/import.h index 572ac475f2..4e412862cb 100644 --- a/plugins/Import/src/import.h +++ b/plugins/Import/src/import.h @@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_langpack.h>
#include <m_system_cpp.h>
#include <m_database.h>
-#include <m_protomod.h>
+#include <m_protosvc.h>
#include <m_icolib.h>
#include <m_clist.h>
#include <m_db_int.h>
diff --git a/plugins/Import/src/main.cpp b/plugins/Import/src/main.cpp index 04f1bc2ff2..55e85c3266 100644 --- a/plugins/Import/src/main.cpp +++ b/plugins/Import/src/main.cpp @@ -88,7 +88,7 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam) // Only autorun import wizard if at least one protocol is installed
int nProtocols = 0;
PROTOACCOUNT **ppProtos = NULL;
- ProtoEnumAccounts(&nProtocols, &ppProtos);
+ Proto_EnumAccounts(&nProtocols, &ppProtos);
if (nProtocols > 0) {
CallService(IMPORT_SERVICE, 0, 0);
db_set_b(NULL, IMPORT_MODULE, IMP_KEY_FR, 1);
diff --git a/plugins/ImportTXT/General.pas b/plugins/ImportTXT/General.pas index a27c64728a..e6bac9318b 100644 --- a/plugins/ImportTXT/General.pas +++ b/plugins/ImportTXT/General.pas @@ -269,7 +269,7 @@ begin Contact := db_find_first();
while (Contact <> 0) do
begin
- otherproto := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, Contact, 0));
+ otherproto := Proto_GetProtoName(Contact);
if otherproto = proto then
begin
ci.cbSize := SizeOf(ci);
@@ -304,7 +304,7 @@ begin Contact := db_find_first();
while (Contact <> 0) do
begin
- otherproto := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, Contact, 0));
+ otherproto := Proto_GetProtoName(Contact);
if otherproto = proto then
begin
ci.cbSize := SizeOf(ci);
@@ -333,7 +333,7 @@ var begin
ProtoCount := 0;
SetLength(Protocols, 30);
- CallService(MS_PROTO_ENUMACCOUNTS, int(@iProtoCount), int(@ppAccounts));
+ Proto_EnumAccounts(iProtoCount, ppAccounts);
for i := 1 to iProtoCount do
begin
temps := GetContactID(0, ppAccounts^^.szModuleName, false);
@@ -351,7 +351,7 @@ end; function GetContactProto(hContact: THandle): AnsiString;
begin
- result := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0));
+ result := Proto_GetProtoName(hContact);
end;
function DBFreeVariant(dbv: PDBVARIANT): integer;
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 61e9a6b01d..d3d18ab646 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -652,7 +652,7 @@ void updateXstatusProto(PROTOCOL_INFO *protoInfo) void createProtocolList(void) { PROTOACCOUNT **proto; - ProtoEnumAccounts(&ProtoList.protoCount, &proto); + Proto_EnumAccounts(&ProtoList.protoCount, &proto); ProtoList.protoInfo = (PROTOCOL_INFO *)malloc(ProtoList.protoCount * sizeof(PROTOCOL_INFO)); if (!ProtoList.protoInfo) { ProtoList.protoCount = 0; diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp index bacf145aa4..a0b31b6e55 100644 --- a/plugins/KeyboardNotify/src/options.cpp +++ b/plugins/KeyboardNotify/src/options.cpp @@ -225,7 +225,7 @@ INT_PTR CALLBACK DlgProcProtoOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR lvItem.iSubItem = 0; for (int i=0; i < ProtoList.protoCount; i++) { int count; PROTOACCOUNT** protos; - ProtoEnumAccounts( &count, &protos ); + Proto_EnumAccounts( &count, &protos ); if(ProtoList.protoInfo[i].visible) { lvItem.lParam = (LPARAM)ProtoList.protoInfo[i].szProto; lvItem.pszText = protos[i] -> tszAccountName; @@ -1362,7 +1362,7 @@ INT_PTR CALLBACK DlgProcXstatusList(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (ProtoList.protoInfo[i].enabled && XstatusListAux[i].count) { int count; PROTOACCOUNT **protos; - ProtoEnumAccounts( &count, &protos ); + Proto_EnumAccounts( &count, &protos ); tvis.hParent = NULL; tvis.hInsertAfter = TVI_LAST; diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index 27f038b856..b28d5d8670 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -327,7 +327,7 @@ int ModulesLoaded(WPARAM, LPARAM) // Add each proto
PROTOACCOUNT **protos;
int count;
- ProtoEnumAccounts(&count,&protos);
+ Proto_EnumAccounts(&count,&protos);
for (int i = 0; i < count; i++)
if (protos[i]->bIsEnabled)
diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index b8911e0a6a..decd4e0a18 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -1759,7 +1759,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.cbSize = sizeof(pd);
pd.szName = PLUGINNAME;
pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
//set all contacts to offline ///TODO: are that contacts exists ?
for(MCONTACT hContact = db_find_first(PLUGINNAME); hContact; hContact = db_find_next(hContact, PLUGINNAME)){
diff --git a/plugins/LotusNotify/src/stdafx.h b/plugins/LotusNotify/src/stdafx.h index c61bdbf3e8..0cf1942427 100644 --- a/plugins/LotusNotify/src/stdafx.h +++ b/plugins/LotusNotify/src/stdafx.h @@ -20,7 +20,6 @@ #include <m_options.h>
#include <m_popup.h>
#include <m_utils.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_system.h>
//debug.h
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index 5a4a1b3fff..895f5d0f1d 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -599,7 +599,7 @@ INT_PTR onCopyID(WPARAM wparam, LPARAM lparam) GetID(hContact, szProto, (LPSTR)&szID, SIZEOF(szID));
if (db_get_dw(NULL, MODULENAME, "flags", vf_default) & VF_CIDN) {
- PROTOACCOUNT *pa = ProtoGetAccount(szProto);
+ PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (!pa->bOldProto)
mir_snprintf(buffer, "%s: %s", pa->szProtoName, szID);
@@ -700,13 +700,13 @@ INT_PTR onChangeProto(WPARAM wparam, LPARAM lparam) if (CTRL_IS_PRESSED) {
hContactNew = hContact;
RenameDbProto(hContact, hContactNew, GetContactProto(hContact), (char*)lparam, 1);
- CallService(MS_PROTO_REMOVEFROMCONTACT, hContact, (LPARAM)GetContactProto(hContact));
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContactNew, lparam);
+ Proto_RemoveFromContact(hContact, GetContactProto(hContact));
+ Proto_AddToContact(hContactNew, (char*)lparam);
}
else {
hContactNew = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (hContactNew) {
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContactNew, lparam);
+ Proto_AddToContact(hContactNew, (char*)lparam);
RenameDbProto(hContact, hContactNew, GetContactProto(hContact), (char*)lparam, 0);
RenameDbProto(hContact, hContactNew, "CList", "CList", 0);
}
@@ -776,7 +776,7 @@ int BuildMenu(WPARAM wparam, LPARAM) BOOL bIsOnline = FALSE, bShowAll = CTRL_IS_PRESSED;
MCONTACT hContact = (MCONTACT)wparam;
char* pszProto = GetContactProto(hContact);
- PROTOACCOUNT *pa = ProtoGetAccount(pszProto);
+ PROTOACCOUNT *pa = Proto_GetAccount(pszProto);
bIsOnline = isProtoOnline(pszProto);
@@ -822,15 +822,15 @@ int BuildMenu(WPARAM wparam, LPARAM) j++;
}
- int check = 0 != CallService(MS_PROTO_ISPROTOONCONTACT, wparam, (LPARAM)accs[i]->szModuleName);
+ int check = Proto_IsProtoOnContact(wparam, accs[i]->szModuleName);
ModifySubmenuItem(hProtoItem[i], accs[i]->tszAccountName, check, hide);
}
Menu_ShowItem(hmenuProto, j > 1);
}
else Menu_ShowItem(hmenuProto, false);
- Menu_ShowItem(hmenuAdded, (bShowAll || (flags & VF_ADD)) && bIsOnline && IsAccountEnabled(pa));
- Menu_ShowItem(hmenuAuthReq, (bShowAll || (flags & VF_REQ)) && bIsOnline && IsAccountEnabled(pa));
+ Menu_ShowItem(hmenuAdded, (bShowAll || (flags & VF_ADD)) && bIsOnline && Proto_IsAccountEnabled(pa));
+ Menu_ShowItem(hmenuAuthReq, (bShowAll || (flags & VF_REQ)) && bIsOnline && Proto_IsAccountEnabled(pa));
bEnabled = bShowAll || (flags & VF_CID);
Menu_ShowItem(hmenuCopyID, bEnabled);
@@ -883,7 +883,7 @@ int EnumProtoSubmenu(WPARAM, LPARAM) }
}
}
- ProtoEnumAccounts(&protoCount, &accs);
+ Proto_EnumAccounts(&protoCount, &accs);
if (protoCount > MAX_PROTOS)
protoCount = MAX_PROTOS;
for (int i = 0; i < protoCount; i++)
diff --git a/plugins/MenuItemEx/src/menuex.h b/plugins/MenuItemEx/src/menuex.h index 51539bdf50..1d3ae7cda6 100644 --- a/plugins/MenuItemEx/src/menuex.h +++ b/plugins/MenuItemEx/src/menuex.h @@ -10,9 +10,9 @@ #include <m_system_cpp.h>
#include <m_options.h>
#include <m_database.h>
+#include <m_protosvc.h>
#include <m_langpack.h>
#include <m_file.h>
-#include <m_protomod.h>
#include <m_clui.h>
#include <m_ignore.h>
#include <m_icolib.h>
diff --git a/plugins/MirFox/src/MirandaUtils.cpp b/plugins/MirFox/src/MirandaUtils.cpp index 8feae7a960..b213b3d1c9 100644 --- a/plugins/MirFox/src/MirandaUtils.cpp +++ b/plugins/MirFox/src/MirandaUtils.cpp @@ -481,9 +481,9 @@ void MirandaUtils::translateOldDBNames() { //account's settings "ACCOUNTSTATE_"
int accountsTmpCount = 0;
PROTOACCOUNT **accountsTmp;
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&accountsTmpCount, (LPARAM)&accountsTmp);
- for(int i=0; i<accountsTmpCount; i++) {
+ Proto_EnumAccounts(&accountsTmpCount, &accountsTmp);
+ for(int i=0; i<accountsTmpCount; i++) {
logger->log_p(L"TranslateOldDBNames: found ACCOUNT: [%s] protocol: [%S]", accountsTmp[i]->tszAccountName, accountsTmp[i]->szProtoName);
std::string mirandaAccountDBKey("ACCOUNTSTATE_");
@@ -496,7 +496,7 @@ void MirandaUtils::translateOldDBNames() { }
}
- //contacts "state"
+ //contacts "state"
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)){
logger->log_p(L"TranslateOldDBNames: found CONTACT: [" SCNuPTR L"]", hContact);
diff --git a/plugins/MirFox/src/MirfoxData.cpp b/plugins/MirFox/src/MirfoxData.cpp index 9ed2657ee9..17d5a782ab 100644 --- a/plugins/MirFox/src/MirfoxData.cpp +++ b/plugins/MirFox/src/MirfoxData.cpp @@ -280,14 +280,12 @@ MirfoxData::getContactDefaultState(MirandaContact* contact) void
MirfoxData::initializeMirandaAccounts()
{
-
clearMirandaAccounts();
+ //get accounts from Miranda by CallService MS_PROTO_ENUMACCOUNTS
int accountsCount = 0;
PROTOACCOUNT **accounts;
-
- //get accounts from Miranda by CallService MS_PROTO_ENUMACCOUNTS
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&accountsCount, (LPARAM)&accounts);
+ Proto_EnumAccounts(&accountsCount, &accounts);
uint64_t protocolId = 1;
@@ -372,12 +370,11 @@ void MirfoxData::initializeMirandaContacts() for (mirandaContactsIter = mirandaContactsPtr->begin(); mirandaContactsIter != mirandaContactsPtr->end(); mirandaContactsIter++){
logger->log_p(L"initializeMirandaContacts: try to get account for hContact = [" SCNuPTR L"]", mirandaContactsIter->contactHandle);
- char* szModuleName = (char*)CallService(MS_PROTO_GETCONTACTBASEACCOUNT, (WPARAM)(mirandaContactsIter->contactHandle), 0);
- if (szModuleName == NULL){
+ char *szModuleName = Proto_GetBaseAccountName(mirandaContactsIter->contactHandle);
+ if (szModuleName == NULL)
continue; //mirandaContactsIter->mirandaAccountPtr will be NULL
- }
- mirandaContactsIter->mirandaAccountPtr = getMirandaAccountPtrBySzModuleName(szModuleName);
+ mirandaContactsIter->mirandaAccountPtr = getMirandaAccountPtrBySzModuleName(szModuleName);
}
diff --git a/plugins/MirOTR/src/dbfilter.cpp b/plugins/MirOTR/src/dbfilter.cpp index bfdfd10f07..1f349a4c22 100644 --- a/plugins/MirOTR/src/dbfilter.cpp +++ b/plugins/MirOTR/src/dbfilter.cpp @@ -178,7 +178,7 @@ int WindowEvent(WPARAM wParam, LPARAM lParam) if ((hTemp = db_mc_getMostOnline(hContact)) != 0) hContact = hTemp; - if (!CallService(MS_PROTO_ISPROTOONCONTACT, hContact, (LPARAM)MODULENAME)) + if (!Proto_IsProtoOnContact(hContact, MODULENAME)) return 0; lib_cs_lock(); @@ -243,7 +243,7 @@ int OnContactSettingChanged(WPARAM hContact, LPARAM lParam) StatusModeChange((WPARAM)ID_STATUS_OFFLINE, (LPARAM)cws->szModule); return 0; } - if (CallService(MS_PROTO_ISPROTOONCONTACT, hContact, (LPARAM)MODULENAME)) { + if (Proto_IsProtoOnContact(hContact, MODULENAME)) { // only care about contacts to which this filter is attached FinishSession(hContact); } diff --git a/plugins/MirOTR/src/dllmain.cpp b/plugins/MirOTR/src/dllmain.cpp index b798ccefc3..d961050b49 100644 --- a/plugins/MirOTR/src/dllmain.cpp +++ b/plugins/MirOTR/src/dllmain.cpp @@ -79,12 +79,12 @@ extern "C" __declspec(dllexport) int Load(void) pd.cbSize = sizeof(pd);
pd.szName = MODULENAME; pd.type = PROTOTYPE_ENCRYPTION; - CallService(MS_PROTO_REGISTERMODULE,0,(LPARAM)&pd); + Proto_RegisterModule(&pd); // remove us as a filter to all contacts - fix filter type problem if(db_get_b(0, MODULENAME, "FilterOrderFix", 0) != 2) { for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) - CallService(MS_PROTO_REMOVEFROMCONTACT, hContact, (LPARAM)MODULENAME); + Proto_RemoveFromContact(hContact, MODULENAME); db_set_b(0, MODULENAME, "FilterOrderFix", 2); } diff --git a/plugins/MirOTR/src/options.cpp b/plugins/MirOTR/src/options.cpp index 697b0ba1c3..5178e6cf25 100644 --- a/plugins/MirOTR/src/options.cpp +++ b/plugins/MirOTR/src/options.cpp @@ -319,7 +319,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP int num_protocols; PROTOACCOUNT **pppDesc; - ProtoEnumAccounts(&num_protocols, &pppDesc); + Proto_EnumAccounts(&num_protocols, &pppDesc); for (int i = 0; i < num_protocols; i++) { if (!mir_strcmp(pppDesc[i]->szModuleName, META_PROTO)) continue; @@ -502,7 +502,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { const char *proto = GetContactProto(hContact); - if (proto && db_get_b(hContact, proto, "ChatRoom", 0) == 0 && CallService(MS_PROTO_ISPROTOONCONTACT, hContact, (LPARAM)MODULENAME) // ignore chatrooms + if (proto && db_get_b(hContact, proto, "ChatRoom", 0) == 0 && Proto_IsProtoOnContact(hContact, MODULENAME) // ignore chatrooms && mir_strcmp(proto, META_PROTO) != 0) // and MetaContacts { lvI.iItem = 0; @@ -511,7 +511,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM lvI.pszText = (TCHAR*)contact_get_nameT(hContact); lvI.iItem = ListView_InsertItem(lv, &lvI); - PROTOACCOUNT *pa = ProtoGetAccount(proto); + PROTOACCOUNT *pa = Proto_GetAccount(proto); ListView_SetItemText(lv, lvI.iItem, 1, pa->tszAccountName); ListView_SetItemText(lv, lvI.iItem, 2, (TCHAR*)policy_to_string((OtrlPolicy)db_get_dw(hContact, MODULENAME, "Policy", CONTACT_DEFAULT_POLICY))); @@ -683,7 +683,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w if (context->app_data) { user = (TCHAR*)contact_get_nameT((MCONTACT)context->app_data); if (user) { - PROTOACCOUNT *pa = ProtoGetAccount(context->protocol); + PROTOACCOUNT *pa = Proto_GetAccount(context->protocol); for (Fingerprint *fp = context->fingerprint_root.next; fp; fp = fp->next) { otrl_privkey_hash_to_humanT(hash, fp->fingerprint); @@ -749,7 +749,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w MCONTACT hContact = (MCONTACT)fp->context->app_data; TCHAR buff[1024], hash[45]; otrl_privkey_hash_to_humanT(hash, fp->fingerprint); - PROTOACCOUNT *pa = ProtoGetAccount(GetContactProto(hContact)); + PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact)); mir_sntprintf(buff, SIZEOF(buff) - 1, TranslateT(LANG_FINGERPRINT_STILL_IN_USE), hash, contact_get_nameT(hContact), pa->tszAccountName); buff[SIZEOF(buff) - 1] = '\0'; ShowError(buff); @@ -780,7 +780,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w MCONTACT hContact = (MCONTACT)it->first->context->app_data; TCHAR buff[1024], hash[45]; otrl_privkey_hash_to_humanT(hash, it->first->fingerprint); - PROTOACCOUNT *pa = ProtoGetAccount(GetContactProto(hContact)); + PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact)); mir_sntprintf(buff, SIZEOF(buff) - 1, TranslateT(LANG_FINGERPRINT_NOT_DELETED), hash, contact_get_nameT(hContact), pa->tszAccountName); buff[SIZEOF(buff) - 1] = '\0'; ShowError(buff); diff --git a/plugins/MirOTR/src/stdafx.h b/plugins/MirOTR/src/stdafx.h index ce52cb5ff7..450ebdc342 100644 --- a/plugins/MirOTR/src/stdafx.h +++ b/plugins/MirOTR/src/stdafx.h @@ -27,8 +27,8 @@ using namespace std; #include <m_langpack.h> #include <m_database.h> #include <m_message.h> -#include <m_protomod.h> #include <m_popup.h> +#include <m_protosvc.h> #include <m_contacts.h> #include <m_icolib.h> #include <m_skin.h> diff --git a/plugins/MirOTR/src/svcs_proto.cpp b/plugins/MirOTR/src/svcs_proto.cpp index 81a78e3005..f6edc8e7e7 100644 --- a/plugins/MirOTR/src/svcs_proto.cpp +++ b/plugins/MirOTR/src/svcs_proto.cpp @@ -11,11 +11,11 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){ DEBUGOUTA("'\n"); if (ccs->wParam & PREF_BYPASS_OTR) // bypass for OTR-messages - return CallService(MS_PROTO_CHAINSEND, wParam, lParam); + return Proto_ChainSend(wParam, ccs); char *proto = GetContactProto(ccs->hContact); if(proto && mir_strcmp(proto, META_PROTO) == 0) // bypass for metacontacts - return CallService(MS_PROTO_CHAINSEND, wParam, lParam); + return Proto_ChainSend(wParam, ccs); if (!proto || !ccs->hContact) return 1; // error @@ -27,7 +27,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){ // don't filter OTR messages being sent (OTR messages should only happen *after* the otrl_message_sending call below) if(strncmp(oldmessage, "?OTR", 4) == 0) { DEBUGOUT_T("OTR message without PREF_BYPASS_OTR\n"); - return CallService(MS_PROTO_CHAINSEND, wParam, lParam); + return Proto_ChainSend(wParam, ccs); } ptrA tmpencode; @@ -51,7 +51,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){ } if (newmessage == NULL) - return CallService(MS_PROTO_CHAINSEND, wParam, lParam); + return Proto_ChainSend(wParam, ccs); if(!newmessage[0]){ otrl_message_free(newmessage); @@ -60,7 +60,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){ WPARAM oldflags = ccs->wParam; ccs->lParam = (LPARAM)newmessage; - INT_PTR ret = CallService(MS_PROTO_CHAINSEND, wParam, lParam); + INT_PTR ret = Proto_ChainSend(wParam, ccs); DEBUGOUTA("OTR - sending raw message: '"); DEBUGOUTA((const char*)ccs->lParam); @@ -82,15 +82,14 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam) DEBUGOUTA(pre->szMessage); DEBUGOUTA("'\n"); - if (pre->flags & PREF_BYPASS_OTR) { // bypass for our inline messages - return CallService(MS_PROTO_CHAINRECV, wParam, lParam); - } + if (pre->flags & PREF_BYPASS_OTR) // bypass for our inline messages + return Proto_ChainRecv(wParam, ccs); char *proto = GetContactProto(ccs->hContact); if (!proto || !ccs->hContact) return 1; //error else if(proto && mir_strcmp(proto, META_PROTO) == 0) // bypass for metacontacts - return CallService(MS_PROTO_CHAINRECV, wParam, lParam); + return Proto_ChainRecv(wParam, ccs); char *oldmessage = pre->szMessage; // convert oldmessage to utf-8 @@ -124,7 +123,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam) return 1; // discard internal protocol messages } if (newmessage == NULL) - return CallService(MS_PROTO_CHAINRECV, wParam, lParam); + return Proto_ChainRecv(wParam, ccs); DWORD oldflags = pre->flags; @@ -146,7 +145,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam) msg_free = mir_free; } pre->szMessage = newmessage; - BOOL ret = CallService(MS_PROTO_CHAINRECV, wParam, lParam); + BOOL ret = Proto_ChainRecv(wParam, ccs); /// @todo (White-Tiger#1#03/23/15): why are we doing this? pre->flags = oldflags; pre->szMessage = oldmessage; diff --git a/plugins/MirOTR/src/utils.cpp b/plugins/MirOTR/src/utils.cpp index 7dbfc0a293..0dfc5a2407 100644 --- a/plugins/MirOTR/src/utils.cpp +++ b/plugins/MirOTR/src/utils.cpp @@ -128,12 +128,6 @@ __inline const TCHAR* contact_get_nameT(MCONTACT hContact) { return (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR); } - -__inline const char* contact_get_account(MCONTACT hContact) { - char *uacc = (char *)CallService(MS_PROTO_GETCONTACTBASEACCOUNT, hContact, 0); - return uacc; -} - TCHAR* ProtoGetNickname(const char* proto) { CONTACTINFO ci = {sizeof(ci)}; diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index b31b5a76f5..f8ff7c95c4 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -87,7 +87,7 @@ bool CAppletManager::Initialize(tstring strAppletName) CProtocolData *pProtoData = NULL; CIRCConnection *pIRCConnection = NULL; - ProtoEnumAccounts(&iCount, &ppAccounts); + Proto_EnumAccounts(&iCount, &ppAccounts); for(int i=0;i<iCount;i++) { /**if(ppProtocolDescriptor[i]->type != PROTOTYPE_PROTOCOL) diff --git a/plugins/MirandaG15/src/CConfig.cpp b/plugins/MirandaG15/src/CConfig.cpp index 64892272e5..6fe8307ecf 100644 --- a/plugins/MirandaG15/src/CConfig.cpp +++ b/plugins/MirandaG15/src/CConfig.cpp @@ -116,7 +116,7 @@ void CConfig::LoadSettings() CProtoFilter *pProtoFilter;
tstring strSetting;
- CallService(MS_PROTO_ENUMACCOUNTS,(WPARAM)&iCount,(LPARAM)&ppAccounts);
+ Proto_EnumAccounts(&iCount, &ppAccounts);
for(int i=0;i<iCount;i++)
{
/*if(ppProtocolDescriptor[i]->type != PROTOTYPE_PROTOCOL)
diff --git a/plugins/MirandaG15/src/StdAfx.h b/plugins/MirandaG15/src/StdAfx.h index 3c2e1eb790..f92f33606d 100644 --- a/plugins/MirandaG15/src/StdAfx.h +++ b/plugins/MirandaG15/src/StdAfx.h @@ -20,7 +20,6 @@ using namespace std; #include <newpluginapi.h>
#include <m_message.h>
-#include <m_protomod.h>
#include <m_protosvc.h>
#include <m_database.h>
#include <m_options.h>
diff --git a/plugins/ModernOpt/src/commonheaders.h b/plugins/ModernOpt/src/commonheaders.h index 51e6bc386c..1748b702f5 100644 --- a/plugins/ModernOpt/src/commonheaders.h +++ b/plugins/ModernOpt/src/commonheaders.h @@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_utils.h>
#include <m_langpack.h>
#include <m_clistint.h>
-#include <m_protomod.h>
+#include <m_protosvc.h>
#include <m_skin.h>
#include <m_userinfo.h>
#include <m_descbutton.h>
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 160d36df35..d458e782da 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -1288,7 +1288,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts2(HWND hwndDlg, UINT msg, WPARAM wPa sItem.mask = LVIF_TEXT | LVIF_IMAGE;
char szTemp[500];
- ProtoEnumAccounts(&nCount, &proto);
+ Proto_EnumAccounts(&nCount, &proto);
for (int i = 0; i < nCount; i++)
{
diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp index b011740b6e..8f570a717b 100644 --- a/plugins/MyDetails/src/data.cpp +++ b/plugins/MyDetails/src/data.cpp @@ -27,7 +27,7 @@ void InitProtocolData() {
PROTOACCOUNT **protos;
int count;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
protocols = new ProtocolArray(count);
@@ -152,7 +152,7 @@ void Protocol::SetStatus(int aStatus) PROTOACCOUNT **accs;
pCount = 0;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
for (i = 0; i < count; i++) {
if (CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
continue;
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index 5821da7ec3..90976f1d3c 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -215,7 +215,7 @@ int StatusChanged(WPARAM wParam, LPARAM lParam) else {
PROTOACCOUNT **accs;
int numAccs = 0;
- ProtoEnumAccounts(&numAccs, &accs);
+ Proto_EnumAccounts(&numAccs, &accs);
for (int i = 0; i < numAccs; i++) {
Flag1 |= CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
Flag3 |= CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0);
@@ -583,7 +583,7 @@ int MirandaLoaded(WPARAM, LPARAM) int numAccs = 0;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&numAccs, &accs);
+ Proto_EnumAccounts(&numAccs, &accs);
for (int i = 0, CurProtoIndex = 0; i < numAccs && CurProtoIndex < MAXICQACCOUNTS; i++) {
HANDLE hHook = HookEvent(CString(accs[i]->szModuleName) + ME_ICQ_STATUSMSGREQ, StatusMsgReqHooks[CurProtoIndex]);
if (hHook) {
diff --git a/plugins/NewAwaySysMod/src/Client.cpp b/plugins/NewAwaySysMod/src/Client.cpp index 22ff666fe5..827bd0be7c 100644 --- a/plugins/NewAwaySysMod/src/Client.cpp +++ b/plugins/NewAwaySysMod/src/Client.cpp @@ -32,7 +32,7 @@ void __cdecl UpdateMsgsThreadProc(void *) {
int numAccs;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&numAccs, &accs);
+ Proto_EnumAccounts(&numAccs, &accs);
while (WaitForSingleObject(g_hTerminateUpdateMsgsThread, 0) == WAIT_TIMEOUT && !Miranda_Terminated()) {
DWORD MinUpdateTimeDifference = g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_UPDATEMSGSPERIOD) * 1000; // in milliseconds
@@ -92,7 +92,7 @@ void ChangeProtoMessages(char* szProto, int iMode, TCString &Msg) else { // change message of all protocols
int numAccs;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&numAccs, &accs);
+ Proto_EnumAccounts(&numAccs, &accs);
for (int i = 0; i < numAccs; i++) {
PROTOACCOUNT *p = accs[i];
if (!db_get_b(NULL, p->szModuleName, "LockMainStatus", 0)) {
diff --git a/plugins/NewAwaySysMod/src/Properties.h b/plugins/NewAwaySysMod/src/Properties.h index 55b1da1d22..c0dbd1dab7 100644 --- a/plugins/NewAwaySysMod/src/Properties.h +++ b/plugins/NewAwaySysMod/src/Properties.h @@ -261,7 +261,7 @@ public: if (!szProto) {
int numAccs;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&numAccs, &accs);
+ Proto_EnumAccounts(&numAccs, &accs);
for (int i = 0; i < numAccs; i++)
(*this)[accs[i]->szModuleName]; // add a protocol if it isn't in the list yet
}
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp index be3d3093aa..a485cd6097 100644 --- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp @@ -809,7 +809,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA WindowTitle += _T(")");
}
else {
- PROTOACCOUNT *acc = ProtoGetAccount(szProto);
+ PROTOACCOUNT *acc = Proto_GetAccount(szProto);
WindowTitle += acc->tszAccountName;
WindowTitle += _T(")");
}
@@ -872,12 +872,12 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA HTREEITEM hItem = hSelItem = CList->AddInfo(TranslateT("** All contacts **"), CLC_ROOT, CLC_ROOT, NULL, Skin_LoadProtoIcon(NULL, g_ProtoStates[(char*)NULL].Status));
int numAccs;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&numAccs, &accs);
+ Proto_EnumAccounts(&numAccs, &accs);
for (int i = 0; i < numAccs; i++) {
PROTOACCOUNT *p = accs[i];
// don't forget to change Recent Message Save loop in the UM_SAM_APPLYANDCLOSE if you're changing something here
if (CallProtoService(p->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) {
- PROTOACCOUNT * acc = ProtoGetAccount(p->szModuleName);
+ PROTOACCOUNT * acc = Proto_GetAccount(p->szModuleName);
hItem = CList->AddInfo(TCString(_T("* ")) + acc->tszAccountName + _T(" *"), CLC_ROOT, hItem, (LPARAM)p->szModuleName, Skin_LoadProtoIcon(p->szModuleName, g_ProtoStates[p->szModuleName].Status));
if (dat->szProtocol && !mir_strcmp(p->szModuleName, dat->szProtocol))
hSelItem = hItem;
@@ -928,7 +928,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA // save Recent Messages
int numAccs;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&numAccs, &accs);
+ Proto_EnumAccounts(&numAccs, &accs);
for (int i = 0; i < numAccs; i++) {
PROTOACCOUNT *p = accs[i];
if (CallProtoService(p->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) {
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index dd3a5c2796..d8de67a965 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -1139,9 +1139,9 @@ int ModulesLoaded(WPARAM, LPARAM) int count = 0;
PROTOACCOUNT **accounts = NULL;
- ProtoEnumAccounts(&count, &accounts);
+ Proto_EnumAccounts(&count, &accounts);
for (int i = 0; i < count; i++)
- if (IsAccountEnabled(accounts[i]))
+ if (Proto_IsAccountEnabled(accounts[i]))
db_set_b(NULL, MODULE, accounts[i]->szModuleName, 0);
return 0;
diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp index 7c4be90878..2fc03679d2 100644 --- a/plugins/NewXstatusNotify/src/options.cpp +++ b/plugins/NewXstatusNotify/src/options.cpp @@ -717,7 +717,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA int count;
PROTOACCOUNT **protos;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
for (int i = 0; i < count; i++) {
if (IsSuitableProto(protos[i])) {
diff --git a/plugins/New_GPG/src/commonheaders.h b/plugins/New_GPG/src/commonheaders.h index 5af43c1c9e..6cc28e31b6 100644 --- a/plugins/New_GPG/src/commonheaders.h +++ b/plugins/New_GPG/src/commonheaders.h @@ -60,7 +60,6 @@ using std::fstream; #include <m_langpack.h> #include <m_clui.h> #include <m_skin.h> -#include <m_protomod.h> #include <m_jabber.h> #include <m_icq.h> #include <m_message.h> diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp index bc786fa263..7e06f1040c 100644 --- a/plugins/New_GPG/src/init.cpp +++ b/plugins/New_GPG/src/init.cpp @@ -156,7 +156,7 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam) pd.cbSize = sizeof(pd);
pd.szName = szGPGModuleName;
pd.type = PROTOTYPE_ENCRYPTION;
- CallService(MS_PROTO_REGISTERMODULE,0,(LPARAM)&pd);
+ Proto_RegisterModule(&pd);
CreateProtoServiceFunction(szGPGModuleName, PSR_MESSAGE, RecvMsgSvc);
CreateProtoServiceFunction(szGPGModuleName, PSS_MESSAGE, SendMsgSvc);
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp index b07872ca9c..9275f0d0e2 100755 --- a/plugins/New_GPG/src/main.cpp +++ b/plugins/New_GPG/src/main.cpp @@ -213,7 +213,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR { //get accounts int count = 0; PROTOACCOUNT **accounts; - ProtoEnumAccounts(&count, &accounts); + Proto_EnumAccounts(&count, &accounts); std::wstring accs; for(int i = 0; i < count; i++) { @@ -252,7 +252,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR SendDlgItemMessageA(hwndDlg, IDC_ACCOUNT, CB_ADDSTRING, 0, (LPARAM)Translate("Default")); int count = 0; PROTOACCOUNT **accounts; - ProtoEnumAccounts(&count, &accounts); + Proto_EnumAccounts(&count, &accounts); for(int i = 0; i < count; i++) { if(StriStr(accounts[i]->szModuleName, "metacontacts")) @@ -2084,7 +2084,7 @@ void InitCheck() _wmkdir(tmp_dir.c_str()); int count = 0; PROTOACCOUNT **accounts; - ProtoEnumAccounts(&count, &accounts); + Proto_EnumAccounts(&count, &accounts); string question; //char *keyid = nullptr, *key = nullptr; char *keyid = nullptr; @@ -2242,7 +2242,7 @@ void InitCheck() { int count = 0; PROTOACCOUNT **accounts; - ProtoEnumAccounts(&count, &accounts); + Proto_EnumAccounts(&count, &accounts); ICQ_CUSTOMCAP cap; cap.cbSize = sizeof(ICQ_CUSTOMCAP); cap.hIcon = 0; @@ -2257,7 +2257,7 @@ void InitCheck() { int count = 0; PROTOACCOUNT **accounts; - ProtoEnumAccounts(&count, &accounts); + Proto_EnumAccounts(&count, &accounts); ICQ_CUSTOMCAP cap; cap.cbSize = sizeof(ICQ_CUSTOMCAP); cap.hIcon = 0; diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index 42f3db1978..2fe285c330 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -341,18 +341,18 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) { CCSDATA *ccs = (CCSDATA*)l; if (!ccs) - return CallService(MS_PROTO_CHAINRECV, w, l); + return Proto_ChainRecv(w, ccs); PROTORECVEVENT *pre = (PROTORECVEVENT*)(ccs->lParam); if (!pre) - return CallService(MS_PROTO_CHAINRECV, w, l); + return Proto_ChainRecv(w, ccs); char *msg = pre->szMessage; if (!msg) - return CallService(MS_PROTO_CHAINRECV, w, l); + return Proto_ChainRecv(w, ccs); DWORD dbflags = DBEF_UTF; if(db_mc_isMeta(ccs->hContact)) { if(!strstr(msg, "-----BEGIN PGP MESSAGE-----")) - return CallService(MS_PROTO_CHAINRECV, w, l); + return Proto_ChainRecv(w, ccs); else { if(bDebugLog) @@ -578,7 +578,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) } } if(!strstr(msg, "-----BEGIN PGP MESSAGE-----")) - return CallService(MS_PROTO_CHAINRECV, w, l); + return Proto_ChainRecv(w, ccs); boost::thread *thr = new boost::thread(boost::bind(RecvMsgSvc_func, ccs->hContact, str, msg, (DWORD)ccs->wParam, pre->timestamp)); return 0; } @@ -758,21 +758,21 @@ INT_PTR SendMsgSvc(WPARAM w, LPARAM l) { CCSDATA *ccs = (CCSDATA*)l; if (!ccs) - return CallService(MS_PROTO_CHAINSEND, w, l); + return Proto_ChainSend(w, ccs); if(!ccs->lParam) - return CallService(MS_PROTO_CHAINSEND, w, l); + return Proto_ChainSend(w, ccs); char *msg = (char*)ccs->lParam; if (!msg) { if(bDebugLog) debuglog<<std::string(time_str()+": info: failed to get message data, name: "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)ccs->hContact, GCDNF_TCHAR))); - return CallService(MS_PROTO_CHAINSEND, w, l); + return Proto_ChainSend(w, ccs); } if(strstr(msg,"-----BEGIN PGP MESSAGE-----")) { if(bDebugLog) debuglog<<std::string(time_str()+": info: encrypted messge, let it go, name: "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)ccs->hContact, GCDNF_TCHAR))); - return CallService(MS_PROTO_CHAINSEND, w, l); + return Proto_ChainSend(w, ccs); } if(bDebugLog) debuglog<<std::string(time_str()+": info: contact have key, name: "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)ccs->hContact, GCDNF_TCHAR))); @@ -782,7 +782,7 @@ INT_PTR SendMsgSvc(WPARAM w, LPARAM l) { if(bDebugLog) debuglog<<std::string(time_str()+": info: contact not secured, name: "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)ccs->hContact, GCDNF_TCHAR))); - return CallService(MS_PROTO_CHAINSEND, w, l); + return Proto_ChainSend(w, ccs); } return returnNoError(ccs->hContact); } diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index bef246278a..34728486b2 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -155,7 +155,7 @@ INT_PTR SendKey(WPARAM w, LPARAM l) std::string key_id_str; { LPSTR proto = GetContactProto(hContact); - PROTOACCOUNT *acc = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)proto); + PROTOACCOUNT *acc = Proto_GetAccount(proto); std::string acc_str; if(acc) { @@ -240,7 +240,7 @@ int OnPreBuildContactMenu(WPARAM w, LPARAM l) { CLISTMENUITEM mi2 = { sizeof(mi2) }; LPSTR proto = GetContactProto(hContact); - PROTOACCOUNT *acc = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)proto); + PROTOACCOUNT *acc = Proto_GetAccount(proto); std::string setting; if(acc) { @@ -531,9 +531,10 @@ std::wstring encrypt_file(MCONTACT hContact, TCHAR *filename) //from secureim partially INT_PTR onSendFile(WPARAM w, LPARAM l) { - if(!bFileTransfers) - return CallService(MS_PROTO_CHAINSEND, w, l); CCSDATA *ccs=(CCSDATA*)l; + if(!bFileTransfers) + return Proto_ChainSend(w, ccs); + if(isContactSecured(ccs->hContact)) { char *proto = GetContactProto(ccs->hContact); @@ -581,12 +582,12 @@ INT_PTR onSendFile(WPARAM w, LPARAM l) if(supported_proto && !cap_found) { if(MessageBox(0, TranslateT("Capability to decrypt file not found on other side.\nRecipient may be unable to decrypt file(s).\nDo you want to encrypt file(s) anyway?"), TranslateT("File transfer warning"), MB_YESNO) == IDNO) - return CallService(MS_PROTO_CHAINSEND, w, l); + return Proto_ChainSend(w, ccs); } if(!supported_proto) { if(MessageBox(0, TranslateT("Unable to check encryption support on other side.\nRecipient may be unable to decrypt file(s).\nCurrently capability check supported only for ICQ and Jabber protocols.\nIt will work for any other proto if Miranda with New_GPG is used on other side.\nDo you want to encrypt file(s) anyway?"), TranslateT("File transfer warning"), MB_YESNO) == IDNO) - return CallService(MS_PROTO_CHAINSEND, w, l); + return Proto_ChainSend(w, ccs); } HistoryLog(ccs->hContact, db_event(Translate("encrypting file for transfer"), 0, 0, DBEF_SENT)); DWORD flags = (DWORD)ccs->wParam; //check for PFTS_UNICODE here @@ -627,7 +628,7 @@ INT_PTR onSendFile(WPARAM w, LPARAM l) } } } - return CallService(MS_PROTO_CHAINSEND, w, l); + return Proto_ChainSend(w, ccs); } @@ -668,7 +669,7 @@ int GetJabberInterface(WPARAM w, LPARAM l) //get interface for all jabber accoun void AddHandlers(); int count = 0; PROTOACCOUNT **accounts; - ProtoEnumAccounts(&count, &accounts); + Proto_EnumAccounts(&count, &accounts); list <JabberAccount*>::iterator p; Accounts.clear(); Accounts.push_back(new JabberAccount); @@ -1572,7 +1573,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l) return 1; //TODO: handle error PROTOACCOUNT **accs; int acc_count = 0, processed_keys = 0, processed_private_keys = 0; - ProtoEnumAccounts(&acc_count, &accs); + Proto_EnumAccounts(&acc_count, &accs); char line[256]; file.getline(line, 255); if(!strstr(line, "-----BEGIN PGP PUBLIC KEY BLOCK-----") && !strstr(line, "-----BEGIN PGP PRIVATE KEY BLOCK-----")) diff --git a/plugins/NewsAggregator/Src/Common.h b/plugins/NewsAggregator/Src/Common.h index 11b78ad76f..7a2c424978 100644 --- a/plugins/NewsAggregator/Src/Common.h +++ b/plugins/NewsAggregator/Src/Common.h @@ -32,12 +32,12 @@ Boston, MA 02111-1307, USA. #include <m_clist.h>
#include <m_langpack.h>
#include <m_options.h>
+#include <m_protosvc.h>
#include <m_database.h>
#include <m_netlib.h>
#include <m_icolib.h>
#include <m_message.h>
#include <win2k.h>
-#include <m_protomod.h>
#include <m_xml.h>
#include <m_avatars.h>
#include <m_hotkeys.h>
diff --git a/plugins/NewsAggregator/Src/ExportImport.cpp b/plugins/NewsAggregator/Src/ExportImport.cpp index a7da89e57d..3b2ef7fd8c 100644 --- a/plugins/NewsAggregator/Src/ExportImport.cpp +++ b/plugins/NewsAggregator/Src/ExportImport.cpp @@ -150,7 +150,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)MODULE);
+ Proto_AddToContact(hContact, MODULE);
db_set_ts(hContact, MODULE, "Nick", text);
db_set_ts(hContact, MODULE, "URL", url);
db_set_ts(hContact, MODULE, "Homepage", siteurl);
diff --git a/plugins/NewsAggregator/Src/NewsAggregator.cpp b/plugins/NewsAggregator/Src/NewsAggregator.cpp index 112b90b7ef..fc40b58c16 100644 --- a/plugins/NewsAggregator/Src/NewsAggregator.cpp +++ b/plugins/NewsAggregator/Src/NewsAggregator.cpp @@ -72,7 +72,7 @@ extern "C" __declspec(dllexport) int Load(void) pd.cbSize = sizeof(pd);
pd.szName = MODULE;
pd.type = PROTOTYPE_VIRTUAL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
CreateProtoServiceFunction(MODULE, PS_GETNAME, NewsAggrGetName);
CreateProtoServiceFunction(MODULE, PS_GETCAPS, NewsAggrGetCaps);
diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index 40882267b7..b8849fc775 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -54,7 +54,7 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)MODULE);
+ Proto_AddToContact(hContact, MODULE);
GetDlgItemText(hwndDlg, IDC_FEEDTITLE, str, SIZEOF(str));
db_set_ts(hContact, MODULE, "Nick", str);
diff --git a/plugins/Non-IM Contact/src/commonheaders.h b/plugins/Non-IM Contact/src/commonheaders.h index 4a61d0a0ed..2facfdce1d 100644 --- a/plugins/Non-IM Contact/src/commonheaders.h +++ b/plugins/Non-IM Contact/src/commonheaders.h @@ -38,7 +38,6 @@ struct DLGTEMPLATEEX #include <m_clui.h>
#include <m_skin.h>
#include <m_langpack.h>
-#include <m_protomod.h>
#include <m_database.h>
#include <m_system.h>
#include <m_icolib.h>
diff --git a/plugins/Non-IM Contact/src/contactinfo.cpp b/plugins/Non-IM Contact/src/contactinfo.cpp index 86adb17aae..961ec57d88 100644 --- a/plugins/Non-IM Contact/src/contactinfo.cpp +++ b/plugins/Non-IM Contact/src/contactinfo.cpp @@ -336,7 +336,7 @@ INT_PTR CALLBACK DlgProcCopy(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) }
free(replace);
hContact2 = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact2, (LPARAM)MODNAME);
+ Proto_AddToContact(hContact2, MODNAME);
CallService(MS_IGNORE_IGNORE, (WPARAM)hContact2, IGNOREEVENT_USERONLINE);
db_set_s(hContact2, MODNAME, "Nick", Translate("New Non-IM Contact"));
// blank dbVar2 so the replaceing doesnt crash..
@@ -396,7 +396,7 @@ INT_PTR CALLBACK DlgProcCopy(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) msg("contact did not get created", "");
return 0;
}
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact2, (LPARAM)MODNAME);
+ Proto_AddToContact(hContact2, MODNAME);
CallService(MS_IGNORE_IGNORE, (WPARAM)hContact2, IGNOREEVENT_USERONLINE);
db_set_s(hContact2, MODNAME, "Nick", Translate("New Non-IM Contact"));
db_set_s(hContact2, MODNAME, "Name", dbVar1);
@@ -633,7 +633,7 @@ INT_PTR ImportContacts(WPARAM wParam, LPARAM lParam) msg("contact did get created", "");
continue;
}
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)MODNAME);
+ Proto_AddToContact(hContact, MODNAME);
CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE);
db_set_s(hContact, MODNAME, "Nick", Translate("New Non-IM Contact"));
db_set_s(hContact, MODNAME, "Name", name);
diff --git a/plugins/Non-IM Contact/src/dialog.cpp b/plugins/Non-IM Contact/src/dialog.cpp index 1e85c207a5..1565321cb4 100644 --- a/plugins/Non-IM Contact/src/dialog.cpp +++ b/plugins/Non-IM Contact/src/dialog.cpp @@ -303,7 +303,7 @@ INT_PTR addContact(WPARAM wParam, LPARAM lParam) {
char tmp[256];
MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)MODNAME);
+ Proto_AddToContact(hContact, MODNAME);
CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE);
db_set_ts(hContact, MODNAME, "Nick", TranslateT("New Non-IM Contact"));
DoPropertySheet(hContact, hInst);
@@ -319,7 +319,7 @@ INT_PTR editContact(WPARAM wParam, LPARAM lParam) char tmp[256];
if (!hContact) {
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)MODNAME);
+ Proto_AddToContact(hContact, MODNAME);
CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE);
db_set_s(hContact, MODNAME, "Nick", Translate("New Non-IM Contact"));
}
diff --git a/plugins/Non-IM Contact/src/main.cpp b/plugins/Non-IM Contact/src/main.cpp index 76bdd444de..7b556e486e 100644 --- a/plugins/Non-IM Contact/src/main.cpp +++ b/plugins/Non-IM Contact/src/main.cpp @@ -125,7 +125,7 @@ extern "C" __declspec(dllexport) int Load() HookEvent(ME_CLIST_STATUSMODECHANGE, SetLCStatus);
PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE, MODNAME, PROTOTYPE_VIRTUAL };
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
//load services (the first 5 are the basic ones needed to make a new protocol)
CreateProtoServiceFunction(MODNAME, PS_GETCAPS, GetLCCaps);
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index 88c1756f74..8f627acfa2 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -216,8 +216,7 @@ void LoadProtocols(void) int numberOfProtocols = 0;
PROTOACCOUNT **ppProtocolDescriptors;
- INT_PTR ret = ProtoEnumAccounts(&numberOfProtocols, &ppProtocolDescriptors);
- if (ret == 0)
+ Proto_EnumAccounts(&numberOfProtocols, &ppProtocolDescriptors);
for (int i = 0; i < numberOfProtocols; i++)
Nudge_AddAccount(ppProtocolDescriptors[i]);
diff --git a/plugins/OpenSSL/src/commonheaders.h b/plugins/OpenSSL/src/commonheaders.h index 149c1e85b7..99b3c76c9a 100644 --- a/plugins/OpenSSL/src/commonheaders.h +++ b/plugins/OpenSSL/src/commonheaders.h @@ -50,7 +50,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_langpack.h> #include <m_button.h> #include <m_protosvc.h> -#include <m_protomod.h> #include <m_protocols.h> #include <m_options.h> #include <m_skin.h> diff --git a/plugins/Ping/src/options.cpp b/plugins/Ping/src/options.cpp index cab4183c93..0e99ed7778 100644 --- a/plugins/Ping/src/options.cpp +++ b/plugins/Ping/src/options.cpp @@ -195,7 +195,7 @@ INT_PTR CALLBACK DlgProcDestEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l int num_protocols = 0;
PROTOACCOUNT **pppDesc;
- ProtoEnumAccounts(&num_protocols, &pppDesc);
+ Proto_EnumAccounts(&num_protocols, &pppDesc);
for (int i = 0; i < num_protocols; i++)
SendDlgItemMessage(hwndDlg, IDC_COMBO_DESTPROTO, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)pppDesc[i]->tszAccountName);
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index f5191a64e7..c0465a06a0 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -56,7 +56,7 @@ void SetProtoStatus(TCHAR *pszLabel, char *pszProto, int if_status, int new_stat int num_protocols;
PROTOACCOUNT **pppDesc;
- ProtoEnumAccounts(&num_protocols, &pppDesc);
+ Proto_EnumAccounts(&num_protocols, &pppDesc);
for (int i = 0; i < num_protocols; i++) {
SetProtoStatus(pszLabel, pppDesc[i]->szModuleName, if_status, new_status);
}
@@ -230,9 +230,7 @@ void __cdecl sttCheckStatusThreadProc(void *vp) upCount = count;
total = index;
}
- else {
- total = 0;
- }
+ else total = 0;
}
}
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp index 9d11296629..129f16fafe 100644 --- a/plugins/Popup/src/opt_gen.cpp +++ b/plugins/Popup/src/opt_gen.cpp @@ -204,7 +204,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM {
int protocolCount = 0;
PROTOACCOUNT **protocols;
- ProtoEnumAccounts(&protocolCount, &protocols);
+ Proto_EnumAccounts(&protocolCount, &protocols);
DWORD globalFlags = 0;
for (int i = 0; i < protocolCount; ++i) {
if (!protocols[i]->bIsVirtual) {
@@ -521,7 +521,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM {
int protocolCount;
PROTOACCOUNT **protocols;
- ProtoEnumAccounts(&protocolCount, &protocols);
+ Proto_EnumAccounts(&protocolCount, &protocols);
for (int i = 0; i < protocolCount; ++i) {
if (!protocols[i]->bIsVirtual) {
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index 0e6c805738..3a2ea7b491 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -112,7 +112,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) int pcount = 0;
PROTOACCOUNT** pdesc;
- ProtoEnumAccounts(&pcount,&pdesc);
+ Proto_EnumAccounts(&pcount,&pdesc);
opts.num_protos = pcount;
@@ -410,7 +410,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) TCHAR *tmp = (TCHAR *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR);
mir_tstrncpy(contact->szname, tmp, SIZEOF(contact->szname));
- PROTOACCOUNT *acc = ProtoGetAccount(pszProto);
+ PROTOACCOUNT *acc = Proto_GetAccount(pszProto);
if (acc != NULL)
mir_tstrncpy(contact->proto, acc->tszAccountName, SIZEOF(contact->proto));
diff --git a/plugins/QuickMessages/src/quickmessages.h b/plugins/QuickMessages/src/quickmessages.h index e40ef0c385..044d0137c7 100644 --- a/plugins/QuickMessages/src/quickmessages.h +++ b/plugins/QuickMessages/src/quickmessages.h @@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <m_clist.h>
#include <m_options.h>
#include <m_utils.h>
-#include <m_protomod.h>
+#include <m_protosvc.h>
#include <m_langpack.h>
#include <m_icolib.h>
#include <m_message.h>
diff --git a/plugins/QuickSearch/sr_global.pas b/plugins/QuickSearch/sr_global.pas index b7431f54ca..2f7e59c2c0 100644 --- a/plugins/QuickSearch/sr_global.pas +++ b/plugins/QuickSearch/sr_global.pas @@ -373,7 +373,7 @@ begin width :=82;
flags :=COL_ON;
setting_type :=QST_SERVICE;
- StrDup (service.service,MS_PROTO_GETCONTACTBASEACCOUNT);
+ StrDup (service.service,'Proto/GetContactBaseAccount');
service.flags :=ACF_TYPE_STRING;
service.w_flags:=ACF_TYPE_PARAM;
service.l_flags:=ACF_TYPE_NUMBER;
diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp index 6693535fe9..289696bb4d 100644 --- a/plugins/Quotes/src/Forex.cpp +++ b/plugins/Quotes/src/Forex.cpp @@ -441,16 +441,13 @@ extern "C" Quotes_IconsInit();
Quotes_InitExtraIcons();
- PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
+ PROTOCOLDESCRIPTOR pd = { 0 };
+ pd.cbSize = PROTOCOLDESCRIPTOR_V3_SIZE;
pd.szName = QUOTES_PROTOCOL_NAME;
pd.type = PROTOTYPE_VIRTUAL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
- // CreateProtoServiceFunction(QUOTES_PROTOCOL_NAME, PS_GETNAME, QuoteProtoFunc_GetName);
- // CreateProtoServiceFunction(QUOTES_PROTOCOL_NAME, PS_GETCAPS, QuoteProtoFunc_GetCaps);
- // CreateProtoServiceFunction(QUOTES_PROTOCOL_NAME, PS_SETSTATUS, QuoteProtoFunc_SetStatus);
CreateProtoServiceFunction(QUOTES_PROTOCOL_NAME, PS_GETSTATUS, QuoteProtoFunc_GetStatus);
- // CreateProtoServiceFunction(QUOTES_PROTOCOL_NAME, PS_LOADICON, QuoteProtoFunc_LoadIcon);
HookEvent(ME_SYSTEM_MODULESLOADED, QuotesEventFunc_OnModulesLoaded);
HookEvent(ME_DB_CONTACT_DELETED, QuotesEventFunc_OnContactDeleted);
diff --git a/plugins/Quotes/src/QuotesProviderBase.cpp b/plugins/Quotes/src/QuotesProviderBase.cpp index 74dbfc01f0..a0d1ff989b 100644 --- a/plugins/Quotes/src/QuotesProviderBase.cpp +++ b/plugins/Quotes/src/QuotesProviderBase.cpp @@ -573,7 +573,7 @@ namespace dbei.timestamp = static_cast<DWORD>(nTime);
dbei.flags = DBEF_READ | DBEF_UTF;
dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.cbBlob = ::mir_strlen(psz) + 1;
+ dbei.cbBlob = (int)::mir_strlen(psz) + 1;
dbei.pBlob = (PBYTE)(char*)psz;
db_event_add(hContact, &dbei);
}
@@ -818,7 +818,7 @@ MCONTACT CQuotesProviderBase::CreateNewContact(const tstring& rsName) {
MCONTACT hContact = MCONTACT(CallService(MS_DB_CONTACT_ADD, 0, 0));
if (hContact) {
- if (0 == CallService(MS_PROTO_ADDTOCONTACT, WPARAM(hContact), (LPARAM)QUOTES_PROTOCOL_NAME)) {
+ if (0 == Proto_AddToContact(hContact, QUOTES_PROTOCOL_NAME)) {
tstring sProvName = GetInfo().m_sName;
db_set_ts(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_PROVIDER, sProvName.c_str());
db_set_ts(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_SYMBOL, rsName.c_str());
diff --git a/plugins/Quotes/src/stdafx.h b/plugins/Quotes/src/stdafx.h index fe6920d233..7ee55294c5 100644 --- a/plugins/Quotes/src/stdafx.h +++ b/plugins/Quotes/src/stdafx.h @@ -21,11 +21,11 @@ #include <newpluginapi.h>
#include <m_database.h>
-#include <m_protomod.h>
#include <win2k.h>
#include <m_xml.h>
#include <m_langpack.h>
#include <m_options.h>
+#include <m_protosvc.h>
#include <m_extraicons.h>
#include <m_icolib.h>
#include <m_genmenu.h>
diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp index aaef72e0a9..1444053de8 100644 --- a/plugins/RemovePersonalSettings/src/rps.cpp +++ b/plugins/RemovePersonalSettings/src/rps.cpp @@ -198,11 +198,10 @@ void SetProtocolsOffline() {
if ( GetSettingBool("GlobalSettings", "SetProtocolsOffline", TRUE) ) {
PROTOACCOUNT **accounts;
- int i,count;
-
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&count, (LPARAM)&accounts);
+ int count;
+ Proto_EnumAccounts(&count, &accounts);
- for (i = 0; i < count; i++) {
+ for (int i = 0; i < count; i++) {
/*if (protos[i]->type != PROTOTYPE_PROTOCOL)
continue;*/
if (!accounts[i]->bIsEnabled)
@@ -324,9 +323,7 @@ void RemoveSettings() if ( GetSettingBool("GlobalSettings", "RemoveProtocolSettings", TRUE) ) {
PROTOACCOUNT **accounts;
int i,count;
-
- // TODO MS_PROTO_ENUMACCOUNTS
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&count, (LPARAM)&accounts);
+ Proto_EnumAccounts(&count, &accounts);
for (i = 0; i < count; i++) {
/*if (protos[i]->type != PROTOTYPE_PROTOCOL)
@@ -434,11 +431,10 @@ void RemoveDirectories() // Remove protocol folders
if (GetSettingBool("GlobalSettings", "RemoveProtocolFolders", TRUE)) {
PROTOACCOUNT **accounts;
- int i,count;
-
- CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&count, (LPARAM)&accounts);
+ int count;
+ Proto_EnumAccounts(&count, &accounts);
- for (i = 0; i < count; i++) {
+ for (int i = 0; i < count; i++) {
/*if (protos[i]->type != PROTOTYPE_PROTOCOL)
continue;*/
if (!accounts[i]->bIsEnabled)
diff --git a/plugins/SMS/src/functions.cpp b/plugins/SMS/src/functions.cpp index e407e26228..da12ae052a 100644 --- a/plugins/SMS/src/functions.cpp +++ b/plugins/SMS/src/functions.cpp @@ -502,13 +502,13 @@ int RefreshAccountList(WPARAM eventCode,LPARAM lParam) int dwAccCount=0,dwSMSAccountsCount=0;
PROTOACCOUNT **ppaAccounts;
- ProtoEnumAccounts((int*)&dwAccCount,&ppaAccounts);
+ Proto_EnumAccounts((int*)&dwAccCount,&ppaAccounts);
FreeAccountList();
ssSMSSettings.ppaSMSAccounts=(PROTOACCOUNT**)MEMALLOC((dwAccCount*sizeof(LPVOID)));
if (ssSMSSettings.ppaSMSAccounts)
for (int i=0; i < dwAccCount; i++)
- if ( IsAccountEnabled(ppaAccounts[i]))
+ if ( Proto_IsAccountEnabled(ppaAccounts[i]))
if ( ProtoServiceExists(ppaAccounts[i]->szModuleName,MS_ICQ_SENDSMS))
ssSMSSettings.ppaSMSAccounts[dwSMSAccountsCount++] = ppaAccounts[i];
diff --git a/plugins/Scriver/src/chat/chat.h b/plugins/Scriver/src/chat/chat.h index ff3e798807..53ed0d2758 100644 --- a/plugins/Scriver/src/chat/chat.h +++ b/plugins/Scriver/src/chat/chat.h @@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef _CHAT_H_
#define _CHAT_H_
-#include <m_protomod.h>
#include <m_chat_int.h>
#define EM_ACTIVATE (WM_USER+202)
diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp index 70902bc0b5..c1071ad415 100644 --- a/plugins/Scriver/src/msgwindow.cpp +++ b/plugins/Scriver/src/msgwindow.cpp @@ -65,9 +65,9 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto) tokenLen[2] = j;
}
- char *accModule = (char*)CallService(MS_PROTO_GETCONTACTBASEACCOUNT, hContact, 0);
+ char *accModule = Proto_GetBaseAccountName(hContact);
if (accModule != NULL) {
- PROTOACCOUNT* proto = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)accModule);
+ PROTOACCOUNT* proto = Proto_GetAccount(accModule);
if (proto != NULL) {
tokens[3] = mir_tstrdup(proto->tszAccountName);
tokenLen[3] = mir_tstrlen(tokens[3]);
diff --git a/plugins/SecureIM/src/commonheaders.h b/plugins/SecureIM/src/commonheaders.h index f416e46339..18908fb146 100644 --- a/plugins/SecureIM/src/commonheaders.h +++ b/plugins/SecureIM/src/commonheaders.h @@ -22,7 +22,7 @@ #include <win2k.h>
#include <newpluginapi.h>
#include <m_database.h>
-#include <m_protomod.h>
+#include <m_protosvc.h>
#include <m_langpack.h>
#include <m_options.h>
#include <m_skin.h>
diff --git a/plugins/SecureIM/src/crypt_lists.cpp b/plugins/SecureIM/src/crypt_lists.cpp index 3ea94b4b62..8d1fcc1fd0 100644 --- a/plugins/SecureIM/src/crypt_lists.cpp +++ b/plugins/SecureIM/src/crypt_lists.cpp @@ -21,7 +21,7 @@ void loadSupportedProtocols() int numberOfProtocols;
PROTOACCOUNT **protos;
- ProtoEnumAccounts(&numberOfProtocols, &protos);
+ Proto_EnumAccounts(&numberOfProtocols, &protos);
for (int i = 0; i < numberOfProtocols; i++) {
if (!protos[i]->szModuleName || !CallProtoService(protos[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0))
@@ -67,7 +67,7 @@ void freeSupportedProtocols() pSupPro getSupPro(MCONTACT hContact)
{
for (int j = 0; j < arProto.getCount(); j++)
- if (CallService(MS_PROTO_ISPROTOONCONTACT, hContact, (LPARAM)arProto[j]->name))
+ if (Proto_IsProtoOnContact(hContact, arProto[j]->name))
return arProto[j];
return NULL;
diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp index 3c77fe47c2..ab5c5de63f 100644 --- a/plugins/SecureIM/src/main.cpp +++ b/plugins/SecureIM/src/main.cpp @@ -346,7 +346,7 @@ extern "C" __declspec(dllexport) int __cdecl Load(void) pd.cbSize = sizeof(pd);
pd.szName = (char*)MODULENAME;
pd.type = PROTOTYPE_ENCRYPTION;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
// hook events
HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded);
diff --git a/plugins/SecureIM/src/svcs_proto.cpp b/plugins/SecureIM/src/svcs_proto.cpp index 13a3ee9445..f9e690f68a 100644 --- a/plugins/SecureIM/src/svcs_proto.cpp +++ b/plugins/SecureIM/src/svcs_proto.cpp @@ -48,28 +48,28 @@ LPSTR szUnrtfMsg = NULL; // RecvMsg handler
INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam)
{
- CCSDATA *pccsd = (CCSDATA *)lParam;
- PROTORECVEVENT *ppre = (PROTORECVEVENT *)pccsd->lParam;
- pUinKey ptr = getUinKey(pccsd->hContact);
+ CCSDATA *ccs = (CCSDATA *)lParam;
+ PROTORECVEVENT *ppre = (PROTORECVEVENT *)ccs->lParam;
+ pUinKey ptr = getUinKey(ccs->hContact);
LPSTR szEncMsg = ppre->szMessage, szPlainMsg = NULL;
Sent_NetLog("onRecvMsg: %s", szEncMsg);
int ssig = getSecureSig(ppre->szMessage, &szEncMsg);
- bool bSecured = (isContactSecured(pccsd->hContact)&SECURED) != 0;
- bool bPGP = isContactPGP(pccsd->hContact);
- bool bGPG = isContactGPG(pccsd->hContact);
+ bool bSecured = (isContactSecured(ccs->hContact)&SECURED) != 0;
+ bool bPGP = isContactPGP(ccs->hContact);
+ bool bGPG = isContactGPG(ccs->hContact);
// pass any unchanged message
- if (!ptr || ssig == SiG_GAME || !isSecureProtocol(pccsd->hContact) ||
- (db_mc_isMeta(pccsd->hContact) && (pccsd->wParam & PREF_SIMNOMETA)) || isChatRoom(pccsd->hContact) ||
+ if (!ptr || ssig == SiG_GAME || !isSecureProtocol(ccs->hContact) ||
+ (db_mc_isMeta(ccs->hContact) && (ccs->wParam & PREF_SIMNOMETA)) || isChatRoom(ccs->hContact) ||
(ssig == SiG_NONE && !ptr->msgSplitted && !bSecured && !bPGP && !bGPG)) {
Sent_NetLog("onRecvMsg: pass unhandled");
- return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ return Proto_ChainRecv(wParam, ccs);
}
// drop message: fake, unsigned or from invisible contacts
- if (isContactInvisible(pccsd->hContact) || ssig == SiG_FAKE) {
+ if (isContactInvisible(ccs->hContact) || ssig == SiG_FAKE) {
Sent_NetLog("onRecvMsg: drop unhandled (contact invisible or hidden)");
return 1;
}
@@ -80,8 +80,8 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) ptrA szPlainMsg(m_aastrcat(Translate(sim402), szEncMsg));
ppre->szMessage = szPlainMsg;
- pccsd->wParam |= PREF_SIMNOMETA;
- return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ ccs->wParam |= PREF_SIMNOMETA;
+ return Proto_ChainRecv(wParam, ccs);
}
// received non-pgp secure message from disabled contact
@@ -90,12 +90,12 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) if (ptr->mode == MODE_NATIVE) {
// tell to the other side that we have the plugin disabled with him
- pccsd->wParam |= PREF_METANODB;
- pccsd->lParam = (LPARAM)SIG_DISA;
- pccsd->szProtoService = PSS_MESSAGE;
- CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ ccs->wParam |= PREF_METANODB;
+ ccs->lParam = (LPARAM)SIG_DISA;
+ ccs->szProtoService = PSS_MESSAGE;
+ Proto_ChainSend(wParam, ccs);
- showPopup(sim003, pccsd->hContact, g_hPOP[POP_PU_DIS], 0);
+ showPopup(sim003, ccs->hContact, g_hPOP[POP_PU_DIS], 0);
}
else {
createRSAcntx(ptr);
@@ -133,7 +133,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) szEncMsg = ppre->szMessage;
if (!ptr->cntx) {
- ptr->cntx = cpp_create_context(((bGPGloaded && bGPGkeyrings) ? CPP_MODE_GPG : CPP_MODE_PGP) | ((db_get_b(pccsd->hContact, MODULENAME, "gpgANSI", 0)) ? CPP_MODE_GPG_ANSI : 0));
+ ptr->cntx = cpp_create_context(((bGPGloaded && bGPGkeyrings) ? CPP_MODE_GPG : CPP_MODE_PGP) | ((db_get_b(ccs->hContact, MODULENAME, "gpgANSI", 0)) ? CPP_MODE_GPG_ANSI : 0));
ptr->keyLoaded = 0;
}
@@ -153,30 +153,30 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) if (!szOldMsg) { // error while decrypting message, send error
SAFE_FREE(ptr->msgSplitted);
ppre->szMessage = Translate(sim401);
- return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ return Proto_ChainRecv(wParam, ccs);
}
// receive encrypted message in non-encrypted mode
- if (!isContactPGP(pccsd->hContact) && !isContactGPG(pccsd->hContact)) {
+ if (!isContactPGP(ccs->hContact) && !isContactGPG(ccs->hContact)) {
szNewMsg = m_ustrcat(Translate(sim403), szOldMsg);
szOldMsg = szNewMsg;
}
ptrA szMsgUtf(utf8_to_miranda(szOldMsg, ppre->flags));
- pccsd->wParam = ppre->flags;
+ ccs->wParam = ppre->flags;
ppre->szMessage = szMsgUtf;
// show decoded message
showPopupRM(ptr->hContact);
SAFE_FREE(ptr->msgSplitted);
- pccsd->wParam |= PREF_SIMNOMETA;
- return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ ccs->wParam |= PREF_SIMNOMETA;
+ return Proto_ChainRecv(wParam, ccs);
}
Sent_NetLog("onRecvMsg: switch(ssig)=%d", ssig);
switch (ssig) {
case SiG_PGPM:
- return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ return Proto_ChainRecv(wParam, ccs);
case SiG_SECU: // new secured msg, pass to rsa_recv
Sent_NetLog("onRecvMsg: RSA/AES message");
@@ -197,14 +197,14 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) return 1; // don't display it ...
ptrA szNewMsg(utf8_to_miranda(szOldMsg, ppre->flags));
- pccsd->wParam = ppre->flags;
+ ccs->wParam = ppre->flags;
ppre->szMessage = szNewMsg;
// show decoded message
showPopupRM(ptr->hContact);
SAFE_FREE(ptr->msgSplitted);
- pccsd->wParam |= PREF_SIMNOMETA;
- return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ ccs->wParam |= PREF_SIMNOMETA;
+ return Proto_ChainRecv(wParam, ccs);
}
case SiG_ENON: // online message
@@ -228,14 +228,14 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) mir_strcpy(reSend, SIG_RSND); // copy resend sig
mir_strcat(reSend, szEncMsg); // add mess
- pccsd->wParam |= PREF_METANODB;
- pccsd->lParam = (LPARAM)reSend; // reSend Message to reemit
- pccsd->szProtoService = PSS_MESSAGE;
- CallService(MS_PROTO_CHAINSEND, wParam, lParam); // send back cipher message
+ ccs->wParam |= PREF_METANODB;
+ ccs->lParam = (LPARAM)reSend; // reSend Message to reemit
+ ccs->szProtoService = PSS_MESSAGE;
+ Proto_ChainSend(wParam, ccs); // send back cipher message
ptrA keyToSend(InitKeyA(ptr, 0)); // calculate public and private key
- pccsd->lParam = keyToSend;
- CallService(MS_PROTO_CHAINSEND, wParam, lParam); // send new key
+ ccs->lParam = keyToSend;
+ Proto_ChainSend(wParam, ccs); // send new key
showPopup(sim005, NULL, g_hPOP[POP_PU_DIS], 0);
showPopupKS(ptr->hContact);
@@ -256,7 +256,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
dbv.type = DBVT_BLOB;
if (db_get(ptr->hContact, MODULENAME, "offlineKey", &dbv))
- return CallService(MS_PROTO_CHAINRECV, wParam, lParam); // exit and show messsage
+ return Proto_ChainRecv(wParam, ccs); // exit and show messsage
// if valid key is succefully retrieved
ptr->offlineKey = true;
@@ -273,7 +273,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) if (cpp_keyx(ptr->cntx)) {
// decrypt sended back message and save message for future sending with a new secret key
- addMsg2Queue(ptr, pccsd->wParam, ptrA(decodeMsg(ptr, (LPARAM)pccsd, szEncMsg)));
+ addMsg2Queue(ptr, ccs->wParam, ptrA(decodeMsg(ptr, (LPARAM)ccs, szEncMsg)));
showPopupRM(ptr->hContact);
showPopup(sim004, NULL, g_hPOP[POP_PU_DIS], 0);
}
@@ -336,8 +336,8 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) loadRSAkey(ptr);
exp->rsa_connect(ptr->cntx);
- showPopupKS(pccsd->hContact);
- ShowStatusIconNotify(pccsd->hContact);
+ showPopupKS(ccs->hContact);
+ ShowStatusIconNotify(ccs->hContact);
return 1;
}
@@ -348,10 +348,10 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) ptrA keyToSend(InitKeyA(ptr, CPP_FEATURES_NEWPG | KEY_A_SIG)); // calculate NEW public and private key
Sent_NetLog("onRecvMsg: Sending KEYA %s", keyToSend);
- pccsd->wParam |= PREF_METANODB;
- pccsd->lParam = (LPARAM)keyToSend;
- pccsd->szProtoService = PSS_MESSAGE;
- CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ ccs->wParam |= PREF_METANODB;
+ ccs->lParam = (LPARAM)keyToSend;
+ ccs->szProtoService = PSS_MESSAGE;
+ Proto_ChainSend(wParam, ccs);
showPopupKS(ptr->hContact);
waitForExchange(ptr); // çàïóñòèì îæèäàíèå
@@ -363,10 +363,10 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) ptrA keyToSend(InitKeyA(ptr, 0)); // calculate public and private key
Sent_NetLog("onRecvMsg: Sending KEYA %s", keyToSend);
- pccsd->wParam |= PREF_METANODB;
- pccsd->lParam = (LPARAM)keyToSend;
- pccsd->szProtoService = PSS_MESSAGE;
- CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ ccs->wParam |= PREF_METANODB;
+ ccs->lParam = (LPARAM)keyToSend;
+ ccs->szProtoService = PSS_MESSAGE;
+ Proto_ChainSend(wParam, ccs);
showPopupKS(ptr->hContact);
}
@@ -393,10 +393,10 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) ptrA keyToSend(InitKeyA(ptr, CPP_FEATURES_NEWPG | KEY_B_SIG)); // calculate NEW public and private key
Sent_NetLog("onRecvMsg: Sending KEYB %s", keyToSend);
- pccsd->wParam |= PREF_METANODB;
- pccsd->lParam = keyToSend;
- pccsd->szProtoService = PSS_MESSAGE;
- CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ ccs->wParam |= PREF_METANODB;
+ ccs->lParam = keyToSend;
+ ccs->szProtoService = PSS_MESSAGE;
+ Proto_ChainSend(wParam, ccs);
}
break;
@@ -441,8 +441,8 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) Sent_NetLog("onRecvMsg: exit");
- pccsd->wParam |= PREF_SIMNOMETA;
- int ret = CallService(MS_PROTO_CHAINRECV, wParam, lParam);
+ ccs->wParam |= PREF_SIMNOMETA;
+ int ret = Proto_ChainRecv(wParam, ccs);
SAFE_FREE(szPlainMsg);
return ret;
}
@@ -450,19 +450,19 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) // SendMsg handler
INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam)
{
- CCSDATA *pccsd = (CCSDATA*)lParam;
- pUinKey ptr = getUinKey(pccsd->hContact);
- int ssig = getSecureSig((LPCSTR)pccsd->lParam);
- int stat = getContactStatus(pccsd->hContact);
+ CCSDATA *ccs = (CCSDATA*)lParam;
+ pUinKey ptr = getUinKey(ccs->hContact);
+ int ssig = getSecureSig((LPCSTR)ccs->lParam);
+ int stat = getContactStatus(ccs->hContact);
- Sent_NetLog("onSend: %s", (LPSTR)pccsd->lParam);
+ Sent_NetLog("onSend: %s", (LPSTR)ccs->lParam);
// pass unhandled messages
if (!ptr || ssig == SiG_GAME || ssig == SiG_PGPM || ssig == SiG_SECU || ssig == SiG_SECP ||
- isChatRoom(pccsd->hContact) || stat == -1 ||
+ isChatRoom(ccs->hContact) || stat == -1 ||
(ssig == SiG_NONE && ptr->sendQueue) || (ssig == SiG_NONE && ptr->status == STATUS_DISABLED)) {
Sent_NetLog("onSendMsg: pass unhandled");
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
}
//
@@ -479,28 +479,28 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) }
if (!ptr->keyLoaded && bPGPloaded) ptr->keyLoaded = LoadKeyPGP(ptr);
if (!ptr->keyLoaded && bGPGloaded) ptr->keyLoaded = LoadKeyGPG(ptr);
- if (!ptr->keyLoaded) return returnError(pccsd->hContact, Translate(sim108));
+ if (!ptr->keyLoaded) return returnError(ccs->hContact, Translate(sim108));
LPSTR szNewMsg = NULL;
- ptrA szUtfMsg(miranda_to_utf8((LPCSTR)pccsd->lParam, pccsd->wParam));
+ ptrA szUtfMsg(miranda_to_utf8((LPCSTR)ccs->lParam, ccs->wParam));
if (ptr->keyLoaded == 1) // PGP
szNewMsg = pgp_encode(ptr->cntx, szUtfMsg);
else if (ptr->keyLoaded == 2) // GPG
szNewMsg = gpg_encode(ptr->cntx, szUtfMsg);
if (!szNewMsg)
- return returnError(pccsd->hContact, Translate(sim109));
+ return returnError(ccs->hContact, Translate(sim109));
// îòïðàâëÿåì çàøèôðîâàííîå ñîîáùåíèå
splitMessageSend(ptr, szNewMsg);
showPopupSM(ptr->hContact);
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
}
// îòïðàâëÿåì íåçàøèôðîâàííîå
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
}
// get contact SecureIM status
@@ -523,16 +523,16 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) if (!bSOM || (!isClientMiranda(ptr, 1) && !isSecureIM(ptr, 1)) || !loadRSAkey(ptr)) {
if (ssig == SiG_NONE)
// ïðîñòî øëåì íåçàøèôðîâàííîå â îôôëàéí
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
// íè÷åãî íå øëåì äàëüøå - ýòî ñëóæåáíîå ñîîáùåíèå
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
}
// øëåì øèôðîâàííîå â îôôëàéí
- exp->rsa_send(ptr->cntx, ptrA(miranda_to_utf8((LPCSTR)pccsd->lParam, pccsd->wParam)));
+ exp->rsa_send(ptr->cntx, ptrA(miranda_to_utf8((LPCSTR)ccs->lParam, ccs->wParam)));
showPopupSM(ptr->hContact);
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
}
// SecureIM connection with this contact is disabled
@@ -543,10 +543,10 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) }
if (ssig == SiG_NONE) // ïðîñòî øëåì íåçàøèôðîâàííîå
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
// íè÷åãî íå øëåì äàëüøå - ýòî ñëóæåáíîå ñîîáùåíèå
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
}
// ðàçîðâàòü ñîåäèíåíèå
@@ -557,21 +557,21 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) }
ShowStatusIconNotify(ptr->hContact);
waitForExchange(ptr, 3); // äîøëåì íåøèôðîâàííî
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
}
// ñîåäèíåíèå óñòàíîâëåíî
if (ptr->cntx && exp->rsa_get_state(ptr->cntx) == 7) {
- exp->rsa_send(ptr->cntx, ptrA(miranda_to_utf8((LPCSTR)pccsd->lParam, pccsd->wParam)));
+ exp->rsa_send(ptr->cntx, ptrA(miranda_to_utf8((LPCSTR)ccs->lParam, ccs->wParam)));
ShowStatusIconNotify(ptr->hContact);
showPopupSM(ptr->hContact);
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
}
// ïðîñòî ñîîáùåíèå (áåç òýãîâ, íåò êîíòåêñòà è ðàáîòàþò AIP & NOL)
if (ssig == SiG_NONE && isSecureIM(ptr->hContact)) {
// äîáàâèì åãî â î÷åðåäü
- addMsg2Queue(ptr, pccsd->wParam, (LPSTR)pccsd->lParam);
+ addMsg2Queue(ptr, ccs->wParam, (LPSTR)ccs->lParam);
// çàïóñêàåì ïðîöåññ óñòàíîâêè ñîåäèíåíèÿ
ssig = SiG_INIT;
// çàïóñêàåì òðýä îæèäàíèÿ è äîñûëêè
@@ -583,13 +583,13 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) createRSAcntx(ptr);
loadRSAkey(ptr);
exp->rsa_connect(ptr->cntx);
- showPopupKS(pccsd->hContact);
- ShowStatusIconNotify(pccsd->hContact);
- return returnNoError(pccsd->hContact);
+ showPopupKS(ccs->hContact);
+ ShowStatusIconNotify(ccs->hContact);
+ return returnNoError(ccs->hContact);
}
// ïðîñòî øëåì íåçàøèôðîâàííîå (íå çíàþ äàæå êîãäà òàêîå ñëó÷èòñÿ)
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
}
//
@@ -603,7 +603,7 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) // if user try initialize connection
if (ssig == SiG_INIT) // secure IM is disabled ...
- return returnError(pccsd->hContact, Translate(sim105));
+ return returnError(ccs->hContact, Translate(sim105));
if (ptr->cntx) { // if secure context exists
cpp_delete_context(ptr->cntx); ptr->cntx = 0;
@@ -611,15 +611,15 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) CCSDATA ccsd;
memcpy(&ccsd, (HLOCAL)lParam, sizeof(CCSDATA));
- pccsd->wParam |= PREF_METANODB;
+ ccs->wParam |= PREF_METANODB;
ccsd.lParam = (LPARAM)SIG_DEIN;
ccsd.szProtoService = PSS_MESSAGE;
- CallService(MS_PROTO_CHAINSEND, wParam, (LPARAM)&ccsd);
+ Proto_ChainSend(wParam, &ccsd);
- showPopupDC(pccsd->hContact);
- ShowStatusIconNotify(pccsd->hContact);
+ showPopupDC(ccs->hContact);
+ ShowStatusIconNotify(ccs->hContact);
}
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
}
// contact is offline
@@ -631,10 +631,10 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) if (!bSOM) {
if (ssig != SiG_NONE)
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
// exit and send unencrypted message
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
}
BOOL isMiranda = isClientMiranda(ptr->hContact);
@@ -652,18 +652,18 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) db_unset(ptr->hContact, MODULENAME, "offlineKey");
db_unset(ptr->hContact, MODULENAME, "offlineKeyTimeout");
if (msgbox1(0, sim106, MODULENAME, MB_YESNO | MB_ICONQUESTION) == IDNO)
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
// exit and send unencrypted message
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
}
}
else {
if (ssig != SiG_NONE)
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
// exit and send unencrypted message
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
}
}
else {
@@ -691,31 +691,31 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) if (ptr->cntx) {
cpp_delete_context(ptr->cntx); ptr->cntx = 0;
- pccsd->wParam |= PREF_METANODB;
- CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ ccs->wParam |= PREF_METANODB;
+ Proto_ChainSend(wParam, ccs);
- showPopupDC(pccsd->hContact);
- ShowStatusIconNotify(pccsd->hContact);
+ showPopupDC(ccs->hContact);
+ ShowStatusIconNotify(ccs->hContact);
}
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
}
if (cpp_keya(ptr->cntx) && cpp_keyb(ptr->cntx) && !cpp_keyx(ptr->cntx))
CalculateKeyX(ptr, ptr->hContact);
- ShowStatusIconNotify(pccsd->hContact);
+ ShowStatusIconNotify(ccs->hContact);
// if cryptokey exist
if (cpp_keyx(ptr->cntx)) {
Sent_NetLog("onSendMsg: cryptokey exist");
- ptrA szNewMsg(encodeMsg(ptr, (LPARAM)pccsd));
+ ptrA szNewMsg(encodeMsg(ptr, (LPARAM)ccs));
Sent_NetLog("onSend: encrypted msg '%s'", szNewMsg);
- pccsd->wParam |= PREF_METANODB;
- pccsd->lParam = szNewMsg;
- pccsd->szProtoService = PSS_MESSAGE;
- int ret = CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ ccs->wParam |= PREF_METANODB;
+ ccs->lParam = szNewMsg;
+ ccs->szProtoService = PSS_MESSAGE;
+ int ret = Proto_ChainSend(wParam, ccs);
showPopupSM(ptr->hContact);
return ret;
@@ -726,26 +726,26 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) // send KeyA if init || always_try || waitkey || always_if_possible
if (ssig == SiG_INIT || (stid == STATUS_ALWAYSTRY && isClientMiranda(ptr->hContact)) || isSecureIM(ptr->hContact) || ptr->waitForExchange) {
if (ssig == SiG_NONE)
- addMsg2Queue(ptr, pccsd->wParam, (LPSTR)pccsd->lParam);
+ addMsg2Queue(ptr, ccs->wParam, (LPSTR)ccs->lParam);
if (!ptr->waitForExchange) {
// init || always_try || always_if_possible
ptrA keyToSend(InitKeyA(ptr, 0)); // calculate public and private key & fill KeyA
Sent_NetLog("Sending KEY3: %s", keyToSend);
- pccsd->wParam |= PREF_METANODB;
- pccsd->lParam = (LPARAM)keyToSend;
- pccsd->szProtoService = PSS_MESSAGE;
- CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ ccs->wParam |= PREF_METANODB;
+ ccs->lParam = (LPARAM)keyToSend;
+ ccs->szProtoService = PSS_MESSAGE;
+ Proto_ChainSend(wParam, ccs);
- showPopupKS(pccsd->hContact);
- ShowStatusIconNotify(pccsd->hContact);
+ showPopupKS(ccs->hContact);
+ ShowStatusIconNotify(ccs->hContact);
waitForExchange(ptr); // çàïóñêàåì îæèäàíèå
}
- return returnNoError(pccsd->hContact);
+ return returnNoError(ccs->hContact);
}
Sent_NetLog("onSendMsg: pass unchanged to chain");
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
+ return Proto_ChainSend(wParam, ccs);
}
diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp index cd635e746f..e51c8dad93 100644 --- a/plugins/SeenPlugin/src/options.cpp +++ b/plugins/SeenPlugin/src/options.cpp @@ -234,7 +234,7 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM PROTOACCOUNT **protos;
int numberOfProtocols;
- ProtoEnumAccounts(&numberOfProtocols, &protos);
+ Proto_EnumAccounts(&numberOfProtocols, &protos);
for (int i = 0; i < numberOfProtocols; i++) {
if (CallProtoService(protos[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index 98c6e34c68..ea0df3cb61 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -51,7 +51,7 @@ int IsWatchedProtocol(const char* szProto) if (szProto == NULL)
return 0;
- PROTOACCOUNT *pd = ProtoGetAccount(szProto);
+ PROTOACCOUNT *pd = Proto_GetAccount(szProto);
if (pd == NULL || CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
return 0;
@@ -372,7 +372,7 @@ TCHAR *ParseString(TCHAR *szstring, MCONTACT hcontact, BYTE isfile) case 'A':
{
- PROTOACCOUNT *pa = ProtoGetAccount(ci.szProto);
+ PROTOACCOUNT *pa = Proto_GetAccount(ci.szProto);
if (!pa) goto LBL_noData;
_tcsncpy(szdbsetting, pa->tszAccountName, SIZEOF(szdbsetting));
charPtr = szdbsetting;
diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp index 3cf30d20d1..c77d6f3d86 100644 --- a/plugins/ShellExt/src/shlcom.cpp +++ b/plugins/ShellExt/src/shlcom.cpp @@ -193,7 +193,8 @@ void ipcGetSkinIcons(THeaderIPC *ipch) int protoCount;
PROTOACCOUNT **pp;
- if (ProtoEnumAccounts(&protoCount,&pp) == 0 && protoCount != 0) {
+ Proto_EnumAccounts(&protoCount,&pp);
+ if (protoCount != 0) {
spi.pid = GetCurrentProcessId();
while (protoCount > 0) {
PROTOACCOUNT *pa = *pp;
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index 023e3e37c4..4f100ffca0 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -481,7 +481,7 @@ void SaveMessageToDB(const char *szProto, TCHAR *tszMsg, BOOL bIsFormat) {
for (int i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
@@ -699,7 +699,7 @@ INT_PTR SetStatusModeFromExtern(WPARAM wParam, LPARAM lParam) for (int i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) &~ CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
@@ -756,7 +756,7 @@ void SetStatusMessage(const char *szProto, int iInitialStatus, int iStatus, TCHA int status;
for (int i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
@@ -793,7 +793,7 @@ void SetStatusMessage(const char *szProto, int iInitialStatus, int iStatus, TCHA for (int i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
@@ -877,7 +877,7 @@ INT_PTR ShowStatusMessageDialogInternal(WPARAM wParam, LPARAM lParam) {
for (int i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
@@ -896,7 +896,7 @@ INT_PTR ShowStatusMessageDialogInternal(WPARAM wParam, LPARAM lParam) {
for (int i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
@@ -946,7 +946,7 @@ INT_PTR ShowStatusMessageDialog(WPARAM wParam, LPARAM lParam) for (int i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
@@ -1002,7 +1002,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) if (accounts->statusMsgCount == 1 && !szProto) {
for (int i = 0; i < accounts->count; ++i) {
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
@@ -1111,7 +1111,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) if (!bShowDlg || bScreenSaverRunning || (iProtoFlags & PROTO_NOCHANGE && !bOnStartup)) {
TCHAR *msg = NULL;
for (int i = 0; i < accounts->count; ++i) {
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
@@ -1255,7 +1255,7 @@ VOID CALLBACK SetStartupStatusGlobal(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWO // is global status mode going to be set?
for (i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
@@ -1293,7 +1293,7 @@ VOID CALLBACK SetStartupStatusGlobal(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWO for (i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
@@ -1313,7 +1313,7 @@ VOID CALLBACK SetStartupStatusProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD for (i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
@@ -1353,7 +1353,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD d for (int i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
@@ -1434,11 +1434,11 @@ static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam) int iStatusMenuItemCount = 0, count;
DWORD iStatusMsgFlags = 0;
- ProtoEnumAccounts(&count, &pa);
+ Proto_EnumAccounts(&count, &pa);
hProtoStatusMenuItem = (HANDLE *)mir_realloc(hProtoStatusMenuItem, sizeof(HANDLE) * count);
for (int i = 0; i < count; ++i)
{
- if (!IsAccountEnabled(pa[i]))
+ if (!Proto_IsAccountEnabled(pa[i]))
continue;
if (CallProtoService(pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND)
@@ -1468,7 +1468,7 @@ static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam) for (int i = 0; i < count; ++i)
{
- if (!IsAccountEnabled(pa[i]))
+ if (!Proto_IsAccountEnabled(pa[i]))
continue;
if (!CallProtoService(pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
@@ -1487,13 +1487,13 @@ static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam) continue;
TCHAR szBuffer[256];
- if (CallService(MS_PROTO_ISACCOUNTLOCKED,0,(LPARAM)pa[i]->szModuleName))
+ if (Proto_IsAccountLocked(pa[i]->szModuleName))
{
mir_sntprintf(szBuffer, TranslateT("%s (locked)"), pa[i]->tszAccountName);
mi.ptszPopupName = szBuffer;
}
- else
- mi.ptszPopupName = pa[i]->tszAccountName;
+ else mi.ptszPopupName = pa[i]->tszAccountName;
+
hProtoStatusMenuItem[i] = Menu_AddStatusMenuItem(&mi);
}
@@ -1521,7 +1521,7 @@ static int OnIdleChanged(WPARAM, LPARAM lParam) for (int i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (db_get_b(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
@@ -1722,9 +1722,9 @@ static int OnAccListChanged(WPARAM wParam, LPARAM lParam) accounts->statusMsgCount = 0;
UnhookProtoEvents();
- ProtoEnumAccounts(&accounts->count, &accounts->pa);
+ Proto_EnumAccounts(&accounts->count, &accounts->pa);
for (int i = 0; i < accounts->count; ++i) {
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!mir_strcmp(accounts->pa[i]->szProtoName, "ICQ"))
@@ -1816,7 +1816,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) else {
g_uSetStatusTimer = (UINT_PTR *)mir_alloc(sizeof(UINT_PTR) * accounts->count);
for (int i = 0; i < accounts->count; ++i) {
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) & ~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
@@ -1838,7 +1838,7 @@ static int OnOkToExit(WPARAM, LPARAM) char szSetting[80];
for (int i = 0; i < accounts->count; ++i) {
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) & ~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp index 9bbd4adc5c..083a0aa7e1 100644 --- a/plugins/SimpleStatusMsg/src/msgbox.cpp +++ b/plugins/SimpleStatusMsg/src/msgbox.cpp @@ -648,7 +648,7 @@ void ClearHistory(struct MsgBoxData *data, int cur_sel) } db_set_s(NULL, "SimpleStatusMsg", "LastMsg", ""); for (i = 0; i < accounts->count; i++) { - if (!IsAccountEnabled(accounts->pa[i])) + if (!Proto_IsAccountEnabled(accounts->pa[i])) continue; if (!CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0)) @@ -780,7 +780,7 @@ void ChangeDlgStatus(HWND hwndDlg, struct MsgBoxData *msgbox_data, int iStatus) TCHAR szTitle[256], szProtoName[128]; BOOL bDisabled = msgbox_data->m_szProto && !(CallProtoService(msgbox_data->m_szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND); - mir_sntprintf(szProtoName, SIZEOF(szProtoName), msgbox_data->m_szProto ? ProtoGetAccount(msgbox_data->m_szProto)->tszAccountName : TranslateT("global")); + mir_sntprintf(szProtoName, SIZEOF(szProtoName), msgbox_data->m_szProto ? Proto_GetAccount(msgbox_data->m_szProto)->tszAccountName : TranslateT("global")); if (iStatus == ID_STATUS_CURRENT) { if (msgbox_data->m_bOnStartup) mir_sntprintf(szTitle, TranslateT("%s message (%s)"), TranslateT("<startup>"), szProtoName); @@ -905,7 +905,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA TranslateDialogDefault(hwndDlg); init_data = (struct MsgBoxInitData *)lParam; GetWindowText(hwndDlg, szFormat, SIZEOF(szFormat)); - mir_sntprintf(szProtoName, SIZEOF(szProtoName), init_data->m_szProto ? ProtoGetAccount(init_data->m_szProto)->tszAccountName : TranslateT("global")); + mir_sntprintf(szProtoName, SIZEOF(szProtoName), init_data->m_szProto ? Proto_GetAccount(init_data->m_szProto)->tszAccountName : TranslateT("global")); if (init_data->m_iStatus == ID_STATUS_CURRENT) { if (init_data->m_bOnStartup) @@ -1138,7 +1138,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA else { db_set_s(NULL, "SimpleStatusMsg", "LastMsg", ""); for (int j = 0; j < accounts->count; j++) { - if (!IsAccountEnabled(accounts->pa[j])) + if (!Proto_IsAccountEnabled(accounts->pa[j])) continue; if (!CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0)) @@ -1188,7 +1188,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA else { db_set_s(NULL, "SimpleStatusMsg", "LastMsg", buff); for (int j = 0; j < accounts->count; j++) { - if (!IsAccountEnabled(accounts->pa[j])) + if (!Proto_IsAccountEnabled(accounts->pa[j])) continue; if (!CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0)) @@ -1236,7 +1236,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA else { db_set_s(NULL, "SimpleStatusMsg", "LastMsg", buff); for (int j = 0; j < accounts->count; j++) { - if (!IsAccountEnabled(accounts->pa[j])) + if (!Proto_IsAccountEnabled(accounts->pa[j])) continue; if (!CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0)) diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index 44208ff54c..931ceaa6bf 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -143,7 +143,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l for (j = 0; j < accounts->count; j++)
{
- if (!IsAccountEnabled(accounts->pa[j]) || !CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) || !(CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
+ if (!Proto_IsAccountEnabled(accounts->pa[j]) || !CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) || !(CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
mir_snprintf(setting, "%sFlags", accounts->pa[j]->szModuleName);
@@ -190,7 +190,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l for (i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i])
+ if (!Proto_IsAccountEnabled(accounts->pa[i])
|| !CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0)
|| !(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
{
@@ -931,7 +931,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l for (k = 0; k < accounts->count; k++)
{
- if (!IsAccountEnabled(accounts->pa[k]) || !CallProtoService(accounts->pa[k]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) || !(CallProtoService(accounts->pa[k]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
+ if (!Proto_IsAccountEnabled(accounts->pa[k]) || !CallProtoService(accounts->pa[k]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) || !(CallProtoService(accounts->pa[k]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
if (k != j - 1)
@@ -1020,7 +1020,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l for (int j = 0; j < accounts->count; j++)
{
- if (!IsAccountEnabled(accounts->pa[j]))
+ if (!Proto_IsAccountEnabled(accounts->pa[j]))
continue;
if (!(CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
@@ -1046,7 +1046,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l for (i = 0; i < accounts->count; i++)
{
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
@@ -1351,7 +1351,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w }
db_set_s(NULL, "SimpleStatusMsg", "LastMsg", "");
for (i = 0; i < accounts->count; i++) {
- if (!IsAccountEnabled(accounts->pa[i]))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]))
continue;
if (!CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
@@ -1451,7 +1451,7 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa data->setdelay = (int *)mir_alloc(sizeof(int) * accounts->count);
for (i = 0; i < accounts->count; ++i)
{
- if (!IsAccountEnabled(accounts->pa[i]) || !(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) &~ CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]) || !(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) &~ CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
continue;
index = SendDlgItemMessage(hwndDlg, IDC_LISTPROTO, LB_ADDSTRING, 0, (LPARAM)accounts->pa[i]->tszAccountName);
@@ -1637,7 +1637,7 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa char szSetting[80];
for (int i = 0; i < accounts->count; i++)
{
- if (!IsAccountEnabled(accounts->pa[i]) || !(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
+ if (!Proto_IsAccountEnabled(accounts->pa[i]) || !(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
continue;
mir_snprintf(szSetting, "Startup%sStatus", accounts->pa[i]->szModuleName);
diff --git a/plugins/SkypeStatusChange/src/options.cpp b/plugins/SkypeStatusChange/src/options.cpp index f2ed13bfc0..5fc56c5a53 100644 --- a/plugins/SkypeStatusChange/src/options.cpp +++ b/plugins/SkypeStatusChange/src/options.cpp @@ -46,7 +46,7 @@ void InitProtocolTree(HWND hDlg,HWND hwndTreeCtrl) enum{OFFLINE_STATUS_INDEX = 5};
- ProtoEnumAccounts(&cAccounts, &ppAccount);
+ Proto_EnumAccounts(&cAccounts, &ppAccount);
for(int i = 0; i < cAccounts;++i)
{
PROTOACCOUNT* pAccount = ppAccount[i];
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index 63b79d169b..3c568b9735 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -832,7 +832,7 @@ bool SmileyCategoryListType::DeleteCustomCategory(int index) void SmileyCategoryListType::AddAccountAsCategory(PROTOACCOUNT *acc, const CMString& defaultFile)
{
- if (IsAccountEnabled(acc) && acc->szProtoName && IsSmileyProto(acc->szModuleName))
+ if (Proto_IsAccountEnabled(acc) && acc->szProtoName && IsSmileyProto(acc->szModuleName))
{
CMString displayName(acc->tszAccountName ? acc->tszAccountName : A2T_SM(acc->szModuleName));
CMString PhysProtoName, paths;
@@ -981,7 +981,7 @@ void SmileyCategoryListType::AddAllProtocolsAsCategory(void) PROTOCOLDESCRIPTOR **proto;
int protoCount = 0;
- CallService(MS_PROTO_ENUMPROTOS, (WPARAM)&protoCount, (LPARAM)&proto);
+ Proto_EnumProtocols(&protoCount, &proto);
for (int i = 0; i < protoCount; i++){
PROTOCOLDESCRIPTOR* pd = proto[i];
@@ -990,7 +990,7 @@ void SmileyCategoryListType::AddAllProtocolsAsCategory(void) }
PROTOACCOUNT **accList;
- ProtoEnumAccounts(&protoCount, &accList);
+ Proto_EnumAccounts(&protoCount, &accList);
for (int i = 0; i < protoCount; i++)
AddAccountAsCategory(accList[i], defaultFile);
diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp index 10301d536c..1b7a45727f 100644 --- a/plugins/Spamotron/src/options.cpp +++ b/plugins/Spamotron/src/options.cpp @@ -92,7 +92,7 @@ extern HINSTANCE hInst; INT_PTR CALLBACK DlgProcOptionsMain(HWND optDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
static int bInitializing = 0, i, j, numProtocols;
- PROTOCOLDESCRIPTOR** pd;
+ PROTOACCOUNT **pd;
TCHAR pName[256] = {0};
char protoOption[256] = {0};
char protoName[256] = {0};
@@ -102,113 +102,113 @@ INT_PTR CALLBACK DlgProcOptionsMain(HWND optDlg, UINT msg, WPARAM wParam, LPARAM TCHAR buf[512];
switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(optDlg);
- bInitializing = 1;
-
- ///Main enable switch
- CheckDlgButton(optDlg, IDC_OPT_OUT_MSG_APPROVE, _getOptB("ApproveOnMsgOut", defaultApproveOnMsgOut) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(optDlg, IDC_OPT_IN_MSG_APPROVE, _getOptB("ApproveOnMsgIn", defaultApproveOnMsgIn) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(optDlg, IDC_OPT_DONT_REPLY_SAME_MSG, _getOptB("DontReplySameMsg", defaultDontReplySameMsg) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(optDlg, IDC_OPT_DONT_REPLY_MSG, _getOptB("DontReplyMsg", defaultDontReplyMsg) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(optDlg, IDC_OPT_HIDE_UNTIL_VERIFIED, _getOptB("HideUnverified", defaultHideUnverified) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(optDlg, IDC_OPT_ADD_PERMANENTLY, _getOptB("AddPermanently", defaultAddPermanently) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(optDlg, IDC_OPT_LOG_ACTIONS, _getOptB("LogActions", defaultLogActions) ? BST_CHECKED : BST_UNCHECKED);
-
- SetDlgItemText(optDlg, IDC_OPT_IN_MSG_APPROVE_WORDLIST, _getOptS(buf, SIZEOF(buf), "ApproveOnMsgInWordlist", defaultApproveOnMsgInWordlist));
- SetDlgItemText(optDlg, IDC_OPT_MAX_MSG_CONTACT, _itot((unsigned int)_getOptD("MaxMsgContactCountPerDay", defaultMaxMsgContactCountPerDay), buf, 10));
- SetDlgItemText(optDlg, IDC_OPT_MAX_SAME_MSG, _itot((unsigned int)_getOptD("MaxSameMsgCountPerDay", defaultMaxSameMsgCountPerDay), buf, 10));
- SetDlgItemText(optDlg, IDC_OPT_DONT_REPLY_MSG_WORDLIST, _getOptS(buf, SIZEOF(buf), "DontReplyMsgWordlist", defaultDontReplyMsgWordlist));
-
- ///Individual protocols list
- ListView_SetExtendedListViewStyle(hProtocolsList, LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT);
- lvc.mask = LVCF_WIDTH;
- lvc.cx = 120;
- ListView_InsertColumn(hProtocolsList, 0, &lvc);
- lvi.mask = LVIF_TEXT | LVIF_STATE;
- CallService(MS_PROTO_ENUMACCOUNTS, (LPARAM)&numProtocols, (WPARAM)&pd);
- for (i = 0, j = 0; i < numProtocols; i++)
- {
- lvi.iItem = i;
- _getMOptS(pName, 200*sizeof(TCHAR), pd[i]->szName, "AM_BaseProto", _T(""));
- if (mir_tstrcmp(pName, _T("ICQ")) != 0)
- continue;
- lvi.pszText = mir_a2u(pd[i]->szName);
- ListView_InsertItem(hProtocolsList, &lvi);
- memset(protoOption, 0, sizeof(protoOption));
- mir_strcat(protoOption, "proto_");
- mir_strcat(protoOption, pd[i]->szName);
- ListView_SetCheckState(hProtocolsList, j++, _getOptB(protoOption, 0));
- }
-
- bInitializing = 0;
- return TRUE;
-
- case WM_COMMAND:
- if (bInitializing)
- return FALSE;
- switch (LOWORD(wParam)) {
- case IDC_OPT_OUT_MSG_APPROVE:
- case IDC_OPT_IN_MSG_APPROVE:
- case IDC_OPT_DONT_REPLY_SAME_MSG:
- case IDC_OPT_DONT_REPLY_MSG:
- case IDC_OPT_ADD_PERMANENTLY:
- case IDC_OPT_HIDE_UNTIL_VERIFIED:
- case IDC_OPT_LOG_ACTIONS:
- if (HIWORD(wParam) != BN_CLICKED)
- return FALSE;
- break;
- case IDC_OPT_IN_MSG_APPROVE_WORDLIST:
- case IDC_OPT_MAX_MSG_CONTACT:
- case IDC_OPT_MAX_SAME_MSG:
- case IDC_OPT_DONT_REPLY_MSG_WORDLIST:
- if (HIWORD(wParam) != EN_CHANGE)
- return FALSE;
- break;
- }
- SendMessage(GetParent(optDlg), PSM_CHANGED, 0, 0);
+ case WM_INITDIALOG:
+ TranslateDialogDefault(optDlg);
+ bInitializing = 1;
+
+ ///Main enable switch
+ CheckDlgButton(optDlg, IDC_OPT_OUT_MSG_APPROVE, _getOptB("ApproveOnMsgOut", defaultApproveOnMsgOut) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(optDlg, IDC_OPT_IN_MSG_APPROVE, _getOptB("ApproveOnMsgIn", defaultApproveOnMsgIn) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(optDlg, IDC_OPT_DONT_REPLY_SAME_MSG, _getOptB("DontReplySameMsg", defaultDontReplySameMsg) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(optDlg, IDC_OPT_DONT_REPLY_MSG, _getOptB("DontReplyMsg", defaultDontReplyMsg) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(optDlg, IDC_OPT_HIDE_UNTIL_VERIFIED, _getOptB("HideUnverified", defaultHideUnverified) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(optDlg, IDC_OPT_ADD_PERMANENTLY, _getOptB("AddPermanently", defaultAddPermanently) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(optDlg, IDC_OPT_LOG_ACTIONS, _getOptB("LogActions", defaultLogActions) ? BST_CHECKED : BST_UNCHECKED);
+
+ SetDlgItemText(optDlg, IDC_OPT_IN_MSG_APPROVE_WORDLIST, _getOptS(buf, SIZEOF(buf), "ApproveOnMsgInWordlist", defaultApproveOnMsgInWordlist));
+ SetDlgItemText(optDlg, IDC_OPT_MAX_MSG_CONTACT, _itot((unsigned int)_getOptD("MaxMsgContactCountPerDay", defaultMaxMsgContactCountPerDay), buf, 10));
+ SetDlgItemText(optDlg, IDC_OPT_MAX_SAME_MSG, _itot((unsigned int)_getOptD("MaxSameMsgCountPerDay", defaultMaxSameMsgCountPerDay), buf, 10));
+ SetDlgItemText(optDlg, IDC_OPT_DONT_REPLY_MSG_WORDLIST, _getOptS(buf, SIZEOF(buf), "DontReplyMsgWordlist", defaultDontReplyMsgWordlist));
+
+ ///Individual protocols list
+ ListView_SetExtendedListViewStyle(hProtocolsList, LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT);
+ lvc.mask = LVCF_WIDTH;
+ lvc.cx = 120;
+ ListView_InsertColumn(hProtocolsList, 0, &lvc);
+ lvi.mask = LVIF_TEXT | LVIF_STATE;
+ Proto_EnumAccounts(&numProtocols, &pd);
+ for (i = 0, j = 0; i < numProtocols; i++)
+ {
+ lvi.iItem = i;
+ _getMOptS(pName, 200*sizeof(TCHAR), pd[i]->szModuleName, "AM_BaseProto", _T(""));
+ if (mir_tstrcmp(pName, _T("ICQ")) != 0)
+ continue;
+ lvi.pszText = mir_a2u(pd[i]->szModuleName);
+ ListView_InsertItem(hProtocolsList, &lvi);
+ memset(protoOption, 0, sizeof(protoOption));
+ mir_strcat(protoOption, "proto_");
+ mir_strcat(protoOption, pd[i]->szModuleName);
+ ListView_SetCheckState(hProtocolsList, j++, _getOptB(protoOption, 0));
+ }
+
+ bInitializing = 0;
+ return TRUE;
+
+ case WM_COMMAND:
+ if (bInitializing)
+ return FALSE;
+ switch (LOWORD(wParam)) {
+ case IDC_OPT_OUT_MSG_APPROVE:
+ case IDC_OPT_IN_MSG_APPROVE:
+ case IDC_OPT_DONT_REPLY_SAME_MSG:
+ case IDC_OPT_DONT_REPLY_MSG:
+ case IDC_OPT_ADD_PERMANENTLY:
+ case IDC_OPT_HIDE_UNTIL_VERIFIED:
+ case IDC_OPT_LOG_ACTIONS:
+ if (HIWORD(wParam) != BN_CLICKED)
+ return FALSE;
break;
- case WM_NOTIFY:
- if (bInitializing)
+ case IDC_OPT_IN_MSG_APPROVE_WORDLIST:
+ case IDC_OPT_MAX_MSG_CONTACT:
+ case IDC_OPT_MAX_SAME_MSG:
+ case IDC_OPT_DONT_REPLY_MSG_WORDLIST:
+ if (HIWORD(wParam) != EN_CHANGE)
return FALSE;
- switch (LOWORD(wParam)) {
- case IDC_OPT_PROTOCOLS:
- if (
- ((LPNMHDR)lParam)->code == LVN_ITEMCHANGED &&
- ((LPNMLISTVIEW)lParam)->uChanged & LVIF_STATE &&
- (((LPNMLISTVIEW)lParam)->uOldState & LVIS_STATEIMAGEMASK) != \
- (((LPNMLISTVIEW)lParam)->uNewState & LVIS_STATEIMAGEMASK)
- )
- SendMessage(GetParent(optDlg), PSM_CHANGED, 0, 0);
- break;
- }
- switch (((NMHDR*)lParam)->code) {
- case PSN_APPLY:
- _setOptB("ApproveOnMsgOut", IsDlgButtonChecked(optDlg, IDC_OPT_OUT_MSG_APPROVE));
- _setOptB("ApproveOnMsgIn", IsDlgButtonChecked(optDlg, IDC_OPT_IN_MSG_APPROVE));
- _setOptB("DontReplySameMsg", IsDlgButtonChecked(optDlg, IDC_OPT_DONT_REPLY_SAME_MSG));
- _setOptB("DontReplyMsg", IsDlgButtonChecked(optDlg, IDC_OPT_DONT_REPLY_MSG));
- _setOptB("AddPermanently", IsDlgButtonChecked(optDlg, IDC_OPT_ADD_PERMANENTLY));
- _setOptB("HideUnverified", IsDlgButtonChecked(optDlg, IDC_OPT_HIDE_UNTIL_VERIFIED));
- _setOptB("LogActions", IsDlgButtonChecked(optDlg, IDC_OPT_LOG_ACTIONS));
- _saveDlgItemText(optDlg, IDC_OPT_IN_MSG_APPROVE_WORDLIST, "ApproveOnMsgInWordlist");
- _saveDlgItemText(optDlg, IDC_OPT_DONT_REPLY_MSG_WORDLIST, "DontReplyMsgWordlist");
- _saveDlgItemInt(optDlg, IDC_OPT_MAX_MSG_CONTACT, "MaxMsgContactCountPerDay");
- _saveDlgItemInt(optDlg, IDC_OPT_MAX_SAME_MSG, "MaxSameMsgCountPerDay");
- numProtocols = ListView_GetItemCount(hProtocolsList);
- for (i = 0; i < numProtocols; i++) {
- ListView_GetItemText(hProtocolsList, i, 0, buf, SIZEOF(buf));
- //wcstombs(protoName, buf, SIZEOF(buf));
- memset(protoOption, 0, sizeof(protoOption));
- mir_strcat(protoOption, "proto_");
- mir_strcat(protoOption, mir_u2a(buf));
- _setOptB(protoOption, ListView_GetCheckState(hProtocolsList, i));
- }
- return TRUE;
- }
break;
- case WM_DESTROY:
+ }
+ SendMessage(GetParent(optDlg), PSM_CHANGED, 0, 0);
+ break;
+
+ case WM_NOTIFY:
+ if (bInitializing)
+ return FALSE;
+
+ switch (LOWORD(wParam)) {
+ case IDC_OPT_PROTOCOLS:
+ if (
+ ((LPNMHDR)lParam)->code == LVN_ITEMCHANGED &&
+ ((LPNMLISTVIEW)lParam)->uChanged & LVIF_STATE &&
+ (((LPNMLISTVIEW)lParam)->uOldState & LVIS_STATEIMAGEMASK) != \
+ (((LPNMLISTVIEW)lParam)->uNewState & LVIS_STATEIMAGEMASK)
+ )
+ SendMessage(GetParent(optDlg), PSM_CHANGED, 0, 0);
break;
+ }
+ switch (((NMHDR*)lParam)->code) {
+ case PSN_APPLY:
+ _setOptB("ApproveOnMsgOut", IsDlgButtonChecked(optDlg, IDC_OPT_OUT_MSG_APPROVE));
+ _setOptB("ApproveOnMsgIn", IsDlgButtonChecked(optDlg, IDC_OPT_IN_MSG_APPROVE));
+ _setOptB("DontReplySameMsg", IsDlgButtonChecked(optDlg, IDC_OPT_DONT_REPLY_SAME_MSG));
+ _setOptB("DontReplyMsg", IsDlgButtonChecked(optDlg, IDC_OPT_DONT_REPLY_MSG));
+ _setOptB("AddPermanently", IsDlgButtonChecked(optDlg, IDC_OPT_ADD_PERMANENTLY));
+ _setOptB("HideUnverified", IsDlgButtonChecked(optDlg, IDC_OPT_HIDE_UNTIL_VERIFIED));
+ _setOptB("LogActions", IsDlgButtonChecked(optDlg, IDC_OPT_LOG_ACTIONS));
+ _saveDlgItemText(optDlg, IDC_OPT_IN_MSG_APPROVE_WORDLIST, "ApproveOnMsgInWordlist");
+ _saveDlgItemText(optDlg, IDC_OPT_DONT_REPLY_MSG_WORDLIST, "DontReplyMsgWordlist");
+ _saveDlgItemInt(optDlg, IDC_OPT_MAX_MSG_CONTACT, "MaxMsgContactCountPerDay");
+ _saveDlgItemInt(optDlg, IDC_OPT_MAX_SAME_MSG, "MaxSameMsgCountPerDay");
+ numProtocols = ListView_GetItemCount(hProtocolsList);
+ for (i = 0; i < numProtocols; i++) {
+ ListView_GetItemText(hProtocolsList, i, 0, buf, SIZEOF(buf));
+ //wcstombs(protoName, buf, SIZEOF(buf));
+ memset(protoOption, 0, sizeof(protoOption));
+ mir_strcat(protoOption, "proto_");
+ mir_strcat(protoOption, mir_u2a(buf));
+ _setOptB(protoOption, ListView_GetCheckState(hProtocolsList, i));
+ }
+ return TRUE;
+ }
+ break;
}
return FALSE;
}
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp index 08a79a64d9..bd6ea8f7dc 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp @@ -580,7 +580,7 @@ int CSModuleLoaded(WPARAM wParam, LPARAM lParam) int count;
PROTOACCOUNT** protos;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
for (int i = 0; i < count; i++)
if (IsSuitableProto(protos[i]))
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp index 2eb6dde172..370819a3f7 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp @@ -46,7 +46,7 @@ INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L PROTOACCOUNT** proto;
int protoCount = 0;
- ProtoEnumAccounts(&protoCount, &proto);
+ Proto_EnumAccounts(&protoCount, &proto);
if (protoCount <= 0)
{
DisableDialog(hwndDlg);
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp index 7dc9711bb0..2e1af36c2a 100644 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp +++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp @@ -162,7 +162,7 @@ static void GetCurrentConnectionSettings() int count; PROTOACCOUNT** protos; - ProtoEnumAccounts(&count, &protos); + Proto_EnumAccounts(&count, &protos); for (int i = 0; i < count; i++) if (IsSuitableProto(protos[i])) @@ -836,7 +836,7 @@ static void CheckContinueslyFunction(void *) int count; PROTOACCOUNT** protos; - ProtoEnumAccounts(&count, &protos); + Proto_EnumAccounts(&count, &protos); for (int i = 0; i < count; i++) { if (!IsSuitableProto(protos[i])) @@ -876,7 +876,7 @@ static VOID CALLBACK CheckContinueslyTimer(HWND, UINT, UINT_PTR, DWORD) // =============== popup ====================== static TCHAR* GetHumanName(LPARAM lParam) { - PROTOACCOUNT *ProtoAccount = ProtoGetAccount((char*)lParam); + PROTOACCOUNT *ProtoAccount = Proto_GetAccount((char*)lParam); return (ProtoAccount != NULL) ? ProtoAccount->tszAccountName : TranslateT("Protocol"); } diff --git a/plugins/StatusPlugins/KeepStatus/options.cpp b/plugins/StatusPlugins/KeepStatus/options.cpp index a5ecb7c2fe..452ac6e691 100644 --- a/plugins/StatusPlugins/KeepStatus/options.cpp +++ b/plugins/StatusPlugins/KeepStatus/options.cpp @@ -60,7 +60,7 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg, UINT msg, WPARAM wParam int count;
PROTOACCOUNT** protos;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
for (i = 0; i < count; i++) {
if (!IsSuitableProto(protos[i]))
diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp index 19032f1316..ca7d35b838 100644 --- a/plugins/StatusPlugins/StartupStatus/options.cpp +++ b/plugins/StatusPlugins/StartupStatus/options.cpp @@ -39,7 +39,7 @@ static TSettingsList* GetCurrentProtoSettings() {
int count;
PROTOACCOUNT **protos;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
TSettingsList *result = new TSettingsList(count, CompareSettings);
if (result == NULL)
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp index 25c0e0bffd..a3b6687216 100644 --- a/plugins/StatusPlugins/StartupStatus/profiles.cpp +++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp @@ -237,7 +237,7 @@ int GetProfile( int profile, TSettingsList& arSettings ) // if count == 0, continue so the default profile will be returned PROTOACCOUNT** protos; - ProtoEnumAccounts( &count, &protos ); + Proto_EnumAccounts( &count, &protos ); for ( int i=0; i < count; i++ ) if ( IsSuitableProto( protos[i] )) diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp index b126018a9a..155cc1e17b 100644 --- a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp +++ b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp @@ -290,14 +290,14 @@ static int OnOkToExit(WPARAM, LPARAM) // save last protocolstatus
int count;
PROTOACCOUNT** protos;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
for (int i = 0; i < count; i++) {
PROTOACCOUNT *pa = protos[i];
if (!IsSuitableProto(pa))
continue;
- if (!ProtoGetAccount(pa->szModuleName))
+ if (!Proto_GetAccount(pa->szModuleName))
continue;
char lastName[128], lastMsg[128];
diff --git a/plugins/StatusPlugins/commonstatus.cpp b/plugins/StatusPlugins/commonstatus.cpp index f0423a24cc..fa128665f6 100644 --- a/plugins/StatusPlugins/commonstatus.cpp +++ b/plugins/StatusPlugins/commonstatus.cpp @@ -135,7 +135,7 @@ static int equalsGlobalStatus(PROTOCOLSETTINGEX **ps) int count;
PROTOACCOUNT **protos;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
for (i = 0; i < count; i++) {
if (!IsSuitableProto(protos[i]))
@@ -216,7 +216,7 @@ INT_PTR SetStatusEx(WPARAM wParam, LPARAM) // set all status messages first
for (int i = 0; i < protoList->getCount(); i++) {
char *szProto = protoSettings[i]->szName;
- if (!ProtoGetAccount(szProto)) {
+ if (!Proto_GetAccount(szProto)) {
log_debugA("CommonStatus: %s is not loaded", szProto);
continue;
}
@@ -290,7 +290,7 @@ int GetProtoCount() {
int pCount = 0, count;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
for (int i = 0; i < count; i++)
if (IsSuitableProto(accs[i]))
diff --git a/plugins/StopSpamMod/src/options.cpp b/plugins/StopSpamMod/src/options.cpp index 8ca2b6fca7..e26d2749a4 100755 --- a/plugins/StopSpamMod/src/options.cpp +++ b/plugins/StopSpamMod/src/options.cpp @@ -148,16 +148,14 @@ INT_PTR CALLBACK ProtoDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) switch(msg)
{
case WM_INITDIALOG:
- {
- TranslateDialogDefault(hwnd);
- int n;
- PROTOACCOUNT **pppd;
- if(!ProtoEnumAccounts(&n, &pppd))
- for (int i = 0; i < n; ++i) {
- SendDlgItemMessageA(hwnd, (ProtoInList(pppd[i]->szModuleName) ? ID_USEDPROTO : ID_ALLPROTO), LB_ADDSTRING, 0, (LPARAM)pppd[i]->szModuleName);
- }
- }
+ TranslateDialogDefault(hwnd);
+ int n;
+ PROTOACCOUNT **pppd;
+ Proto_EnumAccounts(&n, &pppd);
+ for (int i = 0; i < n; ++i)
+ SendDlgItemMessageA(hwnd, (ProtoInList(pppd[i]->szModuleName) ? ID_USEDPROTO : ID_ALLPROTO), LB_ADDSTRING, 0, (LPARAM)pppd[i]->szModuleName);
return TRUE;
+
case WM_COMMAND:
switch(LOWORD(wParam))
{
diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp index 5474b3bab3..8c67f36c0e 100755 --- a/plugins/StopSpamMod/src/utilities.cpp +++ b/plugins/StopSpamMod/src/utilities.cpp @@ -342,7 +342,7 @@ void CleanThread() std::list<std::string> protocols;
int count = 0;
PROTOACCOUNT **accounts;
- ProtoEnumAccounts(&count, &accounts);
+ Proto_EnumAccounts(&count, &accounts);
for(int i = 0; i < count; i++)
{
if(!strstr(accounts[i]->szModuleName, "MetaContacts") && !strstr(accounts[i]->szModuleName, "Weather")) //not real protocols
diff --git a/plugins/StopSpamPlus/src/opt_proto.cpp b/plugins/StopSpamPlus/src/opt_proto.cpp index 404f619eca..cd3f17909c 100644 --- a/plugins/StopSpamPlus/src/opt_proto.cpp +++ b/plugins/StopSpamPlus/src/opt_proto.cpp @@ -14,8 +14,6 @@ int IsProtoIM(const PROTOACCOUNT *pa) int FillTree(HWND hwnd)
{
ProtocolData *PD;
- int i, n;
- PROTOACCOUNT** pa;
TVINSERTSTRUCT tvis;
tvis.hParent = NULL;
@@ -24,11 +22,12 @@ int FillTree(HWND hwnd) TreeView_DeleteAllItems(hwnd);
- if (CallService(MS_PROTO_ENUMACCOUNTS, (LPARAM)&n, (WPARAM)&pa))
- return FALSE;
+ int n;
+ PROTOACCOUNT** pa;
+ Proto_EnumAccounts(&n, &pa);
- for (i = 0; i < n; i++) {
- if (IsAccountEnabled(pa[i])) {
+ for (int i = 0; i < n; i++) {
+ if (Proto_IsAccountEnabled(pa[i])) {
PD = (ProtocolData*)mir_alloc(sizeof(ProtocolData));
PD->RealName = pa[i]->szModuleName;
PD->enabled = IsProtoIM(pa[i]);
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index c0aea1f488..fa3c09ec13 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -112,7 +112,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa else
pd.lchIcon = LoadIconEx("window");
- PROTOACCOUNT *pa = ProtoGetAccount(pszProtoName);
+ PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName);
mir_sntprintf(pd.lptzContactName, SIZEOF(pd.lptzContactName), _T("%s - %s"),
(pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName,
pcli->pfnGetContactDisplayName(hContact, 0));
diff --git a/plugins/TabSRMM/src/commonheaders.h b/plugins/TabSRMM/src/commonheaders.h index e66fa8fb24..2aa8eb0347 100644 --- a/plugins/TabSRMM/src/commonheaders.h +++ b/plugins/TabSRMM/src/commonheaders.h @@ -69,7 +69,6 @@ #include <m_fontservice.h>
#include <m_acc.h>
#include <m_chat_int.h>
-#include <m_protomod.h>
#include <m_hotkeys.h>
#include <m_genmenu.h>
#include <m_popup.h>
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index 7b1583e0d4..6429432ee9 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -61,7 +61,7 @@ void CContactCache::initPhaseTwo() { m_szAccount = 0; if (cc->szProto) { - PROTOACCOUNT *acc = ProtoGetAccount(cc->szProto); + PROTOACCOUNT *acc = Proto_GetAccount(cc->szProto); if (acc && acc->tszAccountName) m_szAccount = acc->tszAccountName; } @@ -152,7 +152,7 @@ void CContactCache::updateMeta() m_hSub = db_mc_getSrmmSub(cc->contactID); m_szMetaProto = GetContactProto(m_hSub); m_wMetaStatus = (WORD)db_get_w(m_hSub, m_szMetaProto, "Status", ID_STATUS_OFFLINE); - PROTOACCOUNT *pa = ProtoGetAccount(m_szMetaProto); + PROTOACCOUNT *pa = Proto_GetAccount(m_szMetaProto); if (pa) m_szAccount = pa->tszAccountName; diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 402c169e67..e39e300218 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -694,7 +694,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro if (!PluginConfig.g_hMenuTrayUnread || hContact == 0 || szProto == NULL)
return 0;
- PROTOACCOUNT *acc = ProtoGetAccount(szProto);
+ PROTOACCOUNT *acc = Proto_GetAccount(szProto);
TCHAR *tszFinalProto = (acc && acc->tszAccountName ? acc->tszAccountName : 0);
if (tszFinalProto == 0)
return 0;
diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp index 950b90c482..6cd62d5a68 100644 --- a/plugins/TabSRMM/src/trayicon.cpp +++ b/plugins/TabSRMM/src/trayicon.cpp @@ -214,7 +214,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, con if (hIcon == 0)
hIcon = Skin_LoadProtoIcon(szProto, wStatus);
- PROTOACCOUNT *acc = ProtoGetAccount(szProto);
+ PROTOACCOUNT *acc = Proto_GetAccount(szProto);
if (acc && acc->tszAccountName) {
mii.cbSize = sizeof(mii);
mir_sntprintf(szMenuEntry, SIZEOF(szMenuEntry), _T("%s: %s (%s)"), acc->tszAccountName, szFinalNick, szStatus);
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 9f58b47288..47a814109c 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -1966,7 +1966,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA int i, count = 0;
PROTOACCOUNT **accs;
- ProtoEnumAccounts(&count, &accs);
+ Proto_EnumAccounts(&count, &accs);
for (i = 0; i < count; i++) {
if (CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) != 0) {
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index 55eec69396..1423c9b7ba 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -70,16 +70,14 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa pwd->iIndent = opt.iTextIndent; pwd->iSidebarWidth = opt.iSidebarWidth; - if (ServiceExists(MS_PROTO_GETACCOUNT)) { - PROTOACCOUNT *pa = ProtoGetAccount(pwd->clcit.szProto); - if (pa) - mir_tstrcpy(pwd->swzTitle, pa->tszAccountName); - } + PROTOACCOUNT *pa = Proto_GetAccount(pwd->clcit.szProto); + if (pa) + mir_tstrcpy(pwd->swzTitle, pa->tszAccountName); if (mir_tstrlen(pwd->swzTitle) == 0) a2t(pwd->clcit.szProto, pwd->swzTitle, TITLE_TEXT_LEN); - if (CallService(MS_PROTO_ISACCOUNTLOCKED, 0, (LPARAM)pwd->clcit.szProto)) + if (Proto_IsAccountLocked(pwd->clcit.szProto)) mir_sntprintf(pwd->swzTitle, SIZEOF(pwd->swzTitle), TranslateT("%s (locked)"), pwd->swzTitle); // protocol status @@ -1467,7 +1465,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa int oldOrder = -1, iProtoCount = 0; PROTOACCOUNT **accs; - ProtoEnumAccounts(&iProtoCount, &accs); + Proto_EnumAccounts(&iProtoCount, &accs); for (int j = 0; j < iProtoCount; j++) { PROTOACCOUNT *pa = NULL; @@ -1484,7 +1482,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (opt.bHideOffline && wStatus == ID_STATUS_OFFLINE) continue; - if (!IsAccountEnabled(pa) || !IsTrayProto(pa->tszAccountName, (BOOL)wParam)) + if (!Proto_IsAccountEnabled(pa) || !IsTrayProto(pa->tszAccountName, (BOOL)wParam)) continue; if (dwItems & TRAYTIP_NUMCONTACTS) { @@ -1501,7 +1499,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa TCHAR swzProto[256]; mir_tstrcpy(swzProto, pa->tszAccountName); if (dwItems & TRAYTIP_LOCKSTATUS) - if (CallService(MS_PROTO_ISACCOUNTLOCKED, 0, (LPARAM)pa->szModuleName)) + if (Proto_IsAccountLocked(pa->szModuleName)) mir_sntprintf(swzProto, SIZEOF(swzProto), TranslateT("%s (locked)"), pa->tszAccountName); AddRow(pwd, swzProto, buff, NULL, false, false, !bFirstItem, true, Skin_LoadProtoIcon(pa->szModuleName, wStatus)); diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index 4830e729d7..15310e474d 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -265,12 +265,12 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff } } else if (!mir_tstrcmp(swzRawSpec, _T("account"))) { - char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEACCOUNT, hContact, 0); + char *szProto = Proto_GetBaseAccountName(hContact); if ((INT_PTR)szProto == CALLSERVICE_NOTFOUND) { return GetSysSubstText(hContact, _T("proto"), buff, bufflen); } else if (szProto) { - PROTOACCOUNT *pa = ProtoGetAccount(szProto); + PROTOACCOUNT *pa = Proto_GetAccount(szProto); if (pa && pa->tszAccountName) { _tcsncpy(buff, pa->tszAccountName, bufflen); return true; @@ -512,7 +512,7 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF if (*p) { char *cp = GetContactProto(hContact); if (cp != NULL) { - PROTOACCOUNT *acc = ProtoGetAccount(cp); + PROTOACCOUNT *acc = Proto_GetAccount(cp); if (acc != NULL) { cp = acc->szProtoName; } diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index c51b7da658..aec54e4156 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -680,7 +680,7 @@ BOOL CTooltipNotify::ProtosDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP // enum protocols currently running
int iProtoCount = 0;
PROTOACCOUNT **ppProtos = 0;
- ProtoEnumAccounts(&iProtoCount, &ppProtos);
+ Proto_EnumAccounts(&iProtoCount, &ppProtos);
// and fill in the list
for (int i=0; i < iProtoCount; i++)
diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index 4ce4b7df3a..7c54e5f271 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -1172,7 +1172,7 @@ void CreateProtocolList(void) int i;
PROTOACCOUNT **acc;
//
- ProtoEnumAccounts(&NumberOfAccounts,&acc);
+ Proto_EnumAccounts(&NumberOfAccounts,&acc);
//
ProtoList = (PROTOLIST*)mir_alloc(sizeof(PROTOLIST)*(NumberOfAccounts));
//
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp index 3b166e29b0..c3a8cee0a6 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.cpp +++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp @@ -473,7 +473,7 @@ int MAnnivDate::DBGetBirthDate(MCONTACT hContact, LPSTR pszProto) SetFlags(MADF_HASCUSTOM);
}
// if pszProto is set to NULL, this will be scaned only incase the birthday date has not been found yet
- else if (pszProto || (pszProto = DB::Contact::Proto(hContact)) != NULL)
+ else if (pszProto || (pszProto = Proto_GetBaseAccountName(hContact)) != NULL)
{
// try to get birthday from basic protocol
if (!DBGetDate(hContact, pszProto, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
@@ -728,7 +728,7 @@ int MAnnivDate::BackupBirthday(MCONTACT hContact, LPSTR pszProto, const BYTE bDo // A custom birthday was set by user before and is not to be ignored
if ((_wFlags & MADF_HASCUSTOM) && (bDontIgnoreAnything || !lastAnswer || (*lastAnswer != IDNONE))) {
if (!pszProto)
- pszProto = DB::Contact::Proto(hContact);
+ pszProto = Proto_GetBaseAccountName(hContact);
if (pszProto) {
BYTE bIsMeta = DB::Module::IsMeta(pszProto);
@@ -772,7 +772,7 @@ int MAnnivDate::BackupBirthday(MCONTACT hContact, LPSTR pszProto, const BYTE bDo for (int i = 0; i < nSubContactCount; i++) {
MCONTACT hSubContact = db_mc_getSub(hContact, i);
if (hSubContact != NULL) {
- if (!mdbIgnore.DBGetDate(hSubContact, DB::Contact::Proto(hSubContact), SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
+ if (!mdbIgnore.DBGetDate(hSubContact, Proto_GetBaseAccountName(hSubContact), SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
mdbIgnore.DBWriteDateStamp(hSubContact, USERINFO, SET_REMIND_BIRTHDAY_IGNORED);
DBWriteBirthDate(hSubContact);
diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp index 2231f7c157..f5d6d28d63 100644 --- a/plugins/UserInfoEx/src/classPsTreeItem.cpp +++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp @@ -274,21 +274,21 @@ int CPsTreeItem::ItemLabel(const BYTE bReadDBValue) **/
HICON CPsTreeItem::ProtoIcon()
{
+ if (!_pszName)
+ return NULL;
+
PROTOACCOUNT **pa;
int ProtoCount;
- if (!ProtoEnumAccounts(&ProtoCount, &pa)) {
- if (_pszName) {
- for (int i = 0; i < ProtoCount; i++) {
- if (!mir_tcsnicmp(pa[i]->tszAccountName, _A2T(_pszName), mir_tstrlen(pa[i]->tszAccountName))) {
- CHAR szIconID[MAX_PATH];
- mir_snprintf(szIconID, SIZEOF(szIconID), "core_status_%s1", pa[i]->szModuleName);
- HICON hIco = IcoLib_GetIcon(szIconID);
- if (!hIco)
- hIco = (HICON)CallProtoService(pa[i]->szModuleName, PS_LOADICON, PLI_PROTOCOL, NULL);
-
- return hIco;
- }
- }
+ Proto_EnumAccounts(&ProtoCount, &pa);
+ for (int i = 0; i < ProtoCount; i++) {
+ if (!mir_tcsnicmp(pa[i]->tszAccountName, _A2T(_pszName), mir_tstrlen(pa[i]->tszAccountName))) {
+ CHAR szIconID[MAX_PATH];
+ mir_snprintf(szIconID, SIZEOF(szIconID), "core_status_%s1", pa[i]->szModuleName);
+ HICON hIco = IcoLib_GetIcon(szIconID);
+ if (!hIco)
+ hIco = (HICON)CallProtoService(pa[i]->szModuleName, PS_LOADICON, PLI_PROTOCOL, NULL);
+
+ return hIco;
}
}
return NULL;
diff --git a/plugins/UserInfoEx/src/commonheaders.h b/plugins/UserInfoEx/src/commonheaders.h index d16a2d558f..d8df6855c7 100644 --- a/plugins/UserInfoEx/src/commonheaders.h +++ b/plugins/UserInfoEx/src/commonheaders.h @@ -56,7 +56,6 @@ using namespace std; #include <m_database.h>
#include <m_hotkeys.h>
#include <m_langpack.h>
-#include <m_protomod.h>
#include <m_options.h>
#include <m_xml.h>
#include <m_timezones.h>
@@ -222,7 +221,7 @@ static FORCEINLINE BOOL IsProtoOnline(LPSTR pszProto) static FORCEINLINE BOOL IsProtoAccountEnabled(PROTOACCOUNT *pAcc)
{
- return (pAcc->bIsEnabled && ProtoGetAccount(pAcc->szModuleName));
+ return (pAcc->bIsEnabled && Proto_GetAccount(pAcc->szModuleName));
}
typedef HRESULT (STDAPICALLTYPE *pfnDwmIsCompositionEnabled)(BOOL *);
diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index 2c698d806b..23ef5396dd 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -746,7 +746,7 @@ class CAnnivList // ignore meta subcontacts here, as they are not interesting.
if (!db_mc_isSub(hContact)) {
// filter protocol
- pszProto = DB::Contact::Proto(hContact);
+ pszProto = Proto_GetBaseAccountName(hContact);
if (pszProto) {
numContacts++;
switch (GenderOf(hContact, pszProto)) {
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index 0828884142..e43577998e 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -167,8 +167,7 @@ public: int UploadFirst()
{
// create a list of all protocols which support uploading contact information
- if ( ProtoEnumAccounts(&_numProto, &_pPd))
- return _bExitAfterUploading ? UPLOAD_FINISH_CLOSE : UPLOAD_FINISH;
+ Proto_EnumAccounts(&_numProto, &_pPd);
return UploadNext();
}
@@ -290,7 +289,7 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM lParam) }
else {
// get contact's protocol
- psh._pszPrefix = psh._pszProto = DB::Contact::Proto(wParam);
+ psh._pszPrefix = psh._pszProto = Proto_GetBaseAccountName(wParam);
if (psh._pszProto == NULL) {
MsgErr(NULL, LPGENT("Could not find contact's protocol. Maybe it is not active!"));
return 1;
@@ -317,7 +316,7 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM lParam) psh._hContact = db_mc_getSub(wParam, i);
psh._nSubContact = i;
if (psh._hContact) {
- psh._pszProto = DB::Contact::Proto(psh._hContact);
+ psh._pszProto = Proto_GetBaseAccountName(psh._hContact);
if ((INT_PTR)psh._pszProto != CALLSERVICE_NOTFOUND)
NotifyEventHooks(g_hDetailsInitEvent, (WPARAM)&psh, (LPARAM)psh._hContact);
}
@@ -561,28 +560,25 @@ void DlgContactInfoInitTreeIcons() // avoid pages from loading doubled
if (!(bInitIcons & INIT_ICONS_CONTACT)) {
- LPCSTR pszContactProto = NULL;
- PROTOACCOUNT **pd;
- int ProtoCount = 0;
-
psh._dwFlags |= PSF_PROTOPAGESONLY_INIT;
// enumerate all protocols
- if (!ProtoEnumAccounts(&ProtoCount, &pd)) {
- for (i = 0; i < ProtoCount; i++) {
- // enumerate all contacts
- for (psh._hContact = db_find_first(); psh._hContact != NULL; psh._hContact = db_find_next(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(g_hDetailsInitEvent, (WPARAM)&psh, (LPARAM)psh._hContact);
- if (psh._pPages) {
- psh.Free_pPages();
- psh._dwFlags = PSTVF_INITICONS | PSF_PROTOPAGESONLY;
- }
- break;
+ PROTOACCOUNT **pd;
+ int ProtoCount = 0;
+ Proto_EnumAccounts(&ProtoCount, &pd);
+ for (i = 0; i < ProtoCount; i++) {
+ // enumerate all contacts
+ for (psh._hContact = db_find_first(); psh._hContact != NULL; psh._hContact = db_find_next(psh._hContact)) {
+ // compare contact's protocol to the current one, to add
+ LPCSTR pszContactProto = Proto_GetBaseAccountName(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(g_hDetailsInitEvent, (WPARAM)&psh, (LPARAM)psh._hContact);
+ if (psh._pPages) {
+ psh.Free_pPages();
+ psh._dwFlags = PSTVF_INITICONS | PSF_PROTOPAGESONLY;
}
+ break;
}
}
}
@@ -637,10 +633,10 @@ void DlgContactInfoLoadModule() PROTOACCOUNT **pAcc;
int nAccCount;
- if (MIRSUCCEEDED(ProtoEnumAccounts(&nAccCount, &pAcc)))
- for (int i = 0; (i < nAccCount) && !myGlobals.CanChangeDetails; i++)
- if (IsProtoAccountEnabled(pAcc[i])) // update my contact information on icq server
- myGlobals.CanChangeDetails = MIREXISTS(CallProtoService(pAcc[i]->szModuleName, PS_CHANGEINFOEX, NULL, NULL));
+ Proto_EnumAccounts(&nAccCount, &pAcc);
+ for (int i = 0; (i < nAccCount) && !myGlobals.CanChangeDetails; i++)
+ if (IsProtoAccountEnabled(pAcc[i])) // update my contact information on icq server
+ myGlobals.CanChangeDetails = MIREXISTS(CallProtoService(pAcc[i]->szModuleName, PS_CHANGEINFOEX, NULL, NULL));
}
static void ResetUpdateInfo(LPPS pPs)
@@ -1554,7 +1550,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar for (int i = 0; i < numSubs; i++) {
MCONTACT hSubContact = db_mc_getSub(pPs->hContact, i);
if (hSubContact != NULL) {
- if (ProtoServiceExists(DB::Contact::Proto(hSubContact), PSS_GETINFO)) {
+ if (ProtoServiceExists(Proto_GetBaseAccountName(hSubContact), PSS_GETINFO)) {
pPs->infosUpdated = (TAckInfo *)mir_realloc(pPs->infosUpdated, sizeof(TAckInfo) * (pPs->nSubContacts + 1));
pPs->infosUpdated[pPs->nSubContacts].hContact = hSubContact;
pPs->infosUpdated[pPs->nSubContacts].acks = NULL;
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp index a85bff5d88..0951d07ace 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp @@ -94,7 +94,7 @@ BYTE CExImContactBase::fromDB(MCONTACT hContact) if (!_hContact) return TRUE; // Proto - if (!(pszProto = DB::Contact::Proto(_hContact))) return FALSE; + if (!(pszProto = Proto_GetBaseAccountName(_hContact))) return FALSE; _pszProto = mir_strdup(pszProto); // AM_BaseProto @@ -229,21 +229,19 @@ MCONTACT CExImContactBase::toDB() { // create new contact if none exists if (_hContact == INVALID_CONTACT_ID && _pszProto && _pszUIDKey && _dbvUID.type != DBVT_DELETED) { - PROTOACCOUNT* pszAccount = 0; - if (NULL == (pszAccount = ProtoGetAccount( _pszProto ))) { + PROTOACCOUNT *pszAccount = Proto_GetAccount(_pszProto); + if (pszAccount == NULL) { //account does not exist return _hContact = INVALID_CONTACT_ID; } - if (!IsAccountEnabled(pszAccount)) { - ; - } + // create new contact _hContact = DB::Contact::Add(); if (!_hContact) { return _hContact = INVALID_CONTACT_ID; } // Add the protocol to the new contact - if (CallService(MS_PROTO_ADDTOCONTACT, _hContact, (LPARAM)_pszProto)) { + if (Proto_AddToContact(_hContact, _pszProto)) { DB::Contact::Delete(_hContact); return _hContact = INVALID_CONTACT_ID; } @@ -484,7 +482,7 @@ BYTE CExImContactBase::isHandle(MCONTACT hContact) if (!_pszProto) return hContact == NULL; // compare protocols - pszProto = DB::Contact::Proto(hContact); + pszProto = Proto_GetBaseAccountName(hContact); if (pszProto == NULL || (INT_PTR)pszProto == CALLSERVICE_NOTFOUND || mir_strcmp(pszProto, _pszProto)) return FALSE; diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp index 682110ae8a..374f296123 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp @@ -220,7 +220,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar name = (LPCTSTR) pDat->ExImContact->ptszName;
break;
case EXIM_ACCOUNT:
- PROTOACCOUNT* acc = ProtoGetAccount(pDat->ExImContact->pszName);
+ PROTOACCOUNT* acc = Proto_GetAccount(pDat->ExImContact->pszName);
name = (LPCTSTR) acc->tszAccountName;
break;
}
@@ -240,7 +240,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar TreeView_SetItemHeight(hTree, 18);
pszProto = (pDat->ExImContact->Typ == EXIM_CONTACT && pDat->ExImContact->hContact != NULL)
- ? (LPSTR)DB::Contact::Proto(pDat->ExImContact->hContact)
+ ? (LPSTR)Proto_GetBaseAccountName(pDat->ExImContact->hContact)
: NULL;
// add items that are always exported
@@ -298,7 +298,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar {
// ignore empty modules
if (!DB::Module::IsEmpty(hContact, p)) {
- pszProto = DB::Contact::Proto(hContact);
+ pszProto = Proto_GetBaseAccountName(hContact);
// Filter by mode
switch (pDat->ExImContact->Typ)
{
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp index 8dff63f5d4..fb0a8ad16e 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp @@ -856,7 +856,7 @@ BYTE CVCardFileVCF::Open(MCONTACT hContact, LPCSTR pszFileName, LPCSTR pszMode) return FALSE;
if ((_hContact = hContact) == INVALID_CONTACT_ID)
return FALSE;
- if (!(_pszBaseProto = DB::Contact::Proto(_hContact)))
+ if (!(_pszBaseProto = Proto_GetBaseAccountName(_hContact)))
return FALSE;
return TRUE;
}
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp index 6f5158a941..b2a0a1676f 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp @@ -177,7 +177,7 @@ int CFileXml::Export(lpExImParam ExImContact, LPCSTR pszFileName) break;
case EXIM_ACCOUNT:
// export only contact with selectet account name
- if (!mir_strncmp(ExImContact->pszName, DB::Contact::Proto(hContact), mir_strlen(ExImContact->pszName))) {
+ if (!mir_strncmp(ExImContact->pszName, Proto_GetBaseAccountName(hContact), mir_strlen(ExImContact->pszName))) {
if (vContact.fromDB(hContact)) {
vContact.Export(xmlfile, &Modules);
}
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp index b67b99b966..3b7fea78fe 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp @@ -60,7 +60,7 @@ static void DisplayNameToFileName(lpExImParam ExImContact, LPSTR pszFileName, WO disp = temp;
break;
case EXIM_ACCOUNT:
- PROTOACCOUNT* acc = ProtoGetAccount(ExImContact->pszName);
+ PROTOACCOUNT* acc = Proto_GetAccount(ExImContact->pszName);
temp = mir_t2a(acc->tszAccountName);
disp = temp;
break;
diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp index e54be73d85..17fd80aa2e 100644 --- a/plugins/UserInfoEx/src/mir_db.cpp +++ b/plugins/UserInfoEx/src/mir_db.cpp @@ -30,22 +30,6 @@ namespace DB { namespace Contact {
/**
-* This function is used to retrieve a contact's basic protocol
-* @param hContact - handle to the contact
-* @return This function returns the basic protocol of a contact.
-**/
-
-LPSTR Proto(MCONTACT hContact)
-{
- if (hContact) {
- INT_PTR result;
- result = CallService(MS_PROTO_GETCONTACTBASEACCOUNT, hContact, NULL);
- return (LPSTR) ((result == CALLSERVICE_NOTFOUND) ? NULL : result);
- }
- return NULL;
-}
-
-/**
* Gets the number of contacts in the database, which does not count the user
* @param hContact - handle to the contact
* @return Returns the number of contacts. They can be retrieved using
@@ -262,7 +246,7 @@ BYTE GetEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSetti if (def > -1 && def < INT_MAX) {
hSubContact = db_mc_getSub(hContact, def);
if (hSubContact != NULL)
- result = DB::Setting::GetEx(hSubContact, pszModule, DB::Contact::Proto(hSubContact), pszSetting, dbv, destType) != 0;
+ result = DB::Setting::GetEx(hSubContact, pszModule, Proto_GetBaseAccountName(hSubContact), pszSetting, dbv, destType) != 0;
}
// scan all subcontacts for the setting
if (result) {
@@ -273,7 +257,7 @@ BYTE GetEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSetti if (i != def) {
hSubContact = db_mc_getSub(hContact, i);
if (hSubContact != NULL)
- result = DB::Setting::GetEx(hSubContact, pszModule, DB::Contact::Proto(hSubContact), pszSetting, dbv, destType) != 0;
+ result = DB::Setting::GetEx(hSubContact, pszModule, Proto_GetBaseAccountName(hSubContact), pszSetting, dbv, destType) != 0;
} } } } } }
return result;
@@ -317,7 +301,7 @@ WORD GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSubModule, LPCSTR ps if (def > -1 && def < INT_MAX) {
hSubContact = db_mc_getSub(hContact, def);
if (hSubContact != NULL) {
- wFlags = GetCtrl(hSubContact, pszSubModule, NULL, DB::Contact::Proto(hSubContact), pszSetting, dbv, destType);
+ wFlags = GetCtrl(hSubContact, pszSubModule, NULL, Proto_GetBaseAccountName(hSubContact), pszSetting, dbv, destType);
if (wFlags != 0) {
wFlags &= ~CTRLF_HASCUSTOM;
wFlags |= CTRLF_HASMETA;
@@ -332,7 +316,7 @@ WORD GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSubModule, LPCSTR ps if (i != def) {
hSubContact = db_mc_getSub(hContact, i);
if (hSubContact != NULL) {
- wFlags = GetCtrl(hSubContact, pszSubModule, NULL, DB::Contact::Proto(hSubContact), pszSetting, dbv, destType);
+ wFlags = GetCtrl(hSubContact, pszSubModule, NULL, Proto_GetBaseAccountName(hSubContact), pszSetting, dbv, destType);
if (wFlags != 0) {
wFlags &= ~CTRLF_HASCUSTOM;
wFlags |= CTRLF_HASMETA;
diff --git a/plugins/UserInfoEx/src/mir_db.h b/plugins/UserInfoEx/src/mir_db.h index adb8ef8927..6b83a4e3a5 100644 --- a/plugins/UserInfoEx/src/mir_db.h +++ b/plugins/UserInfoEx/src/mir_db.h @@ -32,8 +32,6 @@ namespace Contact { { return pcli->pfnGetContactDisplayName(hContact, 0);
}
- LPSTR Proto(MCONTACT hContact);
-
INT_PTR GetCount();
MCONTACT Add();
diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp index 08b486726b..29ddc0cea9 100644 --- a/plugins/UserInfoEx/src/mir_menuitems.cpp +++ b/plugins/UserInfoEx/src/mir_menuitems.cpp @@ -543,7 +543,7 @@ INT_PTR RebuildAccount(WPARAM wParam, LPARAM lParam) mhRoot = pcli->menuProtos[i].pMenu;
if ( mhRoot == NULL )
break;
- pAccountName = ProtoGetAccount(pcli->menuProtos[i].szProto);
+ pAccountName = Proto_GetAccount(pcli->menuProtos[i].szProto);
// create service name main (account module name) and set pointer to end it
char text[ 200 ];
diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp index b65f24b7f9..9ce4fd36ee 100644 --- a/plugins/UserInfoEx/src/psp_profile.cpp +++ b/plugins/UserInfoEx/src/psp_profile.cpp @@ -1140,7 +1140,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR MCONTACT hSubContact, hDefContact;
LPCSTR pszSubBaseProto;
- if ((hDefContact = db_mc_getSub(hContact, iDefault)) && (pszSubBaseProto = DB::Contact::Proto(hDefContact))) {
+ if ((hDefContact = db_mc_getSub(hContact, iDefault)) && (pszSubBaseProto = Proto_GetBaseAccountName(hDefContact))) {
if ((numProtoItems += ProfileList_AddItemlistFromDB(pList, iItem, idList, nList, hDefContact, pszSubBaseProto, pFmt[i].szCatFmt, pFmt[i].szValFmt, CTRLF_HASMETA | CTRLF_HASPROTO)) < 0)
return FALSE;
@@ -1151,7 +1151,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR continue;
if (!(hSubContact = db_mc_getSub(hContact, j)))
continue;
- if (!(pszSubBaseProto = DB::Contact::Proto(hSubContact)))
+ if (!(pszSubBaseProto = Proto_GetBaseAccountName(hSubContact)))
continue;
if ((numProtoItems += ProfileList_AddItemlistFromDB(pList, iItem, idList, nList, hSubContact, pszSubBaseProto, pFmt[i].szCatFmt, pFmt[i].szValFmt, CTRLF_HASMETA | CTRLF_HASPROTO)) < 0)
return FALSE;
diff --git a/plugins/UserInfoEx/src/svc_contactinfo.cpp b/plugins/UserInfoEx/src/svc_contactinfo.cpp index 1219e9ec17..3c53c8e23e 100644 --- a/plugins/UserInfoEx/src/svc_contactinfo.cpp +++ b/plugins/UserInfoEx/src/svc_contactinfo.cpp @@ -343,7 +343,7 @@ INT_PTR GetContactInfo(WPARAM wParam, LPARAM lParam) CONTACTINFO *ci = (CONTACTINFO*) lParam;
INT_PTR result;
- if (ci && ci->cbSize == sizeof(CONTACTINFO) && (ci->szProto != NULL || (ci->szProto = DB::Contact::Proto(ci->hContact)) != NULL)) {
+ if (ci && ci->cbSize == sizeof(CONTACTINFO) && (ci->szProto != NULL || (ci->szProto = Proto_GetBaseAccountName(ci->hContact)) != NULL)) {
switch (ci->dwFlag & 0x7F) {
//
diff --git a/plugins/UserInfoEx/src/svc_email.cpp b/plugins/UserInfoEx/src/svc_email.cpp index 351e36c9f2..d5890f52e6 100644 --- a/plugins/UserInfoEx/src/svc_email.cpp +++ b/plugins/UserInfoEx/src/svc_email.cpp @@ -43,7 +43,7 @@ static LPSTR Get(MCONTACT hContact) {
// ignore owner
if (hContact != NULL) {
- LPCSTR pszProto = DB::Contact::Proto(hContact);
+ LPCSTR pszProto = Proto_GetBaseAccountName(hContact);
if (pszProto != NULL) {
LPCSTR e[2][4] = {
diff --git a/plugins/UserInfoEx/src/svc_gender.cpp b/plugins/UserInfoEx/src/svc_gender.cpp index c440d15f3a..71f0f5eee5 100644 --- a/plugins/UserInfoEx/src/svc_gender.cpp +++ b/plugins/UserInfoEx/src/svc_gender.cpp @@ -55,7 +55,7 @@ BYTE GenderOf(MCONTACT hContact, LPCSTR pszProto) BYTE GenderOf(MCONTACT hContact)
{
- return GenderOf(hContact, DB::Contact::Proto(hContact));
+ return GenderOf(hContact, Proto_GetBaseAccountName(hContact));
}
/***********************************************************************************************************
diff --git a/plugins/UserInfoEx/src/svc_homepage.cpp b/plugins/UserInfoEx/src/svc_homepage.cpp index 33b847f650..e1dede08d9 100644 --- a/plugins/UserInfoEx/src/svc_homepage.cpp +++ b/plugins/UserInfoEx/src/svc_homepage.cpp @@ -43,7 +43,7 @@ static LPSTR Get(MCONTACT hContact) {
// ignore owner
if (hContact != NULL) {
- LPCSTR pszProto = DB::Contact::Proto(hContact);
+ LPCSTR pszProto = Proto_GetBaseAccountName(hContact);
if (pszProto != NULL) {
LPCSTR e[2] = { SET_CONTACT_HOMEPAGE, SET_CONTACT_COMPANY_HOMEPAGE };
for (int i = 0; i < 2; i++) {
diff --git a/plugins/UserInfoEx/src/svc_phone.cpp b/plugins/UserInfoEx/src/svc_phone.cpp index 130976526b..d236757f2c 100644 --- a/plugins/UserInfoEx/src/svc_phone.cpp +++ b/plugins/UserInfoEx/src/svc_phone.cpp @@ -53,7 +53,7 @@ static INT_PTR Get(MCONTACT hContact) // ignore owner
if (hContact != NULL) {
- LPCSTR pszProto = DB::Contact::Proto(hContact);
+ LPCSTR pszProto = Proto_GetBaseAccountName(hContact);
if (pszProto != NULL) {
LPCSTR e[2][4] = {
{ SET_CONTACT_CELLULAR, SET_CONTACT_PHONE, "MyPhone0" },
diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp index ddf2672909..6a99a2ac44 100644 --- a/plugins/UserInfoEx/src/svc_refreshci.cpp +++ b/plugins/UserInfoEx/src/svc_refreshci.cpp @@ -629,7 +629,7 @@ class CContactUpdater : public CContactQueue **/
virtual void Callback(MCONTACT hContact, PVOID param)
{
- LPSTR pszProto = DB::Contact::Proto(hContact);
+ LPSTR pszProto = Proto_GetBaseAccountName(hContact);
if (pszProto && pszProto[0])
{
@@ -689,7 +689,7 @@ public: **/
BOOL QueueAddRefreshContact(MCONTACT hContact, int iWait)
{
- LPSTR pszProto = DB::Contact::Proto(hContact);
+ LPSTR pszProto = Proto_GetBaseAccountName(hContact);
if ((mir_strcmp(pszProto, "Weather") != 0) && (mir_strcmp(pszProto, META_PROTO) != 0) && IsProtoOnline(pszProto))
return Add(iWait, hContact);
@@ -763,17 +763,14 @@ static CContactUpdater *ContactUpdater = NULL; **/
static BOOL IsMirandaOnline()
{
- PROTOACCOUNT **pAcc;
- int i, nAccCount;
BOOL bIsOnline = FALSE;
+ PROTOACCOUNT **pAcc;
+ int nAccCount;
+ Proto_EnumAccounts(&nAccCount, &pAcc);
+
+ for (int i = 0; (i < nAccCount) && !bIsOnline; i++)
+ bIsOnline |= (IsProtoAccountEnabled(pAcc[i]) && IsProtoOnline(pAcc[i]->szModuleName));
- if (MIRSUCCEEDED(ProtoEnumAccounts(&nAccCount, &pAcc)))
- {
- for (i = 0; (i < nAccCount) && !bIsOnline; i++)
- {
- bIsOnline |= (IsProtoAccountEnabled(pAcc[i]) && IsProtoOnline(pAcc[i]->szModuleName));
- }
- }
return bIsOnline;
}
diff --git a/plugins/UserInfoEx/src/svc_timezone_old.cpp b/plugins/UserInfoEx/src/svc_timezone_old.cpp index 4056bcb15b..b859507240 100644 --- a/plugins/UserInfoEx/src/svc_timezone_old.cpp +++ b/plugins/UserInfoEx/src/svc_timezone_old.cpp @@ -412,7 +412,7 @@ CTimeZone* GetContactTimeZone(MCONTACT hContact, LPCSTR pszProto) CTimeZone* GetContactTimeZone(MCONTACT hContact)
{
- return GetContactTimeZone(hContact, DB::Contact::Proto(hContact));
+ return GetContactTimeZone(hContact, Proto_GetBaseAccountName(hContact));
}
/**
@@ -531,13 +531,13 @@ void SvcTimezoneSyncWithWindows() PROTOACCOUNT **pAcc;
int nAccCount;
- if (MIRSUCCEEDED(ProtoEnumAccounts(&nAccCount, &pAcc))) {
- for (int i = 0; i < nAccCount; i++) {
- // update local timezone as database setting
- if (IsProtoAccountEnabled(pAcc[i]) && SvcTimezoneSyncWithWindowsProc(pAcc[i]->szModuleName, tzi.Bias))
- // update my contact information on icq server
- CallProtoService(pAcc[i]->szModuleName, PS_CHANGEINFOEX, CIXT_LOCATION, NULL);
- }
+ Proto_EnumAccounts(&nAccCount, &pAcc);
+
+ for (int i = 0; i < nAccCount; i++) {
+ // update local timezone as database setting
+ if (IsProtoAccountEnabled(pAcc[i]) && SvcTimezoneSyncWithWindowsProc(pAcc[i]->szModuleName, tzi.Bias))
+ // update my contact information on icq server
+ CallProtoService(pAcc[i]->szModuleName, PS_CHANGEINFOEX, CIXT_LOCATION, NULL);
}
}
diff --git a/plugins/Utils.pas/mircontacts.pas b/plugins/Utils.pas/mircontacts.pas index 78c68501ee..15bb6d61a7 100644 --- a/plugins/Utils.pas/mircontacts.pas +++ b/plugins/Utils.pas/mircontacts.pas @@ -9,7 +9,6 @@ uses //----- Contact info -----
-function GetContactProtoAcc(hContact:TMCONTACT):PAnsiChar;
function GetContactProto(hContact: TMCONTACT): PAnsiChar; overload;
function GetContactProto(hContact: TMCONTACT; var SubContact: TMCONTACT; var SubProtocol: PAnsiChar): PAnsiChar; overload;
function GetContactDisplayName(hContact: TMCONTACT; Proto: PAnsiChar = nil; Contact: boolean = false): PWideChar;
@@ -63,27 +62,19 @@ uses //----- Contact info -----
-function GetContactProtoAcc(hContact:TMCONTACT):PAnsiChar;
-begin
- if ServiceExists(MS_PROTO_GETCONTACTBASEACCOUNT)<>0 then
- result:=PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEACCOUNT,hContact,0))
- else
- result:=PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0));
-end;
-
function GetContactProto(hContact: TMCONTACT): PAnsiChar;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
- Result := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0));
+ Result := Proto_GetProtoName(hContact);
end;
function GetContactProto(hContact: TMCONTACT; var SubContact: TMCONTACT; var SubProtocol: PAnsiChar): PAnsiChar;
begin
- Result := GetContactProto(hContact);
+ Result := Proto_GetProtoName(hContact);
if StrCmp(Result, META_PROTO)=0 then
begin
SubContact := CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0);
- SubProtocol := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, SubContact, 0));
+ SubProtocol := Proto_GetProtoName(SubContact);
end
else
begin
@@ -246,7 +237,7 @@ begin begin
result:=0;
- p:=PPROTOACCOUNT(CallService(MS_PROTO_GETACCOUNT,0,lparam(@name)));
+ p:=Proto_GetAccount(@name);
if p=nil then
result:=-2 // deleted
else if (not p^.bIsEnabled) or p^.bDynDisabled then
@@ -371,7 +362,7 @@ var is_chat:boolean;
begin
result:=0;
- Proto:=GetContactProtoAcc(hContact);
+ Proto:=Proto_GetBaseAccountName(hContact);
if Proto<>nil then
begin
p:=StrCopyE(section,setting);
@@ -593,7 +584,7 @@ begin if lAccount then
begin
- acc:=GetContactProtoAcc(hContact);
+ acc:=Proto_GetBaseAccountName(hContact);
StrReplaceW(buf,'%account%',FastAnsiToWideBuf(acc,buf1));
end
else
@@ -602,7 +593,7 @@ begin if lUID then
begin
if acc=nil then
- acc:=GetContactProtoAcc(hContact);
+ acc:=Proto_GetBaseAccountName(hContact);
if IsChat(hContact) then
begin
p:=DBReadUnicode(hContact,acc,'ChatRoomID');
diff --git a/plugins/Utils.pas/protocols.pas b/plugins/Utils.pas/protocols.pas index e1e7f3786b..08b9221711 100644 --- a/plugins/Utils.pas/protocols.pas +++ b/plugins/Utils.pas/protocols.pas @@ -411,7 +411,7 @@ var p:pAnsichar;
// hContract:THANDLE;
begin
- CallService(MS_PROTO_ENUMACCOUNTS,wparam(@protoCount),lparam(@proto));
+ Proto_EnumAccounts(protoCount, proto);
mGetMem(protos,(protoCount+1)*SizeOf(tMyProto)); // 0 - default
NumProto:=0;
diff --git a/plugins/Utils.pas/srvblock.pas b/plugins/Utils.pas/srvblock.pas index 5ceb7a8fed..cf7b4125eb 100644 --- a/plugins/Utils.pas/srvblock.pas +++ b/plugins/Utils.pas/srvblock.pas @@ -562,7 +562,7 @@ begin if StrPos(buf,protostr)<>nil then
if CallService(MS_DB_CONTACT_IS,data.Parameter,0)<>0 then
- StrReplace(buf,protostr,GetContactProtoAcc(data.Parameter))
+ StrReplace(buf,protostr,Proto_GetBaseAccountName(data.Parameter))
else
Exit;
diff --git a/plugins/Utils/mir_options.cpp b/plugins/Utils/mir_options.cpp index a90cf77148..9618b51c4f 100644 --- a/plugins/Utils/mir_options.cpp +++ b/plugins/Utils/mir_options.cpp @@ -210,7 +210,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha int count;
PROTOACCOUNT **protos;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
for (int i = 0; i < count; i++) {
PROTOACCOUNT *p = protos[i];
diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp index 38b9a6296b..0c8a0642e7 100644 --- a/plugins/Variables/src/contact.cpp +++ b/plugins/Variables/src/contact.cpp @@ -120,7 +120,7 @@ TCHAR* getContactInfoT(BYTE type, MCONTACT hContact) return mir_a2t(szProto);
case CCNF_ACCOUNT: {
- PROTOACCOUNT *pa = ProtoGetAccount(szProto);
+ PROTOACCOUNT *pa = Proto_GetAccount(szProto);
return pa ? mir_tstrdup(pa->tszAccountName) : NULL;
}
diff --git a/plugins/Watrack/proto/proto.pas b/plugins/Watrack/proto/proto.pas index e26ce14f17..625e4fa031 100644 --- a/plugins/Watrack/proto/proto.pas +++ b/plugins/Watrack/proto/proto.pas @@ -84,129 +84,6 @@ begin db_event_add(hContact, @dbeo);
end;
-{SEND-time text translation}
-(*
-const
- BufSize = 16384;
-
-function FormatToBBW(src:PWideChar):PWideChar;
-var
- buf:array [0..32] of WideChar;
- p:PWideChar;
- i,j:integer;
-begin
- result:=src;
- StrReplaceW(src,'{b}' ,'[b]');
- StrReplaceW(src,'{/b}' ,'[/b]');
- StrReplaceW(src,'{u}' ,'[u]');
- StrReplaceW(src,'{/u}' ,'[/u]');
- StrReplaceW(src,'{i}' ,'[i]');
- StrReplaceW(src,'{/i}' ,'[/i]');
- StrReplaceW(src,'{/cf}','[/color]');
- StrReplaceW(src,'{/bg}','');
- StrCopyW(buf,'[color=');
- repeat
- i:=StrPosW(src,'{cf');
- if i=0 then break;
- j:=i;
- dec(i);
- while (src[j]<>#0) and (src[j]<>'}') do inc(j);
- if src[j]='}' then inc(j);
- case StrToInt(src+i+3) of
- 4,10: p:='green]';
- 5,6: p:='red]';
- 7,14: p:='magenta]';
- 3,11,
- 12,13: p:='blue]';
- 8,9: p:='yellow]';
- 2,15: p:='black]';
- else
- {1,16:} p:='white]';
- end;
- StrCopyW(buf+7,p);
- StrCopyW(src+i,src+j);
- StrInsertW(buf,src,i);
- until false;
- repeat
- i:=StrIndex(src,'{bg');
- if i=0 then break;
- j:=i;
- dec(i);
- while (src[j]<>#0) and (src[j]<>'}') do inc(j);
- if src[j]='}' then inc(j);
- StrCopyW(src+i,src+j);
- until false;
-end;
-
-function SendMessageProcW(wParam:WPARAM; lParam:LPARAM):integer; cdecl;
-var
- ccs:PCCSDATA;
- uns,s,ss:pWideChar;
- p:PAnsiChar;
- present:boolean;
- i:integer;
-begin
- if DisablePlugin<>dsPermanent then
- begin
- ccs:=PCCSDATA(lParam);
- if ccs^.wParam=0 then
- present:=StrPos('%music%',PAnsiChar(ccs^.lParam))<>nil
- else // not needed?
- begin
- uns:=PWideChar(ccs^.lParam+StrLen(PAnsiChar(ccs^.lParam))+1);
- present:=StrPos(uns,'%music%')<>nil;
- end;
-
- if present then
- begin
- if CallService(MS_WAT_GETMUSICINFO,0,0)=WAT_RES_NOTFOUND then
- s:=nil
- else
- begin
- if SimpleMode<>BST_UNCHECKED then
- i:=0
- else
- i:=CallService(MS_PROTO_GETCONTACTBASEPROTO,ccs^.hContact,0);
- s:=GetMacros(TM_MESSAGE,i);
- end;
- // if s<>nil then // for empty strings
- begin
- mGetMem(ss,BufSize*SizeOf(pWideChar));
- FillChar(ss^,BufSize*SizeOf(pWideChar),0);
- if ccs^.wParam=0 then
- AnsiToWide(PAnsiChar(ccs^.lParam),uns,UserCP);
- StrCopyW(ss,uns);
- if ccs^.wParam=0 then
- mFreeMem(uns);
- StrReplaceW(ss,'%music%',s);
- mFreeMem(s);
- if StrPos(ss,'{')<>nil then
- FormatToBBW(ss);
- s:=PWideChar(ccs^.lParam);
- WideToAnsi(ss,p,UserCP);
- if ccs^.wParam=0 then
- begin
- ccs^.lParam:=tlparam(p);
- end
- else
- begin
- move(PAnsiChar(ss)^,(PAnsiChar(ss)+StrLen(p)+1)^,
- (StrLenW(ss)+1)*SizeOf(WideChar));
- StrCopy(PAnsiChar(ss),p);
- ccs^.lParam:=tlparam(ss);
- end;
- result:=CallService(MS_PROTO_CHAINSEND,wParam,lParam);
- mFreeMem(p);
- ccs^.lParam:=tlparam(s);
- mFreeMem(ss);
- exit;
- end;
- end;
- end;
- result:=CallService(MS_PROTO_CHAINSEND,wParam,lParam);
-end;
-*)
-
function ReceiveMessageProcW(wParam:WPARAM; lParam:LPARAM):int_ptr; cdecl;
const
bufsize = 4096*SizeOf(WideChar);
@@ -237,13 +114,13 @@ begin (StrCmp(PPROTORECVEVENT(ccs^.lParam)^.szMessage.a,
wpRequest,Length(wpRequest))=0) then
begin
- StrCopy(PAnsiChar(buf),PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,ccs^.hContact,0)));
+ StrCopy(PAnsiChar(buf),Proto_GetProtoName(ccs^.hContact));
i:=DBReadWord(ccs^.hContact,PAnsiChar(buf),'ApparentMode');
StrCat(PAnsiChar(buf),PS_GETSTATUS);
if (i=ID_STATUS_OFFLINE) or
((i=0) and (CallService(PAnsiChar(buf),0,0)=ID_STATUS_INVISIBLE)) then
begin
- result:=CallService(MS_PROTO_CHAINRECV,wParam,lParam);
+ result:=Proto_ChainRecv(wParam,ccs);
end
else if DBReadByte(ccs^.hContact,strCList,ShareOptText,0)<>0 then
// or (NotListedAllow and (DBReadByte(ccs^.hContact,strCList,'NotOnList',0))
@@ -385,7 +262,7 @@ begin Translate('You Get Error'),MB_ICONERROR);
end
else
- result:=CallService(MS_PROTO_CHAINRECV,wParam,lParam);
+ result:=Proto_ChainRecv(wParam,ccs);
mFreeMem(buf);
end;
@@ -409,7 +286,7 @@ begin while hContact<>0 do
begin
if not IsChat(hContact) then
- CallService(MS_PROTO_ADDTOCONTACT,hContact,lparam(PluginShort));
+ Proto_AddToContact(hContact,PluginShort);
hContact:=db_find_next(hContact);
end;
end;
@@ -418,7 +295,7 @@ function HookAddUser(hContact:WPARAM;lParam:LPARAM):int; cdecl; begin
result:=0;
if not IsChat(hContact) then
- CallService(MS_PROTO_ADDTOCONTACT,hContact,tlparam(PluginShort));
+ Proto_AddToContact(hContact,PluginShort);
end;
function OnContactMenu(hContact:WPARAM;lParam:LPARAM):int;cdecl;
@@ -442,12 +319,9 @@ begin desc.cbSize:=PROTOCOLDESCRIPTOR_V3_SIZE;//SizeOf(desc);
desc.szName:=PluginShort;
desc._type :=PROTOTYPE_TRANSLATION;
+ Proto_RegisterModule(@desc);
- CallService(MS_PROTO_REGISTERMODULE,0,lparam(@desc));
-// CreateProtoServiceFunction(PluginShort,PSS_MESSAGE ,@SendMessageProcW);
-// CreateProtoServiceFunction(PluginShort,PSS_MESSAGEW,@SendMessageProcW);
hSRM:=CreateProtoServiceFunction(PluginShort,PSR_MESSAGE ,@ReceiveMessageProcW);
-// CreateProtoServiceFunction(PluginShort,PSR_MESSAGEW,@ReceiveMessageProcW);
end;
function IconChanged(wParam:WPARAM;lParam:LPARAM):int;cdecl;
diff --git a/plugins/Watrack/status/i_hotkey.inc b/plugins/Watrack/status/i_hotkey.inc index 115be86655..e8f6ac3ea6 100644 --- a/plugins/Watrack/status/i_hotkey.inc +++ b/plugins/Watrack/status/i_hotkey.inc @@ -20,10 +20,8 @@ begin CurWin:=GetFocus;
if CurWin<>0 then
begin
-// j:=WndToContact(WaitFocusedWndChild(GetForegroundwindow){GetFocus});
j:=WndToContact(CurWin);
- p:=GetContactProtoAcc(j);
-// p:=PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,j,0));
+ p:=Proto_GetBaseAccountName(j);
if DBReadByte(j,p,'ChatRoom',0)=1 then
begin
isUnicode:=false;
diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp index 02e61c82d2..ed3196c1e5 100644 --- a/plugins/Weather/src/weather.cpp +++ b/plugins/Weather/src/weather.cpp @@ -218,7 +218,7 @@ extern "C" int __declspec(dllexport) Load(void) pd.cbSize = sizeof(pd);
pd.szName = WEATHERPROTONAME;
pd.type = (opt.NoProtoCondition) ? PROTOTYPE_VIRTUAL : PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
// initialize weather protocol services
InitServices();
diff --git a/plugins/Weather/src/weather.h b/plugins/Weather/src/weather.h index 182fb07cd9..6dfcb98e11 100644 --- a/plugins/Weather/src/weather.h +++ b/plugins/Weather/src/weather.h @@ -34,13 +34,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <malloc.h>
#include <newpluginapi.h>
-#include <m_protomod.h>
#include <m_icolib.h>
#include <m_options.h>
#include <m_langpack.h>
#include <m_skin.h>
#include <m_database.h>
#include <m_history.h>
+#include <m_protosvc.h>
#include <m_userinfo.h>
#include <m_netlib.h>
#include <m_ignore.h>
diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp index ea5f444fdc..878b590c65 100644 --- a/plugins/Weather/src/weather_addstn.cpp +++ b/plugins/Weather/src/weather_addstn.cpp @@ -64,7 +64,7 @@ INT_PTR WeatherAddToList(WPARAM wParam, LPARAM lParam) // if contact with the same ID was not found, add it
if (psr->cbSize < sizeof(PROTOSEARCHRESULT)) return 0;
MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)WEATHERPROTONAME);
+ Proto_AddToContact(hContact, WEATHERPROTONAME);
// suppress online notification for the new contact
CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE);
diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp index a9981b30fe..3df115a69a 100644 --- a/plugins/WebView/src/main.cpp +++ b/plugins/WebView/src/main.cpp @@ -158,7 +158,7 @@ extern "C" int __declspec(dllexport) Load() pd.cbSize = sizeof(pd);
pd.szName = MODULENAME;
pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ Proto_RegisterModule(&pd);
//protocol services
InitServices();
diff --git a/plugins/WebView/src/stdafx.h b/plugins/WebView/src/stdafx.h index 6bf059e385..fbd7b84666 100644 --- a/plugins/WebView/src/stdafx.h +++ b/plugins/WebView/src/stdafx.h @@ -21,7 +21,6 @@ #include <m_clistint.h>
#include <m_clui.h>
#include <m_database.h>
-#include <m_protomod.h>
#include <m_protocols.h>
#include <m_protosvc.h>
#include <m_button.h>
diff --git a/plugins/WebView/src/webview_services.cpp b/plugins/WebView/src/webview_services.cpp index 7f6c29897c..20196b0fd1 100644 --- a/plugins/WebView/src/webview_services.cpp +++ b/plugins/WebView/src/webview_services.cpp @@ -369,7 +369,7 @@ INT_PTR AddToList(WPARAM wParam, LPARAM lParam) } hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); - CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)MODULENAME); + Proto_AddToContact(hContact, MODULENAME); /////////write to db db_set_b(hContact, MODULENAME, ON_TOP_KEY, 0); diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp index 8808b4b7b0..8e9f057066 100644 --- a/plugins/WhenWasIt/src/dlg_handlers.cpp +++ b/plugins/WhenWasIt/src/dlg_handlers.cpp @@ -591,7 +591,7 @@ int UpdateBirthdayEntry(HWND hList, MCONTACT hContact, int entry, int bShowAll, age--;
char *szProto = GetContactProto(hContact);
- PROTOACCOUNT *pAcc = ProtoGetAccount(szProto);
+ PROTOACCOUNT *pAcc = Proto_GetAccount(szProto);
TCHAR *ptszAccName = (pAcc == NULL) ? TranslateT("Unknown") : pAcc->tszAccountName;
LVITEM item = { 0 };
diff --git a/plugins/WinterSpeak/src/SpeakAnnounce.cpp b/plugins/WinterSpeak/src/SpeakAnnounce.cpp index 0de3c7c0c1..4a7ca4de9b 100644 --- a/plugins/WinterSpeak/src/SpeakAnnounce.cpp +++ b/plugins/WinterSpeak/src/SpeakAnnounce.cpp @@ -23,7 +23,7 @@ void SpeakAnnounce::statusChange(DBCONTACTWRITESETTING *write_setting, MCONTACT return;
// check if we just connected, and want to suppress status changes
- if (!m_db.getStatusFlag(AnnounceDatabase::StatusFlag_SuppressConnect) && m_protocol_info.isDisabled((char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)user, 0)))
+ if (!m_db.getStatusFlag(AnnounceDatabase::StatusFlag_SuppressConnect) && m_protocol_info.isDisabled(GetContactProto(user)))
return;
bool speak = false;
diff --git a/plugins/WinterSpeak/src/SpeakConfig.cpp b/plugins/WinterSpeak/src/SpeakConfig.cpp index 20b86b05f2..11b7d249b6 100644 --- a/plugins/WinterSpeak/src/SpeakConfig.cpp +++ b/plugins/WinterSpeak/src/SpeakConfig.cpp @@ -50,40 +50,39 @@ bool SpeakConfig::say(const std::wstring &sentence, MCONTACT user, bool message) if (NULL != user)
{
// get the status of the protocol of this user
- const char *protocol = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)user, 0);
-
- switch (CallProtoService(protocol, PS_GETSTATUS, 0, 0))
- {
- case ID_STATUS_ONLINE:
- active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Online);
- break;
- case ID_STATUS_AWAY:
- active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Away);
- break;
- case ID_STATUS_DND:
- active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Dnd);
- break;
- case ID_STATUS_NA:
- active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Na);
- break;
- case ID_STATUS_OCCUPIED:
- active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Occupied);
- break;
- case ID_STATUS_FREECHAT:
- active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_FreeForChat);
- break;
- case ID_STATUS_INVISIBLE:
- active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Invisible);
- break;
- case ID_STATUS_OFFLINE:
- // if we are offline for this protocol, then don't speak the
- // sentence this is so we don't announce users offline status if
- // we are disconnected.
- active = false;
- break;
- default:
- active = false;
- break;
+ const char *protocol = GetContactProto(user);
+
+ switch (CallProtoService(protocol, PS_GETSTATUS, 0, 0)) {
+ case ID_STATUS_ONLINE:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Online);
+ break;
+ case ID_STATUS_AWAY:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Away);
+ break;
+ case ID_STATUS_DND:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Dnd);
+ break;
+ case ID_STATUS_NA:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Na);
+ break;
+ case ID_STATUS_OCCUPIED:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Occupied);
+ break;
+ case ID_STATUS_FREECHAT:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_FreeForChat);
+ break;
+ case ID_STATUS_INVISIBLE:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Invisible);
+ break;
+ case ID_STATUS_OFFLINE:
+ // if we are offline for this protocol, then don't speak the
+ // sentence this is so we don't announce users offline status if
+ // we are disconnected.
+ active = false;
+ break;
+ default:
+ active = false;
+ break;
}
// if its a user say, then check the users status
diff --git a/plugins/XSoundNotify/src/dialog.cpp b/plugins/XSoundNotify/src/dialog.cpp index 00a777b36b..00bb9d704f 100644 --- a/plugins/XSoundNotify/src/dialog.cpp +++ b/plugins/XSoundNotify/src/dialog.cpp @@ -20,7 +20,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP WindowList_Add(hChangeSoundDlgList, hwndDlg, hContact);
Utils_RestoreWindowPositionNoSize(hwndDlg, hContact, SETTINGSNAME, "ChangeSoundDlg");
char* szProto = GetContactProto(hContact);
- PROTOACCOUNT *pa = ProtoGetAccount(szProto);
+ PROTOACCOUNT *pa = Proto_GetAccount(szProto);
char* szUniqueId = (char*)CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
if ((INT_PTR)szUniqueId != CALLSERVICE_NOTFOUND && szUniqueId != NULL) {
DBVARIANT dbvuid = { 0 };
diff --git a/plugins/XSoundNotify/src/options.cpp b/plugins/XSoundNotify/src/options.cpp index d85991de2e..8e414f6a24 100644 --- a/plugins/XSoundNotify/src/options.cpp +++ b/plugins/XSoundNotify/src/options.cpp @@ -30,7 +30,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l TranslateDialogDefault(hwndDlg);
int count;
PROTOACCOUNT **protos;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
for (int i = 0; i < count; i++)
if (IsSuitableProto(protos[i]))
SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_PROTO, CB_SETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_PROTO, CB_ADDSTRING, 0, (LPARAM)protos[i]->tszAccountName), (LPARAM)protos[i]);
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index a6fecdae02..e54db97808 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -69,7 +69,7 @@ void InitSelfSounds() int protoCount = 0;
PROTOACCOUNT** protos = 0;
- ProtoEnumAccounts(&protoCount, &protos);
+ Proto_EnumAccounts(&protoCount, &protos);
for (int i = 0; i < protoCount; i++) {
for (int j = 0; j < SIZEOF(selfSounds); j++) {
char namebuf[128];
@@ -193,7 +193,7 @@ static int PrebuildContactMenu(WPARAM wParam, LPARAM) MCONTACT hContact = wParam;
if (hContact) {
char *szProto = GetContactProto(hContact);
- PROTOACCOUNT *pa = ProtoGetAccount(szProto);
+ PROTOACCOUNT *pa = Proto_GetAccount(szProto);
Menu_ShowItem(hChangeSound, IsSuitableProto(pa));
}
return 0;
diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp index 4a2a341cfc..0f5b14e4f1 100644 --- a/plugins/YAMN/src/main.cpp +++ b/plugins/YAMN/src/main.cpp @@ -286,7 +286,7 @@ extern "C" int __declspec(dllexport) Load(void) PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE }; pd.szName = YAMN_DBMODULE; pd.type = PROTOTYPE_VIRTUAL; - CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); + Proto_RegisterModule(&pd); InitializeCriticalSection(&AccountStatusCS); InitializeCriticalSection(&FileWritingCS); diff --git a/plugins/YAMN/src/proto/pop3/pop3comm.cpp b/plugins/YAMN/src/proto/pop3/pop3comm.cpp index a8f458ebd7..90d9cd5fbf 100644 --- a/plugins/YAMN/src/proto/pop3/pop3comm.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3comm.cpp @@ -303,7 +303,7 @@ int RegisterPOP3Plugin(WPARAM, LPARAM) if (!Finder->hContact && (Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT)) {
//No account contact found, have to create one
Finder->hContact = CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, Finder->hContact, (LPARAM)YAMN_DBMODULE);
+ Proto_AddToContact(Finder->hContact, YAMN_DBMODULE);
db_set_s(Finder->hContact, YAMN_DBMODULE, "Id", Finder->Name);
db_set_s(Finder->hContact, YAMN_DBMODULE, "Nick", Finder->Name);
db_set_s(Finder->hContact, "Protocol", "p", YAMN_DBMODULE);
diff --git a/plugins/YAMN/src/services.cpp b/plugins/YAMN/src/services.cpp index 209e26ce5f..812dfd7e41 100644 --- a/plugins/YAMN/src/services.cpp +++ b/plugins/YAMN/src/services.cpp @@ -484,7 +484,7 @@ void RefreshContact(void) }
else if ((Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT)) {
Finder->hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)Finder->hContact, (LPARAM)YAMN_DBMODULE);
+ Proto_AddToContact(Finder->hContact, YAMN_DBMODULE);
db_set_s(Finder->hContact, YAMN_DBMODULE, "Id", Finder->Name);
db_set_s(Finder->hContact, YAMN_DBMODULE, "Nick", Finder->Name);
db_set_s(Finder->hContact, "Protocol", "p", YAMN_DBMODULE);
diff --git a/plugins/YAMN/src/yamn.h b/plugins/YAMN/src/yamn.h index 5e3f80b0f9..29955fcc7c 100644 --- a/plugins/YAMN/src/yamn.h +++ b/plugins/YAMN/src/yamn.h @@ -16,7 +16,7 @@ #include <m_clist.h>
#include <m_options.h>
#include <m_database.h>
-#include <m_protomod.h>
+#include <m_protosvc.h>
#include <m_icolib.h>
#include <m_popup.h>
#include <m_messages.h>
diff --git a/plugins/ZeroNotification/src/main.cpp b/plugins/ZeroNotification/src/main.cpp index 09e18df031..aca9c5de92 100644 --- a/plugins/ZeroNotification/src/main.cpp +++ b/plugins/ZeroNotification/src/main.cpp @@ -135,7 +135,7 @@ static int ProtoAck(WPARAM wParam, LPARAM lParam) if ( ack->type == ACKTYPE_STATUS && ack->result == ACKRESULT_SUCCESS ) {
long status = 0;
int count;
- ProtoEnumAccounts(&count, &protos);
+ Proto_EnumAccounts(&count, &protos);
for (int i=0; i < count; i++)
status = status | Proto_Status2Flag(CallProtoService(protos[i]->szModuleName, PS_GETSTATUS, 0, 0));
diff --git a/plugins/helpers/commonheaders.h b/plugins/helpers/commonheaders.h index 9c4e656ae6..e193175670 100644 --- a/plugins/helpers/commonheaders.h +++ b/plugins/helpers/commonheaders.h @@ -47,7 +47,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_netlib.h>
#include <m_button.h>
#include <m_protosvc.h>
-#include <m_protomod.h>
#include <m_protocols.h>
#include <m_options.h>
#include <m_utils.h>
diff --git a/plugins/mRadio/i_myservice.inc b/plugins/mRadio/i_myservice.inc index 3aa403398d..88ae278633 100644 --- a/plugins/mRadio/i_myservice.inc +++ b/plugins/mRadio/i_myservice.inc @@ -13,7 +13,7 @@ begin begin
if wParam=0 then
wParam:=GetCListSelContact;
- p:=GetContactProtoAcc(wParam);
+ p:=Proto_GetBaseAccountName(wParam);
if (p=nil) or (StrCmp(p,PluginName)<>0) then
exit;
hContact:=wParam;
@@ -161,7 +161,7 @@ begin result:=CallService(MS_DB_CONTACT_ADD,0,0);
if result<>0 then
begin
- CallService(MS_PROTO_ADDTOCONTACT,result,lparam(PluginName));
+ Proto_AddToContact(result,PluginName);
DBWriteString(result,PluginName,optStationURL,pc);
DBWriteString(result,PluginName,optFirstName ,pc);
@@ -297,7 +297,7 @@ begin result:=CallService(MS_DB_CONTACT_ADD,0,0);
if result<>0 then
begin
- CallService(MS_PROTO_ADDTOCONTACT,result,tlparam(PluginName));
+ Proto_AddToContact(result,PluginName);
//
// DBWriteByte(result,strCList,'Hidden' ,0);
DBWriteByte(result,strCList,'NotOnList',1);
diff --git a/plugins/mRadio/i_optdlg.inc b/plugins/mRadio/i_optdlg.inc index 52df888dd8..3b13dffae6 100644 --- a/plugins/mRadio/i_optdlg.inc +++ b/plugins/mRadio/i_optdlg.inc @@ -682,8 +682,7 @@ begin begin
if value._type=DBVT_DELETED then
begin
- if StrCmp(PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0)),
- PluginName)<>0 then exit;
+ if StrCmp(Proto_GetProtoName(wParam),PluginName)<>0 then exit;
pc:=DBReadString(wParam,PluginName,optNick);
DBWriteString(wParam,strCList,optMyHandle,pc);
@@ -697,8 +696,7 @@ begin if StrCmp(szSetting,optAge)=0 then
begin
- if StrCmp(PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0)),
- PluginName)<>0 then exit;
+ if StrCmp(Proto_GetProtoName(wParam),PluginName)<>0 then exit;
if value._type=DBVT_DELETED then
i:=DBReadWord(wParam,PluginName,optAge)
else
@@ -712,8 +710,7 @@ begin DBVT_ASCIIZ ,
DBVT_WCHAR ,
DBVT_UTF8 :
- if StrCmp(PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0)),
- PluginName)<>0 then exit;
+ if StrCmp(Proto_GetProtoName(wParam),PluginName)<>0 then exit;
else
exit;
end;
@@ -739,8 +736,4 @@ begin result:=0;
if ActiveContact<>THANDLE(wParam) then exit;
ControlCenter(MRC_STOP,wParam);
-
-{ if StrCmp(PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0)),
- PluginName)<>0 then exit;
-}
end;
diff --git a/plugins/mRadio/i_search.inc b/plugins/mRadio/i_search.inc index 81e1a00eca..d6e65e4794 100644 --- a/plugins/mRadio/i_search.inc +++ b/plugins/mRadio/i_search.inc @@ -400,7 +400,7 @@ begin hContact:=CallService(MS_DB_CONTACT_ADD,0,0);
if hContact<>0 then
begin
- CallService(MS_PROTO_ADDTOCONTACT,hContact,tlparam(PluginName));
+ Proto_AddToContact(hContact,PluginName);
// URL
DBWriteUnicode(hContact,PluginName,optStationURL,lurl);
DBWriteUnicode(hContact,PluginName,optFirstName ,lurl);
diff --git a/plugins/mRadio/i_visual.inc b/plugins/mRadio/i_visual.inc index 5f56bcd4c7..68a7479312 100644 --- a/plugins/mRadio/i_visual.inc +++ b/plugins/mRadio/i_visual.inc @@ -9,8 +9,7 @@ var begin
FillChar(mi,SizeOf(mi),0);
mi.cbSize:=sizeof(mi);
- if StrCmp(PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0)),
- PluginName)<>0 then
+ if StrCmp(Proto_GetProtoName(hContact),PluginName)<>0 then
begin
mi.flags:=CMIM_FLAGS or CMIF_HIDDEN;
CallService(MS_CLIST_MODIFYMENUITEM,hCMenuItemPlay,tlparam(@mi));
diff --git a/plugins/mRadio/mradio.dpr b/plugins/mRadio/mradio.dpr index e929303b0d..2d60f57c1b 100644 --- a/plugins/mRadio/mradio.dpr +++ b/plugins/mRadio/mradio.dpr @@ -168,7 +168,7 @@ begin desc.cbSize:=PROTOCOLDESCRIPTOR_V3_SIZE;//SizeOf(desc);
desc.szName:=PluginName;
desc._type :=PROTOTYPE_VIRTUAL;
- CallService(MS_PROTO_REGISTERMODULE,0,lparam(@desc));
+ Proto_RegisterModule(@desc);
// hooks and services
hhRadioStatus:=CreateHookableEvent(ME_RADIO_STATUS);
|