summaryrefslogtreecommitdiff
path: root/plugins/Scriver/src/chat
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Scriver/src/chat')
-rw-r--r--plugins/Scriver/src/chat/clist.cpp24
-rw-r--r--plugins/Scriver/src/chat/main.cpp2
-rw-r--r--plugins/Scriver/src/chat/manager.cpp4
-rw-r--r--plugins/Scriver/src/chat/options.cpp76
-rw-r--r--plugins/Scriver/src/chat/services.cpp8
-rw-r--r--plugins/Scriver/src/chat/tools.cpp6
-rw-r--r--plugins/Scriver/src/chat/window.cpp32
7 files changed, 76 insertions, 76 deletions
diff --git a/plugins/Scriver/src/chat/clist.cpp b/plugins/Scriver/src/chat/clist.cpp
index 130ddeff2d..9ce653839e 100644
--- a/plugins/Scriver/src/chat/clist.cpp
+++ b/plugins/Scriver/src/chat/clist.cpp
@@ -66,7 +66,7 @@ HANDLE CList_AddRoom(const char* pszModule, const TCHAR* pszRoom, const TCHAR* p
} }
END_GROUPLOOP:
- DBWriteContactSettingWord(hContact, pszModule, "Status", ID_STATUS_OFFLINE);
+ db_set_w(hContact, pszModule, "Status", ID_STATUS_OFFLINE);
DBWriteContactSettingTString(hContact, pszModule, "Nick", pszDisplayName );
return hContact;
}
@@ -82,8 +82,8 @@ END_GROUPLOOP:
DBDeleteContactSetting(hContact, "CList", "Group");
DBWriteContactSettingTString( hContact, pszModule, "Nick", pszDisplayName );
DBWriteContactSettingTString( hContact, pszModule, "ChatRoomID", pszRoom );
- DBWriteContactSettingByte(hContact, pszModule, "ChatRoom", (BYTE)iType);
- DBWriteContactSettingWord(hContact, pszModule, "Status", ID_STATUS_OFFLINE);
+ db_set_b(hContact, pszModule, "ChatRoom", (BYTE)iType);
+ db_set_w(hContact, pszModule, "Status", ID_STATUS_OFFLINE);
return hContact;
}
@@ -91,8 +91,8 @@ BOOL CList_SetOffline(HANDLE hContact, BOOL bHide)
{
if ( hContact ) {
char * szProto = GetContactProto(hContact);
- DBWriteContactSettingWord(hContact, szProto,"ApparentMode",(LPARAM) 0);
- DBWriteContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ db_set_w(hContact, szProto,"ApparentMode",(LPARAM) 0);
+ db_set_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
return TRUE;
}
@@ -106,10 +106,10 @@ BOOL CList_SetAllOffline(BOOL bHide, const char *pszModule)
char *szProto = GetContactProto(hContact);
if ( MM_FindModule( szProto )) {
if (!pszModule || (pszModule && !strcmp(pszModule, szProto))) {
- int i = DBGetContactSettingByte(hContact, szProto, "ChatRoom", 0);
+ int i = db_get_b(hContact, szProto, "ChatRoom", 0);
if ( i != 0 ) {
- DBWriteContactSettingWord(hContact, szProto,"ApparentMode",(LPARAM)(WORD) 0);
- DBWriteContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ db_set_w(hContact, szProto,"ApparentMode",(LPARAM)(WORD) 0);
+ db_set_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
}
}
}
@@ -129,7 +129,7 @@ int CList_RoomDoubleclicked(WPARAM wParam,LPARAM lParam)
szProto = GetContactProto(hContact);
if ( MM_FindModule(szProto)) {
- if (DBGetContactSettingByte(hContact, szProto, "ChatRoom", 0) == 0)
+ if (db_get_b(hContact, szProto, "ChatRoom", 0) == 0)
return 0;
if ( !DBGetContactSettingTString( hContact, szProto, "ChatRoomID", &dbv )) {
@@ -137,7 +137,7 @@ int CList_RoomDoubleclicked(WPARAM wParam,LPARAM lParam)
if ( si ) {
// is the "toggle visibility option set, so we need to close the window?
if (si->hWnd != NULL
- && DBGetContactSettingByte(NULL, "Chat", "ToggleVisibility", 0)==1
+ && db_get_b(NULL, "Chat", "ToggleVisibility", 0)==1
&& !CallService(MS_CLIST_GETEVENT, (WPARAM)hContact, 0)
&& IsWindowVisible(si->hWnd)
&& !IsIconic(si->hWnd))
@@ -202,7 +202,7 @@ int CList_PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
if ( szProto ) {
// display this menu item only for chats
- if ( DBGetContactSettingByte( hContact, szProto, "ChatRoom", 0 )) {
+ if ( db_get_b( hContact, szProto, "ChatRoom", 0 )) {
// still hide it for offline protos
if ( CallProtoService( szProto, PS_GETSTATUS, 0, 0 ) != ID_STATUS_OFFLINE ) {
clmi.flags &= ~CMIF_HIDDEN;
@@ -296,7 +296,7 @@ HANDLE CList_FindRoom ( const char* pszModule, const TCHAR* pszRoom)
while (hContact) {
char *szProto = GetContactProto(hContact);
if (szProto && !lstrcmpiA(szProto, pszModule)) {
- if ( DBGetContactSettingByte( hContact, szProto, "ChatRoom", 0) != 0 ) {
+ if ( db_get_b( hContact, szProto, "ChatRoom", 0) != 0 ) {
DBVARIANT dbv;
if ( !DBGetContactSettingTString( hContact, szProto, "ChatRoomID", &dbv )) {
if ( !lstrcmpi(dbv.ptszVal, pszRoom)) {
diff --git a/plugins/Scriver/src/chat/main.cpp b/plugins/Scriver/src/chat/main.cpp
index d6e5895a02..5009e3bdbc 100644
--- a/plugins/Scriver/src/chat/main.cpp
+++ b/plugins/Scriver/src/chat/main.cpp
@@ -49,7 +49,7 @@ int Chat_Load()
int Chat_Unload(void)
{
- DBWriteContactSettingWord(NULL, "Chat", "SplitterX", (WORD)g_Settings.iSplitterX);
+ db_set_w(NULL, "Chat", "SplitterX", (WORD)g_Settings.iSplitterX);
CList_SetAllOffline(TRUE, NULL);
diff --git a/plugins/Scriver/src/chat/manager.cpp b/plugins/Scriver/src/chat/manager.cpp
index 0807ea9f7e..28eb7e91ff 100644
--- a/plugins/Scriver/src/chat/manager.cpp
+++ b/plugins/Scriver/src/chat/manager.cpp
@@ -117,7 +117,7 @@ int SM_RemoveSession(const TCHAR* pszID, const char* pszModule, BOOL removeConta
{
CList_SetOffline(pTemp->windowData.hContact, pTemp->iType == GCW_CHATROOM?TRUE:FALSE);
/* if (pTemp->iType != GCW_SERVER)
- DBWriteContactSettingByte(pTemp->windowData.hContact, "CList", "Hidden", 1);*/
+ db_set_b(pTemp->windowData.hContact, "CList", "Hidden", 1);*/
}
DBWriteContactSettingString(pTemp->windowData.hContact, pTemp->pszModule , "Topic", "");
DBWriteContactSettingString(pTemp->windowData.hContact, pTemp->pszModule, "StatusBar", "");
@@ -587,7 +587,7 @@ BOOL SM_SetStatus(const TCHAR* pszID, const char* pszModule, int wStatus)
if ( pTemp->iType != GCW_SERVER && wStatus != ID_STATUS_OFFLINE )
DBDeleteContactSetting(pTemp->windowData.hContact, "CList", "Hidden");
- DBWriteContactSettingWord(pTemp->windowData.hContact, pTemp->pszModule, "Status", (WORD)wStatus);
+ db_set_w(pTemp->windowData.hContact, pTemp->pszModule, "Status", (WORD)wStatus);
}
PostMessage(pTemp->hWnd, GC_FIXTABICONS, 0, 0);
diff --git a/plugins/Scriver/src/chat/options.cpp b/plugins/Scriver/src/chat/options.cpp
index 86c21c65df..4a82d7da0d 100644
--- a/plugins/Scriver/src/chat/options.cpp
+++ b/plugins/Scriver/src/chat/options.cpp
@@ -133,7 +133,7 @@ static void FillBranch(HWND hwndTree, HTREEITEM hParent, struct branch_t *branch
if (branch[i].iMode)
iState = ((DBGetContactSettingDword(NULL, "Chat", branch[i].szDBName, defaultval)&branch[i].iMode)&branch[i].iMode)!=0?2:1;
else
- iState = DBGetContactSettingByte(NULL, "Chat", branch[i].szDBName, branch[i].bDefault)!=0?2:1;
+ iState = db_get_b(NULL, "Chat", branch[i].szDBName, branch[i].bDefault)!=0?2:1;
tvis.item.state=INDEXTOSTATEIMAGEMASK(iState);
branch[i].hItem = TreeView_InsertItem(hwndTree, &tvis);
}
@@ -158,7 +158,7 @@ static void SaveBranch(HWND hwndTree, struct branch_t *branch, int nValues)
iState |= GC_EVENT_REMOVESTATUS;
DBWriteContactSettingDword(NULL, "Chat", branch[i].szDBName, (DWORD)iState);
}
- else DBWriteContactSettingByte(NULL, "Chat", branch[i].szDBName, bChecked);
+ else db_set_b(NULL, "Chat", branch[i].szDBName, bChecked);
} }
static void CheckHeading(HWND hwndTree, HTREEITEM hHeading)
@@ -253,9 +253,9 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
TranslateDialogDefault(hwndDlg);
SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_CHAT_CHECKBOXES),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_CHAT_CHECKBOXES),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES);
SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN2,UDM_SETRANGE,0,MAKELONG(255,10));
- SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN2,UDM_SETPOS,0,MAKELONG(DBGetContactSettingByte(NULL,"Chat","NicklistRowDist",12),0));
- hListHeading1 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), TranslateT("Appearance and functionality of chat windows"), DBGetContactSettingByte(NULL, "Chat", "Branch1Exp", 0)?TRUE:FALSE);
- hListHeading4 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), TranslateT("Icons to display in the tray"), DBGetContactSettingByte(NULL, "Chat", "Branch5Exp", 0)?TRUE:FALSE);
+ SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN2,UDM_SETPOS,0,MAKELONG(db_get_b(NULL,"Chat","NicklistRowDist",12),0));
+ hListHeading1 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), TranslateT("Appearance and functionality of chat windows"), db_get_b(NULL, "Chat", "Branch1Exp", 0)?TRUE:FALSE);
+ hListHeading4 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), TranslateT("Icons to display in the tray"), db_get_b(NULL, "Chat", "Branch5Exp", 0)?TRUE:FALSE);
FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading1, branch1, SIZEOF(branch1), 0);
FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading4, branch4, SIZEOF(branch4), 0x1000);
SendMessage(hwndDlg, OPT_FIXHEADINGS, 0, 0);
@@ -336,7 +336,7 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
iLen = SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN2,UDM_GETPOS,0,0);
if (iLen > 0)
- DBWriteContactSettingByte(NULL, "Chat", "NicklistRowDist", (BYTE)iLen);
+ db_set_b(NULL, "Chat", "NicklistRowDist", (BYTE)iLen);
else
DBDeleteContactSetting(NULL, "Chat", "NicklistRowDist");
SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch1, SIZEOF(branch1));
@@ -352,9 +352,9 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
case WM_DESTROY:
{
BYTE b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading1, TVIS_EXPANDED)&TVIS_EXPANDED?1:0;
- DBWriteContactSettingByte(NULL, "Chat", "Branch1Exp", b);
+ db_set_b(NULL, "Chat", "Branch1Exp", b);
b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading4, TVIS_EXPANDED)&TVIS_EXPANDED?1:0;
- DBWriteContactSettingByte(NULL, "Chat", "Branch5Exp", b);
+ db_set_b(NULL, "Chat", "Branch5Exp", b);
}
break;
}
@@ -431,8 +431,8 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_LIMIT), g_Settings.LoggingEnabled?TRUE:FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_LIMITTEXT2), g_Settings.LoggingEnabled?TRUE:FALSE);
- hListHeading2 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), TranslateT("Appearance"), DBGetContactSettingByte(NULL, "Chat", "Branch2Exp", 0)?TRUE:FALSE);
- hListHeading3 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), TranslateT("Default events to show in new chat rooms if the \'event filter\' is enabled"), DBGetContactSettingByte(NULL, "Chat", "Branch3Exp", 0)?TRUE:FALSE);
+ hListHeading2 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), TranslateT("Appearance"), db_get_b(NULL, "Chat", "Branch2Exp", 0)?TRUE:FALSE);
+ hListHeading3 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), TranslateT("Default events to show in new chat rooms if the \'event filter\' is enabled"), db_get_b(NULL, "Chat", "Branch3Exp", 0)?TRUE:FALSE);
FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading2, branch2, SIZEOF(branch2), 0x0);
FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading3, branch3, SIZEOF(branch3), 0x03E0);
SendMessage(hwndDlg, OPT_FIXHEADINGS, 0, 0);
@@ -598,15 +598,15 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
else DBDeleteContactSetting(NULL, "Chat", "HeaderOutgoing");
g_Settings.HighlightEnabled = IsDlgButtonChecked(hwndDlg, IDC_CHAT_HIGHLIGHT) == BST_CHECKED?TRUE:FALSE;
- DBWriteContactSettingByte(NULL, "Chat", "HighlightEnabled", (BYTE)g_Settings.HighlightEnabled);
+ db_set_b(NULL, "Chat", "HighlightEnabled", (BYTE)g_Settings.HighlightEnabled);
g_Settings.LoggingEnabled = IsDlgButtonChecked(hwndDlg, IDC_CHAT_LOGGING) == BST_CHECKED?TRUE:FALSE;
- DBWriteContactSettingByte(NULL, "Chat", "LoggingEnabled", (BYTE)g_Settings.LoggingEnabled);
+ db_set_b(NULL, "Chat", "LoggingEnabled", (BYTE)g_Settings.LoggingEnabled);
iLen = SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN2,UDM_GETPOS,0,0);
- DBWriteContactSettingWord(NULL, "Chat", "LogLimit", (WORD)iLen);
+ db_set_w(NULL, "Chat", "LogLimit", (WORD)iLen);
iLen = SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN3,UDM_GETPOS,0,0);
- DBWriteContactSettingWord(NULL, "Chat", "LoggingLimit", (WORD)iLen);
+ db_set_w(NULL, "Chat", "LoggingLimit", (WORD)iLen);
SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch2, SIZEOF(branch2));
SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch3, SIZEOF(branch3));
@@ -616,11 +616,11 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
g_Settings.dwIconFlags = DBGetContactSettingDword(NULL, "Chat", "IconFlags", 0x0000);
g_Settings.dwTrayIconFlags = DBGetContactSettingDword(NULL, "Chat", "TrayIconFlags", 0x1000);
g_Settings.dwPopupFlags = DBGetContactSettingDword(NULL, "Chat", "PopupFlags", 0x0000);
- g_Settings.StripFormat = (BOOL)DBGetContactSettingByte(NULL, "Chat", "TrimFormatting", 0);
- g_Settings.TrayIconInactiveOnly = (BOOL)DBGetContactSettingByte(NULL, "Chat", "TrayIconInactiveOnly", 1);
- g_Settings.PopUpInactiveOnly = (BOOL)DBGetContactSettingByte(NULL, "Chat", "PopUpInactiveOnly", 1);
+ g_Settings.StripFormat = (BOOL)db_get_b(NULL, "Chat", "TrimFormatting", 0);
+ g_Settings.TrayIconInactiveOnly = (BOOL)db_get_b(NULL, "Chat", "TrayIconInactiveOnly", 1);
+ g_Settings.PopUpInactiveOnly = (BOOL)db_get_b(NULL, "Chat", "PopUpInactiveOnly", 1);
- g_Settings.LogIndentEnabled = (DBGetContactSettingByte(NULL, "Chat", "LogIndentEnabled", 1) != 0)?TRUE:FALSE;
+ g_Settings.LogIndentEnabled = (db_get_b(NULL, "Chat", "LogIndentEnabled", 1) != 0)?TRUE:FALSE;
MM_FontsChanged();
SM_BroadcastMessage(NULL, GC_SETWNDPROPS, 0, 0, TRUE);
return TRUE;
@@ -640,9 +640,9 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
}
{
BYTE b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading2, TVIS_EXPANDED)&TVIS_EXPANDED?1:0;
- DBWriteContactSettingByte(NULL, "Chat", "Branch2Exp", b);
+ db_set_b(NULL, "Chat", "Branch2Exp", b);
b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading3, TVIS_EXPANDED)&TVIS_EXPANDED?1:0;
- DBWriteContactSettingByte(NULL, "Chat", "Branch3Exp", b);
+ db_set_b(NULL, "Chat", "Branch3Exp", b);
}
break;
}
@@ -725,11 +725,11 @@ static INT_PTR CALLBACK DlgProcOptionsPopup(HWND hwndDlg,UINT uMsg,WPARAM wParam
iLen = 1;
g_Settings.iPopupStyle = iLen;
- DBWriteContactSettingByte(NULL, "Chat", "PopupStyle", (BYTE)iLen);
+ db_set_b(NULL, "Chat", "PopupStyle", (BYTE)iLen);
iLen = SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN1,UDM_GETPOS,0,0);
g_Settings.iPopupTimeout = iLen;
- DBWriteContactSettingWord(NULL, "Chat", "PopupTimeout", (WORD)iLen);
+ db_set_w(NULL, "Chat", "PopupTimeout", (WORD)iLen);
g_Settings.crPUBkgColour = SendDlgItemMessage(hwndDlg,IDC_CHAT_BKG,CPM_GETCOLOUR,0,0);
DBWriteContactSettingDword(NULL, "Chat", "PopupColorBG", (DWORD)SendDlgItemMessage(hwndDlg,IDC_CHAT_BKG,CPM_GETCOLOUR,0,0));
@@ -773,34 +773,34 @@ void LoadGlobalSettings(void)
{
LOGFONT lf;
- g_Settings.LogLimitNames = DBGetContactSettingByte(NULL, "Chat", "LogLimitNames", 1);
- g_Settings.ShowTime = DBGetContactSettingByte(NULL, "Chat", "ShowTimeStamp", 1);
- g_Settings.SoundsFocus = DBGetContactSettingByte(NULL, "Chat", "SoundsFocus", 0);
- g_Settings.ShowTimeIfChanged = (BOOL)DBGetContactSettingByte(NULL, "Chat", "ShowTimeStampIfChanged", 0);
- g_Settings.TimeStampEventColour = (BOOL)DBGetContactSettingByte(NULL, "Chat", "TimeStampEventColour", 0);
+ g_Settings.LogLimitNames = db_get_b(NULL, "Chat", "LogLimitNames", 1);
+ g_Settings.ShowTime = db_get_b(NULL, "Chat", "ShowTimeStamp", 1);
+ g_Settings.SoundsFocus = db_get_b(NULL, "Chat", "SoundsFocus", 0);
+ g_Settings.ShowTimeIfChanged = (BOOL)db_get_b(NULL, "Chat", "ShowTimeStampIfChanged", 0);
+ g_Settings.TimeStampEventColour = (BOOL)db_get_b(NULL, "Chat", "TimeStampEventColour", 0);
g_Settings.iEventLimit = DBGetContactSettingWord(NULL, "Chat", "LogLimit", 100);
g_Settings.dwIconFlags = DBGetContactSettingDword(NULL, "Chat", "IconFlags", 0x0000);
g_Settings.dwTrayIconFlags = DBGetContactSettingDword(NULL, "Chat", "TrayIconFlags", 0x1000);
g_Settings.dwPopupFlags = DBGetContactSettingDword(NULL, "Chat", "PopupFlags", 0x0000);
g_Settings.LoggingLimit = DBGetContactSettingWord(NULL, "Chat", "LoggingLimit", 100);
- g_Settings.LoggingEnabled = (BOOL)DBGetContactSettingByte(NULL, "Chat", "LoggingEnabled", 0);
- g_Settings.FlashWindow = (BOOL)DBGetContactSettingByte(NULL, "Chat", "FlashWindow", 0);
- g_Settings.HighlightEnabled = (BOOL)DBGetContactSettingByte(NULL, "Chat", "HighlightEnabled", 1);
+ g_Settings.LoggingEnabled = (BOOL)db_get_b(NULL, "Chat", "LoggingEnabled", 0);
+ g_Settings.FlashWindow = (BOOL)db_get_b(NULL, "Chat", "FlashWindow", 0);
+ g_Settings.HighlightEnabled = (BOOL)db_get_b(NULL, "Chat", "HighlightEnabled", 1);
g_Settings.crUserListColor = DBGetContactSettingDword(NULL, "ChatFonts", "Font18Col", RGB(0,0,0));
g_Settings.crUserListBGColor = DBGetContactSettingDword(NULL, "Chat", "ColorNicklistBG", GetSysColor(COLOR_WINDOW));
g_Settings.crUserListSelectedBGColor = DBGetContactSettingDword(NULL, "Chat", "ColorNicklistSelectedBG", GetSysColor(COLOR_HIGHLIGHT));
g_Settings.crUserListHeadingsColor = DBGetContactSettingDword(NULL, "ChatFonts", "Font19Col", RGB(170,170,170));
g_Settings.crLogBackground = DBGetContactSettingDword(NULL, "Chat", "ColorLogBG", GetSysColor(COLOR_WINDOW));
- g_Settings.StripFormat = (BOOL)DBGetContactSettingByte(NULL, "Chat", "StripFormatting", 0);
- g_Settings.TrayIconInactiveOnly = (BOOL)DBGetContactSettingByte(NULL, "Chat", "TrayIconInactiveOnly", 1);
- g_Settings.PopUpInactiveOnly = (BOOL)DBGetContactSettingByte(NULL, "Chat", "PopUpInactiveOnly", 1);
- g_Settings.AddColonToAutoComplete = (BOOL)DBGetContactSettingByte(NULL, "Chat", "AddColonToAutoComplete", 1);
- g_Settings.iPopupStyle = DBGetContactSettingByte(NULL, "Chat", "PopupStyle", 1);
+ g_Settings.StripFormat = (BOOL)db_get_b(NULL, "Chat", "StripFormatting", 0);
+ g_Settings.TrayIconInactiveOnly = (BOOL)db_get_b(NULL, "Chat", "TrayIconInactiveOnly", 1);
+ g_Settings.PopUpInactiveOnly = (BOOL)db_get_b(NULL, "Chat", "PopUpInactiveOnly", 1);
+ g_Settings.AddColonToAutoComplete = (BOOL)db_get_b(NULL, "Chat", "AddColonToAutoComplete", 1);
+ g_Settings.iPopupStyle = db_get_b(NULL, "Chat", "PopupStyle", 1);
g_Settings.iPopupTimeout = DBGetContactSettingWord(NULL, "Chat", "PopupTimeout", 3);
g_Settings.crPUBkgColour = DBGetContactSettingDword(NULL, "Chat", "PopupColorBG", GetSysColor(COLOR_WINDOW));
g_Settings.crPUTextColour = DBGetContactSettingDword(NULL, "Chat", "PopupColorText", 0);
- g_Settings.ShowContactStatus = DBGetContactSettingByte(NULL, "Chat", "ShowContactStatus", 0);
- g_Settings.ContactStatusFirst = DBGetContactSettingByte(NULL, "Chat", "ContactStatusFirst", 0);
+ g_Settings.ShowContactStatus = db_get_b(NULL, "Chat", "ShowContactStatus", 0);
+ g_Settings.ContactStatusFirst = db_get_b(NULL, "Chat", "ContactStatusFirst", 0);
InitSetting( &g_Settings.pszTimeStamp, "HeaderTime", _T("[%H:%M]"));
InitSetting( &g_Settings.pszTimeStampLog, "LogTimestamp", _T("[%d %b %y %H:%M]"));
@@ -816,7 +816,7 @@ void LoadGlobalSettings(void)
}
else lstrcpyn(g_Settings.pszLogDir, DEFLOGFILENAME, MAX_PATH);
- g_Settings.LogIndentEnabled = (DBGetContactSettingByte(NULL, "Chat", "LogIndentEnabled", 1) != 0)?TRUE:FALSE;
+ g_Settings.LogIndentEnabled = (db_get_b(NULL, "Chat", "LogIndentEnabled", 1) != 0)?TRUE:FALSE;
if (g_Settings.MessageBoxFont)
DeleteObject(g_Settings.MessageBoxFont);
diff --git a/plugins/Scriver/src/chat/services.cpp b/plugins/Scriver/src/chat/services.cpp
index cb1375c491..6e798f364e 100644
--- a/plugins/Scriver/src/chat/services.cpp
+++ b/plugins/Scriver/src/chat/services.cpp
@@ -222,8 +222,8 @@ static INT_PTR Service_NewChat(WPARAM wParam, LPARAM lParam)
si->iSplitterX = g_Settings.iSplitterX;
si->iSplitterY = g_Settings.iSplitterY;
si->iLogFilterFlags = (int)DBGetContactSettingDword(NULL, "Chat", "FilterFlags", 0x03E0);
- si->bFilterEnabled = DBGetContactSettingByte(NULL, "Chat", "FilterEnabled", 0);
- si->bNicklistEnabled = DBGetContactSettingByte(NULL, "Chat", "ShowNicklist", 1);
+ si->bFilterEnabled = db_get_b(NULL, "Chat", "FilterEnabled", 0);
+ si->bNicklistEnabled = db_get_b(NULL, "Chat", "ShowNicklist", 1);
if ( !( gcw->dwFlags & GC_UNICODE )) {
si->pszID = mir_strdup( gcw->pszID );
@@ -302,7 +302,7 @@ static INT_PTR DoControl(GCEVENT * gce, WPARAM wp)
SESSION_INFO* si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
if (si) {
si->bInitDone = TRUE;
- if (wp != SESSION_INITDONE || DBGetContactSettingByte(NULL, "Chat", "PopupOnJoin", 0) == 0)
+ if (wp != SESSION_INITDONE || db_get_b(NULL, "Chat", "PopupOnJoin", 0) == 0)
ShowRoom(si, wp, TRUE);
return 0;
} }
@@ -506,7 +506,7 @@ static INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam)
if ( gce->pszText ) {
replaceStr( &si->ptszTopic, gce->ptszText);
DBWriteContactSettingTString( si->windowData.hContact, si->pszModule , "Topic", RemoveFormatting( si->ptszTopic ));
- if ( DBGetContactSettingByte( NULL, "Chat", "TopicOnClist", 0 ))
+ if ( db_get_b( NULL, "Chat", "TopicOnClist", 0 ))
DBWriteContactSettingTString( si->windowData.hContact, "CList" , "StatusMsg", RemoveFormatting( si->ptszTopic ));
} }
break;
diff --git a/plugins/Scriver/src/chat/tools.cpp b/plugins/Scriver/src/chat/tools.cpp
index 7d12ba29b9..5d528f75dc 100644
--- a/plugins/Scriver/src/chat/tools.cpp
+++ b/plugins/Scriver/src/chat/tools.cpp
@@ -280,9 +280,9 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO* si, GCEVENT * gce, BOOL bHighligh
gce->pDest->iType |= GC_EVENT_HIGHLIGHT;
if (bInactive || !g_Settings.SoundsFocus)
SkinPlaySound("ChatHighlight");
- if (bInactive && si->hWnd && DBGetContactSettingByte(NULL, "Chat", "FlashWindowHighlight", 0) != 0)
+ if (bInactive && si->hWnd && db_get_b(NULL, "Chat", "FlashWindowHighlight", 0) != 0)
SendMessage(GetParent(si->hWnd), CM_STARTFLASHING, 0, 0);
- if (DBGetContactSettingByte(si->windowData.hContact, "CList", "Hidden", 0) != 0)
+ if (db_get_b(si->windowData.hContact, "CList", "Hidden", 0) != 0)
DBDeleteContactSetting(si->windowData.hContact, "CList", "Hidden");
if (bInactive)
DoTrayIcon(si, gce);
@@ -334,7 +334,7 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO* si, GCEVENT * gce, BOOL bHighligh
if (bInactive && !( si->wState & STATE_TALK )) {
si->wState |= STATE_TALK;
- DBWriteContactSettingWord(si->windowData.hContact, si->pszModule,"ApparentMode",(LPARAM)(WORD) 40071);
+ db_set_w(si->windowData.hContact, si->pszModule,"ApparentMode",(LPARAM)(WORD) 40071);
}
if (bInactive && si->hWnd)
SendMessage(si->hWnd, GC_SETTABHIGHLIGHT, 0, 0);
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp
index 3a9a9e0350..406207adbb 100644
--- a/plugins/Scriver/src/chat/window.cpp
+++ b/plugins/Scriver/src/chat/window.cpp
@@ -265,11 +265,11 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
dat->szSearchQuery = NULL;
mir_free(dat->szSearchResult);
dat->szSearchResult = NULL;
- if (( isCtrl != 0 ) ^ (0 != DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_SENDONENTER, SRMSGDEFSET_SENDONENTER))) {
+ if (( isCtrl != 0 ) ^ (0 != db_get_b(NULL, SRMMMOD, SRMSGSET_SENDONENTER, SRMSGDEFSET_SENDONENTER))) {
PostMessage(GetParent(hwnd), WM_COMMAND, IDOK, 0);
return 0;
}
- if (DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_SENDONDBLENTER, SRMSGDEFSET_SENDONDBLENTER)) {
+ if (db_get_b(NULL, SRMMMOD, SRMSGSET_SENDONDBLENTER, SRMSGDEFSET_SENDONDBLENTER)) {
if (dat->lastEnterTime + 2 < time(NULL))
dat->lastEnterTime = time(NULL);
else {
@@ -627,7 +627,7 @@ static LRESULT CALLBACK ButtonSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, L
HWND hColor = GetDlgItem(GetParent(hwnd), IDC_CHAT_COLOR);
HWND hBGColor = GetDlgItem(GetParent(hwnd), IDC_CHAT_BKGCOLOR);
- if (DBGetContactSettingByte(NULL, "Chat", "RightClickFilter", 0) != 0) {
+ if (db_get_b(NULL, "Chat", "RightClickFilter", 0) != 0) {
if (hFilter == hwnd)
SendMessage(GetParent(hwnd), GC_SHOWFILTERMENU, 0, 0);
if (hColor == hwnd)
@@ -1118,7 +1118,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_LIMITTEXT, (WPARAM)sizeof(TCHAR)*0x7FFFFFFF, 0);
SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_SETOLECALLBACK, 0, (LPARAM) & reOleCallback);
- if (DBGetContactSettingByte(NULL, "Chat", "UseIEView", 0)) {
+ if (db_get_b(NULL, "Chat", "UseIEView", 0)) {
IEVIEWWINDOW ieWindow;
IEVIEWEVENT iee;
@@ -1191,10 +1191,10 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
ih = GetTextPixelSize( _T("AQG_glo'"), g_Settings.UserListFont,FALSE);
ih2 = GetTextPixelSize( _T("AQG_glo'"), g_Settings.UserListHeadingsFont,FALSE);
- height = DBGetContactSettingByte(NULL, "Chat", "NicklistRowDist", 12);
+ height = db_get_b(NULL, "Chat", "NicklistRowDist", 12);
font = ih > ih2?ih:ih2;
// make sure we have space for icon!
- if (DBGetContactSettingByte(NULL, "Chat", "ShowContactStatus", 0))
+ if (db_get_b(NULL, "Chat", "ShowContactStatus", 0))
font = font > 16 ? font : 16;
SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LIST), LB_SETITEMHEIGHT, 0, (LPARAM)height > font ? height : font);
@@ -1384,7 +1384,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
si->wState |= GC_EVENT_HIGHLIGHT;
SendMessage(si->hWnd, GC_FIXTABICONS, 0, 0);
SendMessage(hwndDlg, DM_UPDATETITLEBAR, 0, 0);
- if (DBGetContactSettingByte(NULL, "Chat", "FlashWindowHighlight", 0) != 0 && GetActiveWindow() != hwndDlg && GetForegroundWindow() != GetParent(hwndDlg))
+ if (db_get_b(NULL, "Chat", "FlashWindowHighlight", 0) != 0 && GetActiveWindow() != hwndDlg && GetForegroundWindow() != GetParent(hwndDlg))
SendMessage(GetParent(si->hWnd), CM_STARTFLASHING, 0, 0);
}
break;
@@ -1403,7 +1403,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
if (si->wState & STATE_TALK) {
si->wState &= ~STATE_TALK;
- DBWriteContactSettingWord(si->windowData.hContact, si->pszModule ,"ApparentMode",(LPARAM) 0);
+ db_set_w(si->windowData.hContact, si->pszModule ,"ApparentMode",(LPARAM) 0);
}
if (si->wState & GC_EVENT_HIGHLIGHT) {
@@ -1440,9 +1440,9 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
int ih = GetTextPixelSize( _T("AQGgl'"), g_Settings.UserListFont,FALSE);
int ih2 = GetTextPixelSize( _T("AQGg'"), g_Settings.UserListHeadingsFont,FALSE);
int font = ih > ih2?ih:ih2;
- int height = DBGetContactSettingByte(NULL, "Chat", "NicklistRowDist", 12);
+ int height = db_get_b(NULL, "Chat", "NicklistRowDist", 12);
// make sure we have space for icon!
- if (DBGetContactSettingByte(NULL, "Chat", "ShowContactStatus", 0))
+ if (db_get_b(NULL, "Chat", "ShowContactStatus", 0))
font = font > 16 ? font : 16;
mis->itemHeight = height > font?height:font;
return TRUE;
@@ -1553,7 +1553,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
if (CallService(MS_CLIST_GETEVENT, (WPARAM)si->windowData.hContact, 0))
CallService(MS_CLIST_REMOVEEVENT, (WPARAM)si->windowData.hContact, (LPARAM)"chaticon");
si->wState &= ~STATE_TALK;
- DBWriteContactSettingWord(si->windowData.hContact, si->pszModule ,"ApparentMode",(LPARAM) 0);
+ db_set_w(si->windowData.hContact, si->pszModule ,"ApparentMode",(LPARAM) 0);
SendMessage(hwndDlg, GC_CLOSEWINDOW, 0, 0);
return TRUE;
@@ -1566,7 +1566,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
goto LABEL_SHOWWINDOW;
case SESSION_INITDONE:
- if (DBGetContactSettingByte(NULL, "Chat", "PopupOnJoin", 0)!=0)
+ if (db_get_b(NULL, "Chat", "PopupOnJoin", 0)!=0)
return TRUE;
// fall through
case WINDOW_VISIBLE:
@@ -1693,7 +1693,7 @@ LABEL_SHOWWINDOW:
SetActiveSession(si->ptszID, si->pszModule);
if (DBGetContactSettingWord(si->windowData.hContact, si->pszModule ,"ApparentMode", 0) != 0)
- DBWriteContactSettingWord(si->windowData.hContact, si->pszModule ,"ApparentMode",(LPARAM) 0);
+ db_set_w(si->windowData.hContact, si->pszModule ,"ApparentMode",(LPARAM) 0);
if (CallService(MS_CLIST_GETEVENT, (WPARAM)si->windowData.hContact, 0))
CallService(MS_CLIST_REMOVEEVENT, (WPARAM)si->windowData.hContact, (LPARAM)"chaticon");
}
@@ -1901,7 +1901,7 @@ LABEL_SHOWWINDOW:
si->bFilterEnabled = !si->bFilterEnabled;
SendDlgItemMessage(hwndDlg,IDC_CHAT_FILTER,BM_SETIMAGE,IMAGE_ICON,(LPARAM)GetCachedIcon(si->bFilterEnabled?"chat_filter":"chat_filter2"));
- if (si->bFilterEnabled && DBGetContactSettingByte(NULL, "Chat", "RightClickFilter", 0) == 0) {
+ if (si->bFilterEnabled && db_get_b(NULL, "Chat", "RightClickFilter", 0) == 0) {
SendMessage(hwndDlg, GC_SHOWFILTERMENU, 0, 0);
break;
}
@@ -1920,7 +1920,7 @@ LABEL_SHOWWINDOW:
break;
if (IsDlgButtonChecked(hwndDlg, IDC_CHAT_BKGCOLOR)) {
- if (DBGetContactSettingByte(NULL, "Chat", "RightClickFilter", 0) == 0)
+ if (db_get_b(NULL, "Chat", "RightClickFilter", 0) == 0)
SendMessage(hwndDlg, GC_SHOWCOLORCHOOSER, 0, (LPARAM)IDC_CHAT_BKGCOLOR);
else if (si->bBGSet){
cf.dwMask = CFM_BACKCOLOR;
@@ -1953,7 +1953,7 @@ LABEL_SHOWWINDOW:
break;
if (IsDlgButtonChecked(hwndDlg, IDC_CHAT_COLOR)) {
- if (DBGetContactSettingByte(NULL, "Chat", "RightClickFilter", 0) == 0)
+ if (db_get_b(NULL, "Chat", "RightClickFilter", 0) == 0)
SendMessage(hwndDlg, GC_SHOWCOLORCHOOSER, 0, (LPARAM)IDC_CHAT_COLOR);
else if (si->bFGSet) {
cf.dwMask = CFM_COLOR;