diff options
author | ElzorFox <elzorfox@ya.ru> | 2021-06-16 07:58:12 +0500 |
---|---|---|
committer | ElzorFox <elzorfox@ya.ru> | 2021-06-16 07:58:12 +0500 |
commit | 51896be6cd1319d94897820fced98dd95d59eefd (patch) | |
tree | b303deb5c39bcfe234188dd21e51626d587dc313 /protocols/VKontakte/src | |
parent | 4cf1469fc15b6a34a1b711f82e6678c41401552d (diff) |
VKontakte: code cleaning
Diffstat (limited to 'protocols/VKontakte/src')
-rw-r--r-- | protocols/VKontakte/src/vk_proto.cpp | 1 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_proto.h | 3 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 9 |
3 files changed, 8 insertions, 5 deletions
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 6ca353f69c..fc3efc8d85 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -40,6 +40,7 @@ CVkProto::CVkProto(const char *szModuleName, const wchar_t *pwszUserName) : m_pollingConn(nullptr),
m_bSetBroadcast(false),
m_bNeedSendOnline(false),
+ m_bErr404Return(false),
m_vkOptions(this)
{
m_tWorkThreadTimer = m_tPoolThreadTimer = time(0);
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index a02561378c..e87bc49374 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -181,7 +181,8 @@ private: m_bSetBroadcast,
m_bNotifyForEndLoadingHistory,
m_bNotifyForEndLoadingHistoryAllContact,
- m_bTerminated;
+ m_bTerminated,
+ m_bErr404Return;
LONG m_myUserId;
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 1b906537bf..6be3e23db6 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -74,7 +74,7 @@ void CVkProto::ShutdownSession() void CVkProto::ConnectionFailed(int iReason)
{
delSetting("AccessToken");
- delSetting("Err404Return");
+ m_bErr404Return = false;
ProtoBroadcastAck(0, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, iReason);
debugLogA("CVkProto::ConnectionFailed ShutdownSession");
@@ -200,8 +200,8 @@ void CVkProto::OnOAuthAuthorize(NETLIBHTTPREQUEST *reply, AsyncHttpRequest*) debugLogA("CVkProto::OnOAuthAuthorize %d", reply->resultCode);
GrabCookies(reply);
- if (reply->resultCode == 404 && getBool("Err404Return") == false) {
- setByte("Err404Return", 1);
+ if (reply->resultCode == 404 && !m_bErr404Return) {
+ m_bErr404Return = true;
setString("AccessScore", Score);
AsyncHttpRequest* pReq = new AsyncHttpRequest(this, REQUEST_GET, "https://oauth.vk.com/authorize", false, &CVkProto::OnOAuthAuthorize);
pReq
@@ -344,7 +344,8 @@ void CVkProto::TrackVisitor() void CVkProto::RetrieveMyInfo()
{
debugLogA("CVkProto::RetrieveMyInfo");
- delSetting("Err404Return");
+ m_bErr404Return = false;
+
Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/users.get.json", true, &CVkProto::OnReceiveMyInfo, AsyncHttpRequest::rpHigh));
}
|