From d296f9f99daf102b9af5d56690e2bd00d61c1267 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 24 Jul 2018 11:11:26 +0300 Subject: database: - senseless fiels ptszVal removed from DBVARIANT, pwszVal is used instead; - if you want db_get to return a string, you need to use db_get_s. --- plugins/BuddyExpectator/src/BuddyExpectator.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'plugins/BuddyExpectator/src') diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index 1e419f8915..68421a0d0b 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -661,15 +661,10 @@ int CMPlugin::Load() HookEvent(ME_DB_CONTACT_ADDED, ContactAdded); // ensure all contacts are timestamped - DBVARIANT dbv; DWORD current_time = (DWORD)time(0); - - for (auto &hContact : Contacts()) { - if (!db_get(hContact, MODULENAME, "CreationTime", &dbv)) - db_free(&dbv); - else + for (auto &hContact : Contacts()) + if (!db_get_dw(hContact, MODULENAME, "CreationTime")) db_set_dw(hContact, MODULENAME, "CreationTime", current_time); - } g_plugin.registerIcon("BuddyExpectator", iconList); -- cgit v1.2.3