diff options
-rw-r--r-- | protocols/VKontakte/src/misc.cpp | 71 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 1 |
2 files changed, 38 insertions, 34 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 2304339c5e..8a5303b3a1 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -421,40 +421,43 @@ void CVkProto::SetMirVer(MCONTACT hContact, int platform) CMString MirVer, OldMirVer;
OldMirVer = db_get_sa(hContact, m_szModuleName, "MirVer");
- if (platform == VK_APP_ID)
+ bool bSetFlag = OldMirVer.IsEmpty() || (OldMirVer == "VKontakte (other)");
+
+ switch (platform){
+ case VK_APP_ID:
MirVer = "Miranda NG VKontakte";
- else
- switch (platform){
- case 1:
- MirVer = "VKontakte (mobile)";
- break;
- case 2:
- MirVer = "VKontakte (iphone)";
- break;
- case 3:
- MirVer = "VKontakte (ipad)";
- break;
- case 4:
- MirVer = "VKontakte (android)";
- break;
- case 5:
- MirVer = "VKontakte (wphone)";
- break;
- case 6:
- MirVer = "VKontakte (windows)";
- break; // Official app for Windows 8.X
- case 7:
- MirVer = "VKontakte (website)";
- break;
- default:
- MirVer = "VKontakte (other)";
+ bSetFlag = true;
+ break;
+ case 1:
+ MirVer = "VKontakte (mobile)";
+ bSetFlag = true;
+ break;
+ case 2:
+ MirVer = "VKontakte (iphone)";
+ break;
+ case 3:
+ MirVer = "VKontakte (ipad)";
+ break;
+ case 4:
+ MirVer = "VKontakte (android)";
+ break;
+ case 5:
+ MirVer = "VKontakte (wphone)";
+ break;
+ case 6:
+ MirVer = "VKontakte (windows)";
+ break; // Official app for Windows 8.X
+ case 7:
+ MirVer = "VKontakte (website)";
+ bSetFlag = true;
+ break;
+ default:
+ MirVer = "VKontakte (other)";
}
-
- if (OldMirVer != MirVer)
- if (OldMirVer.IsEmpty()
- || (OldMirVer == "VKontakte (other)")
- || (platform == 7)
- || (platform == 1)
- || (platform == VK_APP_ID))
- setTString(hContact, "MirVer", MirVer.GetBuffer());
+
+ if (OldMirVer == MirVer)
+ return;
+
+ if (bSetFlag)
+ setTString(hContact, "MirVer", MirVer.GetBuffer());
}
\ No newline at end of file diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 86d12c6547..d1f2152bfe 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -460,6 +460,7 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)){
db_unset(hContact, m_szModuleName, "Auth");
db_unset(hContact, m_szModuleName, "ReqAuth");
+ SetMirVer(hContact, -1);
if (bCleanContacts&&!isChatRoom(hContact))
arContacts.insert((HANDLE)hContact);
}
|