From 1fb0cd07fba1e8d6f9ac2ebe3b4f2e1c60acb81b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 27 Feb 2014 21:51:46 +0000 Subject: - metacontacts are always present; - added META_PROTO constant for mc module name; - MS_MC_GETPROTOCOLNAME removed, because it always returns META_PROTO git-svn-id: http://svn.miranda-ng.org/main/trunk@8319 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_nicer/src/Include/clc.h | 2 -- plugins/Clist_nicer/src/clc.cpp | 16 +++++++--------- plugins/Clist_nicer/src/clcitems.cpp | 6 +++--- plugins/Clist_nicer/src/clistmod.cpp | 2 +- plugins/Clist_nicer/src/init.cpp | 7 +------ 5 files changed, 12 insertions(+), 21 deletions(-) (limited to 'plugins/Clist_nicer/src') diff --git a/plugins/Clist_nicer/src/Include/clc.h b/plugins/Clist_nicer/src/Include/clc.h index 9bec318541..ffe0827255 100644 --- a/plugins/Clist_nicer/src/Include/clc.h +++ b/plugins/Clist_nicer/src/Include/clc.h @@ -223,7 +223,6 @@ struct TCluiData { int statusBarHeight; int soundsOff; BYTE tabSRMM_Avail; - BYTE bMetaAvail; BYTE bAvatarServiceAvail; HICON hIconConnecting; DWORD winFlags; @@ -285,7 +284,6 @@ struct TCluiData { DWORD stickyMaskFilter; DWORD filterFlags; COLORREF colorkey; - char szMetaName[256]; BOOL bMetaEnabled; BOOL bSecIMAvail; BOOL bNoTrayTips; diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index 72a9b69df4..3fe336762a 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -151,18 +151,17 @@ static int ClcSettingChanged(WPARAM hContact, LPARAM lParam) else if ( !__strcmp(cws->szSetting, "Timezone") || !__strcmp(cws->szSetting, "TzName")) ReloadExtraInfo(hContact); - if (cfg::dat.bMetaAvail && !(cfg::dat.dwFlags & CLUI_USEMETAICONS) && !__strcmp(szProto, cfg::dat.szMetaName)) { + if (!(cfg::dat.dwFlags & CLUI_USEMETAICONS) && !__strcmp(szProto, META_PROTO)) if ((lstrlenA(cws->szSetting) > 6 && !strncmp(cws->szSetting, "Status", 6)) || strstr("Default,ForceSend,Nick", cws->szSetting)) pcli->pfnClcBroadcast(INTM_NAMEORDERCHANGED, hContact, lParam); - } } // !!!!!!!!!!!!!!!!!! // if (cfg::dat.bMetaAvail && cfg::dat.bMetaEnabled && !__strcmp(cws->szModule, cfg::dat.szMetaName) && !__strcmp(cws->szSetting, "IsSubcontact")) // pcli->pfnClcBroadcast(INTM_HIDDENCHANGED, hContact, lParam); } } - else if (!__strcmp(cws->szModule, cfg::dat.szMetaName)) { - BYTE bMetaEnabled = cfg::getByte(cfg::dat.szMetaName, "Enabled", 1); + else if (!__strcmp(cws->szModule, META_PROTO)) { + BYTE bMetaEnabled = cfg::getByte(META_PROTO, "Enabled", 1); if (bMetaEnabled != (BYTE)cfg::dat.bMetaEnabled) { cfg::dat.bMetaEnabled = bMetaEnabled; pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0); @@ -382,7 +381,7 @@ LBL_Def: if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL)) break; - if (contact->bIsMeta && cfg::dat.bMetaAvail && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) { + if (contact->bIsMeta && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) { contact->hSubContact = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)contact->hContact, 0); contact->metaProto = GetContactProto(contact->hSubContact); contact->iImage = pcli->pfnGetContactIcon(contact->hSubContact); @@ -563,12 +562,11 @@ LBL_Def: if (!FindItem(hwnd, dat, (HANDLE)hContact, &contact, NULL, NULL)) { p = cfg::getCache(hContact, szProto); - if (!dat->bisEmbedded && cfg::dat.bMetaAvail && szProto) { // may be a subcontact, forward the xstatus + if (!dat->bisEmbedded && szProto) { // may be a subcontact, forward the xstatus if (db_mc_isSub(hContact)) { - MCONTACT hMasterContact = (MCONTACT)cfg::getDword(hContact, cfg::dat.szMetaName, "Handle", 0); + MCONTACT hMasterContact = (MCONTACT)cfg::getDword(hContact, META_PROTO, "Handle", 0); if (hMasterContact && hMasterContact != hContact) // avoid recursive call of settings handler - cfg::writeByte(hMasterContact, cfg::dat.szMetaName, "XStatusId", - (BYTE)cfg::getByte(hContact, szProto, "XStatusId", 0)); + cfg::writeByte(hMasterContact, META_PROTO, "XStatusId", (BYTE)cfg::getByte(hContact, szProto, "XStatusId", 0)); break; } } diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 15564ba4ac..cc80971641 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -101,10 +101,10 @@ int AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hContact) p->xStatus = cfg::getByte(hContact, p->proto, "XStatusId", 0); if (p->proto) - p->bIsMeta = !strcmp(p->proto, cfg::dat.szMetaName); + p->bIsMeta = !strcmp(p->proto, META_PROTO); else p->bIsMeta = FALSE; - if (p->bIsMeta && cfg::dat.bMetaAvail && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) { + if (p->bIsMeta && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) { p->hSubContact = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0); p->metaProto = GetContactProto(p->hSubContact); p->iImage = pcli->pfnGetContactIcon(p->hSubContact); @@ -473,7 +473,7 @@ int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, str // always hide subcontacts (but show them on embedded contact lists) - if (cfg::dat.bMetaAvail && dat != NULL && dat->bHideSubcontacts && cfg::dat.bMetaEnabled && db_mc_isSub(hContact)) + if (dat != NULL && dat->bHideSubcontacts && cfg::dat.bMetaEnabled && db_mc_isSub(hContact)) return 1; if ( !cfg::dat.bFilterEffective) diff --git a/plugins/Clist_nicer/src/clistmod.cpp b/plugins/Clist_nicer/src/clistmod.cpp index 74bb93ffad..b83aa19b74 100644 --- a/plugins/Clist_nicer/src/clistmod.cpp +++ b/plugins/Clist_nicer/src/clistmod.cpp @@ -54,7 +54,7 @@ int IconFromStatusMode(const char *szProto, int status, MCONTACT hContact, HICON char *szFinalProto; int finalStatus; - if (szProto != NULL && !strcmp(szProto, cfg::dat.szMetaName) && cfg::dat.bMetaAvail && hContact != 0 && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) { + if (szProto != NULL && !strcmp(szProto, META_PROTO) && hContact != 0 && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) { MCONTACT hSubContact = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0); szFinalProto = GetContactProto(hSubContact); finalStatus = (status == 0) ? (WORD) cfg::getWord(hSubContact, szFinalProto, "Status", ID_STATUS_OFFLINE) : status; diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index 28793ebcc6..73c7381fa6 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -173,15 +173,10 @@ static int systemModulesLoaded(WPARAM wParam, LPARAM lParam) { GetSystemTime(&cfg::dat.st); SystemTimeToFileTime(&cfg::dat.st, &cfg::dat.ft); - cfg::dat.bMetaAvail = ServiceExists(MS_MC_GETDEFAULTCONTACT) ? TRUE : FALSE; - if (cfg::dat.bMetaAvail) - mir_snprintf(cfg::dat.szMetaName, 256, "%s", (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0)); - else - strncpy(cfg::dat.szMetaName, "MetaContacts", 255); if (ServiceExists(MS_MC_DISABLEHIDDENGROUP)) CallService(MS_MC_DISABLEHIDDENGROUP, 1, 0); - cfg::dat.bMetaEnabled = cfg::getByte(cfg::dat.szMetaName, "Enabled", 1); + cfg::dat.bMetaEnabled = cfg::getByte(META_PROTO, "Enabled", 1); cfg::dat.bAvatarServiceAvail = ServiceExists(MS_AV_GETAVATARBITMAP) ? TRUE : FALSE; if (cfg::dat.bAvatarServiceAvail) -- cgit v1.2.3