From 9ac20243efe27f58501c59060a4f22c37104c0e3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 31 May 2015 15:29:24 +0000 Subject: - PROTOCOLDESCRIPTOR_V3_SIZE to identify an ANSI plugin; - absence of fnInitFunc to identify a protocol without instances; - whole bunch of ansi crutches discarded git-svn-id: http://svn.miranda-ng.org/main/trunk@13937 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AddContactPlus/src/addcontact.cpp | 4 +-- plugins/BossKeyPlus/src/BossKey.cpp | 10 ++------ plugins/ConnectionNotify/src/ConnectionNotify.cpp | 16 +++++------- plugins/CryptoPP/src/main.cpp | 3 ++- .../CyrTranslit/src/TransliterationProtocol.cpp | 3 ++- plugins/Dropbox/src/dropbox.cpp | 5 ++-- plugins/Dropbox/src/dropbox_commands.cpp | 3 +-- plugins/FileAsMessage/src/main.cpp | 3 ++- plugins/ListeningTo/src/listeningto.cpp | 30 +++++----------------- plugins/LotusNotify/src/LotusNotify.cpp | 3 ++- plugins/MenuItemEx/src/main.cpp | 2 +- plugins/MirFox/src/MirandaUtils.cpp | 13 +++------- plugins/MirOTR/src/dllmain.cpp | 7 ++--- plugins/MyDetails/src/data.cpp | 2 +- plugins/New_GPG/src/init.cpp | 3 ++- plugins/NewsAggregator/Src/NewsAggregator.cpp | 3 ++- plugins/SecureIM/src/main.cpp | 3 ++- plugins/SendScreenshotPlus/src/CSend.cpp | 2 +- plugins/SimpleStatusMsg/src/main.cpp | 20 ++------------- plugins/StatusPlugins/commonstatus.cpp | 6 +---- plugins/StopSpamMod/src/stopspam.cpp | 2 +- plugins/Weather/src/weather.cpp | 3 ++- plugins/Weather/src/weather_svcs.cpp | 4 +-- plugins/WebView/src/main.cpp | 3 ++- 24 files changed, 54 insertions(+), 99 deletions(-) (limited to 'plugins') diff --git a/plugins/AddContactPlus/src/addcontact.cpp b/plugins/AddContactPlus/src/addcontact.cpp index 723c308338..4e285068a1 100644 --- a/plugins/AddContactPlus/src/addcontact.cpp +++ b/plugins/AddContactPlus/src/addcontact.cpp @@ -294,11 +294,11 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) if (IsDlgButtonChecked(hdlg, IDC_AUTH)) { DWORD flags = CallProtoService(acs->proto, PS_GETCAPS, PFLAGNUM_4, 0); if (flags & PF4_NOCUSTOMAUTH) - CallContactService(hContact, PSS_AUTHREQUESTT, 0, 0); + CallContactService(hContact, PSS_AUTHREQUEST, 0, 0); else { TCHAR szReason[512]; GetDlgItemText(hdlg, IDC_AUTHREQ, szReason, SIZEOF(szReason)); - CallContactService(hContact, PSS_AUTHREQUESTT, 0, (LPARAM)szReason); + CallContactService(hContact, PSS_AUTHREQUEST, 0, (LPARAM)szReason); } } } diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index 97e20e9dc8..4838940312 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -202,14 +202,8 @@ TCHAR* GetDefStatusMsg(unsigned uStatus, const char* szProto) void SetStatus(const char* szProto, unsigned status, TCHAR *tszAwayMsg) { if (tszAwayMsg && CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) - { - if (CallProtoService(szProto, PS_SETAWAYMSGT, status, (LPARAM)tszAwayMsg) == CALLSERVICE_NOTFOUND) - { - char *szAwayMsg = mir_t2a(tszAwayMsg); - CallProtoService(szProto, PS_SETAWAYMSG, status, (LPARAM)szAwayMsg); - mir_free(szAwayMsg); - } - } + CallProtoService(szProto, PS_SETAWAYMSG, status, (LPARAM)tszAwayMsg); + CallProtoService(szProto, PS_SETSTATUS, status, 0); } diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index 32eaf32610..387df80cda 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -864,33 +864,30 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) hInst = hinstDLL; return TRUE; } + extern "C" int __declspec(dllexport) Load(void) { - char service[100] = { "" }; - - PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE }; - #ifdef _DEBUG _OutputDebugString(_T("Entering Load dll")); #endif mir_getLP(&pluginInfo); - //hCurrentEditMutex=CreateMutex(NULL,FALSE,_T("CurrentEditMutex")); hExceptionsMutex = CreateMutex(NULL, FALSE, _T("ExceptionsMutex")); LoadSettings(); connExceptions = LoadSettingsConnections(); - //create protocol - //memset(&pd, 0, sizeof(pd)); - //pd.cbSize=sizeof(pd); + + PROTOCOLDESCRIPTOR pd = { 0 }; + pd.cbSize = sizeof(pd); pd.szName = PLUGINNAME; pd.type = PROTOTYPE_PROTOCOL; CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); - //set all contacts to offline + //set all contacts to offline for (MCONTACT hContact = db_find_first(PLUGINNAME); hContact != NULL; hContact = db_find_next(hContact, PLUGINNAME)) db_set_w(hContact, PLUGINNAME, "status", ID_STATUS_OFFLINE); + char service[100] = { "" }; mir_snprintf(service, SIZEOF(service), "%s%s", PLUGINNAME, PS_GETCAPS); CreateServiceFunction(service, GetCaps); mir_snprintf(service, SIZEOF(service), "%s%s", PLUGINNAME, PS_GETNAME); @@ -902,7 +899,6 @@ extern "C" int __declspec(dllexport) Load(void) mir_snprintf(service, SIZEOF(service), "%s%s", PLUGINNAME, PS_GETSTATUS); CreateServiceFunction(service, GetStatus); - SkinAddNewSoundEx(PLUGINNAME_NEWSOUND, PLUGINNAME, LPGEN("New Connection Notification")); hOptInit = HookEvent(ME_OPT_INITIALISE, ConnectionNotifyOptInit);//register service to hook option call assert(hOptInit); diff --git a/plugins/CryptoPP/src/main.cpp b/plugins/CryptoPP/src/main.cpp index e6dfac13f3..8cb9bfa2b9 100644 --- a/plugins/CryptoPP/src/main.cpp +++ b/plugins/CryptoPP/src/main.cpp @@ -53,7 +53,8 @@ extern "C" __declspec(dllexport) int Load() mir_getLP(&pluginInfoEx); // register plugin module - PROTOCOLDESCRIPTOR pd = { sizeof(pd) }; + PROTOCOLDESCRIPTOR pd = { 0 }; + pd.cbSize = sizeof(pd); pd.szName = (char*)szModuleName; pd.type = PROTOTYPE_ENCRYPTION; CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); diff --git a/plugins/CyrTranslit/src/TransliterationProtocol.cpp b/plugins/CyrTranslit/src/TransliterationProtocol.cpp index f49359cb36..27940f86ac 100644 --- a/plugins/CyrTranslit/src/TransliterationProtocol.cpp +++ b/plugins/CyrTranslit/src/TransliterationProtocol.cpp @@ -28,7 +28,8 @@ char *TransliterationProtocol::MODULE_NAME = "ProtoCyrTranslitByIKR"; void TransliterationProtocol::initialize() { - PROTOCOLDESCRIPTOR pd = { sizeof(pd) }; + PROTOCOLDESCRIPTOR pd = { 0 }; + pd.cbSize = sizeof(pd); pd.szName = MODULE_NAME; pd.type = PROTOTYPE_TRANSLATION; CallService(MS_PROTO_REGISTERMODULE, 0, reinterpret_cast(&pd)); diff --git a/plugins/Dropbox/src/dropbox.cpp b/plugins/Dropbox/src/dropbox.cpp index 6f8c84c2f0..75a8f6389e 100644 --- a/plugins/Dropbox/src/dropbox.cpp +++ b/plugins/Dropbox/src/dropbox.cpp @@ -2,7 +2,8 @@ CDropbox::CDropbox() : transfers(1, HandleKeySortT) { - PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE }; + PROTOCOLDESCRIPTOR pd = { 0 }; + pd.cbSize = sizeof(pd); pd.szName = MODULE; pd.type = PROTOTYPE_VIRTUAL; CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); @@ -19,7 +20,7 @@ CDropbox::CDropbox() : transfers(1, HandleKeySortT) CreateProtoServiceFunction(MODULE, PS_GETNAME, ProtoGetName); CreateProtoServiceFunction(MODULE, PS_LOADICON, ProtoLoadIcon); CreateProtoServiceFunctionObj(PS_GETSTATUS, GlobalService<&CDropbox::ProtoGetStatus>, this); - CreateProtoServiceFunctionObj(PSS_FILEW, GlobalService<&CDropbox::ProtoSendFile>, this); + CreateProtoServiceFunctionObj(PSS_FILE, GlobalService<&CDropbox::ProtoSendFile>, this); CreateProtoServiceFunctionObj(PSS_FILECANCEL, GlobalService<&CDropbox::ProtoCancelFile>, this); CreateProtoServiceFunctionObj(PSS_MESSAGE, GlobalService<&CDropbox::ProtoSendMessage>, this); CreateProtoServiceFunction(MODULE, PSR_MESSAGE, ProtoReceiveMessage); diff --git a/plugins/Dropbox/src/dropbox_commands.cpp b/plugins/Dropbox/src/dropbox_commands.cpp index a5e09c6fb7..dc4fad8d76 100644 --- a/plugins/Dropbox/src/dropbox_commands.cpp +++ b/plugins/Dropbox/src/dropbox_commands.cpp @@ -49,8 +49,7 @@ void CDropbox::CommandContent(void *arg) else { JSONNode content = root.at("contents").as_array(); - int size = content.size(); - for (int i = 0; i < content.size(); i++) + for (size_t i = 0; i < content.size(); i++) { JSONNode item = content[i]; if (item.empty()) diff --git a/plugins/FileAsMessage/src/main.cpp b/plugins/FileAsMessage/src/main.cpp index fc3ce4b1c6..e54c6b8353 100644 --- a/plugins/FileAsMessage/src/main.cpp +++ b/plugins/FileAsMessage/src/main.cpp @@ -199,7 +199,8 @@ extern "C" __declspec(dllexport) int Load(void) CreateServiceFunction(SERVICE_NAME "/FESendFile", OnSendFile); CreateServiceFunction(SERVICE_NAME "/FERecvFile", OnRecvFile); - PROTOCOLDESCRIPTOR pd = { sizeof(pd) }; + PROTOCOLDESCRIPTOR pd = { 0 }; + pd.cbSize = sizeof(pd); pd.szName = SERVICE_NAME; pd.type = PROTOTYPE_FILTER; CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index 75686cbd18..0e1094cd17 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -211,7 +211,7 @@ void RebuildMenu() void RegisterProtocol(char *proto, TCHAR *account) { - if (!ProtoServiceExists(proto, PS_SET_LISTENINGTO) && !ProtoServiceExists(proto, PS_SETCUSTOMSTATUSEX) && !ProtoServiceExists(proto, PS_SETAWAYMSGT) && !ProtoServiceExists(proto, PS_SETAWAYMSG)) + if (!ProtoServiceExists(proto, PS_SET_LISTENINGTO) && !ProtoServiceExists(proto, PS_SETCUSTOMSTATUSEX) && !ProtoServiceExists(proto, PS_SETAWAYMSG)) return; size_t id = proto_items.size(); @@ -678,28 +678,15 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL) mir_free(fr[1]); } } - else if (db_get_b(0,MODULE_NAME,"UseStatusMessage",1) && (ProtoServiceExists(proto, PS_SETAWAYMSGT) || ProtoServiceExists(proto, PS_SETAWAYMSG))) + else if (db_get_b(0,MODULE_NAME,"UseStatusMessage",1) && ProtoServiceExists(proto, PS_SETAWAYMSG)) { int status = CallProtoService(proto, PS_GETSTATUS, 0, 0); if (lti == NULL) - { - INT_PTR ret = CallProtoService(proto, PS_SETAWAYMSGT, (WPARAM) status, 0); - if(ret == CALLSERVICE_NOTFOUND) - { - CallProtoService(proto, PS_SETAWAYMSG, (WPARAM)status, 0); - } - } + CallProtoService(proto, PS_SETAWAYMSG, status, 0); else { - TCHAR *fr = GetParsedFormat(lti); - INT_PTR ret = CallProtoService(proto, PS_SETAWAYMSGT, (WPARAM)status, (LPARAM)fr); - if(ret == CALLSERVICE_NOTFOUND) - { - char *info = mir_t2a(fr); - CallProtoService(proto, PS_SETAWAYMSG, (WPARAM)status, (LPARAM)info); - mir_free(info); - } - mir_free(fr); + ptrT fr(GetParsedFormat(lti)); + CallProtoService(proto, PS_SETAWAYMSG, status, fr); } } } @@ -713,16 +700,11 @@ INT_PTR EnableListeningTo(char *proto,BOOL enabled) { // For all protocols for (unsigned int i = 1; i < proto_items.size(); ++i) - { EnableListeningTo(proto_items[i].proto, enabled); - } } else { - if (!ProtoServiceExists(proto, PS_SET_LISTENINGTO) && - !ProtoServiceExists(proto, PS_SETCUSTOMSTATUSEX) && - !ProtoServiceExists(proto, PS_SETAWAYMSGT) && // by yaho - !ProtoServiceExists(proto, PS_SETAWAYMSG)) + if (!ProtoServiceExists(proto, PS_SET_LISTENINGTO) && !ProtoServiceExists(proto, PS_SETCUSTOMSTATUSEX) && !ProtoServiceExists(proto, PS_SETAWAYMSG)) return 0; char setting[256]; diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index 10372c0246..177730bb9a 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -1630,7 +1630,8 @@ extern "C" int __declspec(dllexport) Load(void) } //create protocol - PROTOCOLDESCRIPTOR pd = {PROTOCOLDESCRIPTOR_V3_SIZE}; + PROTOCOLDESCRIPTOR pd = { 0 }; + pd.cbSize = sizeof(pd); pd.szName = PLUGINNAME; pd.type = PROTOTYPE_PROTOCOL; CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index 91631104cf..202a4589c5 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -402,7 +402,7 @@ INT_PTR CALLBACK AuthReqWndProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpara { TCHAR tszReason[256] = { 0 }; GetDlgItemText(hdlg, IDC_REASON, tszReason, SIZEOF(tszReason)); - CallContactService(hcontact, PSS_AUTHREQUESTT, 0, (LPARAM)tszReason); + CallContactService(hcontact, PSS_AUTHREQUEST, 0, (LPARAM)tszReason); } // fall through case IDCANCEL: DestroyWindow(hdlg); diff --git a/plugins/MirFox/src/MirandaUtils.cpp b/plugins/MirFox/src/MirandaUtils.cpp index 737add6ca9..e13f507caa 100644 --- a/plugins/MirFox/src/MirandaUtils.cpp +++ b/plugins/MirFox/src/MirandaUtils.cpp @@ -370,20 +370,13 @@ void MirandaUtils::setStatusOnAccount(ActionThreadArgStruct* args) INT_PTR result = -1; - if (!(CallProtoService(args->accountSzModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_INDIVMODEMSG)){ - result = CallProtoService(args->accountSzModuleName, PS_SETAWAYMSGW, (WPARAM)status, (LPARAM)args->userActionSelection); - if (result == CALLSERVICE_NOTFOUND){ - char *szMsg = mir_u2a(args->userActionSelection); - result = CallProtoService(args->accountSzModuleName, PS_SETAWAYMSG, (WPARAM)status, (LPARAM)szMsg); - mir_free(szMsg); - } - } + if (!(CallProtoService(args->accountSzModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_INDIVMODEMSG)) + result = CallProtoService(args->accountSzModuleName, PS_SETAWAYMSG, (WPARAM)status, (LPARAM)args->userActionSelection); MirandaAccount* mirandaAccount = args->mirfoxDataPtr->getMirandaAccountPtrBySzModuleName(args->accountSzModuleName); TCHAR* tszAccountName = NULL; - if (mirandaAccount){ + if (mirandaAccount) tszAccountName = mirandaAccount->tszAccountName; - } wchar_t* buffer = new wchar_t[1024 * sizeof(wchar_t)]; if(result == 0){ diff --git a/plugins/MirOTR/src/dllmain.cpp b/plugins/MirOTR/src/dllmain.cpp index 2b3bd3d31a..b798ccefc3 100644 --- a/plugins/MirOTR/src/dllmain.cpp +++ b/plugins/MirOTR/src/dllmain.cpp @@ -73,9 +73,10 @@ extern "C" __declspec(dllexport) int Load(void) db_set_resident(MODULENAME, "TrustLevel"); - ///////////// - ////// init plugin - PROTOCOLDESCRIPTOR pd = { sizeof(pd) }; + //////////////////////////////////////////////////////////////////////////// + // init plugin + PROTOCOLDESCRIPTOR pd = { 0 }; + pd.cbSize = sizeof(pd); pd.szName = MODULENAME; pd.type = PROTOTYPE_ENCRYPTION; CallService(MS_PROTO_REGISTERMODULE,0,(LPARAM)&pd); diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp index 52111dadcb..b011740b6e 100644 --- a/plugins/MyDetails/src/data.cpp +++ b/plugins/MyDetails/src/data.cpp @@ -240,7 +240,7 @@ void Protocol::SetStatusMsg(int aStatus, const TCHAR *message) if (!CanSetStatusMsg(aStatus)) return; - CallProtoService(name, PS_SETAWAYMSGT, (WPARAM)aStatus, (LPARAM)message); + CallProtoService(name, PS_SETAWAYMSG, (WPARAM)aStatus, (LPARAM)message); } bool Protocol::HasAvatar() diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp index 803f131970..9c42ba7ae0 100644 --- a/plugins/New_GPG/src/init.cpp +++ b/plugins/New_GPG/src/init.cpp @@ -154,7 +154,8 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam) HookEvent(ME_MSG_WINDOWEVENT, onWindowEvent); HookEvent(ME_MSG_ICONPRESSED, onIconPressed); - PROTOCOLDESCRIPTOR pd = { sizeof(pd) }; + PROTOCOLDESCRIPTOR pd = { 0 }; + pd.cbSize = sizeof(pd); pd.szName = szGPGModuleName; pd.type = PROTOTYPE_ENCRYPTION; CallService(MS_PROTO_REGISTERMODULE,0,(LPARAM)&pd); diff --git a/plugins/NewsAggregator/Src/NewsAggregator.cpp b/plugins/NewsAggregator/Src/NewsAggregator.cpp index cf05a5b469..5fc4edc8cc 100644 --- a/plugins/NewsAggregator/Src/NewsAggregator.cpp +++ b/plugins/NewsAggregator/Src/NewsAggregator.cpp @@ -68,7 +68,8 @@ extern "C" __declspec(dllexport) int Load(void) hChangeFeedDlgList = WindowList_Create(); // register weather protocol - PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE }; + PROTOCOLDESCRIPTOR pd = { 0 }; + pd.cbSize = sizeof(pd); pd.szName = MODULE; pd.type = PROTOTYPE_VIRTUAL; CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp index 6d3362a52a..feb7457e77 100644 --- a/plugins/SecureIM/src/main.cpp +++ b/plugins/SecureIM/src/main.cpp @@ -344,7 +344,8 @@ extern "C" __declspec(dllexport) int __cdecl Load(void) } // register plugin module - PROTOCOLDESCRIPTOR pd = { sizeof(pd) }; + PROTOCOLDESCRIPTOR pd = { 0 }; + pd.cbSize = sizeof(pd); pd.szName = (char*)MODULENAME; pd.type = PROTOTYPE_ENCRYPTION; CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index 090d93f6a5..60a9880d06 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -296,7 +296,7 @@ void CSend::svcSendFileExit() { TCHAR* pDesc = mir_tstrdup(m_pszFileDesc); ppFile[0] = mir_tstrdup (m_pszFile); ppFile[1] = NULL; - m_hSend = (HANDLE)CallContactService(m_hContact, PSS_FILET, (WPARAM)pDesc, (LPARAM)ppFile); + m_hSend = (HANDLE)CallContactService(m_hContact, PSS_FILE, (WPARAM)pDesc, (LPARAM)ppFile); mir_free(pDesc); mir_free(ppFile[0]); diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index 9162be6f97..488610a156 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -624,16 +624,7 @@ int CheckProtoSettings(const char *szProto, int iInitialStatus) static void Proto_SetAwayMsgT(const char *szProto, int iStatus, TCHAR *tszMsg) { if (!(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_INDIVMODEMSG)) - { - - if (CallProtoService(szProto, PS_SETAWAYMSGW, (WPARAM)iStatus, (LPARAM)tszMsg) == CALLSERVICE_NOTFOUND) - { - char *szMsg = mir_u2a(tszMsg); - CallProtoService(szProto, PS_SETAWAYMSG, (WPARAM)iStatus, (LPARAM)szMsg); - mir_free(szMsg); - } - - } + CallProtoService(szProto, PS_SETAWAYMSG, (WPARAM)iStatus, (LPARAM)tszMsg); } static void Proto_SetStatus(const char *szProto, int iInitialStatus, int iStatus, TCHAR *tszMsg) @@ -644,14 +635,7 @@ static void Proto_SetStatus(const char *szProto, int iInitialStatus, int iStatus if (!(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_INDIVMODEMSG)) { int iMsgStatus = CheckProtoSettings(szProto, iInitialStatus); - - if (CallProtoService(szProto, PS_SETAWAYMSGW, (WPARAM)iMsgStatus, (LPARAM)tszMsg) == CALLSERVICE_NOTFOUND) - { - char *szMsg = mir_u2a(tszMsg); - CallProtoService(szProto, PS_SETAWAYMSG, (WPARAM)iMsgStatus, (LPARAM)szMsg); - mir_free(szMsg); - } - + CallProtoService(szProto, PS_SETAWAYMSG, (WPARAM)iMsgStatus, (LPARAM)tszMsg); CallProtoService(szProto, PS_SETSTATUS, (WPARAM)iMsgStatus, 0); } if (ServiceExists(MS_KS_ANNOUNCESTATUSCHANGE)) diff --git a/plugins/StatusPlugins/commonstatus.cpp b/plugins/StatusPlugins/commonstatus.cpp index 2f4786f33b..f0423a24cc 100644 --- a/plugins/StatusPlugins/commonstatus.cpp +++ b/plugins/StatusPlugins/commonstatus.cpp @@ -196,11 +196,7 @@ static void SetStatusMsg(PROTOCOLSETTINGEX *ps, int newstatus) } } log_debugA("CommonStatus sets status message for %s directly", ps->szName); - if (CALLSERVICE_NOTFOUND == CallProtoService(ps->szName, PS_SETAWAYMSGT, newstatus, (LPARAM)tszMsg)) { - char* sMsg = mir_t2a(tszMsg); - CallProtoService(ps->szName, PS_SETAWAYMSG, newstatus, (LPARAM)sMsg); - mir_free(sMsg); - } + CallProtoService(ps->szName, PS_SETAWAYMSG, newstatus, (LPARAM)tszMsg); mir_free(tszMsg); } diff --git a/plugins/StopSpamMod/src/stopspam.cpp b/plugins/StopSpamMod/src/stopspam.cpp index a719850cb1..8d18c14759 100755 --- a/plugins/StopSpamMod/src/stopspam.cpp +++ b/plugins/StopSpamMod/src/stopspam.cpp @@ -213,7 +213,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) }; // auto auth. reqwest with send congratulation if(gbAutoReqAuth) - CallContactService(hContact,PSS_AUTHREQUESTW,0, (LPARAM)variables_parse(gbCongratulation, hContact).c_str()); + CallContactService(hContact,PSS_AUTHREQUEST,0, (LPARAM)variables_parse(gbCongratulation, hContact).c_str()); } } return 0; diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp index 2d20cdf3be..eba9346537 100644 --- a/plugins/Weather/src/weather.cpp +++ b/plugins/Weather/src/weather.cpp @@ -215,7 +215,8 @@ extern "C" int __declspec(dllexport) Load(void) hUpdateMutex = CreateMutex(NULL, FALSE, NULL); // register weather protocol - PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE }; + PROTOCOLDESCRIPTOR pd = { 0 }; + pd.cbSize = sizeof(pd); pd.szName = WEATHERPROTONAME; pd.type = (opt.NoProtoCondition) ? PROTOTYPE_VIRTUAL : PROTOTYPE_PROTOCOL; CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); diff --git a/plugins/Weather/src/weather_svcs.cpp b/plugins/Weather/src/weather_svcs.cpp index b485257601..c31e761916 100644 --- a/plugins/Weather/src/weather_svcs.cpp +++ b/plugins/Weather/src/weather_svcs.cpp @@ -207,8 +207,8 @@ void InitServices(void) CreateProtoServiceFunction(WEATHERPROTONAME, PS_LOADICON, WeatherLoadIcon); CreateProtoServiceFunction(WEATHERPROTONAME, PS_SETSTATUS, WeatherSetStatus); CreateProtoServiceFunction(WEATHERPROTONAME, PS_GETSTATUS, WeatherGetStatus); - CreateProtoServiceFunction(WEATHERPROTONAME, PS_BASICSEARCHT, WeatherBasicSearch); - CreateProtoServiceFunction(WEATHERPROTONAME, PS_SEARCHBYEMAILT, WeatherBasicSearch); + CreateProtoServiceFunction(WEATHERPROTONAME, PS_BASICSEARCH, WeatherBasicSearch); + CreateProtoServiceFunction(WEATHERPROTONAME, PS_SEARCHBYEMAIL, WeatherBasicSearch); CreateProtoServiceFunction(WEATHERPROTONAME, PS_ADDTOLIST, WeatherAddToList); CreateProtoServiceFunction(WEATHERPROTONAME, PSS_GETINFO, WeatherGetInfo); CreateProtoServiceFunction(WEATHERPROTONAME, PS_GETAVATARINFOT, WeatherGetAvatarInfo); diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp index 8cd85bd533..1495f107ff 100644 --- a/plugins/WebView/src/main.cpp +++ b/plugins/WebView/src/main.cpp @@ -179,7 +179,8 @@ extern "C" int __declspec(dllexport) Load() hNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM) & nlu); // register webview protocol - PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE }; + PROTOCOLDESCRIPTOR pd = { 0 }; + pd.cbSize = sizeof(pd); pd.szName = MODULENAME; pd.type = PROTOTYPE_PROTOCOL; CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); -- cgit v1.2.3