diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-04-04 19:00:03 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-04-04 19:00:03 +0000 |
commit | c814aae8a9ba7f85996792b9c283fcd6605e11ff (patch) | |
tree | 480da7d4b69ba386c28dbe717105d741df8f85eb /plugins/XSoundNotify/src/xsn_utils.cpp | |
parent | 5729f9c9a82d120cfd4a7eeb8b7297ac52a8332b (diff) |
added support of all accounts (not only icq and jabber)
not use atl
can play mp3 and others (bass_interface.dll required)
plugin settings moved to options
added relative path support
git-svn-id: http://svn.miranda-ng.org/main/trunk@4306 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/XSoundNotify/src/xsn_utils.cpp')
-rw-r--r-- | plugins/XSoundNotify/src/xsn_utils.cpp | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/plugins/XSoundNotify/src/xsn_utils.cpp b/plugins/XSoundNotify/src/xsn_utils.cpp deleted file mode 100644 index a4808dd775..0000000000 --- a/plugins/XSoundNotify/src/xsn_utils.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "Common.h"
-
-void initModuleConvertTable(ModuleConvertTable & table)
-{
- int number = 0;
- // may be need to free PROTOACCOUNT, but did't found information about it
- PROTOACCOUNT ** accounts;
- ProtoEnumAccounts(&number, &accounts);
- for (int i = 0; i < number; ++i)
- table[ModuleString(accounts[i]->szModuleName)] = ProtocolString(accounts[i]->szProtoName);
-}
-
-bool isReceiveMessage(LPARAM event)
-{
- DBEVENTINFO info = { sizeof(info) };
- CallService(MS_DB_EVENT_GET, event, (LPARAM)&info);
- // i don't understand why it works and how it works, but it works correctly - practice way (методом тыка)
- // so, i think correct condition would be : eventType == EVENTTYPE_MESSAGE && info.flags & DBEF_READ, but it really isn't
- return !(((info.eventType != EVENTTYPE_MESSAGE) && !(info.flags & DBEF_READ)) || (info.flags & DBEF_SENT));
-}
-
-std::tstring getContactSound(HANDLE contact)
-{
- XSN_Variant sound;
- DBGetContactSettingTString(contact, XSN_ModuleInfo::name(), XSN_ModuleInfo::soundSetting(), &sound);
- return sound.toString();
-}
-
-ModuleString getContactModule(HANDLE contact)
-{
- char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)contact, 0);
- if (proto == nullptr)
- throw std::runtime_error("MS_PROTO_GETCONTACTBASEPROTO failed");
- return ModuleString(proto);
-}
-
-std::tstring getIcqContactId(HANDLE contact, const ModuleString &module)
-{
- XSN_Variant nick;
- DBGetContactSettingTString(contact, module.c_str(), "CustomNick", &nick);
- if (nick.empty())
- DBGetContactSettingTString(contact, module.c_str(), "Nick", &nick);
- DWORD uin = DBGetContactSettingDword(contact, module.c_str(), "UIN", 0);
- TCHAR tmpuin[10];
- _itot_s(uin, tmpuin, 10);
- std::tstring uinStr = tmpuin;
- if (nick.empty())
- return uinStr;
- return nick.toString() + TEXT(" (") + uinStr + TEXT(")");
-}
-
-std::tstring getJabberContactId(HANDLE contact, const ModuleString &module)
-{
- XSN_Variant jid, nick;
- DBGetContactSettingTString(contact, module.c_str(), "jid", &jid);
- DBGetContactSettingTString(contact, "CList", "MyHandle", &nick);
- if (nick.empty())
- return jid.toString();
- return nick.toString() + TEXT(" (") + jid.toString() + TEXT(")");
-}
|