From 4e37f3cad6064396a701fe96bf4801d37d40b362 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 7 Dec 2023 12:34:11 +0300 Subject: fingerprint: more strict service definitions --- plugins/MenuItemEx/src/main.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'plugins/MenuItemEx/src') diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index 2e0e54e8da..1ba2c38e31 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -269,14 +269,12 @@ BOOL MirVerExists(MCONTACT hContact) LPWSTR getMirVer(MCONTACT hContact) { LPSTR szProto = Proto_GetBaseAccountName(hContact); - if (!szProto) return nullptr; + if (!szProto) + return nullptr; - LPWSTR msg = db_get_wsa(hContact, szProto, "MirVer"); - if (msg) { - if (msg[0] != 0) - return msg; - mir_free(msg); - } + ptrW msg(db_get_wsa(hContact, szProto, "MirVer")); + if (msg && msg[0] != 0) + return msg.detach(); return nullptr; } @@ -422,7 +420,7 @@ static void ModifyCopyIP(MCONTACT hContact) static void ModifyCopyMirVer(MCONTACT hContact) { HICON hMenuIcon = nullptr; - if (ServiceExists(MS_FP_GETCLIENTICONT)) { + if (Finger_IsPresent()) { LPWSTR msg = getMirVer(hContact); if (msg) { hMenuIcon = Finger_GetClientIcon(msg, 1); -- cgit v1.2.3