From 53fe3e46177d17b4941610de19f5cc6210700cb4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 12 Nov 2018 21:44:56 +0300 Subject: db_* functions replaced with g_plugin calls --- protocols/ICQCorp/src/options.cpp | 16 ++++++++-------- protocols/ICQCorp/src/protocol.cpp | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'protocols/ICQCorp/src') diff --git a/protocols/ICQCorp/src/options.cpp b/protocols/ICQCorp/src/options.cpp index 2b0e9f1b2c..fb0fd8af76 100644 --- a/protocols/ICQCorp/src/options.cpp +++ b/protocols/ICQCorp/src/options.cpp @@ -29,28 +29,28 @@ static INT_PTR CALLBACK icqOptionsDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hWnd); - SetDlgItemInt(hWnd, IDC_OPT_UIN, db_get_dw(NULL, protoName, "UIN", 0), FALSE); - if (!db_get_s(NULL, protoName, "Password", &dbv)) { + SetDlgItemInt(hWnd, IDC_OPT_UIN, db_get_dw(0, protoName, "UIN", 0), FALSE); + if (!db_get_s(0, protoName, "Password", &dbv)) { SetDlgItemTextA(hWnd, IDC_OPT_PASSWORD, dbv.pszVal); db_free(&dbv); } - if (!db_get_s(NULL, protoName, "Server", &dbv)) { + if (!db_get_s(0, protoName, "Server", &dbv)) { SetDlgItemTextA(hWnd, IDC_OPT_SERVER, dbv.pszVal); db_free(&dbv); } - SetDlgItemInt(hWnd, IDC_OPT_PORT, db_get_w(NULL, protoName, "Port", 4000), FALSE); + SetDlgItemInt(hWnd, IDC_OPT_PORT, db_get_w(0, protoName, "Port", 4000), FALSE); ShowWindow(GetDlgItem(hWnd, IDC_OPT_RECONNECT), SW_HIDE); return TRUE; case WM_NOTIFY: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - db_set_dw(NULL, protoName, "UIN", (DWORD)GetDlgItemInt(hWnd, IDC_OPT_UIN, nullptr, FALSE)); + db_set_dw(0, protoName, "UIN", (DWORD)GetDlgItemInt(hWnd, IDC_OPT_UIN, nullptr, FALSE)); GetDlgItemTextA(hWnd, IDC_OPT_PASSWORD, str, sizeof(str)); - db_set_s(NULL, protoName, "Password", str); + db_set_s(0, protoName, "Password", str); GetDlgItemTextA(hWnd, IDC_OPT_SERVER, str, sizeof(str)); - db_set_s(NULL, protoName, "Server", str); - db_set_w(NULL, protoName, "Port", (WORD)GetDlgItemInt(hWnd, IDC_OPT_PORT, nullptr, FALSE)); + db_set_s(0, protoName, "Server", str); + db_set_w(0, protoName, "Port", (WORD)GetDlgItemInt(hWnd, IDC_OPT_PORT, nullptr, FALSE)); return TRUE; } break; diff --git a/protocols/ICQCorp/src/protocol.cpp b/protocols/ICQCorp/src/protocol.cpp index 6fa78b0e1a..b1e1f02d20 100644 --- a/protocols/ICQCorp/src/protocol.cpp +++ b/protocols/ICQCorp/src/protocol.cpp @@ -195,7 +195,7 @@ bool ICQ::logon(unsigned short logonStatus) DBVARIANT dbv; char str[128]; - if (!db_get_s(NULL, protoName, "Server", &dbv)) { + if (!db_get_s(0, protoName, "Server", &dbv)) { lstrcpyA(str, dbv.pszVal); db_free(&dbv); } @@ -208,7 +208,7 @@ bool ICQ::logon(unsigned short logonStatus) return false; if (!udpSocket.connected()) { - if (!udpSocket.setDestination(str, db_get_w(NULL, protoName, "Port", 4000))) + if (!udpSocket.setDestination(str, db_get_w(0, protoName, "Port", 4000))) return false; udpSocket.openConnection(); } @@ -218,8 +218,8 @@ bool ICQ::logon(unsigned short logonStatus) updateContactList(); - dwUIN = db_get_dw(NULL, protoName, "UIN", 0); - if (!db_get_s(NULL, protoName, "Password", &dbv)) { + dwUIN = db_get_dw(0, protoName, "UIN", 0); + if (!db_get_s(0, protoName, "Password", &dbv)) { lstrcpyA(str, dbv.pszVal); db_free(&dbv); } @@ -763,7 +763,7 @@ unsigned short ICQ::processUdpPacket(Packet &packet) >> timedataStamp >> newCommand; - db_set_dw(NULL, protoName, "LastBroadcastTime", timedataStamp); + db_set_dw(0, protoName, "LastBroadcastTime", timedataStamp); timedataStamp = TimeZone_ToLocal(timedataStamp); processSystemMessage(packet, checkUin, newCommand, timedataStamp); @@ -1061,7 +1061,7 @@ void ICQ::requestSystemMsg() void ICQ::requestBroadcastMsg() { - unsigned int timeStamp = db_get_dw(NULL, protoName, "LastBroadcastTime", 0); + unsigned int timeStamp = db_get_dw(0, protoName, "LastBroadcastTime", 0); Packet packet; packet << ICQ_VERSION -- cgit v1.2.3