summaryrefslogtreecommitdiff
path: root/protocols/AimOscar/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-05 22:27:16 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-05 22:27:16 +0000
commit007b4c7301f0d26a72f89f74e9929f42e24eb3e6 (patch)
treeb1ee30b70c6e36d1a06aed6885cb80dc560a68ca /protocols/AimOscar/src
parentf4a1bbc6ba4b8137cb868639ac146aa97e97e9df (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 'protocols/AimOscar/src')
-rw-r--r--protocols/AimOscar/src/avatars.cpp2
-rw-r--r--protocols/AimOscar/src/connection.cpp2
-rw-r--r--protocols/AimOscar/src/proto.cpp12
-rw-r--r--protocols/AimOscar/src/server.cpp30
-rw-r--r--protocols/AimOscar/src/services.cpp24
-rw-r--r--protocols/AimOscar/src/theme.cpp2
-rw-r--r--protocols/AimOscar/src/ui.cpp30
-rw-r--r--protocols/AimOscar/src/utility.cpp76
8 files changed, 89 insertions, 89 deletions
diff --git a/protocols/AimOscar/src/avatars.cpp b/protocols/AimOscar/src/avatars.cpp
index 2e8ab42266..26cabfb9a8 100644
--- a/protocols/AimOscar/src/avatars.cpp
+++ b/protocols/AimOscar/src/avatars.cpp
@@ -199,7 +199,7 @@ int CAimProto::get_avatar_filename(HANDLE hContact, TCHAR* pszDest, size_t cbLen
DBVARIANT dbv;
if (getTString(hContact, AIM_KEY_AH, &dbv)) return GAIR_NOAVATAR;
tPathLen += mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T("\\%s"), dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (ext == NULL)
{
diff --git a/protocols/AimOscar/src/connection.cpp b/protocols/AimOscar/src/connection.cpp
index 3b98a8ae7c..216821a790 100644
--- a/protocols/AimOscar/src/connection.cpp
+++ b/protocols/AimOscar/src/connection.cpp
@@ -89,7 +89,7 @@ void CAimProto::aim_connection_authorization(void)
{
CallService(MS_DB_CRYPT_DECODESTRING, strlen(dbv.pszVal) + 1, (LPARAM) dbv.pszVal);
password = mir_strdup(dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
goto exit;
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp
index 10d9a0a594..629bd50c3a 100644
--- a/protocols/AimOscar/src/proto.cpp
+++ b/protocols/AimOscar/src/proto.cpp
@@ -180,10 +180,10 @@ int __cdecl CAimProto::AuthRequest(HANDLE hContact, const TCHAR* szMessage)
return 1;
DBVARIANT dbv;
- if (!DBGetContactSettingStringUtf(hContact, MOD_KEY_CL, OTH_KEY_GP, &dbv) && dbv.pszVal[0])
+ if (!db_get_utf(hContact, MOD_KEY_CL, OTH_KEY_GP, &dbv) && dbv.pszVal[0])
{
add_contact_to_group(hContact, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else add_contact_to_group(hContact, AIM_DEFAULT_GROUP);
@@ -537,7 +537,7 @@ HANDLE __cdecl CAimProto::SendFile(HANDLE hContact, const PROTOCHAR* szDescripti
aim_send_file(hServerConn, seqno, detected_ip, ft->local_port, false, ft);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return ft;
}
@@ -722,9 +722,9 @@ void __cdecl CAimProto::get_online_msg_thread(void* arg)
const HANDLE hContact = arg;
DBVARIANT dbv;
- if (!DBGetContactSettingTString(hContact, MOD_KEY_CL, OTH_KEY_SM, &dbv)) {
+ if (!db_get_ts(hContact, MOD_KEY_CL, OTH_KEY_SM, &dbv)) {
sendBroadcast(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else sendBroadcast(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, 0);
}
@@ -827,7 +827,7 @@ int __cdecl CAimProto::UserIsTyping(HANDLE hContact, int type)
aim_typing_notification(hServerConn, seqno, dbv.pszVal, 0x0002);
else if (type == PROTOTYPE_SELFTYPING_OFF)
aim_typing_notification(hServerConn, seqno, dbv.pszVal, 0x0000);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
diff --git a/protocols/AimOscar/src/server.cpp b/protocols/AimOscar/src/server.cpp
index a56fbbaab3..883905bd86 100644
--- a/protocols/AimOscar/src/server.cpp
+++ b/protocols/AimOscar/src/server.cpp
@@ -545,7 +545,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003
msg_exist = true;
char* msg = tlv.part(i + 6, len);
char* msg_s = process_status_msg(msg, sn);
- DBWriteContactSettingStringUtf(hContact, MOD_KEY_CL, OTH_KEY_SM, msg_s);
+ db_set_utf(hContact, MOD_KEY_CL, OTH_KEY_SM, msg_s);
TCHAR* tszMsg = mir_utf8decodeT(msg_s);
sendBroadcast(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, NULL, (LPARAM)tszMsg);
@@ -560,7 +560,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003
}
if (!msg_exist)
- DBDeleteContactSetting(hContact, MOD_KEY_CL, OTH_KEY_SM);
+ db_unset(hContact, MOD_KEY_CL, OTH_KEY_SM);
}
}
else if (tlv.cmp(0x0004))//idle tlv
@@ -676,20 +676,20 @@ void CAimProto::process_ssi_list(SNAC &snac, int &offset)
{
bool ok = false;
DBVARIANT dbv;
- if (!DBGetContactSettingStringUtf(hContact, MOD_KEY_CL, OTH_KEY_GP, &dbv) && dbv.pszVal[0])
+ if (!db_get_utf(hContact, MOD_KEY_CL, OTH_KEY_GP, &dbv) && dbv.pszVal[0])
{
ok = strcmp(group, dbv.pszVal) == 0;
if (strcmp(dbv.pszVal, "MetaContacts Hidden Group") == 0)
{
- DBFreeVariant(&dbv);
- if (!DBGetContactSettingStringUtf(hContact, "MetaContacts", "OldCListGroup", &dbv))
+ db_free(&dbv);
+ if (!db_get_utf(hContact, "MetaContacts", "OldCListGroup", &dbv))
{
ok = strcmp(group, dbv.pszVal) == 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
{
@@ -698,9 +698,9 @@ void CAimProto::process_ssi_list(SNAC &snac, int &offset)
if (!ok)
{
if (strcmp(group, AIM_DEFAULT_GROUP))
- DBWriteContactSettingStringUtf(hContact, MOD_KEY_CL, OTH_KEY_GP, group);
+ db_set_utf(hContact, MOD_KEY_CL, OTH_KEY_GP, group);
else
- DBDeleteContactSetting(hContact, MOD_KEY_CL, OTH_KEY_GP);
+ db_unset(hContact, MOD_KEY_CL, OTH_KEY_GP);
}
}
}
@@ -714,7 +714,7 @@ void CAimProto::process_ssi_list(SNAC &snac, int &offset)
if (tlv.cmp(0x0131) && tlv.len())
{
char* nick = tlv.dup();
- DBWriteContactSettingStringUtf(hContact, MOD_KEY_CL, "MyHandle", nick);
+ db_set_utf(hContact, MOD_KEY_CL, "MyHandle", nick);
mir_free(nick);
nickfound = true;
}
@@ -726,7 +726,7 @@ void CAimProto::process_ssi_list(SNAC &snac, int &offset)
tlv_offset += TLV_HEADER_SIZE + tlv.len();
}
if (!nickfound && getDword(AIM_KEY_LV, 0) >= 0x80500)
- DBDeleteContactSetting(hContact, MOD_KEY_CL, "MyHandle");
+ db_unset(hContact, MOD_KEY_CL, "MyHandle");
}
break;
}
@@ -884,9 +884,9 @@ void CAimProto::modify_ssi_list(SNAC &snac, int &offset)
{
char* nick = tlv.dup();
if (nick)
- DBWriteContactSettingStringUtf(hContact, MOD_KEY_CL, "MyHandle", nick);
+ db_set_utf(hContact, MOD_KEY_CL, "MyHandle", nick);
else
- DBDeleteContactSetting(hContact, MOD_KEY_CL, "MyHandle");
+ db_unset(hContact, MOD_KEY_CL, "MyHandle");
mir_free(nick);
}
@@ -1058,10 +1058,10 @@ void CAimProto::snac_contact_list(SNAC &snac,HANDLE hServerConn,unsigned short &
aim_request_offline_msgs(hServerConn,seqno);
DBVARIANT dbv;
- if (!DBGetContactSettingStringUtf(NULL, m_szModuleName, AIM_KEY_PR, &dbv))
+ if (!db_get_utf(NULL, m_szModuleName, AIM_KEY_PR, &dbv))
{
aim_set_profile(hServerConn, seqno, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (getDword(AIM_KEY_LV, 0) < 0x80500)
diff --git a/protocols/AimOscar/src/services.cpp b/protocols/AimOscar/src/services.cpp
index 3ab5b37754..52c9bf37ce 100644
--- a/protocols/AimOscar/src/services.cpp
+++ b/protocols/AimOscar/src/services.cpp
@@ -79,7 +79,7 @@ int CAimProto::OnWindowEvent(WPARAM wParam, LPARAM lParam)
{
if (_stricmp(dbv.pszVal, SYSTEM_BUDDY))
aim_typing_notification(hServerConn, seqno, dbv.pszVal, 0x000f);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
return 0;
@@ -95,7 +95,7 @@ INT_PTR CAimProto::GetProfile(WPARAM wParam, LPARAM lParam)
{
request_HTML_profile = 1;
aim_query_profile(hServerConn, seqno, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -126,10 +126,10 @@ int CAimProto::OnDbSettingChanged(WPARAM wParam,LPARAM lParam)
if (cws->value.type == DBVT_DELETED)
{
DBVARIANT dbv;
- if (!DBGetContactSettingStringUtf(hContact, MOD_KEY_CL, OTH_KEY_GP, &dbv) && dbv.pszVal[0])
+ if (!db_get_utf(hContact, MOD_KEY_CL, OTH_KEY_GP, &dbv) && dbv.pszVal[0])
{
add_contact_to_group(hContact, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
add_contact_to_group(hContact, AIM_DEFAULT_GROUP);
@@ -172,7 +172,7 @@ int CAimProto::OnContactDeleted(WPARAM wParam,LPARAM /*lParam*/)
const HANDLE hContact = (HANDLE)wParam;
- if (DBGetContactSettingByte(hContact, MOD_KEY_CL, AIM_KEY_NL, 0))
+ if (db_get_b(hContact, MOD_KEY_CL, AIM_KEY_NL, 0))
return 0;
DBVARIANT dbv;
@@ -194,7 +194,7 @@ int CAimProto::OnContactDeleted(WPARAM wParam,LPARAM /*lParam*/)
aim_ssi_update(hServerConn, seqno, false);
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -237,7 +237,7 @@ int CAimProto::OnGroupChange(WPARAM wParam,LPARAM lParam)
else
{
if (is_my_contact(hContact) && getBuddyId(hContact, 1) &&
- !DBGetContactSettingByte(hContact, MOD_KEY_CL, AIM_KEY_NL, 0))
+ !db_get_b(hContact, MOD_KEY_CL, AIM_KEY_NL, 0))
{
if (grpchg->pszNewName)
{
@@ -258,10 +258,10 @@ INT_PTR CAimProto::AddToServerList(WPARAM wParam, LPARAM /*lParam*/)
HANDLE hContact = (HANDLE)wParam;
DBVARIANT dbv;
- if (!DBGetContactSettingStringUtf(hContact, MOD_KEY_CL, OTH_KEY_GP, &dbv) && dbv.pszVal[0])
+ if (!db_get_utf(hContact, MOD_KEY_CL, OTH_KEY_GP, &dbv) && dbv.pszVal[0])
{
add_contact_to_group(hContact, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
add_contact_to_group(hContact, AIM_DEFAULT_GROUP);
@@ -315,7 +315,7 @@ INT_PTR CAimProto::BlockBuddy(WPARAM wParam, LPARAM /*lParam*/)
}
break;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 0;
}
@@ -337,7 +337,7 @@ INT_PTR CAimProto::OnJoinChat(WPARAM wParam, LPARAM /*lParam*/)
{
chatnav_param* par = new chatnav_param(dbv.pszVal, getWord(hContact, "Exchange", 4));
ForkThread(&CAimProto::chatnav_request_thread, par);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -352,7 +352,7 @@ INT_PTR CAimProto::OnLeaveChat(WPARAM wParam, LPARAM /*lParam*/)
if (!getString(hContact, "ChatRoomID", &dbv))
{
chat_leave(dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp
index f20de16ff5..c32409f5b2 100644
--- a/protocols/AimOscar/src/theme.cpp
+++ b/protocols/AimOscar/src/theme.cpp
@@ -255,7 +255,7 @@ int CAimProto::OnPreBuildContactMenu(WPARAM wParam,LPARAM /*lParam*/)
}
Menu_ModifyItem(hBlockContextMenuItem, &mi);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
diff --git a/protocols/AimOscar/src/ui.cpp b/protocols/AimOscar/src/ui.cpp
index 249a0cc573..25e04fd38e 100644
--- a/protocols/AimOscar/src/ui.cpp
+++ b/protocols/AimOscar/src/ui.cpp
@@ -205,13 +205,13 @@ static INT_PTR CALLBACK userinfo_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, L
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, LPARAM(ppro));
DBVARIANT dbv;
- if (!DBGetContactSettingStringUtf(NULL, ppro->m_szModuleName, AIM_KEY_PR, &dbv))
+ if (!db_get_utf(NULL, ppro->m_szModuleName, AIM_KEY_PR, &dbv))
{
html_decode(dbv.pszVal);
TCHAR *txt = mir_utf8decodeT(dbv.pszVal);
SetDlgItemText(hwndDlg, IDC_PROFILE, txt);
mir_free(txt);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
@@ -432,7 +432,7 @@ static INT_PTR CALLBACK userinfo_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, L
case IDC_SETPROFILE:
{
char* buf = rtf_to_html(hwndDlg, IDC_PROFILE);
- DBWriteContactSettingStringUtf(NULL, ppro->m_szModuleName, AIM_KEY_PR, buf);
+ db_set_utf(NULL, ppro->m_szModuleName, AIM_KEY_PR, buf);
if (ppro->state==1)
ppro->aim_set_profile(ppro->hServerConn, ppro->seqno, buf);//also see set caps for profile setting
@@ -676,12 +676,12 @@ INT_PTR CALLBACK admin_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
if (!ppro->getString(AIM_KEY_SN, &dbv))
{
SetDlgItemTextA(hwndDlg, IDC_FNAME, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (!ppro->getString(AIM_KEY_EM, &dbv))
{
SetDlgItemTextA(hwndDlg, IDC_CEMAIL, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
break;
}
@@ -699,7 +699,7 @@ INT_PTR CALLBACK admin_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
{
if (strcmp(name, dbv.pszVal))
ppro->aim_admin_format_name(ppro->hAdminConn,ppro->admin_seqno,name);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
char email[254];
@@ -708,7 +708,7 @@ INT_PTR CALLBACK admin_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
{
if (strcmp(email, dbv.pszVal))
ppro->aim_admin_change_email(ppro->hAdminConn,ppro->admin_seqno,email);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
ShowWindow(GetDlgItem(hwndDlg, IDC_PINFO), SW_HIDE);
@@ -795,28 +795,28 @@ static INT_PTR CALLBACK options_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (!ppro->getString(AIM_KEY_SN, &dbv))
{
SetDlgItemTextA(hwndDlg, IDC_SN, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (!ppro->getString(AIM_KEY_NK, &dbv))
{
SetDlgItemTextA(hwndDlg, IDC_NK, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else if (!ppro->getString(AIM_KEY_SN, &dbv))
{
SetDlgItemTextA(hwndDlg, IDC_NK, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (!ppro->getString(AIM_KEY_PW, &dbv))
{
CallService(MS_DB_CRYPT_DECODESTRING, strlen(dbv.pszVal) + 1, (LPARAM) dbv.pszVal);
SetDlgItemTextA(hwndDlg, IDC_PW, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (!ppro->getString(AIM_KEY_HN, &dbv))
{
SetDlgItemTextA(hwndDlg, IDC_HN, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
SetDlgItemTextA(hwndDlg, IDC_HN, ppro->getByte(AIM_KEY_DSSL, 0) ? AIM_DEFAULT_SERVER_NS : AIM_DEFAULT_SERVER);
@@ -1186,14 +1186,14 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
if (!ppro->getString(AIM_KEY_SN, &dbv))
{
SetDlgItemTextA(hwndDlg, IDC_SN, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (!ppro->getString(AIM_KEY_PW, &dbv))
{
CallService(MS_DB_CRYPT_DECODESTRING, strlen(dbv.pszVal) + 1, (LPARAM) dbv.pszVal);
SetDlgItemTextA(hwndDlg, IDC_PW, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return TRUE;
}
@@ -1391,7 +1391,7 @@ static void clist_chat_invite_send(HANDLE hItem, HWND hwndList, chat_list_item*
{
ppro->aim_chat_invite(ppro->hServerConn, ppro->seqno,
item->cookie, item->exchange, item->instance, dbv.pszVal, msg);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
diff --git a/protocols/AimOscar/src/utility.cpp b/protocols/AimOscar/src/utility.cpp
index 549f2e4235..cabadfffb0 100644
--- a/protocols/AimOscar/src/utility.cpp
+++ b/protocols/AimOscar/src/utility.cpp
@@ -94,7 +94,7 @@ void CAimProto::start_connection(void *arg)
offline_contacts();
DBVARIANT dbv;
if (!getString(AIM_KEY_SN, &dbv))
- DBFreeVariant(&dbv);
+ db_free(&dbv);
else
{
ShowPopup(LPGEN("Please, enter a username in the options dialog."), 0);
@@ -102,7 +102,7 @@ void CAimProto::start_connection(void *arg)
return;
}
if (!getString(AIM_KEY_PW, &dbv))
- DBFreeVariant(&dbv);
+ db_free(&dbv);
else
{
ShowPopup(LPGEN("Please, enter a password in the options dialog."), 0);
@@ -177,7 +177,7 @@ HANDLE CAimProto::find_chat_contact(const char* room)
if (!getString(hContact, "ChatRoomID", &dbv))
{
bool found = !strcmp(room, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (found) return hContact;
}
}
@@ -199,7 +199,7 @@ HANDLE CAimProto::contact_from_sn(const char* sn, bool addIfNeeded, bool tempora
if (!getString(hContact, AIM_KEY_SN, &dbv))
{
bool found = !strcmp(norm_sn, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (found)
{
mir_free(norm_sn);
@@ -221,7 +221,7 @@ HANDLE CAimProto::contact_from_sn(const char* sn, bool addIfNeeded, bool tempora
setString(hContact, AIM_KEY_NK, sn);
LOG("Adding contact %s to client side list.",norm_sn);
if (temporary)
- DBWriteContactSettingByte(hContact, "CList", "NotOnList", 1);
+ db_set_b(hContact, "CList", "NotOnList", 1);
mir_free(norm_sn);
return hContact;
}
@@ -271,10 +271,10 @@ void CAimProto::add_contact_to_group(HANDLE hContact, const char* new_group)
DBVARIANT dbv;
char *nick = NULL;
- if (!DBGetContactSettingStringUtf(hContact, MOD_KEY_CL, "MyHandle", &dbv))
+ if (!db_get_utf(hContact, MOD_KEY_CL, "MyHandle", &dbv))
{
nick = NEWSTR_ALLOCA(dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (getString(hContact, AIM_KEY_SN, &dbv)) return;
@@ -288,9 +288,9 @@ void CAimProto::add_contact_to_group(HANDLE hContact, const char* new_group)
setGroupId(hContact, 1, new_group_id);
if (new_group && strcmp(new_group, AIM_DEFAULT_GROUP))
- DBWriteContactSettingStringUtf(hContact, MOD_KEY_CL, OTH_KEY_GP, new_group);
+ db_set_utf(hContact, MOD_KEY_CL, OTH_KEY_GP, new_group);
else
- DBDeleteContactSetting(hContact, MOD_KEY_CL, OTH_KEY_GP);
+ db_unset(hContact, MOD_KEY_CL, OTH_KEY_GP);
aim_ssi_update(hServerConn, seqno, true);
@@ -319,7 +319,7 @@ void CAimProto::add_contact_to_group(HANDLE hContact, const char* new_group)
aim_ssi_update(hServerConn, seqno, false);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
void CAimProto::offline_contact(HANDLE hContact, bool remove_settings)
@@ -333,7 +333,7 @@ void CAimProto::offline_contact(HANDLE hContact, bool remove_settings)
deleteGroupId(hContact, i);
}
- DBDeleteContactSetting(hContact, MOD_KEY_CL, OTH_KEY_SM);
+ db_unset(hContact, MOD_KEY_CL, OTH_KEY_SM);
}
setWord(hContact, AIM_KEY_ST, ID_STATUS_OFFLINE);
}
@@ -467,10 +467,10 @@ void CAimProto::upload_nicks(void)
while (hContact)
{
DBVARIANT dbv;
- if (is_my_contact(hContact) && !DBGetContactSettingStringUtf(hContact, MOD_KEY_CL, "MyHandle", &dbv))
+ if (is_my_contact(hContact) && !db_get_utf(hContact, MOD_KEY_CL, "MyHandle", &dbv))
{
set_local_nick(hContact, dbv.pszVal, NULL);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
hContact = db_find_next(hContact);
}
@@ -491,7 +491,7 @@ void CAimProto::set_local_nick(HANDLE hContact, char* nick, char* note)
aim_mod_buddy(hServerConn, seqno, dbv.pszVal, group_id, buddy_id, nick, note);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -749,105 +749,105 @@ unsigned short get_random(void)
// Standard functions
int CAimProto::deleteSetting(HANDLE hContact, const char* setting)
-{ return DBDeleteContactSetting(hContact, m_szModuleName, setting);
+{ return db_unset(hContact, m_szModuleName, setting);
}
bool CAimProto::getBool(HANDLE hContact, const char* name, bool defaultValue)
-{ return DBGetContactSettingByte(hContact, m_szModuleName, name, defaultValue) != 0;
+{ return db_get_b(hContact, m_szModuleName, name, defaultValue) != 0;
}
int CAimProto::getByte(const char* name, BYTE defaultValue)
-{ return DBGetContactSettingByte(NULL, m_szModuleName, name, defaultValue);
+{ return db_get_b(NULL, m_szModuleName, name, defaultValue);
}
int CAimProto::getByte(HANDLE hContact, const char* name, BYTE defaultValue)
-{ return DBGetContactSettingByte(hContact, m_szModuleName, name, defaultValue);
+{ return db_get_b(hContact, m_szModuleName, name, defaultValue);
}
int CAimProto::getDword(const char* name, DWORD defaultValue)
-{ return DBGetContactSettingDword(NULL, m_szModuleName, name, defaultValue);
+{ return db_get_dw(NULL, m_szModuleName, name, defaultValue);
}
int CAimProto::getDword(HANDLE hContact, const char* name, DWORD defaultValue)
-{ return DBGetContactSettingDword(hContact, m_szModuleName, name, defaultValue);
+{ return db_get_dw(hContact, m_szModuleName, name, defaultValue);
}
int CAimProto::getString(const char* name, DBVARIANT* result)
-{ return DBGetContactSettingString(NULL, m_szModuleName, name, result);
+{ return db_get_s(NULL, m_szModuleName, name, result);
}
int CAimProto::getString(HANDLE hContact, const char* name, DBVARIANT* result)
-{ return DBGetContactSettingString(hContact, m_szModuleName, name, result);
+{ return db_get_s(hContact, m_szModuleName, name, result);
}
int CAimProto::getTString(const char* name, DBVARIANT* result)
-{ return DBGetContactSettingTString(NULL, m_szModuleName, name, result);
+{ return db_get_ts(NULL, m_szModuleName, name, result);
}
int CAimProto::getTString(HANDLE hContact, const char* name, DBVARIANT* result)
-{ return DBGetContactSettingTString(hContact, m_szModuleName, name, result);
+{ return db_get_ts(hContact, m_szModuleName, name, result);
}
WORD CAimProto::getWord(const char* name, WORD defaultValue)
-{ return (WORD)DBGetContactSettingWord(NULL, m_szModuleName, name, defaultValue);
+{ return (WORD)db_get_w(NULL, m_szModuleName, name, defaultValue);
}
WORD CAimProto::getWord(HANDLE hContact, const char* name, WORD defaultValue)
-{ return (WORD)DBGetContactSettingWord(hContact, m_szModuleName, name, defaultValue);
+{ return (WORD)db_get_w(hContact, m_szModuleName, name, defaultValue);
}
char* CAimProto::getSetting(HANDLE hContact, const char* setting)
{
DBVARIANT dbv;
- return DBGetContactSettingString(hContact, m_szModuleName, setting, &dbv) ?
+ return db_get_s(hContact, m_szModuleName, setting, &dbv) ?
NULL : dbv.pszVal;
}
char* CAimProto::getSetting(const char* setting)
{
DBVARIANT dbv;
- return DBGetContactSettingString(NULL, m_szModuleName, setting, &dbv) ?
+ return db_get_s(NULL, m_szModuleName, setting, &dbv) ?
NULL : dbv.pszVal;
}
void CAimProto::setByte(const char* name, BYTE value)
-{ DBWriteContactSettingByte(NULL, m_szModuleName, name, value);
+{ db_set_b(NULL, m_szModuleName, name, value);
}
void CAimProto::setByte(HANDLE hContact, const char* name, BYTE value)
-{ DBWriteContactSettingByte(hContact, m_szModuleName, name, value);
+{ db_set_b(hContact, m_szModuleName, name, value);
}
void CAimProto::setDword(const char* name, DWORD value)
-{ DBWriteContactSettingDword(NULL, m_szModuleName, name, value);
+{ db_set_dw(NULL, m_szModuleName, name, value);
}
void CAimProto::setDword(HANDLE hContact, const char* name, DWORD value)
-{ DBWriteContactSettingDword(hContact, m_szModuleName, name, value);
+{ db_set_dw(hContact, m_szModuleName, name, value);
}
void CAimProto::setString(const char* name, const char* value)
-{ DBWriteContactSettingString(NULL, m_szModuleName, name, value);
+{ db_set_s(NULL, m_szModuleName, name, value);
}
void CAimProto::setString(HANDLE hContact, const char* name, const char* value)
-{ DBWriteContactSettingString(hContact, m_szModuleName, name, value);
+{ db_set_s(hContact, m_szModuleName, name, value);
}
void CAimProto::setTString(const char* name, const TCHAR* value)
-{ DBWriteContactSettingTString(NULL, m_szModuleName, name, value);
+{ db_set_ts(NULL, m_szModuleName, name, value);
}
void CAimProto::setTString(HANDLE hContact, const char* name, const TCHAR* value)
-{ DBWriteContactSettingTString(hContact, m_szModuleName, name, value);
+{ db_set_ts(hContact, m_szModuleName, name, value);
}
void CAimProto::setWord(const char* name, WORD value)
-{ DBWriteContactSettingWord(NULL, m_szModuleName, name, value);
+{ db_set_w(NULL, m_szModuleName, name, value);
}
void CAimProto::setWord(HANDLE hContact, const char* name, WORD value)
-{ DBWriteContactSettingWord(hContact, m_szModuleName, name, value);
+{ db_set_w(hContact, m_szModuleName, name, value);
}
int CAimProto::sendBroadcast(HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam)