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.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index c80990c01f..70c28659e5 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -506,23 +506,23 @@ void CVkProto::DBAddAuthRequest(const MCONTACT hContact)
mir_free(szNick);
}
-MCONTACT CVkProto::MContactFromDbEvent(HANDLE hDbEvent)
-{
- debugLogA("CVkProto::MContactFromDbEvent");
- if (!hDbEvent || !IsOnline())
- return INVALID_CONTACT_ID;
-
- DWORD body[2];
- DBEVENTINFO dbei = { sizeof(dbei) };
- dbei.cbBlob = sizeof(DWORD) * 2;
- dbei.pBlob = (PBYTE)&body;
-
- if (db_event_get(hDbEvent, &dbei))
- return INVALID_CONTACT_ID;
- if (dbei.eventType != EVENTTYPE_AUTHREQUEST || strcmp(dbei.szModule, m_szModuleName))
- return INVALID_CONTACT_ID;
-
- MCONTACT hContact = DbGetAuthEventContact(&dbei);
+MCONTACT CVkProto::MContactFromDbEvent(MEVENT hDbEvent)
+{
+ debugLogA("CVkProto::MContactFromDbEvent");
+ if (!hDbEvent || !IsOnline())
+ return INVALID_CONTACT_ID;
+
+ DWORD body[2];
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ dbei.cbBlob = sizeof(DWORD) * 2;
+ dbei.pBlob = (PBYTE)&body;
+
+ if (db_event_get(hDbEvent, &dbei))
+ return INVALID_CONTACT_ID;
+ if (dbei.eventType != EVENTTYPE_AUTHREQUEST || strcmp(dbei.szModule, m_szModuleName))
+ return INVALID_CONTACT_ID;
+
+ MCONTACT hContact = DbGetAuthEventContact(&dbei);
db_unset(hContact, m_szModuleName, "ReqAuth");
return hContact;
}
@@ -607,30 +607,30 @@ void CVkProto::ContactTypingThread(void *p)
int CVkProto::OnProcessSrmmEvent(WPARAM, LPARAM lParam)
{
- debugLogA("CVkProto::OnProcessSrmmEvent");
- MessageWindowEventData *event = (MessageWindowEventData *)lParam;
-
- if (event->uType == MSG_WINDOW_EVT_OPENING)
- SetSrmmReadStatus(event->hContact);
+ debugLogA("CVkProto::OnProcessSrmmEvent");
+ MessageWindowEventData *event = (MessageWindowEventData *)lParam;
+
+ if (event->uType == MSG_WINDOW_EVT_OPENING)
+ SetSrmmReadStatus(event->hContact);
return 0;
}
void CVkProto::SetSrmmReadStatus(MCONTACT hContact)
{
- time_t time = getDword(hContact, "LastMsgReadTime", 0);
- if (!time)
- return;
-
- TCHAR ttime[64];
- _locale_t locale = _create_locale(LC_ALL, "");
- _tcsftime_l(ttime, SIZEOF(ttime), _T("%X - %x"), localtime(&time), locale);
- _free_locale(locale);
-
- StatusTextData st = { 0 };
- st.cbSize = sizeof(st);
- st.hIcon = Skin_GetIconByHandle(GetIconHandle(IDI_READMSG));
- mir_sntprintf(st.tszText, SIZEOF(st.tszText), TranslateT("Message read: %s"), ttime);
+ time_t time = getDword(hContact, "LastMsgReadTime", 0);
+ if (!time)
+ return;
+
+ TCHAR ttime[64];
+ _locale_t locale = _create_locale(LC_ALL, "");
+ _tcsftime_l(ttime, SIZEOF(ttime), _T("%X - %x"), localtime(&time), locale);
+ _free_locale(locale);
+
+ StatusTextData st = { 0 };
+ st.cbSize = sizeof(st);
+ st.hIcon = Skin_GetIconByHandle(GetIconHandle(IDI_READMSG));
+ mir_sntprintf(st.tszText, SIZEOF(st.tszText), TranslateT("Message read: %s"), ttime);
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st);
}