From dd6ac172c4f814fa4b5ace6caca80d00d7e01ac8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 20 Feb 2020 21:23:22 +0300 Subject: bunch of useless threads replaced with a call of ProtoBroadcastAsync --- protocols/Weather/src/weather_svcs.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'protocols/Weather/src') diff --git a/protocols/Weather/src/weather_svcs.cpp b/protocols/Weather/src/weather_svcs.cpp index c3c9b4ab4b..bc86236668 100644 --- a/protocols/Weather/src/weather_svcs.cpp +++ b/protocols/Weather/src/weather_svcs.cpp @@ -170,12 +170,8 @@ static void __cdecl WeatherGetAwayMsgThread(void *arg) Sleep(100); MCONTACT hContact = (DWORD_PTR)arg; - DBVARIANT dbv; - if (!db_get_ws(hContact, "CList", "StatusMsg", &dbv)) { - ProtoBroadcastAck(MODULENAME, hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.pwszVal); - db_free(&dbv); - } - else ProtoBroadcastAck(MODULENAME, hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1); + ptrW wszStatus(db_get_wsa(hContact, "CList", "StatusMsg")); + ProtoBroadcastAck(MODULENAME, hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, wszStatus); } static INT_PTR WeatherGetAwayMsg(WPARAM, LPARAM lParam) -- cgit v1.2.3