diff options
author | George Hazan <george.hazan@gmail.com> | 2014-07-19 14:11:25 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-07-19 14:11:25 +0000 |
commit | 6be9b9c1dd00da5ecd33cbc20ece4162ba56c402 (patch) | |
tree | 73fbf2e3632a8372d8102a07c4f374b3289c7e97 /plugins/New_GPG/src/icons.cpp | |
parent | e4a8fd6f323b262018bae68bfe87da65cf2092c0 (diff) |
db_mc_tryMeta applied
git-svn-id: http://svn.miranda-ng.org/main/trunk@9860 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/New_GPG/src/icons.cpp')
-rw-r--r-- | plugins/New_GPG/src/icons.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/plugins/New_GPG/src/icons.cpp b/plugins/New_GPG/src/icons.cpp index dffaad03bd..71493e49f2 100644 --- a/plugins/New_GPG/src/icons.cpp +++ b/plugins/New_GPG/src/icons.cpp @@ -48,26 +48,18 @@ void setClistIcon(MCONTACT hContact) {
bool enabled = isContactSecured(hContact);
extern HANDLE g_hCLIcon;
- MCONTACT hMC = hContact;
- if(db_mc_isSub(hContact))
- hMC = db_mc_getMeta(hContact);
- else if(metaIsProtoMetaContacts(hContact))
- hMC = db_mc_getMeta(hContact);
+ MCONTACT hMC = db_mc_tryMeta(hContact);
const char *szIconId = (enabled) ? "secured" : NULL;
ExtraIcon_SetIcon(g_hCLIcon, hContact, szIconId);
- if(hMC)
+ if(hMC != hContact)
ExtraIcon_SetIcon(g_hCLIcon, hMC, szIconId);
}
void setSrmmIcon(MCONTACT h)
{
- MCONTACT hContact = metaIsProtoMetaContacts(h) ? metaGetMostOnline(h) : h;
+ MCONTACT hContact = db_mc_isMeta(h) ? metaGetMostOnline(h) : h;
bool enabled = isContactSecured(hContact);
- MCONTACT hMC = NULL;
- if(db_mc_isSub(hContact))
- hMC = db_mc_getMeta(hContact);
- else if(metaIsProtoMetaContacts(hContact))
- hMC = db_mc_getMeta(hContact);
+ MCONTACT hMC = db_mc_tryMeta(hContact);
StatusIconData sid = { sizeof(sid) };
sid.szModule = szGPGModuleName;
@@ -75,14 +67,14 @@ void setSrmmIcon(MCONTACT h) sid.dwId = 1;
sid.flags = enabled ? 0 : MBF_HIDDEN;
Srmm_ModifyIcon(hContact, &sid);
- if(hMC)
+ if(hMC != hContact)
Srmm_ModifyIcon(hMC, &sid);
sid.hIcon = IconLibGetIcon("unsecured");
sid.dwId = 2;
sid.flags = enabled ? MBF_HIDDEN : 0;
Srmm_ModifyIcon(hContact, &sid);
- if(hMC)
+ if(hMC != hContact)
Srmm_ModifyIcon(hMC, &sid);
}
|