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. --- protocols/Twitter/src/connection.cpp | 6 +++--- protocols/Twitter/src/contacts.cpp | 4 ++-- protocols/Twitter/src/ui.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'protocols/Twitter/src') diff --git a/protocols/Twitter/src/connection.cpp b/protocols/Twitter/src/connection.cpp index 28bb28b4e3..af7f0774ab 100644 --- a/protocols/Twitter/src/connection.cpp +++ b/protocols/Twitter/src/connection.cpp @@ -177,7 +177,7 @@ bool TwitterProto::NegotiateConnection() } if (!getWString(TWITTER_KEY_GROUP, &dbv)) { - Clist_GroupCreate(0, dbv.ptszVal); + Clist_GroupCreate(0, dbv.pwszVal); db_free(&dbv); } @@ -401,7 +401,7 @@ void TwitterProto::UpdateAvatarWorker(void *p) return; std::string ext = data->url.substr(data->url.rfind('.')); // finds the filetype of the avatar - std::wstring filename = GetAvatarFolder() + L'\\' + dbv.ptszVal + (wchar_t*)_A2T(ext.c_str()); // local filename and path + std::wstring filename = GetAvatarFolder() + L'\\' + dbv.pwszVal + (wchar_t*)_A2T(ext.c_str()); // local filename and path db_free(&dbv); PROTO_AVATAR_INFORMATION ai = { 0 }; @@ -537,7 +537,7 @@ void TwitterProto::ShowContactPopup(MCONTACT hContact, const std::string &text, DBVARIANT dbv; if (!db_get_ws(hContact, "CList", "MyHandle", &dbv) || !getWString(hContact, TWITTER_KEY_UN, &dbv)) { - wcsncpy(popup.lptzContactName, dbv.ptszVal, MAX_CONTACTNAME); + wcsncpy(popup.lptzContactName, dbv.pwszVal, MAX_CONTACTNAME); db_free(&dbv); } diff --git a/protocols/Twitter/src/contacts.cpp b/protocols/Twitter/src/contacts.cpp index 3545862b9c..99c08ac1e9 100644 --- a/protocols/Twitter/src/contacts.cpp +++ b/protocols/Twitter/src/contacts.cpp @@ -163,7 +163,7 @@ void TwitterProto::GetAwayMsgWorker(void *arg) DBVARIANT dbv; if (!db_get_ws(hContact, "CList", "StatusMsg", &dbv)) { - ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal); + ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.pwszVal); db_free(&dbv); } else ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_FAILED, (HANDLE)1, 0); @@ -252,7 +252,7 @@ MCONTACT TwitterProto::AddToClientList(const char *name, const char *status) Skin_PlaySound("TwitterNewContact"); DBVARIANT dbv; if (!getWString(TWITTER_KEY_GROUP, &dbv)) { - db_set_ws(hContact, "CList", "Group", dbv.ptszVal); + db_set_ws(hContact, "CList", "Group", dbv.pwszVal); db_free(&dbv); } diff --git a/protocols/Twitter/src/ui.cpp b/protocols/Twitter/src/ui.cpp index d7164be99e..ffc6eb818a 100644 --- a/protocols/Twitter/src/ui.cpp +++ b/protocols/Twitter/src/ui.cpp @@ -40,7 +40,7 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM DBVARIANT dbv; if (!proto->getWString(TWITTER_KEY_GROUP, &dbv)) { - SetDlgItemText(hwndDlg, IDC_GROUP, dbv.ptszVal); + SetDlgItemText(hwndDlg, IDC_GROUP, dbv.pwszVal); db_free(&dbv); } else SetDlgItemText(hwndDlg, IDC_GROUP, L"Twitter"); -- cgit v1.2.3