From 5b378496114ec47ffa27d3d9e7bc2a744d9e0a77 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 20 Nov 2012 13:36:00 +0000 Subject: - all xstatus services moved to m_xstatus.h - old obsoleted services PS_GETXSTATUS & PS_SETXSTATUS removed git-svn-id: http://svn.miranda-ng.org/main/trunk@2390 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/CSList/cslist_10.vcxproj.filters | 3 -- plugins/CSList/src/cslist.cpp | 8 ++-- plugins/CSList/src/cslist.h | 2 +- plugins/Clist_nicer/src/Include/commonheaders.h | 1 + plugins/Clist_nicer/src/clcitems.cpp | 7 ++-- plugins/Clist_nicer/src/clui.cpp | 9 ++-- plugins/Clist_nicer/src/cluiservices.cpp | 1 - plugins/KeyboardNotify/src/Common.h | 2 +- plugins/KeyboardNotify/src/main.cpp | 34 +++++++-------- plugins/KeyboardNotify/src/options.cpp | 8 ++-- plugins/ListeningTo/src/commons.h | 2 +- plugins/ListeningTo/src/listeningto.cpp | 29 +++++++------ plugins/MyDetails/src/commons.h | 2 +- plugins/MyDetails/src/data.cpp | 55 +++++++++++-------------- plugins/MyDetails/src/data.h | 2 - plugins/MyDetails/src/frame.cpp | 33 ++++----------- plugins/NewXstatusNotify/src/common.h | 2 +- plugins/NewXstatusNotify/src/xstatus.cpp | 8 ++-- plugins/TipperYM/src/common.h | 1 + plugins/TipperYM/src/popwin.cpp | 4 +- plugins/TipperYM/src/translations.cpp | 8 ++-- plugins/Utils/mir_options.cpp | 6 +-- 22 files changed, 98 insertions(+), 129 deletions(-) (limited to 'plugins') diff --git a/plugins/CSList/cslist_10.vcxproj.filters b/plugins/CSList/cslist_10.vcxproj.filters index eb57988f85..57c03ce842 100644 --- a/plugins/CSList/cslist_10.vcxproj.filters +++ b/plugins/CSList/cslist_10.vcxproj.filters @@ -13,9 +13,6 @@ {0c22408f-3e3b-4310-970e-525e94308c9d} ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - {072cb5e6-88d2-4b64-a2ee-b49ae44f8b49} - diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index 7c0c4b23b5..9f1a80b810 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -257,8 +257,8 @@ void CSList::setStatus( WORD code, StatusItem* item, char* protoName) int statusToSet = -1; if (lstrcmpA(pdescr->szProtoName, "ICQ") == 0) { - ICQ_CUSTOM_STATUS ics = {0}; - ics.cbSize = sizeof(ICQ_CUSTOM_STATUS); + CUSTOM_STATUS ics = {0}; + ics.cbSize = sizeof(CUSTOM_STATUS); ics.flags = CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE | CSSF_TCHAR; if (code == IDC_CANCEL) @@ -278,13 +278,13 @@ void CSList::setStatus( WORD code, StatusItem* item, char* protoName) ics.status = &statusToSet; char protoService[64]; - mir_snprintf(protoService, SIZEOF(protoService), "%s%s", protoName, PS_ICQ_SETCUSTOMSTATUSEX); + mir_snprintf(protoService, SIZEOF(protoService), "%s%s", protoName, PS_SETCUSTOMSTATUSEX); CallService(protoService, 0, (LPARAM)&ics); } if (lstrcmpA(pdescr->szProtoName, "JABBER") == 0) { JABBER_CUSTOM_STATUS ics = {0}; - ics.cbSize = sizeof(ICQ_CUSTOM_STATUS); + ics.cbSize = sizeof(CUSTOM_STATUS); ics.flags = CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE | CSSF_TCHAR; if (code == IDC_CANCEL) diff --git a/plugins/CSList/src/cslist.h b/plugins/CSList/src/cslist.h index ec2e533771..fa66a2c116 100644 --- a/plugins/CSList/src/cslist.h +++ b/plugins/CSList/src/cslist.h @@ -69,7 +69,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/plugins/Clist_nicer/src/Include/commonheaders.h b/plugins/Clist_nicer/src/Include/commonheaders.h index 1ffcc2ac76..383ad487d8 100644 --- a/plugins/Clist_nicer/src/Include/commonheaders.h +++ b/plugins/Clist_nicer/src/Include/commonheaders.h @@ -84,6 +84,7 @@ #include #include #include +#include #include #include "extbackg.h" diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 4099b03c08..160bc97112 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -31,7 +31,6 @@ */ #include -#include extern int ( *saveAddContactToGroup )(struct ClcData *dat, ClcGroup *group, HANDLE hContact); extern int ( *saveAddInfoItemToGroup )(ClcGroup *group, int flags, const TCHAR *pszText); @@ -301,10 +300,10 @@ BYTE GetCachedStatusMsg(int iExtraCacheEntry, char *szProto) TCHAR xStatusName[128]; char szServiceName[128]; - mir_snprintf(szServiceName, 128, "%s%s", szProto, PS_ICQ_GETCUSTOMSTATUSEX); + mir_snprintf(szServiceName, 128, "%s%s", szProto, PS_GETCUSTOMSTATUSEX); - ICQ_CUSTOM_STATUS cst = {0}; - cst.cbSize = sizeof(ICQ_CUSTOM_STATUS); + CUSTOM_STATUS cst = {0}; + cst.cbSize = sizeof(CUSTOM_STATUS); cst.flags = CSSF_MASK_STATUS; cst.status = &xStatus; if (ServiceExists(szServiceName) && !CallService(szServiceName, (WPARAM)hContact, (LPARAM)&cst) && xStatus > 0) { diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index d39e996e73..c283da5058 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -32,7 +32,6 @@ #include #include -#include #include "../cluiframes/cluiframes.h" #include "../coolsb/coolscroll.h" @@ -1787,16 +1786,16 @@ buttons_done: mir_snprintf(szBuffer, 128, "%s_conn", pd->RealName); hIcon = Skin_GetIcon(szBuffer); } else if (cfg::dat.bShowXStatusOnSbar && status > ID_STATUS_OFFLINE) { - ICQ_CUSTOM_STATUS cst = {0}; + CUSTOM_STATUS cst = {0}; char szServiceName[128]; int xStatus; - mir_snprintf(szServiceName, 128, "%s%s", pd->RealName, PS_ICQ_GETCUSTOMSTATUSEX); - cst.cbSize = sizeof(ICQ_CUSTOM_STATUS); + mir_snprintf(szServiceName, 128, "%s%s", pd->RealName, PS_GETCUSTOMSTATUSEX); + cst.cbSize = sizeof(CUSTOM_STATUS); cst.flags = CSSF_MASK_STATUS; cst.status = &xStatus; if (ServiceExists(szServiceName) && !CallService(szServiceName, 0, (LPARAM)&cst) && xStatus > 0) { - hIcon = (HICON)CallProtoService(pd->RealName, PS_ICQ_GETCUSTOMSTATUSICON, 0, LR_SHARED); // get OWN xStatus icon (if set) + hIcon = (HICON)CallProtoService(pd->RealName, PS_GETCUSTOMSTATUSICON, 0, LR_SHARED); // get OWN xStatus icon (if set) } else hIcon = LoadSkinnedProtoIcon(szProto, status); } else diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp index 6bba347513..2d8c2e0db8 100644 --- a/plugins/Clist_nicer/src/cluiservices.cpp +++ b/plugins/Clist_nicer/src/cluiservices.cpp @@ -25,7 +25,6 @@ UNICODE done */ #include #include "../cluiframes/cluiframes.h" -#include extern HIMAGELIST hCListImages; extern ButtonItem *g_ButtonItems; diff --git a/plugins/KeyboardNotify/src/Common.h b/plugins/KeyboardNotify/src/Common.h index 406f5c14ad..20b2f13d17 100644 --- a/plugins/KeyboardNotify/src/Common.h +++ b/plugins/KeyboardNotify/src/Common.h @@ -51,7 +51,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include -#include +#include #include #include #include diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 7806e4c69d..02254e11ef 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -451,26 +451,24 @@ BOOL checkGlobalStatus() BOOL checkGlobalXstatus() { - ICQ_CUSTOM_STATUS xstatus={0}; - int i, protosSupporting, status=0; + int protosSupporting=0, status=0; - for(i=0, protosSupporting=0; i < ProtoList.protoCount; i++) { - if (!ProtoList.protoInfo[i].enabled || !ProtoList.protoInfo[i].xstatus.count) continue; + for (int i=0; i < ProtoList.protoCount; i++) { + if ( !ProtoList.protoInfo[i].enabled || !ProtoList.protoInfo[i].xstatus.count) + continue; protosSupporting++; // Retrieve xstatus for protocol - xstatus.cbSize = sizeof(ICQ_CUSTOM_STATUS); + CUSTOM_STATUS xstatus = { sizeof(CUSTOM_STATUS) }; xstatus.flags = CSSF_MASK_STATUS; xstatus.status = &status; - CallProtoService(ProtoList.protoInfo[i].szProto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus); + CallProtoService(ProtoList.protoInfo[i].szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus); - if (ProtoList.protoInfo[i].xstatus.enabled[status]) return TRUE; + if (ProtoList.protoInfo[i].xstatus.enabled[status]) + return TRUE; } - if (!protosSupporting) - return TRUE; - else - return FALSE; + return protosSupporting == 0; } @@ -676,7 +674,7 @@ BOOL checkStatus(char *szProto) BOOL checkXstatus(char *szProto) { int status=0; - ICQ_CUSTOM_STATUS xstatus={0}; + CUSTOM_STATUS xstatus={0}; if (!szProto) return checkGlobalXstatus(); @@ -686,10 +684,10 @@ BOOL checkXstatus(char *szProto) if (!ProtoList.protoInfo[i].xstatus.count) return TRUE; // Retrieve xstatus for protocol - xstatus.cbSize = sizeof(ICQ_CUSTOM_STATUS); + xstatus.cbSize = sizeof(CUSTOM_STATUS); xstatus.flags = CSSF_MASK_STATUS; xstatus.status = &status; - CallProtoService(ProtoList.protoInfo[i].szProto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus); + CallProtoService(ProtoList.protoInfo[i].szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus); return ProtoList.protoInfo[i].xstatus.enabled[status]; } @@ -962,16 +960,16 @@ void updateXstatusProto(PROTOCOL_INFO *protoInfo) { unsigned int i; char szServiceName[MAXMODULELABELLENGTH]; - ICQ_CUSTOM_STATUS xstatus={0}; + CUSTOM_STATUS xstatus={0}; - mir_snprintf(szServiceName, sizeof(szServiceName), "%s%s", protoInfo->szProto, PS_ICQ_GETCUSTOMSTATUSEX); + mir_snprintf(szServiceName, sizeof(szServiceName), "%s%s", protoInfo->szProto, PS_GETCUSTOMSTATUSEX); if (!ServiceExists(szServiceName)) return; // Retrieve xstatus.count - xstatus.cbSize = sizeof(ICQ_CUSTOM_STATUS); + xstatus.cbSize = sizeof(CUSTOM_STATUS); xstatus.flags = CSSF_STATUSES_COUNT; xstatus.wParam = &(protoInfo->xstatus.count); - CallProtoService(protoInfo->szProto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus); + CallProtoService(protoInfo->szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus); (protoInfo->xstatus.count)++; // Don't forget about xstatus=0 (None) // Alloc and initiailize xstatus.enabled array diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp index 7ef9db3380..49a3f3fd89 100644 --- a/plugins/KeyboardNotify/src/options.cpp +++ b/plugins/KeyboardNotify/src/options.cpp @@ -1443,22 +1443,22 @@ INT_PTR CALLBACK DlgProcXstatusList(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA hParent = TreeView_InsertItem(hwndTree, &tvis); for(j = 0; j < XstatusListAux[i].count; j++) { TCHAR szDefaultName[1024]; - ICQ_CUSTOM_STATUS xstatus={0}; + CUSTOM_STATUS xstatus={0}; tvis.hParent = hParent; tvis.item.mask = TVIF_TEXT|TVIF_PARAM|TVIF_IMAGE|TVIF_SELECTEDIMAGE; if (!j){ tvis.item.pszText = TranslateT("None"); } else { - xstatus.cbSize = sizeof(ICQ_CUSTOM_STATUS); + xstatus.cbSize = sizeof(CUSTOM_STATUS); xstatus.flags = CSSF_MASK_NAME|CSSF_DEFAULT_NAME|CSSF_UNICODE; xstatus.ptszName = szDefaultName; xstatus.wParam = &j; - CallProtoService(ProtoList.protoInfo[i].szProto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus); + CallProtoService(ProtoList.protoInfo[i].szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus); tvis.item.pszText = szDefaultName; } tvis.item.lParam = (LPARAM)j; - tvis.item.iImage = tvis.item.iSelectedImage = j?ImageList_AddIcon(hImageList, hIconAux=(HICON)CallProtoService(ProtoList.protoInfo[i].szProto, PS_ICQ_GETCUSTOMSTATUSICON, (WPARAM)j, 0)):0; + tvis.item.iImage = tvis.item.iSelectedImage = j?ImageList_AddIcon(hImageList, hIconAux=(HICON)CallProtoService(ProtoList.protoInfo[i].szProto, PS_GETCUSTOMSTATUSICON, (WPARAM)j, 0)):0; if (hIconAux) DestroyIcon(hIconAux); TreeView_InsertItem(hwndTree, &tvis); } diff --git a/plugins/ListeningTo/src/commons.h b/plugins/ListeningTo/src/commons.h index 36f9fa0a34..29915aa334 100644 --- a/plugins/ListeningTo/src/commons.h +++ b/plugins/ListeningTo/src/commons.h @@ -56,7 +56,7 @@ Boston, MA 02111-1307, USA. #include #include #include -#include +#include #include #include #include diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index 538dc8ba89..931270ff1b 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -226,8 +226,7 @@ void RebuildMenu() void RegisterProtocol(char *proto, TCHAR *account) { - if (!ProtoServiceExists(proto, PS_SET_LISTENINGTO) && - !ProtoServiceExists(proto, PS_ICQ_SETCUSTOMSTATUSEX)) + if (!ProtoServiceExists(proto, PS_SET_LISTENINGTO) && !ProtoServiceExists(proto, PS_SETCUSTOMSTATUSEX)) return; size_t id = proto_items.size(); @@ -578,13 +577,13 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti) if (ProtoServiceExists(proto, PS_SET_LISTENINGTO)) CallProtoService(proto, PS_SET_LISTENINGTO, 0, (LPARAM) lti); - else if (ProtoServiceExists(proto, PS_ICQ_SETCUSTOMSTATUSEX)) { + else if (ProtoServiceExists(proto, PS_SETCUSTOMSTATUSEX)) { if (opts.xstatus_set == IGNORE_XSTATUS) return; int status; - ICQ_CUSTOM_STATUS ics = {0}; - ics.cbSize = sizeof(ICQ_CUSTOM_STATUS); + CUSTOM_STATUS ics = {0}; + ics.cbSize = sizeof(CUSTOM_STATUS); ics.status = &status; // Set or reset? @@ -592,7 +591,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti) { // Reset -> only if is still in music xstatus ics.flags = CSSF_MASK_STATUS; - if (CallProtoService(proto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM) &ics) || status != XSTATUS_MUSIC) + if (CallProtoService(proto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM) &ics) || status != XSTATUS_MUSIC) { if (opts.xstatus_set == SET_XSTATUS) { @@ -623,14 +622,14 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti) ics.ptszName = name.str; ics.ptszMessage = msg.str; - CallProtoService(proto, PS_ICQ_SETCUSTOMSTATUSEX, 0, (LPARAM) &ics); + CallProtoService(proto, PS_SETCUSTOMSTATUSEX, 0, (LPARAM) &ics); } else if (opts.xstatus_set == CHECK_XSTATUS) { status = 0; ics.flags = CSSF_MASK_STATUS; - CallProtoService(proto, PS_ICQ_SETCUSTOMSTATUSEX, 0, (LPARAM) &ics); + CallProtoService(proto, PS_SETCUSTOMSTATUSEX, 0, (LPARAM) &ics); } else { @@ -649,7 +648,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti) ics.flags = CSSF_MASK_STATUS; } - CallProtoService(proto, PS_ICQ_SETCUSTOMSTATUSEX, 0, (LPARAM) &ics); + CallProtoService(proto, PS_SETCUSTOMSTATUSEX, 0, (LPARAM) &ics); if (pi != NULL) { @@ -665,20 +664,20 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti) if (opts.xstatus_set == CHECK_XSTATUS_MUSIC) { ics.flags = CSSF_MASK_STATUS; - if (CallProtoService(proto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM) &ics) || status != XSTATUS_MUSIC) + if (CallProtoService(proto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM) &ics) || status != XSTATUS_MUSIC) return; } else if (opts.xstatus_set == CHECK_XSTATUS) { ics.flags = CSSF_MASK_STATUS; - if (!CallProtoService(proto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM) &ics) && status != XSTATUS_MUSIC && status != 0) + if (!CallProtoService(proto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM) &ics) && status != XSTATUS_MUSIC && status != 0) return; } else { // Store old data ics.flags = CSSF_MASK_STATUS; - if (!CallProtoService(proto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM) &ics) && status != XSTATUS_MUSIC) + if (!CallProtoService(proto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM) &ics) && status != XSTATUS_MUSIC) { ProtocolInfo *pi = GetProtoInfo(proto); if (pi != NULL) @@ -688,7 +687,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti) ics.ptszName = pi->old_xstatus_name; ics.ptszMessage = pi->old_xstatus_message; - CallProtoService(proto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM) &ics); + CallProtoService(proto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM) &ics); } } } @@ -717,7 +716,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti) ics.ptszName = name.str; ics.ptszMessage = msg.str; - CallProtoService(proto, PS_ICQ_SETCUSTOMSTATUSEX, 0, (LPARAM) &ics); + CallProtoService(proto, PS_SETCUSTOMSTATUSEX, 0, (LPARAM) &ics); mir_free(fr[1]); } @@ -756,7 +755,7 @@ INT_PTR EnableListeningTo(WPARAM wParam,LPARAM lParam) else { if (!ProtoServiceExists(proto, PS_SET_LISTENINGTO) && - !ProtoServiceExists(proto, PS_ICQ_SETCUSTOMSTATUSEX) && + !ProtoServiceExists(proto, PS_SETCUSTOMSTATUSEX) && !ProtoServiceExists(proto, PS_SETAWAYMSGT)) // by yaho return 0; diff --git a/plugins/MyDetails/src/commons.h b/plugins/MyDetails/src/commons.h index 4753c28d70..5d875f8aff 100644 --- a/plugins/MyDetails/src/commons.h +++ b/plugins/MyDetails/src/commons.h @@ -51,7 +51,7 @@ Boston, MA 02111-1307, USA. #include #include #include -#include +#include #include #include "m_cluiframes.h" #include "m_simpleaway.h" diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp index ddd96e920c..930afa2bda 100644 --- a/plugins/MyDetails/src/data.cpp +++ b/plugins/MyDetails/src/data.cpp @@ -130,11 +130,17 @@ int Protocol::GetStatus() data_changed = true; // check if protocol supports custom status - if (ProtoServiceExists(name, PS_ICQ_GETCUSTOMSTATUS)) + CUSTOM_STATUS css = { sizeof(css) }; + if ( ProtoServiceExists(name, PS_GETCUSTOMSTATUSEX)) { // check if custom status is set - custom_status = CallProtoService(name, PS_ICQ_GETCUSTOMSTATUS, (WPARAM) &custom_status_name, (LPARAM) &custom_status_message); - else - custom_status = 0; + css.flags = CSSF_TCHAR | CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE | CSSF_DEFAULT_NAME; + css.status = &custom_status; + css.ptszName = status_name; + css.ptszMessage = status_message; + if ( CallProtoService(name, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&css) != 0) + status_message[0] = status_name[0] = 0, custom_status = 0; + } + else custom_status = 0; // if protocol supports custom status, but it is not set (custom_status will be -1), show normal status if (custom_status < 0) custom_status = 0; @@ -142,35 +148,24 @@ int Protocol::GetStatus() if (custom_status == 0) { TCHAR *tmp = (TCHAR*) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, status, GSMDF_TCHAR); lcopystr(status_name, tmp, SIZEOF(status_name)); - } else { - DBVARIANT dbv; + } + else { TCHAR tmp[256]; tmp[0] = 0; - if (custom_status_name != NULL && custom_status_name[0] != '\0' && !DBGetContactSettingTString(0, name, custom_status_name, &dbv)) { - if (dbv.ptszVal != NULL && dbv.ptszVal[0] != _T('\0')) - lstrcpyn(tmp, dbv.ptszVal, SIZEOF(tmp)); - else - lstrcpyn(tmp, TranslateT(""), SIZEOF(tmp)); - - DBFreeVariant(&dbv); - } else { + if (status_name[0] != '\0') + lstrcpyn(tmp, status_name, SIZEOF(tmp)); + else lstrcpyn(tmp, TranslateT(""), SIZEOF(tmp)); - } - - if (custom_status_message != NULL && custom_status_message[0] != '\0' && !DBGetContactSettingTString(0, name, custom_status_message, &dbv)) { - if (dbv.ptszVal != NULL && dbv.ptszVal[0] != '\0') { - int len = lstrlen(tmp); - - if (len < SIZEOF(tmp)) - lstrcpyn(&tmp[len], _T(": "), SIZEOF(tmp) - len); - len += 2; + if (status_message[0] != '\0') { + int len = lstrlen(tmp); + if (len < SIZEOF(tmp)) + lstrcpyn(&tmp[len], _T(": "), SIZEOF(tmp) - len); - if (len < SIZEOF(tmp)) - lstrcpyn(&tmp[len], dbv.ptszVal, SIZEOF(tmp) - len); - } + len += 2; - DBFreeVariant(&dbv); + if (len < SIZEOF(tmp)) + lstrcpyn(&tmp[len], status_message, SIZEOF(tmp) - len); } lcopystr(status_name, tmp, SIZEOF(status_name)); @@ -450,7 +445,7 @@ TCHAR * Protocol::GetListeningTo() } lcopystr(listening_to, dbv.ptszVal, SIZEOF(listening_to)); - DBFreeVariant(&dbv); + db_free(&dbv); return listening_to; } @@ -604,7 +599,7 @@ void ProtocolArray::GetDefaultNick() DBVARIANT dbv; if ( !DBGetContactSettingTString(0, MODULE_NAME, SETTING_DEFAULT_NICK, &dbv)) { lstrcpyn(default_nick, dbv.ptszVal, SIZEOF(default_nick)); - DBFreeVariant(&dbv); + db_free(&dbv); } else default_nick[0] = '\0'; } @@ -614,7 +609,7 @@ void ProtocolArray::GetDefaultAvatar() DBVARIANT dbv; if ( !DBGetContactSettingTString(0, "ContactPhoto", "File", &dbv)) { lstrcpyn(default_avatar_file, dbv.ptszVal, SIZEOF(default_avatar_file)); - DBFreeVariant(&dbv); + db_free(&dbv); } else default_avatar_file[0] = '\0'; } diff --git a/plugins/MyDetails/src/data.h b/plugins/MyDetails/src/data.h index 468bc6c590..9eb355e333 100644 --- a/plugins/MyDetails/src/data.h +++ b/plugins/MyDetails/src/data.h @@ -42,9 +42,7 @@ public: TCHAR description[256]; TCHAR nickname[256]; TCHAR status_name[256]; - char *custom_status_name; TCHAR status_message[1024]; - char *custom_status_message; TCHAR listening_to[1024]; AVATARCACHEENTRY *ace; TCHAR avatar_file[1024]; diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index 690bd84a9d..f2e056082b 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -1287,18 +1287,13 @@ void Draw(HWND hwnd, HDC hdc_orig) SelectClipRgn(hdc, rgn); HICON status_icon; - if (proto->custom_status != 0 && ProtoServiceExists(proto->name, PS_ICQ_GETCUSTOMSTATUSICON)) - { - status_icon = (HICON) CallProtoService(proto->name, PS_ICQ_GETCUSTOMSTATUSICON, proto->custom_status, 0); - } + if (proto->custom_status != 0 && ProtoServiceExists(proto->name, PS_GETCUSTOMSTATUSICON)) + status_icon = (HICON) CallProtoService(proto->name, PS_GETCUSTOMSTATUSICON, proto->custom_status, 0); else - { status_icon = LoadSkinnedProtoIcon(proto->name, proto->status); - } - if (status_icon != NULL) - { - DrawIconEx(hdc, data->status_icon_rect.left, data->status_icon_rect.top, status_icon, - ICON_SIZE, ICON_SIZE, 0, NULL, DI_NORMAL); + + if (status_icon != NULL) { + DrawIconEx(hdc, data->status_icon_rect.left, data->status_icon_rect.top, status_icon, ICON_SIZE, ICON_SIZE, 0, NULL, DI_NORMAL); DeleteObject(status_icon); } @@ -2668,21 +2663,9 @@ int SettingsChangedHook(WPARAM wParam, LPARAM lParam) if ((HANDLE)wParam == NULL) { - Protocol *proto = protocols->Get((const char *) cws->szModule); - - if ( !strcmp(cws->szSetting,"Status") - || ( proto != NULL && proto->custom_status != 0 - && proto->custom_status_name != NULL - && !strcmp(cws->szSetting, proto->custom_status_name)) - || ( proto != NULL && proto->custom_status != 0 - && proto->custom_status_message != NULL - && !strcmp(cws->szSetting, proto->custom_status_message))) - { - // Status changed - if (proto != NULL) - PostMessage(hwnd_frame, MWM_STATUS_CHANGED, (WPARAM) proto->name, 0); - } - else if (!strcmp(cws->szSetting,"MyHandle") + Protocol *proto = protocols->Get((const char*)cws->szModule); + + if (!strcmp(cws->szSetting,"MyHandle") || !strcmp(cws->szSetting,"UIN") || !strcmp(cws->szSetting,"Nick") || !strcmp(cws->szSetting,"FirstName") diff --git a/plugins/NewXstatusNotify/src/common.h b/plugins/NewXstatusNotify/src/common.h index e44291ed75..1f988183a1 100644 --- a/plugins/NewXstatusNotify/src/common.h +++ b/plugins/NewXstatusNotify/src/common.h @@ -67,7 +67,7 @@ #include "m_system.h" #include "m_userinfo.h" #include "m_utils.h" -#include "m_icq.h" +#include "m_xstatus.h" #include "m_extraicons.h" #include "m_metacontacts.h" diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index f80caba2f1..bc2bb541e6 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -151,7 +151,7 @@ void ShowPopup(XSTATUSCHANGE *xsc) case TYPE_ICQ_XSTATUS: { int statusId = db_get_b(xsc->hContact, xsc->szProto, "XStatusId", 0); - ppd.lchIcon = (HICON)CallProtoService(xsc->szProto, PS_ICQ_GETCUSTOMSTATUSICON, statusId, LR_SHARED); + ppd.lchIcon = (HICON)CallProtoService(xsc->szProto, PS_GETCUSTOMSTATUSICON, statusId, LR_SHARED); } } @@ -367,12 +367,12 @@ TCHAR *GetDefaultXstatusName(int statusID, char *szProto, TCHAR *buff, int buffl TCHAR nameBuff[64]; buff[0] = 0; - ICQ_CUSTOM_STATUS xstatus = {0}; - xstatus.cbSize = sizeof(ICQ_CUSTOM_STATUS); + CUSTOM_STATUS xstatus = {0}; + xstatus.cbSize = sizeof(CUSTOM_STATUS); xstatus.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR; xstatus.ptszName = nameBuff; xstatus.wParam = (WPARAM *)&statusID; - if (!CallProtoService(szProto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus)) { + if (!CallProtoService(szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus)) { _tcsncpy(buff, TranslateTS(nameBuff), bufflen); buff[bufflen - 1] = 0; } diff --git a/plugins/TipperYM/src/common.h b/plugins/TipperYM/src/common.h index 9098589d1c..d66c1bd221 100644 --- a/plugins/TipperYM/src/common.h +++ b/plugins/TipperYM/src/common.h @@ -76,6 +76,7 @@ Boston, MA 02111-1307, USA. #include #include #include +#include #include #include "resource.h" diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index a5a9b59bfe..34cf0f596a 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -205,7 +205,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa // get advanced status icon if (pwd->bIsIconVisible[1]) { - pwd->extraIcons[1].hIcon = (HICON)CallProtoService(pwd->clcit.szProto, PS_ICQ_GETCUSTOMSTATUSICON, 0, 0); + pwd->extraIcons[1].hIcon = (HICON)CallProtoService(pwd->clcit.szProto, PS_GETCUSTOMSTATUSICON, 0, 0); pwd->extraIcons[1].bDestroy = true; } } @@ -413,7 +413,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa DBFreeVariant(&dbv); } - pwd->extraIcons[i].hIcon = (HICON)CallProtoService(szIconProto, PS_ICQ_GETCUSTOMSTATUSICON, (WPARAM)iXstatus, LR_SHARED); + pwd->extraIcons[i].hIcon = (HICON)CallProtoService(szIconProto, PS_GETCUSTOMSTATUSICON, (WPARAM)iXstatus, LR_SHARED); pwd->extraIcons[i].bDestroy = false; } } diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp index 1fd6e67c39..714c769f2d 100644 --- a/plugins/TipperYM/src/translations.cpp +++ b/plugins/TipperYM/src/translations.cpp @@ -583,7 +583,7 @@ TCHAR *DayMonthToDaysToNextBirthday(HANDLE hContact, const char *szModuleName, c TCHAR *EmptyXStatusToDefaultName(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen) { TCHAR szDefaultName[1024]; - ICQ_CUSTOM_STATUS xstatus = {0}; + CUSTOM_STATUS xstatus = {0}; DBVARIANT dbv; // translate jabber mood @@ -603,13 +603,13 @@ TCHAR *EmptyXStatusToDefaultName(HANDLE hContact, const char *szModuleName, cons int status = DBGetContactSettingByte(hContact, szModuleName, "XStatusId", 0); if (!status) return 0; - if (ProtoServiceExists(szModuleName, PS_ICQ_GETCUSTOMSTATUSEX)) + if (ProtoServiceExists(szModuleName, PS_GETCUSTOMSTATUSEX)) { - xstatus.cbSize = sizeof(ICQ_CUSTOM_STATUS); + xstatus.cbSize = sizeof(CUSTOM_STATUS); xstatus.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR; xstatus.ptszName = szDefaultName; xstatus.wParam = (WPARAM *)&status; - if (CallProtoService(szModuleName, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus)) + if (CallProtoService(szModuleName, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus)) return 0; _tcsncpy(buff, TranslateTS(szDefaultName), bufflen); diff --git a/plugins/Utils/mir_options.cpp b/plugins/Utils/mir_options.cpp index 441fa4cb6a..8a31f3c1ee 100644 --- a/plugins/Utils/mir_options.cpp +++ b/plugins/Utils/mir_options.cpp @@ -45,7 +45,7 @@ static TCHAR* MyDBGetContactSettingTString(HANDLE hContact, char* module, char* if ( !DBGetContactSettingTString(hContact, module, setting, &dbv)) { lstrcpyn(out, dbv.ptszVal, (int)len); - DBFreeVariant(&dbv); + db_free(&dbv); } else { @@ -146,7 +146,7 @@ static void LoadOpt(OptPageControl *ctrl, char *module) if ( !DBGetContactSettingString(NULL, module, ctrl->setting, &dbv)) { lstrcpynA(tmp, dbv.pszVal, SIZEOF(tmp)); - DBFreeVariant(&dbv); + db_free(&dbv); } if (tmp[0] != 0) @@ -281,7 +281,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha DBVARIANT dbv = {0}; if ( !DBGetContactSettingString(NULL, module, ctrl->setting, &dbv)) { lstrcpynA(tmp, dbv.pszVal, SIZEOF(tmp)); - DBFreeVariant(&dbv); + db_free(&dbv); } if (tmp[0] != 0) -- cgit v1.2.3