diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-05 22:27:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-05 22:27:16 +0000 |
commit | 007b4c7301f0d26a72f89f74e9929f42e24eb3e6 (patch) | |
tree | b1ee30b70c6e36d1a06aed6885cb80dc560a68ca /plugins/Boltun | |
parent | f4a1bbc6ba4b8137cb868639ac146aa97e97e9df (diff) |
- rest of menus cleared;
- old database macroses wiped out from all plugins (left in m_database.h for compatibility)
git-svn-id: http://svn.miranda-ng.org/main/trunk@4324 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Boltun')
-rw-r--r-- | plugins/Boltun/src/actionQueue.cpp | 8 | ||||
-rw-r--r-- | plugins/Boltun/src/boltun.cpp | 24 | ||||
-rw-r--r-- | plugins/Boltun/src/config.cpp | 14 |
3 files changed, 23 insertions, 23 deletions
diff --git a/plugins/Boltun/src/actionQueue.cpp b/plugins/Boltun/src/actionQueue.cpp index e652ce8061..a3915bf255 100644 --- a/plugins/Boltun/src/actionQueue.cpp +++ b/plugins/Boltun/src/actionQueue.cpp @@ -75,9 +75,9 @@ void UpdateTimer() static bool NotifyTyping(HANDLE hContact)
{
- int res = DBGetContactSettingByte(hContact, "SRMsg", "SupportTyping", 2);
+ int res = db_get_b(hContact, "SRMsg", "SupportTyping", 2);
if (res == 2)
- res = DBGetContactSettingByte(NULL, "SRMsg", "DefaultTyping", 1);
+ res = db_get_b(NULL, "SRMsg", "DefaultTyping", 1);
return res != 0;
}
@@ -226,11 +226,11 @@ void DoAnswer(HANDLE hContact, const TalkBot::MessageInfo *info, bool sticky = f void AnswerToContact(HANDLE hContact, const TCHAR* messageToAnswer)
{
- if (Config.TalkWarnContacts && DBGetContactSettingByte(hContact, BOLTUN_KEY,
+ if (Config.TalkWarnContacts && db_get_b(hContact, BOLTUN_KEY,
DB_CONTACT_WARNED, FALSE) == FALSE)
{
DoAnswer(hContact, new TalkBot::MessageInfo((const TCHAR*)Config.WarnText), true);
- DBWriteContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_WARNED, TRUE);
+ db_set_b(hContact, BOLTUN_KEY, DB_CONTACT_WARNED, TRUE);
}
else
DoAnswer(hContact, bot->Reply(hContact, messageToAnswer, false));
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index fdf9fbf78c..69cc4f0055 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -188,7 +188,7 @@ static bool LoadMind(const TCHAR* filename, int &line) static bool BoltunAutoChat(HANDLE hContact)
{
- if (DBGetContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT
+ if (db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT
, FALSE) == TRUE)
return false;
@@ -207,11 +207,11 @@ static bool BoltunAutoChat(HANDLE hContact) return true;
}
- if ((DBGetContactSettingByte(hContact,"CList","NotOnList",0) == 1) &&
+ if ((db_get_b(hContact,"CList","NotOnList",0) == 1) &&
Config.TalkWithNotInList)
return true;
- if (DBGetContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT,
+ if (db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT,
FALSE) == TRUE)
return true;
@@ -512,8 +512,8 @@ static int ContactClick(WPARAM wParam, LPARAM lParam, BOOL clickNotToChat) {
HANDLE hContact = (HANDLE)wParam;
- BOOL boltunautochat = DBGetContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, FALSE);
- BOOL boltunnottochat = DBGetContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, FALSE);
+ BOOL boltunautochat = db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, FALSE);
+ BOOL boltunnottochat = db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, FALSE);
if (clickNotToChat)
{
@@ -532,12 +532,12 @@ static int ContactClick(WPARAM wParam, LPARAM lParam, BOOL clickNotToChat) }
else
{
- DBWriteContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_WARNED, FALSE);
+ db_set_b(hContact, BOLTUN_KEY, DB_CONTACT_WARNED, FALSE);
}
}
- DBWriteContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, (BYTE)boltunautochat);
- DBWriteContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, (BYTE)boltunnottochat);
+ db_set_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, (BYTE)boltunautochat);
+ db_set_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, (BYTE)boltunnottochat);
return 0;
}
@@ -564,7 +564,7 @@ static int MessagePrebuild(WPARAM wParam, LPARAM lParam) CLISTMENUITEM clmi = { sizeof(clmi) };
HANDLE hContact = (HANDLE)wParam;
- if (!blInit || (DBGetContactSettingByte(hContact,"CList","NotOnList",0) == 1))
+ if (!blInit || (db_get_b(hContact,"CList","NotOnList",0) == 1))
{
clmi.flags = CMIM_FLAGS | CMIF_GRAYED;
@@ -573,8 +573,8 @@ static int MessagePrebuild(WPARAM wParam, LPARAM lParam) }
else
{
- BOOL boltunautochat = DBGetContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, FALSE);
- BOOL boltunnottochat = DBGetContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, FALSE);
+ BOOL boltunautochat = db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, FALSE);
+ BOOL boltunnottochat = db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, FALSE);
clmi.flags = CMIM_FLAGS | CMIM_ICON | (boltunautochat ? CMIF_CHECKED : 0);
clmi.hIcon = LoadIcon( GetModuleHandle(NULL), MAKEINTRESOURCE((boltunautochat ? IDI_TICK : IDI_NOTICK)));
@@ -649,7 +649,7 @@ extern "C" int __declspec(dllexport) Load(void) MessageBox(NULL, path, TranslateTS(BOLTUN_ERROR), MB_ICONERROR|MB_TASKMODAL|MB_OK);
}
/*record for Uninstall plugin*/
- DBWriteContactSettingString(NULL, "Uninstall", BOLTUN_NAME, BOLTUN_KEY);
+ db_set_s(NULL, "Uninstall", BOLTUN_NAME, BOLTUN_KEY);
return 0;
}
diff --git a/plugins/Boltun/src/config.cpp b/plugins/Boltun/src/config.cpp index b2dcf3849f..b05a560b2b 100644 --- a/plugins/Boltun/src/config.cpp +++ b/plugins/Boltun/src/config.cpp @@ -40,12 +40,12 @@ inline TCHAR* GetString(char* key, const TCHAR* def) {
DBVARIANT dbv;
TCHAR* val;
- if (!DBGetContactSettingTString(NULL, BOLTUN_KEY, key, &dbv))
+ if (!db_get_ts(NULL, BOLTUN_KEY, key, &dbv))
{
size_t len = wcslen(dbv.ptszVal) + 1;
val = new TCHAR[len];
_tcscpy_s(val, len, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
{
@@ -61,22 +61,22 @@ inline const TCHAR* SetString(char* key, const TCHAR* value) size_t len = _tcslen(value) + 1;
TCHAR* val = new TCHAR[len];
_tcscpy_s(val, len, value);
- DBWriteContactSettingTString(NULL, BOLTUN_KEY, key, val);
+ db_set_ts(NULL, BOLTUN_KEY, key, val);
return val;
}
#define BUILDETTERS(x, str, def) \
const bool BoltunConfig::Get##x() { \
- return DBGetContactSettingDword(NULL, BOLTUN_KEY, str, def) != 0; } \
+ return db_get_dw(NULL, BOLTUN_KEY, str, def) != 0; } \
const bool BoltunConfig::Set##x(const bool value) { \
- DBWriteContactSettingDword(NULL, BOLTUN_KEY, str, value); \
+ db_set_dw(NULL, BOLTUN_KEY, str, value); \
return value; }
#define BUILDINTETTERS(x, str, def) \
const int BoltunConfig::Get##x() { \
- return DBGetContactSettingDword(NULL, BOLTUN_KEY, str, def); } \
+ return db_get_dw(NULL, BOLTUN_KEY, str, def); } \
const int BoltunConfig::Set##x(const int value) { \
- DBWriteContactSettingDword(NULL, BOLTUN_KEY, str, value); \
+ db_set_dw(NULL, BOLTUN_KEY, str, value); \
return value; }
#define BUILDSTRETTERS(x, str, def) \
|