summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/misc.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-09-30 10:41:38 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-09-30 10:41:38 +0000
commit2f1ab0e9f068ad2ebfe3f483725aac5bc79f7383 (patch)
treec6b0e6ea5f29daff865ad26c1ee3be63d3aa6ac8 /protocols/VKontakte/src/misc.cpp
parent3a5c7a433b3e190e2ba59f8a5416879f197f9a54 (diff)
VKontakte: basic MirVer support
fix copy-paste bug git-svn-id: http://svn.miranda-ng.org/main/trunk@10648 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/misc.cpp')
-rw-r--r--protocols/VKontakte/src/misc.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index 845706004f..4c7244265c 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -408,4 +408,53 @@ MCONTACT CVkProto::MContactFromDbEvent(HANDLE hDbEvent)
MCONTACT hContact = DbGetAuthEventContact(&dbei);
db_unset(hContact, m_szModuleName, "ReqAuth");
return hContact;
+}
+
+void CVkProto::SetMirVer(MCONTACT hContact, int platform)
+{
+ if (hContact == NULL || hContact == -1)
+ return;
+ if (platform == -1){
+ db_unset(hContact, m_szModuleName, "MirVer");
+ return;
+ }
+
+ CMString MirVer, OldMirVer;
+ OldMirVer = db_get_sa(hContact, m_szModuleName, "MirVer");
+ if (platform == 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 WEB";
+ break;
+ default:
+ MirVer = "VKontakte UnknownApp";
+ }
+
+ if (OldMirVer != MirVer)
+ if (OldMirVer.IsEmpty()
+ || (OldMirVer == "VKontakte UnknownApp")
+ || (platform == 7)
+ || (platform == 1)
+ || (platform == VK_APP_ID))
+ setTString(hContact, "MirVer", MirVer.GetBuffer());
} \ No newline at end of file