From 51f835c7711083e9b3288eaa8d4513f6ee955a45 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 23 Jan 2019 15:52:20 +0300 Subject: code cleaning --- protocols/Gadu-Gadu/src/gg_proto.cpp | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'protocols/Gadu-Gadu/src') diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index 686dd12c0c..186a283c06 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -588,27 +588,18 @@ int GaduProto::SetStatus(int iNewStatus) return 0; } +////////////////////////////////////////////////////////// +// when away message is requested + void __cdecl GaduProto::getawaymsgthread(void *arg) { - DBVARIANT dbv; - MCONTACT hContact = (UINT_PTR)arg; - debugLogA("getawaymsgthread(): started"); gg_sleep(100, FALSE, "getawaymsgthread", 106, 1); - if (!db_get_s(hContact, "CList", GG_KEY_STATUSDESCR, &dbv, DBVT_WCHAR)) { - ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.pwszVal); - debugLogW(L"getawaymsgthread(): Reading away msg <%s>.", dbv.pwszVal); - db_free(&dbv); - } - else { - ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, 0); - } - debugLogA("getawaymsgthread(): end"); + + ptrW wszMsg(db_get_wsa(hContact, "CList", "StatusMsg")); + ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, wszMsg); } -////////////////////////////////////////////////////////// -// when away message is requested -// HANDLE GaduProto::GetAwayMsg(MCONTACT hContact) { #ifdef DEBUGMODE -- cgit v1.2.3