summaryrefslogtreecommitdiff
path: root/plugins/XSoundNotify/EventProcessor.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-07-23 13:52:57 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-07-23 13:52:57 +0000
commit89c5b2369413025e1fe7dfe5c5d0bf3bedd8558d (patch)
tree18f09394ce3b811e3df7d15de747e842000bd4ad /plugins/XSoundNotify/EventProcessor.cpp
parenta9580df150d799246eaecbf3c1fb5cecf9f8ab49 (diff)
git-svn-id: http://svn.miranda-ng.org/main/trunk@1123 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/XSoundNotify/EventProcessor.cpp')
-rw-r--r--plugins/XSoundNotify/EventProcessor.cpp84
1 files changed, 0 insertions, 84 deletions
diff --git a/plugins/XSoundNotify/EventProcessor.cpp b/plugins/XSoundNotify/EventProcessor.cpp
deleted file mode 100644
index 6a97b6b125..0000000000
--- a/plugins/XSoundNotify/EventProcessor.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-#include "EventProcessor.h"
-#include <m_database.h>
-#include "m_protocols.h"
-#include <memory>
-#include "DebugLogger.hpp"
-
-// static area
-
-static std::unique_ptr<XSN_EventProcessor> XSN_EventProcessorPtr;
-
-void XSN_EventProcessor::make(PLUGINLINK * pl)
-{
- XSN_EventProcessorPtr.reset(new XSN_EventProcessor(pl));
-}
-
-XSN_EventProcessor & XSN_EventProcessor::instance()
-{
- return *XSN_EventProcessorPtr;
-}
-
-// class methods
-
-XSN_EventProcessor::XSN_EventProcessor(PLUGINLINK * pl) : pluginLink(pl)
-{
-
-}
-
-void XSN_EventProcessor::process(WPARAM wParam, LPARAM lParam)
-{
- if (!wParam || !lParam || !isReceiveMessage(lParam))
- return ;
- try
- {
- MessageBox(0, "Receive message", "INFO", MB_OK);
- /*GRS_DEBUG_LOG("Receive message");
- HANDLE contact = (HANDLE)wParam;
- MessageBox(0, "Get protocol", "INFO", MB_OK);
- GRS_DEBUG_LOG("Protocol : ");
- xsn_string proto = getProtocol(wParam);
- MessageBox(0, "Protocol is", proto.c_str(), MB_OK);
- GRS_DEBUG_FORMAT_LOG(proto)
- //xsn_string nick = getNick(wParam, proto.c_str());
- XSN_Variant sound;
- DBGetContactSettingTString(contact, proto.c_str(), "XSNPlugin_sound", &sound);
- if (!sound.empty())
- {
- GRS_DEBUG_LOG("Sound for user exist");
- GRS_DEBUG_FORMAT_LOG("Playing sound : " << sound.ptszVal << ", for user : " << getNick(wParam, proto.c_str()));
- PlaySound(sound.toString().c_str(), nullptr, SND_FILENAME | SND_ASYNC);
- }*/
- }
- catch (std::runtime_error &)
- {
- //MessageBoxA(0, e.what(), "Runtime error", MB_OK);
- }
- catch (...)
- {
- //MessageBoxA(0, "Unknown error occured", "Exception", MB_OK);
- }
-}
-
-bool XSN_EventProcessor::isReceiveMessage(LPARAM event)
-{
- DBEVENTINFO info ={ sizeof(info) };
- CallService(MS_DB_EVENT_GET, event, (LPARAM)&info);
-
- // TODO : rec msg flag : 16, send msg flag : 18 - WTF?
- // return (info.eventType == EVENTTYPE_MESSAGE) && (info.flags & DBEF_READ);
- // It's condition work well - magic?
- return !(((info.eventType != EVENTTYPE_MESSAGE) && !(info.flags & DBEF_READ)) || (info.flags & DBEF_SENT));
-}
-
-xsn_string XSN_EventProcessor::getProtocol(WPARAM contact)
-{
- char *pszProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, contact, 0);
- return xsn_string(pszProto);
-}
-
-xsn_string XSN_EventProcessor::getNick(WPARAM contact, LPCTSTR protocol)
-{
- XSN_Variant nick;
- DBGetContactSettingTString((HANDLE)contact, protocol, "Nick", &nick);
- return nick.toString();
-}