From 581204a18bc5a50d1c8a7412e147e560503d11b8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 30 May 2014 15:31:28 +0000 Subject: 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 --- plugins/MenuItemEx/src/main.cpp | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'plugins/MenuItemEx/src/main.cpp') 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; -- cgit v1.2.3