From 0fa39189ae1eea51681d472db38a290bc4df1cfe Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 24 Jan 2024 13:38:10 +0300 Subject: PS_GETNAME: another old atavism removed --- include/delphi/m_protosvc.inc | 10 ---------- include/m_protosvc.h | 12 ------------ plugins/AVS/src/userInfo.cpp | 9 ++------- plugins/Clist_blind/src/clc.cpp | 4 +--- plugins/NewAwaySysMod/src/AwaySys.cpp | 9 +++------ plugins/Variables/src/contact.cpp | 7 ------- plugins/Variables/src/contact.h | 8 +++----- plugins/helpers/gen_helpers.cpp | 6 +----- plugins/mRadio/i_service.inc | 19 +++++-------------- protocols/ConnectionNotify/src/ConnectionNotify.cpp | 8 -------- protocols/EmLanProto/src/amdproto.cpp | 7 ------- protocols/GmailNotifier/src/main.cpp | 7 ------- protocols/ICQCorp/src/services.cpp | 9 --------- protocols/LotusNotify/src/LotusNotify.cpp | 11 +---------- protocols/NewsAggregator/Src/NewsAggregator.cpp | 1 - protocols/NewsAggregator/Src/Services.cpp | 10 ---------- protocols/NewsAggregator/Src/stdafx.h | 1 - protocols/Non-IM Contact/src/main.cpp | 1 - protocols/Non-IM Contact/src/services.cpp | 10 ---------- protocols/Non-IM Contact/src/stdafx.h | 1 - protocols/Sametime/src/sametime.cpp | 11 ----------- protocols/Sametime/src/sametime_proto.cpp | 1 - protocols/Sametime/src/sametime_proto.h | 1 - protocols/Weather/src/stdafx.h | 1 - protocols/Weather/src/weather_opt.cpp | 2 +- protocols/Weather/src/weather_svcs.cpp | 9 --------- protocols/WebView/src/main.cpp | 1 - protocols/WebView/src/webview.h | 1 - protocols/YAMN/src/services.cpp | 7 ------- src/mir_app/src/clui.cpp | 2 +- src/mir_app/src/menu_clist.cpp | 3 --- src/mir_app/src/meta_services.cpp | 16 ---------------- src/mir_app/src/metacontacts.h | 1 - src/mir_app/src/protocols.cpp | 3 +-- 34 files changed, 19 insertions(+), 190 deletions(-) diff --git a/include/delphi/m_protosvc.inc b/include/delphi/m_protosvc.inc index 89a8c1fbce..de4c151296 100644 --- a/include/delphi/m_protosvc.inc +++ b/include/delphi/m_protosvc.inc @@ -197,16 +197,6 @@ const } PS_GETCAPS = '/GetCaps'; - { - wParam : cchName - lParam : Pointer to a buffer to fill with human-readable name - Affect : Get a human-readable name for the protocol, see notes - Result : 0 on success, [non zero] on failure - Notes : Should be translated before being returned, cchName - has the size of the buffer, example strings: "ICQ", "AIM" - } - PS_GETNAME = '/GetName'; - PLI_PROTOCOL = $1; // An icon representing the protocol (eg the multicoloured flower for ICQ) PLIF_LARGE = $0; // Or with one of the above to get the large (32x32 by default) icon diff --git a/include/m_protosvc.h b/include/m_protosvc.h index 763534a509..9bbb4558ad 100644 --- a/include/m_protosvc.h +++ b/include/m_protosvc.h @@ -183,18 +183,6 @@ static __inline unsigned long Proto_Status2Flag(int status) #define PS_GETCAPS "/GetCaps" -/////////////////////////////////////////////////////////////////////////////// -// Get a human-readable name for the protocol -// wParam = cchName -// lParam = (LPARAM)(char*)szName -// Returns 0 on success, nonzero on failure -// cchName is the number of characters in the buffer szName -// This should be translated before being returned -// Some example strings are: -// "ICQ", "AIM", "RSA-1024 Encryption" - -#define PS_GETNAME "/GetName" - /////////////////////////////////////////////////////////////////////////////// // Loads one of the protocol-specific icons // wParam = whichIcon diff --git a/plugins/AVS/src/userInfo.cpp b/plugins/AVS/src/userInfo.cpp index fd36371454..3b7a4bd129 100644 --- a/plugins/AVS/src/userInfo.cpp +++ b/plugins/AVS/src/userInfo.cpp @@ -406,14 +406,9 @@ public: SetMyAvatar(NULL, (LPARAM)L""); } else { - if (char *proto = GetSelectedProtocol()) { - char description[256]; - CallProtoService(proto, PS_GETNAME, _countof(description), (LPARAM)description); - wchar_t *descr = mir_a2u(description); - if (MessageBox(m_hwnd, TranslateT("Are you sure you want to remove your avatar?"), descr, MB_YESNO) == IDYES) + if (char *proto = GetSelectedProtocol()) + if (MessageBox(m_hwnd, TranslateT("Are you sure you want to remove your avatar?"), _A2T(proto), MB_YESNO) == IDYES) SetMyAvatar((WPARAM)proto, (LPARAM)L""); - mir_free(descr); - } } } diff --git a/plugins/Clist_blind/src/clc.cpp b/plugins/Clist_blind/src/clc.cpp index 5a57f0523a..d8e912baf8 100644 --- a/plugins/Clist_blind/src/clc.cpp +++ b/plugins/Clist_blind/src/clc.cpp @@ -71,9 +71,7 @@ static wchar_t* GetProtoName(ClcContact *item) PROTOACCOUNT *acc = Proto_GetAccount(item->pce->szProto); if (acc == nullptr) { - char description[128]; - CallProtoService(item->pce->szProto, PS_GETNAME, sizeof(description), (LPARAM)description); - mir_snwprintf(proto_name, L"%S", description); + mir_snwprintf(proto_name, L"%S", item->pce->szProto); return proto_name; } diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index eb50f63ee7..c3287605f5 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -462,12 +462,9 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) return NULL; // return it now, as later we change NULL to "" } else if (!mir_wstrcmp(ai->argv.w[0], VAR_PROTOCOL)) { - if (VarParseData.szProto) { - CString AnsiResult; - CallProtoService(VarParseData.szProto, PS_GETNAME, 256, (LPARAM)AnsiResult.GetBuffer(256)); - AnsiResult.ReleaseBuffer(); - Result = _A2T(AnsiResult); - } + if (VarParseData.szProto) + Result = _A2T(VarParseData.szProto); + if (Result == nullptr) // if we didn't find a message with specified title return NULL; // return it now, as later we change NULL to "" } diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp index 2d5e1fca0d..399d2d6dcc 100644 --- a/plugins/Variables/src/contact.cpp +++ b/plugins/Variables/src/contact.cpp @@ -65,7 +65,6 @@ static builtinCnfs[] = { CNF_COHOMEPAGE, STR_COHOMEPAGE }, { CCNF_ACCOUNT, STR_ACCOUNT }, - { CCNF_PROTOCOL, STR_PROTOCOL }, { CCNF_STATUS, STR_STATUS }, { CCNF_INTERNALIP, STR_INTERNALIP }, { CCNF_EXTERNALIP, STR_EXTERNALIP }, @@ -128,12 +127,6 @@ wchar_t* getContactInfoT(uint8_t type, MCONTACT hContact) return pa ? mir_wstrdup(pa->tszAccountName) : nullptr; } - case CCNF_PROTOCOL: - char protoname[128]; - if (CallProtoService(szProto, PS_GETNAME, (WPARAM)sizeof(protoname), (LPARAM)protoname)) - return nullptr; - return mir_a2u(protoname); - case CCNF_STATUS: return mir_wstrdup(Clist_GetStatusModeDescription(db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), 0)); diff --git a/plugins/Variables/src/contact.h b/plugins/Variables/src/contact.h index f8d04de21d..da81160e95 100644 --- a/plugins/Variables/src/contact.h +++ b/plugins/Variables/src/contact.h @@ -59,18 +59,16 @@ #define STR_COHOMEPAGE L"cohomepage" #define STR_ACCOUNT L"account" -#define STR_PROTOCOL L"protocol" #define STR_STATUS L"status" #define STR_INTERNALIP L"intip" #define STR_EXTERNALIP L"extip" #define STR_GROUP L"group" #define STR_PROTOID L"protoid" -#define CCNF_ACCOUNT 51 // CUSTOM, returns contact's account name (0.8.0+) -#define CCNF_PROTOCOL 50 // CUSTOM, returns the contact's protocol (human-readable) +#define CCNF_ACCOUNT 50 // CUSTOM, returns contact's account name (0.8.0+) #define CCNF_STATUS 49 // CUSTOM, returns status mode description -#define CCNF_INTERNALIP 48 // CUSTOM, returns the contact's internal IP -#define CCNF_EXTERNALIP 47 // CUSTOM, returns the contact's external IP +#define CCNF_INTERNALIP 48 // CUSTOM, returns the contact's internal IP +#define CCNF_EXTERNALIP 47 // CUSTOM, returns the contact's external IP #define CCNF_GROUP 46 // CUSTOM, returns group name #define CCNF_PROTOID 45 // CUSTOM, returns protocol ID instead of name diff --git a/plugins/helpers/gen_helpers.cpp b/plugins/helpers/gen_helpers.cpp index 3bf6e4976f..f1e5a1abde 100644 --- a/plugins/helpers/gen_helpers.cpp +++ b/plugins/helpers/gen_helpers.cpp @@ -22,11 +22,7 @@ wchar_t* Hlp_GetProtocolName(const char *proto) { - char protoname[256]; - if ((!ProtoServiceExists(proto, PS_GETNAME)) || (CallProtoService(proto, PS_GETNAME, (WPARAM)sizeof(protoname), (LPARAM)protoname))) - return nullptr; - - return mir_a2u(protoname); + return mir_a2u(proto); } wchar_t* Hlp_GetDlgItemText(HWND hwndDlg, int nIDDlgItem) diff --git a/plugins/mRadio/i_service.inc b/plugins/mRadio/i_service.inc index c129046170..f829d5fe82 100644 --- a/plugins/mRadio/i_service.inc +++ b/plugins/mRadio/i_service.inc @@ -18,13 +18,6 @@ begin end end; -function Service_GetName(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl; -begin - if lParam<>0 then - StrCopy(PAnsiChar(lParam),Translate(PluginName),wParam); - result:=0; -end; - procedure GetAwayMsgProc(hContact:TMCONTACT); cdecl; var buf,p:PWideChar; @@ -161,7 +154,7 @@ begin end; var - prh0,prh1,prh2,prh3,prh4,prh5,prh6,prh7,prh8,prh9:THANDLE; + prh0,prh1,prh2,prh3,prh4,prh5,prh6,prh7,prh8:THANDLE; procedure DestroyProtoServices; begin @@ -174,7 +167,6 @@ begin DestroyServiceFunction(prh6); DestroyServiceFunction(prh7); DestroyServiceFunction(prh8); - DestroyServiceFunction(prh9); end; procedure CreateProtoServices; @@ -184,9 +176,8 @@ begin prh2:=CreateProtoService(PS_CREATEADVSEARCHUI, @Service_ExtSearchUI); prh3:=CreateProtoService(PS_SEARCHBYADVANCED, @Service_SearchByAdvanced); prh4:=CreateProtoService(PS_BASICSEARCH, @Service_SearchBasic); - prh5:=CreateProtoService(PS_GETNAME, @Service_GetName); - prh6:=CreateProtoService(PS_LOADICON, @Service_LoadIcon); - prh7:=CreateProtoService(PS_GETSTATUS, @Service_GetStatus); - prh8:=CreateProtoService(PS_SETSTATUS, @Service_SetStatus); - prh9:=CreateProtoService(PSS_GETAWAYMSG, @Service_GetAwayMsg); + prh5:=CreateProtoService(PS_LOADICON, @Service_LoadIcon); + prh6:=CreateProtoService(PS_GETSTATUS, @Service_GetStatus); + prh7:=CreateProtoService(PS_SETSTATUS, @Service_SetStatus); + prh8:=CreateProtoService(PSS_GETAWAYMSG, @Service_GetAwayMsg); end; diff --git a/protocols/ConnectionNotify/src/ConnectionNotify.cpp b/protocols/ConnectionNotify/src/ConnectionNotify.cpp index d328c0bfab..c93ce046a6 100644 --- a/protocols/ConnectionNotify/src/ConnectionNotify.cpp +++ b/protocols/ConnectionNotify/src/ConnectionNotify.cpp @@ -167,13 +167,6 @@ INT_PTR GetCaps(WPARAM wParam, LPARAM) return 0; } -// gives name to protocol module -INT_PTR GetName(WPARAM wParam, LPARAM lParam) -{ - mir_strncpy((char*)lParam, PLUGINNAME, wParam); - return 0; -} - // gives icon for proto module INT_PTR TMLoadIcon(WPARAM wParam, LPARAM) { @@ -403,7 +396,6 @@ int CMPlugin::Load() g_plugin.setWord(hContact, "status", ID_STATUS_OFFLINE); CreateProtoServiceFunction(PLUGINNAME, PS_GETCAPS, GetCaps); - CreateProtoServiceFunction(PLUGINNAME, PS_GETNAME, GetName); CreateProtoServiceFunction(PLUGINNAME, PS_LOADICON, TMLoadIcon); CreateProtoServiceFunction(PLUGINNAME, PS_SETSTATUS, SetStatus); CreateProtoServiceFunction(PLUGINNAME, PS_GETSTATUS, GetStatus); diff --git a/protocols/EmLanProto/src/amdproto.cpp b/protocols/EmLanProto/src/amdproto.cpp index 30f0bc886c..04e7197645 100644 --- a/protocols/EmLanProto/src/amdproto.cpp +++ b/protocols/EmLanProto/src/amdproto.cpp @@ -76,12 +76,6 @@ static INT_PTR __cdecl EMPGetCaps(WPARAM wParam, LPARAM) } } -static INT_PTR __cdecl EMPGetName(WPARAM wParam, LPARAM lParam) -{ - mir_strncpy((char*)lParam, "EmLan", wParam); - return 0; -} - static INT_PTR __cdecl EMPLoadIcon(WPARAM wParam, LPARAM) { if ((wParam & 0xFFFF) != PLI_PROTOCOL) @@ -326,7 +320,6 @@ int CMPlugin::Load() g_lan = new CMLan(); CreateProtoServiceFunction(MODULENAME, PS_GETCAPS, EMPGetCaps); - CreateProtoServiceFunction(MODULENAME, PS_GETNAME, EMPGetName); CreateProtoServiceFunction(MODULENAME, PS_LOADICON, EMPLoadIcon); CreateProtoServiceFunction(MODULENAME, PS_SETSTATUS, EMPSetStatus); CreateProtoServiceFunction(MODULENAME, PS_GETSTATUS, EMPGetStatus); diff --git a/protocols/GmailNotifier/src/main.cpp b/protocols/GmailNotifier/src/main.cpp index 55f05feef0..c555c583f0 100644 --- a/protocols/GmailNotifier/src/main.cpp +++ b/protocols/GmailNotifier/src/main.cpp @@ -68,12 +68,6 @@ INT_PTR GetStatus(WPARAM, LPARAM) return ID_STATUS_ONLINE; } -INT_PTR GetName(WPARAM wParam, LPARAM lParam) -{ - mir_strncpy((char*)lParam, MODULENAME, wParam); - return 0; -} - void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) { PluginMenuCommand(0, 0); @@ -106,7 +100,6 @@ int CMPlugin::Load() CreateProtoServiceFunction(MODULENAME, PS_GETCAPS, GetCaps); CreateProtoServiceFunction(MODULENAME, PS_GETSTATUS, GetStatus); - CreateProtoServiceFunction(MODULENAME, PS_GETNAME, GetName); CreateServiceFunction("GmailMNotifier/Notifying", Notifying); DBVARIANT dbv; diff --git a/protocols/ICQCorp/src/services.cpp b/protocols/ICQCorp/src/services.cpp index 1457488d93..8dc6f047dd 100644 --- a/protocols/ICQCorp/src/services.cpp +++ b/protocols/ICQCorp/src/services.cpp @@ -41,14 +41,6 @@ static INT_PTR icqGetCaps(WPARAM wParam, LPARAM) /////////////////////////////////////////////////////////////////////////////// -static INT_PTR icqGetName(WPARAM wParam, LPARAM lParam) -{ - strncpy((char*)lParam, Translate(protoName), wParam); - return 0; -} - -/////////////////////////////////////////////////////////////////////////////// - static INT_PTR icqLoadIcon(WPARAM wParam, LPARAM) { int id; @@ -421,7 +413,6 @@ int LoadServices() HookEvent(ME_SYSTEM_MODULESLOADED, icqModulesLoaded); CreateProtoServiceFunction(protoName, PS_GETCAPS, icqGetCaps); - CreateProtoServiceFunction(protoName, PS_GETNAME, icqGetName); CreateProtoServiceFunction(protoName, PS_LOADICON, icqLoadIcon); CreateProtoServiceFunction(protoName, PS_SETSTATUS, icqSetStatus); CreateProtoServiceFunction(protoName, PS_GETSTATUS, icqGetStatus); diff --git a/protocols/LotusNotify/src/LotusNotify.cpp b/protocols/LotusNotify/src/LotusNotify.cpp index 4c86622fa0..731fbc296d 100644 --- a/protocols/LotusNotify/src/LotusNotify.cpp +++ b/protocols/LotusNotify/src/LotusNotify.cpp @@ -847,15 +847,7 @@ INT_PTR GetCaps(WPARAM wParam, LPARAM) return 0; } -//gives name to protocol module -INT_PTR GetName(WPARAM wParam, LPARAM lParam) -{ - strncpy((char *)lParam, MODULENAME, wParam); - return 0; -} - - -//gives icon for proto module +// gives icon for proto module INT_PTR TMLoadIcon(WPARAM wParam, LPARAM) { UINT id; @@ -1066,7 +1058,6 @@ int CMPlugin::Load() g_plugin.setWord(hContact, "status", ID_STATUS_OFFLINE); CreateProtoServiceFunction(MODULENAME, PS_GETCAPS, GetCaps); - CreateProtoServiceFunction(MODULENAME, PS_GETNAME, GetName); CreateProtoServiceFunction(MODULENAME, PS_LOADICON, TMLoadIcon); CreateProtoServiceFunction(MODULENAME, PS_SETSTATUS, SetStatus); CreateProtoServiceFunction(MODULENAME, PS_GETSTATUS, GetStatus); diff --git a/protocols/NewsAggregator/Src/NewsAggregator.cpp b/protocols/NewsAggregator/Src/NewsAggregator.cpp index 32be6949e1..2ec6b4f5a0 100644 --- a/protocols/NewsAggregator/Src/NewsAggregator.cpp +++ b/protocols/NewsAggregator/Src/NewsAggregator.cpp @@ -62,7 +62,6 @@ int CMPlugin::Load() hUpdateMutex = CreateMutex(nullptr, FALSE, nullptr); - CreateProtoServiceFunction(MODULENAME, PS_GETNAME, NewsAggrGetName); CreateProtoServiceFunction(MODULENAME, PS_GETCAPS, NewsAggrGetCaps); CreateProtoServiceFunction(MODULENAME, PS_SETSTATUS, NewsAggrSetStatus); CreateProtoServiceFunction(MODULENAME, PS_GETSTATUS, NewsAggrGetStatus); diff --git a/protocols/NewsAggregator/Src/Services.cpp b/protocols/NewsAggregator/Src/Services.cpp index aa1005d285..f809cd4058 100644 --- a/protocols/NewsAggregator/Src/Services.cpp +++ b/protocols/NewsAggregator/Src/Services.cpp @@ -62,16 +62,6 @@ int NewsAggrPreShutdown(WPARAM, LPARAM) return 0; } -INT_PTR NewsAggrGetName(WPARAM wParam, LPARAM lParam) -{ - if(lParam) { - mir_strncpy((char *)lParam, MODULENAME, wParam); - return 0; - } - - return 1; -} - INT_PTR NewsAggrGetCaps(WPARAM wp, LPARAM) { switch(wp) { diff --git a/protocols/NewsAggregator/Src/stdafx.h b/protocols/NewsAggregator/Src/stdafx.h index de0f7ed33e..17c1796916 100644 --- a/protocols/NewsAggregator/Src/stdafx.h +++ b/protocols/NewsAggregator/Src/stdafx.h @@ -102,7 +102,6 @@ void NetlibUnInit(); void InitMenu(); void InitIcons(); -INT_PTR NewsAggrGetName(WPARAM wParam, LPARAM lParam); INT_PTR NewsAggrGetCaps(WPARAM wp, LPARAM lp); INT_PTR NewsAggrSetStatus(WPARAM wp, LPARAM /*lp*/); INT_PTR NewsAggrGetStatus(WPARAM/* wp*/, LPARAM/* lp*/); diff --git a/protocols/Non-IM Contact/src/main.cpp b/protocols/Non-IM Contact/src/main.cpp index d2926c9893..89b0650a9c 100644 --- a/protocols/Non-IM Contact/src/main.cpp +++ b/protocols/Non-IM Contact/src/main.cpp @@ -120,7 +120,6 @@ int CMPlugin::Load() // load services (the first 5 are the basic ones needed to make a new protocol) CreateProtoServiceFunction(MODNAME, PS_GETCAPS, GetLCCaps); - CreateProtoServiceFunction(MODNAME, PS_GETNAME, GetLCName); CreateProtoServiceFunction(MODNAME, PS_LOADICON, LoadLCIcon); CreateProtoServiceFunction(MODNAME, PS_GETSTATUS, GetLCStatus); diff --git a/protocols/Non-IM Contact/src/services.cpp b/protocols/Non-IM Contact/src/services.cpp index 4fda75ac4a..9d297343b5 100644 --- a/protocols/Non-IM Contact/src/services.cpp +++ b/protocols/Non-IM Contact/src/services.cpp @@ -15,16 +15,6 @@ INT_PTR GetLCCaps(WPARAM wParam, LPARAM) return 0; } -//======================================================= -// GetName -//======================================================= -// -INT_PTR GetLCName(WPARAM wParam, LPARAM lParam) -{ - mir_strncpy((char*)lParam, MODNAME, wParam); - return 0; -} - //======================================================= // BPLoadIcon //======================================================= diff --git a/protocols/Non-IM Contact/src/stdafx.h b/protocols/Non-IM Contact/src/stdafx.h index eea3c27698..9e86855567 100644 --- a/protocols/Non-IM Contact/src/stdafx.h +++ b/protocols/Non-IM Contact/src/stdafx.h @@ -59,7 +59,6 @@ extern IconItem iconList[]; // Services.c INT_PTR GetLCCaps(WPARAM wParam,LPARAM lParam); -INT_PTR GetLCName(WPARAM wParam,LPARAM lParam); INT_PTR LoadLCIcon(WPARAM wParam,LPARAM lParam); int SetLCStatus(WPARAM wParam,LPARAM lParam); INT_PTR GetLCStatus(WPARAM wParam,LPARAM lParam); diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp index 27fa124bb6..58bdbb877f 100644 --- a/protocols/Sametime/src/sametime.cpp +++ b/protocols/Sametime/src/sametime.cpp @@ -36,17 +36,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC ///////////////////////////////////////////////////////////////////////////////////////// // protocol related services -/** Copy the name of the protocol into lParam -* @param wParam : max size of the name -* @param lParam : reference to a char *, which will hold the name -*/ -INT_PTR CSametimeProto::GetName(WPARAM wParam, LPARAM lParam) -{ - strncpy((char*)lParam, m_szModuleName, wParam); - return 0; -} - - /** Loads the icon corresponding to the status * Called by the CList when the status changes. * @param wParam : icon type diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp index 7f6c4e6cc5..1174ec9481 100644 --- a/protocols/Sametime/src/sametime_proto.cpp +++ b/protocols/Sametime/src/sametime_proto.cpp @@ -25,7 +25,6 @@ CSametimeProto::CSametimeProto(const char* pszProtoName, const wchar_t* tszUserN SametimeInitIcons(); - CreateProtoService(PS_GETNAME, &CSametimeProto::GetName); CreateProtoService(PS_LOADICON, &CSametimeProto::SametimeLoadIcon); HookProtoEvent(ME_MSG_WINDOWEVENT, &CSametimeProto::OnWindowEvent); diff --git a/protocols/Sametime/src/sametime_proto.h b/protocols/Sametime/src/sametime_proto.h index 44f6bcd3a8..11d5002beb 100644 --- a/protocols/Sametime/src/sametime_proto.h +++ b/protocols/Sametime/src/sametime_proto.h @@ -41,7 +41,6 @@ struct CSametimeProto : public PROTO bool OnContactDeleted(MCONTACT hContact, uint32_t flags) override; // sametime.cpp - INT_PTR __cdecl GetName(WPARAM wParam, LPARAM lParam); INT_PTR __cdecl SametimeLoadIcon(WPARAM wParam, LPARAM lParam); int __cdecl OnWindowEvent(WPARAM wParam, LPARAM lParam); int __cdecl OnIdleChanged(WPARAM wParam, LPARAM lParam); diff --git a/protocols/Weather/src/stdafx.h b/protocols/Weather/src/stdafx.h index d61a64e71a..64993c86ef 100644 --- a/protocols/Weather/src/stdafx.h +++ b/protocols/Weather/src/stdafx.h @@ -67,7 +67,6 @@ along with this program. If not, see . // name #define MODULENAME "Weather" -#define WEATHERPROTOTEXT "Weather" #define DEFCURRENTWEATHER "WeatherCondition" #define WEATHERCONDITION "Current" diff --git a/protocols/Weather/src/weather_opt.cpp b/protocols/Weather/src/weather_opt.cpp index c4b42ede5c..1d92f20191 100644 --- a/protocols/Weather/src/weather_opt.cpp +++ b/protocols/Weather/src/weather_opt.cpp @@ -487,7 +487,7 @@ int OptInit(WPARAM wParam, LPARAM) odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.pfnDlgProc = OptionsProc; odp.szGroup.a = LPGEN("Network"); - odp.szTitle.a = WEATHERPROTOTEXT; + odp.szTitle.a = MODULENAME; odp.szTab.a = LPGEN("General"); odp.flags = ODPF_BOLDGROUPS; g_plugin.addOptions(wParam, &odp); diff --git a/protocols/Weather/src/weather_svcs.cpp b/protocols/Weather/src/weather_svcs.cpp index 3c4c775347..ced1ce5c71 100644 --- a/protocols/Weather/src/weather_svcs.cpp +++ b/protocols/Weather/src/weather_svcs.cpp @@ -81,14 +81,6 @@ INT_PTR WeatherGetCaps(WPARAM wParam, LPARAM) return ret; } -// protocol service function to get weather protocol name -INT_PTR WeatherGetName(WPARAM wParam, LPARAM lParam) -{ - strncpy((char*)lParam, WEATHERPROTOTEXT, wParam - 1); - *((char*)lParam + wParam - 1) = 0; - return 0; -} - // protocol service function to get the current status of the protocol INT_PTR WeatherGetStatus(WPARAM, LPARAM) { @@ -264,7 +256,6 @@ static INT_PTR WeatherAdvancedStatusIcon(WPARAM hContact, LPARAM) void InitServices(void) { CreateProtoServiceFunction(MODULENAME, PS_GETCAPS, WeatherGetCaps); - CreateProtoServiceFunction(MODULENAME, PS_GETNAME, WeatherGetName); CreateProtoServiceFunction(MODULENAME, PS_LOADICON, WeatherLoadIcon); CreateProtoServiceFunction(MODULENAME, PS_SETSTATUS, WeatherSetStatus); CreateProtoServiceFunction(MODULENAME, PS_GETSTATUS, WeatherGetStatus); diff --git a/protocols/WebView/src/main.cpp b/protocols/WebView/src/main.cpp index 77375f0e63..a12a8640ab 100644 --- a/protocols/WebView/src/main.cpp +++ b/protocols/WebView/src/main.cpp @@ -58,7 +58,6 @@ CMPlugin::CMPlugin() : void InitServices() { CreateProtoServiceFunction(MODULENAME, PS_GETCAPS, GetCaps); - CreateProtoServiceFunction(MODULENAME, PS_GETNAME, GetName); CreateProtoServiceFunction(MODULENAME, PS_LOADICON, BPLoadIcon); CreateProtoServiceFunction(MODULENAME, PS_SETSTATUS, SetStatus); CreateProtoServiceFunction(MODULENAME, PS_GETSTATUS, GetStatus); diff --git a/protocols/WebView/src/webview.h b/protocols/WebView/src/webview.h index bc2f52ed5d..3ee6c9b88b 100644 --- a/protocols/WebView/src/webview.h +++ b/protocols/WebView/src/webview.h @@ -166,7 +166,6 @@ int SendToRichEdit(HWND hWindow, char *truncated, COLORREF rgbText, COLORREF rgb // Services INT_PTR GetCaps(WPARAM wParam, LPARAM lParam); -INT_PTR GetName(WPARAM wParam, LPARAM lParam); INT_PTR BPLoadIcon(WPARAM wParam, LPARAM lParam); // BPLoadIcon INT_PTR SetStatus(WPARAM wParam, LPARAM lParam); diff --git a/protocols/YAMN/src/services.cpp b/protocols/YAMN/src/services.cpp index c7f1ea5f1c..153ce77c79 100644 --- a/protocols/YAMN/src/services.cpp +++ b/protocols/YAMN/src/services.cpp @@ -17,12 +17,6 @@ static INT_PTR Service_GetCaps(WPARAM wParam, LPARAM) return 0; } -static INT_PTR Service_GetName(WPARAM wParam, LPARAM lParam) -{ - mir_strncpy((char *)lParam, YAMN_DBMODULE, wParam); - return 0; -} - static INT_PTR Service_LoadIcon(WPARAM wParam, LPARAM) { if (LOWORD(wParam) == PLI_PROTOCOL) @@ -190,7 +184,6 @@ void CreateServiceFunctions(void) { // Standard 'protocol' services CreateServiceFunction(YAMN_DBMODULE PS_GETCAPS, Service_GetCaps); - CreateServiceFunction(YAMN_DBMODULE PS_GETNAME, Service_GetName); CreateServiceFunction(YAMN_DBMODULE PS_LOADICON, Service_LoadIcon); // Checks mail diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 7efc4404be..b942e43469 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -146,7 +146,7 @@ public: { szProto = Proto_GetBaseAccountName(hContact); bDelContact = (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_SERVERCLIST) != 0; - bDelHistory = (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_SERVERMSGID) != 0; + bDelHistory = ProtoServiceExists(szProto, PS_GETCAPS); bForEveryone = (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_DELETEFORALL) != 0; } diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp index 49b7e3a074..74abd6075a 100644 --- a/src/mir_app/src/menu_clist.cpp +++ b/src/mir_app/src/menu_clist.cpp @@ -512,13 +512,10 @@ static INT_PTR StatusMenuExecService(WPARAM wParam, LPARAM) if (smep->status == 0 && smep->pimi != nullptr && smep->szProto != nullptr) { char *prot = smep->szProto; - char szHumanName[64] = { 0 }; PROTOACCOUNT *acc = Proto_GetAccount(smep->szProto); acc->bIsLocked = !acc->bIsLocked; db_set_b(0, prot, "LockMainStatus", acc->bIsLocked); - CallProtoService(smep->szProto, PS_GETNAME, _countof(szHumanName), (LPARAM)szHumanName); - TMO_IntMenuItem *pimi = MO_GetIntMenuItem(smep->pimi); if (pimi == nullptr) return 0; diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index 54ebf95f07..108fae7414 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -76,21 +76,6 @@ INT_PTR Meta_GetCaps(WPARAM wParam, LPARAM) return 0; } -/** Copy the name of the protocole into lParam -* @param wParam : max size of the name -* @param lParam : reference to a char *, which will hold the name -*/ - -INT_PTR Meta_GetName(WPARAM wParam, LPARAM lParam) -{ - char *name = (char *)Translate(META_PROTO); - size_t size = min(mir_strlen(name), wParam - 1); // copy only the first size bytes. - if (strncpy((char *)lParam, name, size) == nullptr) - return 1; - ((char *)lParam)[size] = '\0'; - return 0; -} - /** Loads the icon corresponding to the status * Called by the CList when the status changes. * @param wParam : icon type @@ -815,7 +800,6 @@ void Meta_InitServices() } CreateProtoServiceFunction(META_PROTO, PS_GETCAPS, Meta_GetCaps); - CreateProtoServiceFunction(META_PROTO, PS_GETNAME, Meta_GetName); CreateProtoServiceFunction(META_PROTO, PS_LOADICON, Meta_LoadIcon); CreateProtoServiceFunction(META_PROTO, PS_SETSTATUS, Meta_SetStatus); diff --git a/src/mir_app/src/metacontacts.h b/src/mir_app/src/metacontacts.h index e6edd3d205..c5545b4e12 100644 --- a/src/mir_app/src/metacontacts.h +++ b/src/mir_app/src/metacontacts.h @@ -67,7 +67,6 @@ DBCachedContact* CheckMeta(MCONTACT hMeta); void Meta_FixStatus(DBCachedContact *ccMeta); INT_PTR Meta_GetCaps(WPARAM wParam, LPARAM lParam); -INT_PTR Meta_GetName(WPARAM wParam, LPARAM lParam); INT_PTR Meta_LoadIcon(WPARAM wParam, LPARAM lParam); INT_PTR Meta_SetStatus(WPARAM wParam, LPARAM lParam); INT_PTR Meta_GetStatus(WPARAM wParam, LPARAM lParam); diff --git a/src/mir_app/src/protocols.cpp b/src/mir_app/src/protocols.cpp index 509f1bbedb..f9553396db 100644 --- a/src/mir_app/src/protocols.cpp +++ b/src/mir_app/src/protocols.cpp @@ -71,8 +71,7 @@ static TServiceListItem serviceItems[] = { PS_GETAWAYMSG, 28 }, { PS_SETAWAYMSG, 29 }, { PSS_USERISTYPING, 30 }, - { PS_GETNAME, 31 }, - { PS_GETSTATUS, 32 }, + { PS_GETSTATUS, 31 }, }; //------------------------------------------------------------------------------------ -- cgit v1.2.3