diff options
author | George Hazan <george.hazan@gmail.com> | 2012-10-07 11:42:28 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-10-07 11:42:28 +0000 |
commit | 197fe77f67654cf8c46c53376190fc321176c08b (patch) | |
tree | 1a161cf7fb7968e3781b1d11771195d9b5e4c26c /plugins/MirOTR | |
parent | 4bcab3fc00696ca2daf1396bfc75bd49009644d6 (diff) |
old database macros removed from m_database.h
git-svn-id: http://svn.miranda-ng.org/main/trunk@1796 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirOTR')
-rw-r--r-- | plugins/MirOTR/MirOTR/dllmain.cpp | 4 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/mirotrmenu.cpp | 2 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/options.cpp | 12 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/otr.cpp | 6 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/svcs_menu.cpp | 6 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/svcs_proto.cpp | 4 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/svcs_srmm.cpp | 4 |
7 files changed, 19 insertions, 19 deletions
diff --git a/plugins/MirOTR/MirOTR/dllmain.cpp b/plugins/MirOTR/MirOTR/dllmain.cpp index 14f8991277..4b4280638a 100644 --- a/plugins/MirOTR/MirOTR/dllmain.cpp +++ b/plugins/MirOTR/MirOTR/dllmain.cpp @@ -67,8 +67,8 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) { hEventWindow = HookEvent(ME_MSG_WINDOWEVENT, WindowEvent);
- if (options.bHaveSecureIM && !db_byte_get(0, MODULENAME, "sim_warned", 0)) {
- db_byte_set(0, MODULENAME, "sim_warned", 1);
+ if (options.bHaveSecureIM && !db_get_b(0, MODULENAME, "sim_warned", 0)) {
+ db_set_b(0, MODULENAME, "sim_warned", 1);
options.default_policy = OTRL_POLICY_MANUAL_MOD;
SaveOptions();
MessageBox(0, TranslateT(LANG_OTR_SECUREIM_TEXT), TranslateT(LANG_OTR_SECUREIM_TITLE), 0x30);
diff --git a/plugins/MirOTR/MirOTR/mirotrmenu.cpp b/plugins/MirOTR/MirOTR/mirotrmenu.cpp index e66ad10566..07a874c425 100644 --- a/plugins/MirOTR/MirOTR/mirotrmenu.cpp +++ b/plugins/MirOTR/MirOTR/mirotrmenu.cpp @@ -127,7 +127,7 @@ INT_PTR MirOTRMenuCheckService(WPARAM wParam,LPARAM) }
CallService(MO_MODIFYMENUITEM, (WPARAM)hStatusInfoItem, (LPARAM)&mi);
} else if (pcpp->MenuItemHandle == hHTMLConvMenuItem) {
- if (db_byte_get(hContact, MODULENAME, "HTMLConv", 0) )
+ if (db_get_b(hContact, MODULENAME, "HTMLConv", 0) )
mi.flags |= CMIM_FLAGS|CMIF_CHECKED;
else
mi.flags = CMIM_FLAGS|(mi.flags &~CMIF_CHECKED);
diff --git a/plugins/MirOTR/MirOTR/options.cpp b/plugins/MirOTR/MirOTR/options.cpp index b5973096e2..6a3e338037 100644 --- a/plugins/MirOTR/MirOTR/options.cpp +++ b/plugins/MirOTR/MirOTR/options.cpp @@ -404,7 +404,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP mir_free(temp);
- ListView_SetItemText(lv, ilvItem, 1, (TCHAR*)policy_to_string(db_dword_get(0,MODULENAME"_ProtoPol", pppDesc[i]->szName, CONTACT_DEFAULT_POLICY)) );
+ ListView_SetItemText(lv, ilvItem, 1, (TCHAR*)policy_to_string(db_get_dw(0,MODULENAME"_ProtoPol", pppDesc[i]->szName, CONTACT_DEFAULT_POLICY)) );
if(otrl_privkey_fingerprint(otr_user_state, fprint, pppDesc[i]->szName, pppDesc[i]->szName)) {
temp = mir_a2t(fprint);
ListView_SetItemText(lv, ilvItem, 2, temp);
@@ -498,7 +498,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP ListView_GetItemText(lv, i, 0, proto_t, 128);
ListView_GetItemText(lv, i, 1, policy, 64);
proto = mir_t2a(proto_t);
- db_dword_set(0, MODULENAME"_ProtoPol", proto, policy_from_string(policy));
+ db_set_dw(0, MODULENAME"_ProtoPol", proto, policy_from_string(policy));
mir_free(proto);
}
// handle apply
@@ -582,7 +582,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM while ( hContact != NULL )
{
proto = contact_get_proto(hContact);
- if(proto && db_byte_get(hContact, proto, "ChatRoom", 0) == 0 && CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)MODULENAME) // ignore chatrooms
+ if(proto && db_get_b(hContact, proto, "ChatRoom", 0) == 0 && CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)MODULENAME) // ignore chatrooms
&& (g_metaproto == 0 || strcmp(proto, g_metaproto) != 0)) // and MetaContacts
{
lvI.iItem = 0;
@@ -595,8 +595,8 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM ListView_SetItemText(lv, lvI.iItem, 1, proto_t);
mir_free(proto_t);
- ListView_SetItemText(lv, lvI.iItem, 2, (TCHAR*)policy_to_string((OtrlPolicy)db_dword_get(hContact, MODULENAME, "Policy", CONTACT_DEFAULT_POLICY)) );
- ListView_SetItemText(lv, lvI.iItem, 3, (db_byte_get(hContact, MODULENAME, "HTMLConv", 0))?TranslateT(LANG_YES):TranslateT(LANG_NO) );
+ ListView_SetItemText(lv, lvI.iItem, 2, (TCHAR*)policy_to_string((OtrlPolicy)db_get_dw(hContact, MODULENAME, "Policy", CONTACT_DEFAULT_POLICY)) );
+ ListView_SetItemText(lv, lvI.iItem, 3, (db_get_b(hContact, MODULENAME, "HTMLConv", 0))?TranslateT(LANG_YES):TranslateT(LANG_NO) );
}
@@ -651,7 +651,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM {
if (!it->first) continue;
if (it->second.policy) DBWriteContactSettingDword(it->first, MODULENAME, "Policy", (DWORD)it->second.policy);
- if (it->second.htmlconv) db_byte_set(it->first, MODULENAME, "HTMLConv", it->second.htmlconv-1);
+ if (it->second.htmlconv) db_set_b(it->first, MODULENAME, "HTMLConv", it->second.htmlconv-1);
}
return TRUE;
} else if (((LPNMHDR) lParam)->hwndFrom == GetDlgItem(hwndDlg, IDC_LV_CONT_CONTACTS)) {
diff --git a/plugins/MirOTR/MirOTR/otr.cpp b/plugins/MirOTR/MirOTR/otr.cpp index 69c8efebe0..ee6e3e0e12 100644 --- a/plugins/MirOTR/MirOTR/otr.cpp +++ b/plugins/MirOTR/MirOTR/otr.cpp @@ -82,15 +82,15 @@ extern "C" { DWORD pol;
if(hContact) {
pol = DBGetContactSettingDword(hContact, MODULENAME, "Policy", CONTACT_DEFAULT_POLICY);
- if (options.bHaveSecureIM && pol != OTRL_POLICY_MANUAL_MOD && pol != OTRL_POLICY_NEVER && db_byte_get(hContact, "SecureIM" , "StatusID", 0)) {
+ if (options.bHaveSecureIM && pol != OTRL_POLICY_MANUAL_MOD && pol != OTRL_POLICY_NEVER && db_get_b(hContact, "SecureIM" , "StatusID", 0)) {
// if SecureIM is not disabled for this contact, MirOTR will be set to manual
- db_dword_set(hContact, MODULENAME, "Policy", OTRL_POLICY_MANUAL_MOD);
+ db_set_dw(hContact, MODULENAME, "Policy", OTRL_POLICY_MANUAL_MOD);
return OTRL_POLICY_MANUAL_MOD;
}
if(pol != CONTACT_DEFAULT_POLICY) return pol ;
}
if(context->protocol) {
- pol = db_dword_get(0,MODULENAME"_ProtoPol", context->protocol, CONTACT_DEFAULT_POLICY);
+ pol = db_get_dw(0,MODULENAME"_ProtoPol", context->protocol, CONTACT_DEFAULT_POLICY);
if(pol != CONTACT_DEFAULT_POLICY) return pol ;
}
diff --git a/plugins/MirOTR/MirOTR/svcs_menu.cpp b/plugins/MirOTR/MirOTR/svcs_menu.cpp index 76b0a07817..17c2d9a4b0 100644 --- a/plugins/MirOTR/MirOTR/svcs_menu.cpp +++ b/plugins/MirOTR/MirOTR/svcs_menu.cpp @@ -114,10 +114,10 @@ INT_PTR SVC_VerifyOTR(WPARAM wParam, LPARAM lParam) { INT_PTR SVC_ToggleHTMLOTR(WPARAM wParam, LPARAM lParam) {
HANDLE hContact = (HANDLE)wParam;
- if (db_byte_get(hContact, MODULENAME, "HTMLConv", 0))
- db_byte_set(hContact, MODULENAME, "HTMLConv", 0);
+ if (db_get_b(hContact, MODULENAME, "HTMLConv", 0))
+ db_set_b(hContact, MODULENAME, "HTMLConv", 0);
else
- db_byte_set(hContact, MODULENAME, "HTMLConv", 1);
+ db_set_b(hContact, MODULENAME, "HTMLConv", 1);
return 0;
}
diff --git a/plugins/MirOTR/MirOTR/svcs_proto.cpp b/plugins/MirOTR/MirOTR/svcs_proto.cpp index d20ef4d896..618034cc10 100644 --- a/plugins/MirOTR/MirOTR/svcs_proto.cpp +++ b/plugins/MirOTR/MirOTR/svcs_proto.cpp @@ -51,7 +51,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){ char *tmpencode = NULL;
ConnContext *context = otrl_context_find_miranda(otr_user_state, (void*)ccs->hContact);
- if (db_byte_get(ccs->hContact, MODULENAME, "HTMLConv", 0) && otr_context_get_trust(context) >= TRUST_UNVERIFIED) {
+ if (db_get_b(ccs->hContact, MODULENAME, "HTMLConv", 0) && otr_context_get_trust(context) >= TRUST_UNVERIFIED) {
char *tmpencode = encode_html_entities_utf8(oldmessage_utf);
if (tmpencode != NULL) {
if (!(ccs->wParam & PREF_UTF)) mir_free(oldmessage_utf);
@@ -344,7 +344,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam){ TrustLevel level = otr_context_get_trust(context);
if (level >= TRUST_UNVERIFIED) {
char* premsg;
- if (db_byte_get(ccs->hContact, MODULENAME, "HTMLConv", 0)) {
+ if (db_get_b(ccs->hContact, MODULENAME, "HTMLConv", 0)) {
premsg = striphtml(newmessage);
otrl_message_free(newmessage);
newmessage = premsg;
diff --git a/plugins/MirOTR/MirOTR/svcs_srmm.cpp b/plugins/MirOTR/MirOTR/svcs_srmm.cpp index 595045c301..707eb0a020 100644 --- a/plugins/MirOTR/MirOTR/svcs_srmm.cpp +++ b/plugins/MirOTR/MirOTR/svcs_srmm.cpp @@ -46,7 +46,7 @@ int SVC_IconPressed(WPARAM wParam, LPARAM lParam) { /*
HMENU hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT));
CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM)hMenu, 0);
- TrustLevel level = (TrustLevel) db_dword_get(hContact, MODULENAME, "TrustLevel", TRUST_NOT_PRIVATE);
+ TrustLevel level = (TrustLevel) db_get_dw(hContact, MODULENAME, "TrustLevel", TRUST_NOT_PRIVATE);
MENUITEMINFO minfo = {0};
minfo.cbSize = sizeof(MENUITEMINFO);
minfo.fMask = MIIM_STRING|MIIM_STATE|MIIM_BITMAP;
@@ -195,7 +195,7 @@ void SetEncryptionStatus(HANDLE hContact, TrustLevel level) { CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid2);
}
if (options.bHaveButtonsBar) CallService(MS_BB_SETBUTTONSTATE, (WPARAM)hContact, (LPARAM)&button);
- db_dword_set(hContact, MODULENAME, "TrustLevel", level);
+ db_set_dw(hContact, MODULENAME, "TrustLevel", level);
if (!chat_room && options.bHaveMetaContacts) {
HANDLE hMeta = (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
|