summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/misc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/VKontakte/src/misc.cpp')
-rw-r--r--protocols/VKontakte/src/misc.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index 3691ae82ff..d078df244c 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -1451,4 +1451,34 @@ void CVkProto::ShowCaptchaInBrowser(HBITMAP hBitmap)
wszHTMLPath = L"file://" + wszHTMLPath;
Utils_OpenUrlW(wszHTMLPath);
-} \ No newline at end of file
+}
+
+void CVkProto::AddVkDeactivateEvent(MCONTACT hContact, CMStringW& wszType)
+{
+ CVKDeactivateEvent vkDeactivateEvent[] = {
+ { L"", Translate("User restored control over own page") },
+ { L"deleted", Translate("User was deactivated (deleted)") },
+ { L"banned", Translate("User was deactivated (banned)") }
+ };
+
+ int iDEIdx = -1;
+ for (int i = 0; i < _countof(vkDeactivateEvent); i++)
+ if (wszType == vkDeactivateEvent[i].wszType) {
+ iDEIdx = i;
+ break;
+ }
+
+ if (iDEIdx == -1)
+ return;
+
+ DBEVENTINFO dbei;
+ dbei.cbSize = sizeof(dbei);
+ dbei.szModule = m_szModuleName;
+ dbei.timestamp = time(NULL);
+ dbei.eventType = VK_USER_DEACTIVATE_ACTION;
+ dbei.cbBlob = mir_strlen(vkDeactivateEvent[iDEIdx].szDescription) + 1;
+ dbei.pBlob = (PBYTE)mir_strdup(vkDeactivateEvent[iDEIdx].szDescription);
+ dbei.flags = DBEF_UTF;
+ db_event_add(hContact, &dbei);
+}
+