From 81337e86426dd4a79836554342bdc2e7e6195769 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 18 Jun 2013 14:12:13 +0000 Subject: massive extinction of stupid service name's buffers git-svn-id: http://svn.miranda-ng.org/main/trunk@5010 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_nicer/src/clcitems.cpp | 10 +++------- plugins/Clist_nicer/src/clui.cpp | 16 +++++----------- 2 files changed, 8 insertions(+), 18 deletions(-) (limited to 'plugins/Clist_nicer/src') diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index ebb3a8c3d8..6bc3a2a65f 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -270,19 +270,15 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) int xStatus; WPARAM xStatus2; TCHAR xStatusName[128]; - char szServiceName[128]; - mir_snprintf(szServiceName, 128, "%s%s", szProto, PS_GETCUSTOMSTATUSEX); - - CUSTOM_STATUS cst = {0}; - cst.cbSize = sizeof(CUSTOM_STATUS); + CUSTOM_STATUS cst = { sizeof(cst) }; cst.flags = CSSF_MASK_STATUS; cst.status = &xStatus; - if (ServiceExists(szServiceName) && !CallService(szServiceName, (WPARAM)hContact, (LPARAM)&cst) && xStatus > 0) { + if (ProtoServiceExists(szProto, PS_GETCUSTOMSTATUSEX) && !CallProtoService(szProto, PS_GETCUSTOMSTATUSEX, (WPARAM)hContact, (LPARAM)&cst) && xStatus > 0) { cst.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR; cst.wParam = &xStatus2; cst.ptszName = xStatusName; - if ( !CallService(szServiceName, (WPARAM)hContact, (LPARAM)&cst)) { + if ( !CallProtoService(szProto, PS_GETCUSTOMSTATUSEX, (WPARAM)hContact, (LPARAM)&cst)) { TCHAR *szwXstatusName = TranslateTS(xStatusName); p->statusMsg = (TCHAR *)realloc(p->statusMsg, (lstrlen(szwXstatusName) + 2) * sizeof(TCHAR)); _tcsncpy(p->statusMsg, szwXstatusName, lstrlen(szwXstatusName) + 1); diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index fe000c8e9d..2b346b8ccc 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -1384,11 +1384,9 @@ skipbg: } else if (item->dwFlags & BUTTON_ISPROTOSERVICE && cfg::clcdat) { if (contactOK) { - char szFinalService[512]; - - mir_snprintf(szFinalService, 512, "%s/%s", GetContactProto(hContact), item->szService); - if (ServiceExists(szFinalService)) - CallService(szFinalService, wwParam, llParam); + char *szProto = GetContactProto(hContact); + if (ProtoServiceExists(szProto, item->szService)) + CallProtoService(szProto, item->szService, wwParam, llParam); else serviceFailure = TRUE; } @@ -1708,15 +1706,11 @@ buttons_done: hIcon = Skin_GetIcon(szBuffer); } else if (cfg::dat.bShowXStatusOnSbar && status > ID_STATUS_OFFLINE) { - CUSTOM_STATUS cst = {0}; - char szServiceName[128]; int xStatus; - - mir_snprintf(szServiceName, 128, "%s%s", pd->RealName, PS_GETCUSTOMSTATUSEX); - cst.cbSize = sizeof(CUSTOM_STATUS); + CUSTOM_STATUS cst = { sizeof(cst) }; cst.flags = CSSF_MASK_STATUS; cst.status = &xStatus; - if (ServiceExists(szServiceName) && !CallService(szServiceName, 0, (LPARAM)&cst) && xStatus > 0) + if (ProtoServiceExists(pd->RealName, PS_GETCUSTOMSTATUSEX) && !CallProtoService(pd->RealName, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&cst) && xStatus > 0) hIcon = (HICON)CallProtoService(pd->RealName, PS_GETCUSTOMSTATUSICON, 0, LR_SHARED); // get OWN xStatus icon (if set) else hIcon = LoadSkinnedProtoIcon(szProto, status); -- cgit v1.2.3