summaryrefslogtreecommitdiff
path: root/plugins/MenuItemEx/src/main.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-05-30 15:31:28 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-05-30 15:31:28 +0000
commit581204a18bc5a50d1c8a7412e147e560503d11b8 (patch)
tree59f78fa2cc227e4feae48c9cf4e10544c80c4c71 /plugins/MenuItemEx/src/main.cpp
parentfd0d38e50db088692bfff7608df3b765d804e847 (diff)
db_mc_getMostOnline - a handy helper for MS_MC_GETMOSTONLINECONTACT
git-svn-id: http://svn.miranda-ng.org/main/trunk@9372 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MenuItemEx/src/main.cpp')
-rw-r--r--plugins/MenuItemEx/src/main.cpp26
1 files changed, 7 insertions, 19 deletions
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp
index 38d0187e8d..46a1ab65e3 100644
--- a/plugins/MenuItemEx/src/main.cpp
+++ b/plugins/MenuItemEx/src/main.cpp
@@ -268,11 +268,6 @@ BOOL isMetaContact(MCONTACT hContact)
return FALSE;
}
-MCONTACT getMostOnline(MCONTACT hContact)
-{
- return (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0);
-}
-
void GetID(MCONTACT hContact, LPSTR szProto, LPSTR szID)
{
DBVARIANT dbv_uniqueid;
@@ -336,19 +331,12 @@ BOOL IPExists(MCONTACT hContact)
BOOL MirVerExists(MCONTACT hContact)
{
- LPSTR szProto, msg;
- BOOL ret = 0;
-
- szProto = GetContactProto(hContact);
- if (!szProto) return 0;
-
- msg = db_get_sa(hContact,szProto,"MirVer");
- if (msg) {
- if (strlen(msg)) ret = 1;
- mir_free(msg);
- }
+ LPSTR szProto = GetContactProto(hContact);
+ if (!szProto)
+ return 0;
- return ret;
+ ptrT msg(db_get_tsa(hContact, szProto, "MirVer"));
+ return lstrlen(msg) != 0;
}
void getIP(MCONTACT hContact,LPSTR szProto,LPSTR szIP)
@@ -506,7 +494,7 @@ void ModifyCopyID(MCONTACT hContact, BOOL bShowID, BOOL bTrimID)
mi.flags = CMIM_ICON | CMIM_NAME | CMIF_UNICODE;
if (isMetaContact(hContact)) {
- MCONTACT hC = getMostOnline(hContact);
+ MCONTACT hC = db_mc_getMostOnline(hContact);
if (!hContact) hC = db_mc_getDefault(hContact);
hContact = hC;
}
@@ -605,7 +593,7 @@ INT_PTR onCopyID(WPARAM wparam, LPARAM lparam)
MCONTACT hContact = (MCONTACT)wparam;
if (isMetaContact(hContact)) {
- MCONTACT hC = getMostOnline(hContact);
+ MCONTACT hC = db_mc_getMostOnline(hContact);
if (!hContact)
hC = db_mc_getDefault(hContact);
hContact = hC;