diff options
author | George Hazan <george.hazan@gmail.com> | 2014-02-27 21:51:46 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-02-27 21:51:46 +0000 |
commit | 1fb0cd07fba1e8d6f9ac2ebe3b4f2e1c60acb81b (patch) | |
tree | 904c95b33e03e806aea734552281257768273a14 /plugins/Clist_modern | |
parent | a8e8aebfd4f53977873c72c2d828c2c1f505f10d (diff) |
- 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
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r-- | plugins/Clist_modern/src/hdr/modern_commonheaders.h | 3 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_cachefuncs.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clc.cpp | 118 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcitems.cpp | 6 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcutils.cpp | 9 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clistmod.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clistsettings.cpp | 4 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clui.cpp | 3 |
8 files changed, 68 insertions, 79 deletions
diff --git a/plugins/Clist_modern/src/hdr/modern_commonheaders.h b/plugins/Clist_modern/src/hdr/modern_commonheaders.h index 3e1f3bfec6..41d53055f2 100644 --- a/plugins/Clist_modern/src/hdr/modern_commonheaders.h +++ b/plugins/Clist_modern/src/hdr/modern_commonheaders.h @@ -114,9 +114,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define DEFAULT_SKIN_FOLDER "Skins\\Modern contact list"
extern TCHAR SkinsFolder[MAX_PATH];
-// module name of MetaContacts plugin
-extern char *g_szMetaModuleName;
-
//macros to free data and set it pointer to NULL
#define mir_free_and_nil(x) {mir_free((void*)x); x=NULL;}
// shared vars
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index 8c9e5b4137..febfdd72f8 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -204,7 +204,7 @@ void CSmileyString::ReplaceSmileys(struct SHORTDATA *dat, ClcCacheEntry *pdnce, if (dat->text_use_protocol_smileys) {
sp.Protocolname = pdnce->m_cache_cszProto;
- if ( db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT) != 1 && pdnce->m_cache_cszProto != NULL && g_szMetaModuleName && strcmp(pdnce->m_cache_cszProto, g_szMetaModuleName) == 0) {
+ if (db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT) != 1 && pdnce->m_cache_cszProto != NULL && strcmp(pdnce->m_cache_cszProto, META_PROTO) == 0) {
MCONTACT hContact = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (LPARAM)pdnce->hContact, 0);
if (hContact != 0)
sp.Protocolname = GetContactProto(hContact);
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 882743d19d..971e0f1266 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -84,12 +84,8 @@ static int clcHookModulesLoaded(WPARAM wParam, LPARAM lParam) if (ServiceExists(MS_MC_DISABLEHIDDENGROUP))
CallService(MS_MC_DISABLEHIDDENGROUP, TRUE, 0);
- if (ServiceExists(MS_MC_GETPROTOCOLNAME))
- g_szMetaModuleName = (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
// Get icons
- int i;
-
TCHAR szMyPath[MAX_PATH];
GetModuleFileName(g_hInst, szMyPath, SIZEOF(szMyPath));
@@ -105,7 +101,7 @@ static int clcHookModulesLoaded(WPARAM wParam, LPARAM lParam) Skin_AddIcon(&sid);
sid.pszSection = LPGEN("Contact List") "/" LPGEN("Avatar Overlay");
- for (i = 0; i < SIZEOF(g_pAvatarOverlayIcons); i++) {
+ for (int i = 0; i < SIZEOF(g_pAvatarOverlayIcons); i++) {
sid.pszDescription = g_pAvatarOverlayIcons[i].description;
sid.pszName = g_pAvatarOverlayIcons[i].name;
sid.iDefaultIndex = -g_pAvatarOverlayIcons[i].id;
@@ -113,7 +109,7 @@ static int clcHookModulesLoaded(WPARAM wParam, LPARAM lParam) }
sid.pszSection = LPGEN("Contact List") "/" LPGEN("Status Overlay");
- for (i = 0; i < SIZEOF(g_pStatusOverlayIcons); i++) {
+ for (int i = 0; i < SIZEOF(g_pStatusOverlayIcons); i++) {
sid.pszDescription = g_pStatusOverlayIcons[i].description;
sid.pszName = g_pStatusOverlayIcons[i].name;
sid.iDefaultIndex = -g_pStatusOverlayIcons[i].id;
@@ -201,7 +197,7 @@ static int clcHookSettingChanged(WPARAM hContact, LPARAM lParam) DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
if (hContact == NULL) {
- if (g_szMetaModuleName && !mir_strcmp(cws->szModule, g_szMetaModuleName)) {
+ if (!mir_strcmp(cws->szModule, META_PROTO)) {
if (!mir_strcmp(cws->szSetting, "Enabled"))
pcli->pfnClcBroadcast(INTM_RELOADOPTIONS, hContact, lParam);
}
@@ -214,7 +210,7 @@ static int clcHookSettingChanged(WPARAM hContact, LPARAM lParam) {
if (!strcmp(cws->szSetting, "TickTS"))
pcli->pfnClcBroadcast(INTM_STATUSCHANGED, hContact, 0);
- else if (g_szMetaModuleName && !strcmp(cws->szModule, g_szMetaModuleName)) {
+ else if (!strcmp(cws->szModule, META_PROTO)) {
if (!strcmp(cws->szSetting, "Handle"))
pcli->pfnClcBroadcast(INTM_NAMEORDERCHANGED, 0, 0);
else if (!strcmp(cws->szSetting, "Default"))
@@ -400,7 +396,7 @@ static LRESULT clcOnCreate(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPA dat->MetaIgnoreEmptyExtra = db_get_b(NULL, "CLC", "MetaIgnoreEmptyExtra", SETTING_METAIGNOREEMPTYEXTRA_DEFAULT);
dat->IsMetaContactsEnabled = (!(GetWindowLongPtr(hwnd, GWL_STYLE)&CLS_MANUALUPDATE)) &&
- g_szMetaModuleName && db_get_b(NULL, g_szMetaModuleName, "Enabled", 1) && ServiceExists(MS_MC_GETDEFAULTCONTACT);
+ db_get_b(NULL, META_PROTO, "Enabled", 1) && ServiceExists(MS_MC_GETDEFAULTCONTACT);
dat->expandMeta = db_get_b(NULL, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT);
dat->useMetaIcon = db_get_b(NULL, "CLC", "Meta", SETTING_USEMETAICON_DEFAULT);
@@ -1100,7 +1096,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (ServiceExists(MS_MC_ADDTOMETA)) {
ClcContact *contSour;
cliGetRowByIndex(dat, dat->iDragItem, &contSour, NULL);
- if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto, g_szMetaModuleName)) {
+ if (contSour->type == CLCIT_CONTACT && mir_strcmp(contSour->proto, META_PROTO)) {
if (!contSour->isSubcontact)
hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
else
@@ -1114,7 +1110,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, ClcContact *contSour, *contDest;
cliGetRowByIndex(dat, dat->selection, &contDest, NULL);
cliGetRowByIndex(dat, dat->iDragItem, &contSour, NULL);
- if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto, g_szMetaModuleName)) {
+ if (contSour->type == CLCIT_CONTACT && mir_strcmp(contSour->proto, META_PROTO)) {
if (!contSour->isSubcontact)
hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
else if (contSour->subcontacts == contDest)
@@ -1130,7 +1126,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, ClcContact *contSour, *contDest;
cliGetRowByIndex(dat, dat->selection, &contDest, NULL);
cliGetRowByIndex(dat, dat->iDragItem, &contSour, NULL);
- if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto, g_szMetaModuleName)) {
+ if (contSour->type == CLCIT_CONTACT && mir_strcmp(contSour->proto, META_PROTO)) {
if (!contSour->isSubcontact)
hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
else if (contDest->subcontacts == contSour->subcontacts)
@@ -1240,7 +1236,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, cliGetRowByIndex(dat, dat->selection, &contDest, NULL);
hcontact = contSour->hContact;
if (contSour->type == CLCIT_CONTACT) {
- if (g_szMetaModuleName && mir_strcmp(contSour->proto, g_szMetaModuleName)) {
+ if (mir_strcmp(contSour->proto, META_PROTO)) {
if (!contSour->isSubcontact) {
MCONTACT hDest = contDest->hContact;
mir_sntprintf(Wording, SIZEOF(Wording), TranslateT("Do you want contact '%s' to be converted to MetaContact and '%s' be added to it?"), contDest->szText, contSour->szText);
@@ -1272,18 +1268,18 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, break;
case DROPTARGET_ONMETACONTACT:
- {
- ClcContact *contDest, *contSour;
- int res;
- cliGetRowByIndex(dat, dat->iDragItem, &contSour, NULL);
- cliGetRowByIndex(dat, dat->selection, &contDest, NULL);
- if (contSour->type == CLCIT_CONTACT) {
- if (g_szMetaModuleName && strcmp(contSour->proto, g_szMetaModuleName)) {
+ {
+ ClcContact *contDest, *contSour;
+ cliGetRowByIndex(dat, dat->iDragItem, &contSour, NULL);
+ cliGetRowByIndex(dat, dat->selection, &contDest, NULL);
+ if (contSour->type == CLCIT_CONTACT) {
+ if (!strcmp(contSour->proto, META_PROTO))
+ break;
if (!contSour->isSubcontact) {
MCONTACT hcontact = contSour->hContact;
MCONTACT handle = contDest->hContact;
mir_sntprintf(Wording, SIZEOF(Wording), TranslateT("Do you want contact '%s' to be added to metacontact '%s'?"), contSour->szText, contDest->szText);
- res = MessageBox(hwnd, Wording, TranslateT("Adding contact to MetaContact"), MB_OKCANCEL | MB_ICONQUESTION);
+ int res = MessageBox(hwnd, Wording, TranslateT("Adding contact to MetaContact"), MB_OKCANCEL | MB_ICONQUESTION);
if (res == 1) {
if (!handle) return 0;
CallService(MS_MC_ADDTOMETA, (WPARAM)hcontact, (LPARAM)handle);
@@ -1293,7 +1289,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (contSour->subcontacts == contDest) {
MCONTACT hsour = contSour->hContact;
mir_sntprintf(Wording, SIZEOF(Wording), TranslateT("Do you want contact '%s' to be default?"), contSour->szText);
- res = MessageBox(hwnd, Wording, TranslateT("Set default contact"), MB_OKCANCEL | MB_ICONQUESTION);
+ int res = MessageBox(hwnd, Wording, TranslateT("Set default contact"), MB_OKCANCEL | MB_ICONQUESTION);
if (res == 1)
CallService(MS_MC_SETDEFAULTCONTACT, (WPARAM)contDest->hContact, (LPARAM)hsour);
}
@@ -1302,7 +1298,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, MCONTACT hfrom = contSour->subcontacts->hContact;
MCONTACT handle = contDest->hContact;
mir_sntprintf(Wording, SIZEOF(Wording), TranslateT("Do you want contact '%s' to be removed from MetaContact '%s' and added to '%s'?"), contSour->szText, contSour->subcontacts->szText, contDest->szText);
- res = MessageBox(hwnd, Wording, TranslateT("Changing MetaContacts (Moving)"), MB_OKCANCEL | MB_ICONQUESTION);
+ int res = MessageBox(hwnd, Wording, TranslateT("Changing MetaContacts (Moving)"), MB_OKCANCEL | MB_ICONQUESTION);
if (res == 1) {
if (!handle) return 0;
@@ -1313,16 +1309,16 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, }
}
}
- }
break;
case DROPTARGET_ONSUBCONTACT:
- {
- ClcContact *contDest, *contSour;
- cliGetRowByIndex(dat, dat->iDragItem, &contSour, NULL);
- cliGetRowByIndex(dat, dat->selection, &contDest, NULL);
- if (contSour->type == CLCIT_CONTACT) {
- if (g_szMetaModuleName && strcmp(contSour->proto, g_szMetaModuleName)) {
+ {
+ ClcContact *contDest, *contSour;
+ cliGetRowByIndex(dat, dat->iDragItem, &contSour, NULL);
+ cliGetRowByIndex(dat, dat->selection, &contDest, NULL);
+ if (contSour->type == CLCIT_CONTACT) {
+ if (!strcmp(contSour->proto, META_PROTO))
+ break;
if (!contSour->isSubcontact) {
MCONTACT hcontact = contSour->hContact;
MCONTACT handle = contDest->subcontacts->hContact;
@@ -1348,7 +1344,6 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, }
}
}
- }
break;
case DROPTARGET_ONGROUP:
@@ -1356,39 +1351,38 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, break;
case DROPTARGET_INSERTION:
- {
- ClcContact *contact, *destcontact;
- ClcGroup *group, *destgroup;
- BOOL NeedRename = FALSE;
- TCHAR newName[128] = { 0 };
- int newIndex, i;
- pcli->pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
- i = pcli->pfnGetRowByIndex(dat, dat->iInsertionMark, &destcontact, &destgroup);
- if (i != -1 && group->groupId != destgroup->groupId) {
- TCHAR *groupName = mir_tstrdup(pcli->pfnGetGroupName(contact->groupId, 0));
- TCHAR *shortGroup = NULL;
- TCHAR *sourceGrName = mir_tstrdup(pcli->pfnGetGroupName(destgroup->groupId, 0));
- if (groupName) {
- int len = (int)_tcslen(groupName);
- do { len--; }
- while (len >= 0 && groupName[len] != '\\');
- if (len >= 0) shortGroup = groupName + len + 1;
- else shortGroup = groupName;
- }
- if (shortGroup) {
- NeedRename = TRUE;
- if (sourceGrName)
- mir_sntprintf(newName, SIZEOF(newName), _T("%s\\%s"), sourceGrName, shortGroup);
- else
- mir_sntprintf(newName, SIZEOF(newName), _T("%s"), shortGroup);
+ {
+ ClcContact *contact, *destcontact;
+ ClcGroup *group, *destgroup;
+ BOOL NeedRename = FALSE;
+ TCHAR newName[128] = { 0 };
+ pcli->pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
+ int i = pcli->pfnGetRowByIndex(dat, dat->iInsertionMark, &destcontact, &destgroup);
+ if (i != -1 && group->groupId != destgroup->groupId) {
+ TCHAR *groupName = mir_tstrdup(pcli->pfnGetGroupName(contact->groupId, 0));
+ TCHAR *shortGroup = NULL;
+ TCHAR *sourceGrName = mir_tstrdup(pcli->pfnGetGroupName(destgroup->groupId, 0));
+ if (groupName) {
+ int len = (int)_tcslen(groupName);
+ do { len--; }
+ while (len >= 0 && groupName[len] != '\\');
+ if (len >= 0) shortGroup = groupName + len + 1;
+ else shortGroup = groupName;
+ }
+ if (shortGroup) {
+ NeedRename = TRUE;
+ if (sourceGrName)
+ mir_sntprintf(newName, SIZEOF(newName), _T("%s\\%s"), sourceGrName, shortGroup);
+ else
+ mir_sntprintf(newName, SIZEOF(newName), _T("%s"), shortGroup);
+ }
+ mir_free(groupName);
+ mir_free(sourceGrName);
}
- mir_free(groupName);
- mir_free(sourceGrName);
+ int newIndex = CallService(MS_CLIST_GROUPMOVEBEFORE, contact->groupId, (destcontact && i != -1) ? destcontact->groupId : 0);
+ newIndex = newIndex ? newIndex : contact->groupId;
+ if (NeedRename) pcli->pfnRenameGroup(newIndex, newName);
}
- newIndex = CallService(MS_CLIST_GROUPMOVEBEFORE, contact->groupId, (destcontact && i != -1) ? destcontact->groupId : 0);
- newIndex = newIndex ? newIndex : contact->groupId;
- if (NeedRename) pcli->pfnRenameGroup(newIndex, newName);
- }
break;
case DROPTARGET_OUTSIDE:
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index 240aa9c7f8..029856fada 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -197,7 +197,7 @@ static void _LoadDataToContact(ClcContact *cont, ClcGroup *group, ClcData *dat, //Add subcontacts
if (szProto)
{
- if ( g_szMetaModuleName && dat->IsMetaContactsEnabled && mir_strcmp(cont->proto,g_szMetaModuleName) == 0)
+ if (dat->IsMetaContactsEnabled && mir_strcmp(cont->proto, META_PROTO) == 0)
AddSubcontacts(dat,cont,CLCItems_IsShowOfflineGroup(group));
}
cont->lastPaintCounter = 0;
@@ -265,7 +265,7 @@ void cli_AddContactToTree(HWND hwnd,ClcData *dat,MCONTACT hContact,int updateTot if (dat->IsMetaContactsEnabled && cacheEntry && cacheEntry->m_cache_nHiddenSubcontact)
return; //contact should not be added
- if (!dat->IsMetaContactsEnabled && cacheEntry && g_szMetaModuleName && !mir_strcmp(cacheEntry->m_cache_cszProto,g_szMetaModuleName))
+ if (!dat->IsMetaContactsEnabled && cacheEntry && !mir_strcmp(cacheEntry->m_cache_cszProto, META_PROTO))
return;
corecli.pfnAddContactToTree(hwnd,dat,hContact,updateTotalCount,checkHideOffline);
@@ -398,7 +398,7 @@ void cliRebuildEntireList(HWND hwnd, ClcData *dat) }
if (cont) {
cont->SubAllocated = 0;
- if (cont->proto && g_szMetaModuleName && dat->IsMetaContactsEnabled && strcmp(cont->proto,g_szMetaModuleName) == 0)
+ if (cont->proto && dat->IsMetaContactsEnabled && strcmp(cont->proto, META_PROTO) == 0)
AddSubcontacts(dat,cont,CLCItems_IsShowOfflineGroup(group));
}
}
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp index cca9ba9184..031f051d92 100644 --- a/plugins/Clist_modern/src/modern_clcutils.cpp +++ b/plugins/Clist_modern/src/modern_clcutils.cpp @@ -453,8 +453,10 @@ int GetDropTargetInformation(HWND hwnd,ClcData *dat,POINT pt) }
dat->selection = hit;
- if (g_szMetaModuleName && !mir_strcmp(contact->proto,g_szMetaModuleName) && ( ServiceExists(MS_MC_ADDTOMETA))) return DROPTARGET_ONMETACONTACT;
- if (contact->isSubcontact && ( ServiceExists(MS_MC_ADDTOMETA))) return DROPTARGET_ONSUBCONTACT;
+ if (!mir_strcmp(contact->proto, META_PROTO) && ServiceExists(MS_MC_ADDTOMETA))
+ return DROPTARGET_ONMETACONTACT;
+ if (contact->isSubcontact && ServiceExists(MS_MC_ADDTOMETA))
+ return DROPTARGET_ONSUBCONTACT;
return DROPTARGET_ONCONTACT;
}
COLORREF sttGetColor(char * module, char * color, COLORREF defColor)
@@ -746,9 +748,8 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat ) dat->selTextColour = db_get_dw(NULL,"CLC","SelTextColour",CLCDEFAULT_MODERN_SELTEXTCOLOUR);
dat->hotTextColour = db_get_dw(NULL,"CLC","HotTextColour",CLCDEFAULT_MODERN_HOTTEXTCOLOUR);
dat->quickSearchColour = db_get_dw(NULL,"CLC","QuickSearchColour",CLCDEFAULT_MODERN_QUICKSEARCHCOLOUR);
- if (!g_szMetaModuleName && ServiceExists(MS_MC_GETPROTOCOLNAME)) g_szMetaModuleName = (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
dat->IsMetaContactsEnabled = (!(GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_MANUALUPDATE)) &&
- g_szMetaModuleName && db_get_b(NULL,g_szMetaModuleName,"Enabled",1) && ServiceExists(MS_MC_GETDEFAULTCONTACT);
+ db_get_b(NULL, META_PROTO, "Enabled", 1) && ServiceExists(MS_MC_GETDEFAULTCONTACT);
if (pcli->hwndContactTree == NULL || dat->hWnd == pcli->hwndContactTree)
dat->MetaIgnoreEmptyExtra = db_get_b(NULL,"CLC","MetaIgnoreEmptyExtra",SETTING_METAIGNOREEMPTYEXTRA_DEFAULT);
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp index 89fea99c57..b4e4d06ab1 100644 --- a/plugins/Clist_modern/src/modern_clistmod.cpp +++ b/plugins/Clist_modern/src/modern_clistmod.cpp @@ -87,7 +87,7 @@ int cli_IconFromStatusMode(const char *szProto,int nStatus, MCONTACT hContact) char *szActProto = (char*)szProto;
int nActStatus = nStatus;
MCONTACT hActContact = hContact;
- if (!db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT) && g_szMetaModuleName && !mir_strcmp(szActProto,g_szMetaModuleName)) {
+ if (!db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT) && !mir_strcmp(szActProto, META_PROTO)) {
// substitute params by mostonline contact datas
MCONTACT hMostOnlineContact = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hActContact, 0);
if (hMostOnlineContact) {
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp index 46cde88cca..8eea4be0ea 100644 --- a/plugins/Clist_modern/src/modern_clistsettings.cpp +++ b/plugins/Clist_modern/src/modern_clistsettings.cpp @@ -259,7 +259,7 @@ void cliCheckCacheItem(ClcCacheEntry *pdnce) if (pdnce->bIsHidden == -1)
pdnce->bIsHidden = db_get_b(pdnce->hContact,"CList","Hidden",0);
- pdnce->m_cache_nHiddenSubcontact = g_szMetaModuleName && db_mc_isSub(pdnce->hContact);
+ pdnce->m_cache_nHiddenSubcontact = db_mc_isSub(pdnce->hContact);
if (pdnce->m_cache_nNoHiddenOffline == -1)
pdnce->m_cache_nNoHiddenOffline = db_get_b(pdnce->hContact,"CList","noOffline",0);
@@ -446,7 +446,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) // PostMessage(pcli->hwndContactTree,CLM_AUTOREBUILD, 0, 0);
if (!mir_strcmp(cws->szSetting, "Status") || wildcmp(cws->szSetting, "Status?")) {
- if (g_szMetaModuleName && !mir_strcmp(cws->szModule,g_szMetaModuleName) && mir_strcmp(cws->szSetting, "Status")) {
+ if (!mir_strcmp(cws->szModule, META_PROTO) && mir_strcmp(cws->szSetting, "Status")) {
int res = 0;
if (pcli->hwndContactTree && g_flag_bOnModulesLoadedCalled)
res = PostAutoRebuidMessage(pcli->hwndContactTree);
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 9e677a612e..63f8bb1ad0 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -151,9 +151,6 @@ int CLUI::OnEvent_ModulesLoaded(WPARAM wParam, LPARAM lParam) if ( ServiceExists(MS_MC_DISABLEHIDDENGROUP))
CallService(MS_MC_DISABLEHIDDENGROUP, TRUE, 0);
- if ( ServiceExists(MS_MC_GETPROTOCOLNAME))
- g_szMetaModuleName = (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
-
cliCluiProtocolStatusChanged(0, 0);
SleepEx(0, TRUE);
g_flag_bOnModulesLoadedCalled = TRUE;
|