diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-10-23 09:18:49 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-10-23 09:18:49 +0000 |
commit | 676c1d3d4bc2d6a52cc71ec14ef7e7b8b9817564 (patch) | |
tree | 894bc4f4b5f4d3de1e4bc8e13dd1de07fecbe5f4 /protocols/VKontakte/src/vk_proto.cpp | |
parent | 169df25f12faff23b8fd8c20e057af715a2777ca (diff) |
VKontakte:
popup & sound support for newsfeed
add hidden option for return chat message
version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@15600 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_proto.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_proto.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index f0f2de1357..e1cfb32c3f 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -171,6 +171,8 @@ int CVkProto::OnModulesLoaded(WPARAM, LPARAM) HookProtoEvent(ME_MSG_WINDOWEVENT, &CVkProto::OnProcessSrmmEvent);
HookProtoEvent(ME_DB_EVENT_MARKED_READ, &CVkProto::OnDbEventRead);
HookProtoEvent(ME_DB_CONTACT_SETTINGCHANGED, &CVkProto::OnDbSettingChanged);
+ //Sounds
+ SkinAddNewSoundExT("NewsFeed", m_tszUserName, LPGENT("VKontakte newsfeed & notification event"));
InitPopups();
InitMenus();
@@ -397,12 +399,39 @@ void CVkProto::UnInitMenus() /////////////////////////////////////////////////////////////////////////////////////////
// PopUp support
+LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) { + case WM_COMMAND: + case WM_CONTEXTMENU: + { + CVkSendMsgParam *pd = (CVkSendMsgParam *)PUGetPluginData(hwnd); + if (pd != NULL && pd->hContact != NULL) + CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM)pd->hContact, 0); + PUDeletePopup(hwnd); + } + break; + case UM_FREEPLUGINDATA: + { + CVkSendMsgParam *pd = (CVkSendMsgParam *)PUGetPluginData(hwnd); + delete pd; + } + return FALSE; + default: + break; + } + + return DefWindowProc(hwnd, message, wParam, lParam); +}
+
void CVkProto::InitPopups(void)
{
TCHAR desc[256];
char name[256];
POPUPCLASS ppc = { sizeof(ppc) };
ppc.flags = PCF_TCHAR;
+ ppc.PluginWindowProc = PopupDlgProc; + ppc.lParam = APF_RETURN_HWND;
mir_sntprintf(desc, _T("%s %s"), m_tszUserName, TranslateT("Errors"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Error");
@@ -435,6 +464,7 @@ void CVkProto::MsgPopup(MCONTACT hContact, const TCHAR *szMsg, const TCHAR *szTi ppd.ptszText = szMsg;
ppd.pszClassName = name;
ppd.hContact = hContact;
+ ppd.PluginData = new CVkSendMsgParam(hContact);
mir_snprintf(name, "%s_%s", m_szModuleName, err ? "Error" : "Notification");
CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&ppd);
|