diff options
author | George Hazan <ghazan@miranda.im> | 2018-12-08 20:12:16 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-12-08 20:12:26 +0300 |
commit | 8ffc77be71507825a8f7585bcabff8ccc370206a (patch) | |
tree | aa13a8070f31286db6ad22e17a577e547942f951 /protocols/VKontakte | |
parent | 41b2fdfc654e3eec07c97ceba00cda13d988ffff (diff) |
db_get_sa / db_get_wsa to receive the default value, massive code simplification
Diffstat (limited to 'protocols/VKontakte')
-rw-r--r-- | protocols/VKontakte/src/vk_proto.cpp | 3 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_status.cpp | 2 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 8 |
3 files changed, 6 insertions, 7 deletions
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index eda0ad160b..1785b36830 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -559,8 +559,7 @@ void CVkProto::OnReceiveAuthRequest(NETLIBHTTPREQUEST *reply, AsyncHttpRequest * int iRet = jnResponse.as_int();
setByte(param->hContact, "Auth", 0);
if (iRet == 2) {
- CMStringW msg,
- wszNick(ptrW(db_get_wsa(param->hContact, m_szModuleName, "Nick")));
+ CMStringW msg, wszNick(db_get_wsm(param->hContact, m_szModuleName, "Nick"));
if (wszNick.IsEmpty())
wszNick = TranslateT("(Unknown contact)");
msg.AppendFormat(TranslateT("User %s added as friend"), wszNick.c_str());
diff --git a/protocols/VKontakte/src/vk_status.cpp b/protocols/VKontakte/src/vk_status.cpp index 29efd4b9e3..89011c4e89 100644 --- a/protocols/VKontakte/src/vk_status.cpp +++ b/protocols/VKontakte/src/vk_status.cpp @@ -76,7 +76,7 @@ void CVkProto::SetServerStatus(int iNewStatus) return;
int iOldStatus = m_iStatus;
- CMStringW oldStatusMsg(ptrW(db_get_wsa(0, m_szModuleName, "OldStatusMsg")));
+ CMStringW oldStatusMsg(db_get_wsm(0, m_szModuleName, "OldStatusMsg"));
ptrW pwszListeningToMsg(db_get_wsa(0, m_szModuleName, "ListeningTo"));
if (iNewStatus == ID_STATUS_OFFLINE) {
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 53c5bd2ff8..f2534e82f1 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -824,8 +824,8 @@ INT_PTR __cdecl CVkProto::SvcDeleteFriend(WPARAM hContact, LPARAM flag) return 1;
ptrW pwszNick(db_get_wsa(hContact, m_szModuleName, "Nick"));
- CMStringW pwszMsg;
if (flag == 0) {
+ CMStringW pwszMsg;
pwszMsg.AppendFormat(TranslateT("Are you sure to delete %s from your friend list?"), IsEmpty(pwszNick) ? TranslateT("(Unknown contact)") : pwszNick);
if (IDNO == MessageBoxW(nullptr, pwszMsg, TranslateT("Attention!"), MB_ICONWARNING | MB_YESNO))
return 1;
@@ -844,7 +844,7 @@ void CVkProto::OnReceiveDeleteFriend(NETLIBHTTPREQUEST *reply, AsyncHttpRequest JSONNode jnRoot;
const JSONNode &jnResponse = CheckJsonResponse(pReq, reply, jnRoot);
if (jnResponse) {
- CMStringW wszNick(ptrW(db_get_wsa(param->hContact, m_szModuleName, "Nick")));
+ CMStringW wszNick(db_get_wsm(param->hContact, m_szModuleName, "Nick"));
if (wszNick.IsEmpty())
wszNick = TranslateT("(Unknown contact)");
CMStringW msgformat, msg;
@@ -941,7 +941,7 @@ INT_PTR __cdecl CVkProto::SvcReportAbuse(WPARAM hContact, LPARAM) if (!IsOnline() || userID == VK_INVALID_USER || userID == VK_FEED_USER)
return 1;
- CMStringW wszNick(ptrW(db_get_wsa(hContact, m_szModuleName, "Nick"))),
+ CMStringW wszNick(db_get_wsm(hContact, m_szModuleName, "Nick")),
pwszMsg(FORMAT, TranslateT("Are you sure to report abuse on %s?"), wszNick.IsEmpty() ? TranslateT("(Unknown contact)") : wszNick);
if (IDNO == MessageBoxW(nullptr, pwszMsg, TranslateT("Attention!"), MB_ICONWARNING | MB_YESNO))
return 1;
@@ -957,7 +957,7 @@ INT_PTR __cdecl CVkProto::SvcOpenBroadcast(WPARAM hContact, LPARAM) {
debugLogA("CVkProto::SvcOpenBroadcast");
- CMStringW wszAudio(ptrW(db_get_wsa(hContact, m_szModuleName, "AudioUrl")));
+ CMStringW wszAudio(db_get_wsm(hContact, m_szModuleName, "AudioUrl"));
if (!wszAudio.IsEmpty())
Utils_OpenUrlW(wszAudio);
|