summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src/chat
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-06-27 15:34:33 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-06-27 15:34:33 +0000
commitb48741c8d0ed916d2cdd41956667ec4082ab245a (patch)
tree1d0e149514343e602495e85861649e173324fd01 /plugins/TabSRMM/src/chat
parentb1d29a5793fc80dd1c0d26e4ba900853fad41809 (diff)
obsolete helpers removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@5152 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src/chat')
-rw-r--r--plugins/TabSRMM/src/chat/clist.cpp26
-rw-r--r--plugins/TabSRMM/src/chat/log.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/main.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/manager.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/muchighlight.cpp32
-rw-r--r--plugins/TabSRMM/src/chat/options.cpp176
-rw-r--r--plugins/TabSRMM/src/chat/services.cpp34
-rw-r--r--plugins/TabSRMM/src/chat/tools.cpp36
-rw-r--r--plugins/TabSRMM/src/chat/window.cpp78
9 files changed, 194 insertions, 194 deletions
diff --git a/plugins/TabSRMM/src/chat/clist.cpp b/plugins/TabSRMM/src/chat/clist.cpp
index cab020142b..0d3efc5358 100644
--- a/plugins/TabSRMM/src/chat/clist.cpp
+++ b/plugins/TabSRMM/src/chat/clist.cpp
@@ -47,7 +47,7 @@ static HANDLE Clist_GroupExists(TCHAR *tszGroup)
do {
_itoa(i, str, 10);
- result = M->GetTString(0, "CListGroups", str, &dbv);
+ result = db_get_ts(0, "CListGroups", str, &dbv);
if (!result) {
match = (!_tcscmp(tszGroup, &dbv.ptszVal[1]) && (lstrlen(tszGroup) == lstrlen(&dbv.ptszVal[1])));
db_free(&dbv);
@@ -67,7 +67,7 @@ HANDLE CList_AddRoom(const char* pszModule, const TCHAR* pszRoom, const TCHAR* p
TCHAR pszGroup[50];
*pszGroup = '\0';
- if (!M->GetTString(NULL, "Chat", "AddToGroup", &dbv)) {
+ if (!db_get_ts(NULL, "Chat", "AddToGroup", &dbv)) {
if (lstrlen(dbv.ptszVal) > 0)
lstrcpyn(pszGroup, dbv.ptszVal, 50);
db_free(&dbv);
@@ -91,9 +91,9 @@ HANDLE CList_AddRoom(const char* pszModule, const TCHAR* pszRoom, const TCHAR* p
else
db_unset(hContact, "CList", "Group");
- M->WriteTString(hContact, pszModule, "Nick", pszDisplayName);
- M->WriteTString(hContact, pszModule, "ChatRoomID", pszRoom);
- M->WriteByte(hContact, pszModule, "ChatRoom", (BYTE)iType);
+ db_set_ts(hContact, pszModule, "Nick", pszDisplayName);
+ db_set_ts(hContact, pszModule, "ChatRoomID", pszRoom);
+ db_set_b(hContact, pszModule, "ChatRoom", (BYTE)iType);
db_set_w(hContact, pszModule, "Status", ID_STATUS_OFFLINE);
return hContact;
}
@@ -105,7 +105,7 @@ BOOL CList_SetOffline(HANDLE hContact, BOOL bHide)
if (szProto == NULL)
return FALSE;
- int i = M->GetByte(hContact, szProto, "ChatRoom", 0);
+ int i = db_get_b(hContact, szProto, "ChatRoom", 0);
db_set_w(hContact, szProto, "ApparentMode", (LPARAM)0);
db_set_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
return TRUE;
@@ -119,7 +119,7 @@ BOOL CList_SetAllOffline(BOOL bHide, const char *pszModule)
char *szProto = GetContactProto(hContact);
if (MM_FindModule(szProto)) {
if (!pszModule || (pszModule && !strcmp(pszModule, szProto))) {
- int i = M->GetByte(hContact, szProto, "ChatRoom", 0);
+ int i = db_get_b(hContact, szProto, "ChatRoom", 0);
if (i != 0) {
db_set_w(hContact, szProto, "ApparentMode", (LPARAM)(WORD) 0);
db_set_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
@@ -143,15 +143,15 @@ int CList_RoomDoubleclicked(WPARAM wParam, LPARAM lParam)
szProto = GetContactProto(hContact);
if (MM_FindModule(szProto)) {
- if (M->GetByte(hContact, szProto, "ChatRoom", 0) == 0)
+ if (db_get_b(hContact, szProto, "ChatRoom", 0) == 0)
return 0;
- if (!M->GetTString(hContact, szProto, "ChatRoomID", &dbv)) {
+ if (!db_get_ts(hContact, szProto, "ChatRoomID", &dbv)) {
SESSION_INFO* si = SM_FindSession(dbv.ptszVal, szProto);
if (si) {
// is the "toggle visibility option set, so we need to close the window?
if (si->hWnd != NULL
- && M->GetByte("Chat", "ToggleVisibility", 0) == 1
+ && M.GetByte("Chat", "ToggleVisibility", 0) == 1
&& !CallService(MS_CLIST_GETEVENT, (WPARAM)hContact, 0)
&& IsWindowVisible(si->hWnd)
&& !IsIconic(si->pContainer->hwnd)) {
@@ -218,7 +218,7 @@ int CList_PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
char *szProto = GetContactProto(hContact);
if ( szProto ) {
// display this menu item only for chats
- if ( M->GetByte(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) {
CLISTMENUITEM clmi = { sizeof(clmi) };
@@ -292,11 +292,11 @@ BOOL CList_AddEvent(HANDLE hContact, HICON Icon, HANDLE event, int type, const T
HANDLE CList_FindRoom(const char* pszModule, const TCHAR* pszRoom)
{
for (HANDLE hContact = db_find_first(pszModule); hContact; hContact = db_find_next(hContact, pszModule)) {
- if ( !M->GetByte(hContact, pszModule, "ChatRoom", 0))
+ if ( !db_get_b(hContact, pszModule, "ChatRoom", 0))
continue;
DBVARIANT dbv;
- if (!M->GetTString(hContact, pszModule, "ChatRoomID", &dbv)) {
+ if (!db_get_ts(hContact, pszModule, "ChatRoomID", &dbv)) {
if (!lstrcmpi(dbv.ptszVal, pszRoom)) {
db_free(&dbv);
return hContact;
diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp
index 0001d7e2cb..3cc58f65b8 100644
--- a/plugins/TabSRMM/src/chat/log.cpp
+++ b/plugins/TabSRMM/src/chat/log.cpp
@@ -1266,7 +1266,7 @@ void LoadMsgLogBitmaps(void)
else
iIconSize = sizeX;
- hBkgBrush = CreateSolidBrush(M->GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR_MUC, SRMSGDEFSET_BKGCOLOUR));
+ hBkgBrush = CreateSolidBrush(M.GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR_MUC, SRMSGDEFSET_BKGCOLOUR));
bih.biSize = sizeof(bih);
bih.biBitCount = 24;
bih.biCompression = BI_RGB;
diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp
index c3ffc5e0e9..8fbcdf565d 100644
--- a/plugins/TabSRMM/src/chat/main.cpp
+++ b/plugins/TabSRMM/src/chat/main.cpp
@@ -54,7 +54,7 @@ char *pszActiveWndModule = 0;
int Chat_Load()
{
- if (M->GetByte("forceDisableMUC", 0)) {
+ if (M.GetByte("forceDisableMUC", 0)) {
PluginConfig.m_chat_enabled = false;
return 0;
}
diff --git a/plugins/TabSRMM/src/chat/manager.cpp b/plugins/TabSRMM/src/chat/manager.cpp
index 88931e8b73..f87b52962a 100644
--- a/plugins/TabSRMM/src/chat/manager.cpp
+++ b/plugins/TabSRMM/src/chat/manager.cpp
@@ -121,7 +121,7 @@ int SM_RemoveSession(const TCHAR* pszID, const char* pszModule, bool removeConta
if (pTemp->hContact) {
CList_SetOffline(pTemp->hContact, pTemp->iType == GCW_CHATROOM ? TRUE : FALSE);
//if (pTemp->iType != GCW_SERVER)
- //db_set_b(pTemp->hContact, "CList", "Hidden", 1);
+ //db_set_b(0, pTemp->hContact, "CList", "Hidden", 1);
}
db_set_s(pTemp->hContact, pTemp->pszModule , "Topic", "");
db_set_s(pTemp->hContact, pTemp->pszModule, "StatusBar", "");
diff --git a/plugins/TabSRMM/src/chat/muchighlight.cpp b/plugins/TabSRMM/src/chat/muchighlight.cpp
index 79752fa472..c860988b25 100644
--- a/plugins/TabSRMM/src/chat/muchighlight.cpp
+++ b/plugins/TabSRMM/src/chat/muchighlight.cpp
@@ -59,17 +59,17 @@ void CMUCHighlight::init()
m_fInitialized = true;
- if (0 == M->GetTString(0, "Chat", "HighlightWords", &dbv)) {
+ if (0 == db_get_ts(0, "Chat", "HighlightWords", &dbv)) {
m_TextPatternString = dbv.ptszVal;
_wsetlocale(LC_ALL, L"");
wcslwr(m_TextPatternString);
}
- if (0 == M->GetTString(0, "Chat", "HighlightNames", &dbv))
+ if (0 == db_get_ts(0, "Chat", "HighlightNames", &dbv))
m_NickPatternString = dbv.ptszVal;
- m_dwFlags = M->GetByte("Chat", "HighlightEnabled", MATCH_TEXT);
- m_fHighlightMe = (M->GetByte("Chat", "HighlightMe", 1) ? true : false);
+ m_dwFlags = M.GetByte("Chat", "HighlightEnabled", MATCH_TEXT);
+ m_fHighlightMe = (M.GetByte("Chat", "HighlightMe", 1) ? true : false);
__try {
tokenize(m_TextPatternString, m_TextPatterns, m_iTextPatterns);
@@ -136,7 +136,7 @@ int CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dwF
if ((m_dwFlags & MATCH_TEXT) && (dwFlags & MATCH_TEXT) && (m_fHighlightMe || m_iTextPatterns > 0) && psi != 0) {
#ifdef __HLT_PERFSTATS
int words = 0;
- M->startTimer();
+ M.startTimer();
#endif
TCHAR *tszCleaned = ::RemoveFormatting(pgce->ptszText, true, true);
TCHAR *p = tszCleaned;
@@ -187,9 +187,9 @@ int CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dwF
skip_textpatterns:
#ifdef __HLT_PERFSTATS
- M->stopTimer(0);
+ M.stopTimer(0);
if (psi && psi->dat) {
- mir_sntprintf(psi->dat->szStatusBar, 100, _T("PERF text match: %d ticks = %f msec (%d words, %d patterns)"), (int)M->getTicks(), M->getMsec(), words, m_iTextPatterns);
+ mir_sntprintf(psi->dat->szStatusBar, 100, _T("PERF text match: %d ticks = %f msec (%d words, %d patterns)"), (int)M.getTicks(), M.getMsec(), words, m_iTextPatterns);
if (psi->dat->pContainer->hwndStatus)
::SendMessage(psi->dat->pContainer->hwndStatus, SB_SETTEXT, 0, (LPARAM)psi->dat->szStatusBar);
}
@@ -267,22 +267,22 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
TranslateDialogDefault(hwndDlg);
{
DBVARIANT dbv = {0};
- if ( !M->GetTString(0, "Chat", "HighlightWords", &dbv)) {
+ if ( !db_get_ts(0, "Chat", "HighlightWords", &dbv)) {
::SetDlgItemText(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN, dbv.ptszVal);
::db_free(&dbv);
}
- if ( !M->GetTString(0, "Chat", "HighlightNames", &dbv)) {
+ if ( !db_get_ts(0, "Chat", "HighlightNames", &dbv)) {
::SetDlgItemText(hwndDlg, IDC_HIGHLIGHTNICKPATTERN, dbv.ptszVal);
::db_free(&dbv);
}
- DWORD dwFlags = M->GetByte("Chat", "HighlightEnabled", MATCH_TEXT);
+ DWORD dwFlags = M.GetByte("Chat", "HighlightEnabled", MATCH_TEXT);
::CheckDlgButton(hwndDlg, IDC_HIGHLIGHTNICKENABLE, dwFlags & MATCH_NICKNAME ? BST_CHECKED : BST_UNCHECKED);
::CheckDlgButton(hwndDlg, IDC_HIGHLIGHTNICKUID, dwFlags & MATCH_UIN ? BST_CHECKED : BST_UNCHECKED);
::CheckDlgButton(hwndDlg, IDC_HIGHLIGHTTEXTENABLE, dwFlags & MATCH_TEXT ? BST_CHECKED : BST_UNCHECKED);
- ::CheckDlgButton(hwndDlg, IDC_HIGHLIGHTME, M->GetByte("Chat", "HighlightMe", 1) ? BST_CHECKED : BST_UNCHECKED);
+ ::CheckDlgButton(hwndDlg, IDC_HIGHLIGHTME, M.GetByte("Chat", "HighlightMe", 1) ? BST_CHECKED : BST_UNCHECKED);
::SendMessage(hwndDlg, WM_USER + 100, 0, 0);
}
@@ -324,16 +324,16 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
if (iLen) {
szBuf = reinterpret_cast<wchar_t *>(mir_alloc((iLen + 2) * sizeof(wchar_t)));
::GetDlgItemText(hwndDlg, IDC_HIGHLIGHTNICKPATTERN, szBuf, iLen + 1);
- M->WriteTString(0, "Chat", "HighlightNames",szBuf);
+ db_set_ts(0, "Chat", "HighlightNames",szBuf);
}
iLen = ::GetWindowTextLength(::GetDlgItem(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN));
if (iLen) {
szBuf = reinterpret_cast<TCHAR *>(mir_realloc(szBuf, sizeof(wchar_t) * (iLen + 2)));
::GetDlgItemText(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN, szBuf, iLen + 1);
- M->WriteTString(0, "Chat", "HighlightWords", szBuf);
+ db_set_ts(0, "Chat", "HighlightWords", szBuf);
}
- else M->WriteTString(0, "Chat", "HighlightWords", L"");
+ else db_set_ts(0, "Chat", "HighlightWords", L"");
mir_free(szBuf);
BYTE dwFlags = (::IsDlgButtonChecked(hwndDlg, IDC_HIGHLIGHTNICKENABLE) ? MATCH_NICKNAME : 0) |
@@ -342,8 +342,8 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
if (dwFlags & MATCH_NICKNAME)
dwFlags |= (::IsDlgButtonChecked(hwndDlg, IDC_HIGHLIGHTNICKUID) ? MATCH_UIN : 0);
- M->WriteByte("Chat", "HighlightEnabled", dwFlags);
- M->WriteByte("Chat", "HighlightMe", ::IsDlgButtonChecked(hwndDlg, IDC_HIGHLIGHTME) ? 1 : 0);
+ db_set_b(0, "Chat", "HighlightEnabled", dwFlags);
+ db_set_b(0, "Chat", "HighlightMe", ::IsDlgButtonChecked(hwndDlg, IDC_HIGHLIGHTME) ? 1 : 0);
g_Settings.Highlight->init();
}
return TRUE;
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp
index 2004b5e9a4..0acd694435 100644
--- a/plugins/TabSRMM/src/chat/options.cpp
+++ b/plugins/TabSRMM/src/chat/options.cpp
@@ -231,17 +231,17 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM
if (colour) {
wsprintfA(str, "Font%dCol", i);
- *colour = M->GetDword(szMod, str, fol[j].defColour);
+ *colour = M.GetDword(szMod, str, fol[j].defColour);
}
if (lf) {
wsprintfA(str, "Font%dSize", i);
- lf->lfHeight = (char) M->GetByte(szMod, str, fol[j].defSize);
+ lf->lfHeight = (char) M.GetByte(szMod, str, fol[j].defSize);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
wsprintfA(str, "Font%dSty", i);
- style = M->GetByte(szMod, str, fol[j].defStyle);
- if (i == MSGFONTID_MESSAGEAREA && section == FONTSECTION_IM && M->GetByte(0, SRMSGMOD_T, "inputFontFix", 1) == 1) {
+ style = M.GetByte(szMod, str, fol[j].defStyle);
+ if (i == MSGFONTID_MESSAGEAREA && section == FONTSECTION_IM && M.GetByte("inputFontFix", 1) == 1) {
lf->lfWeight = FW_NORMAL;
lf->lfItalic = 0;
lf->lfUnderline = 0;
@@ -254,7 +254,7 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM
lf->lfStrikeOut = style & FONTF_STRIKEOUT ? 1 : 0;
}
wsprintfA(str, "Font%dSet", i);
- lf->lfCharSet = M->GetByte(szMod, str, fol[j].defCharset);
+ lf->lfCharSet = M.GetByte(szMod, str, fol[j].defCharset);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
@@ -264,7 +264,7 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM
lf->lfCharSet = SYMBOL_CHARSET;
lstrcpyn(lf->lfFaceName, _T("Webdings"), SIZEOF(lf->lfFaceName));
} else {
- if (M->GetTString(NULL, szMod, str, &dbv)) {
+ if (db_get_ts(NULL, szMod, str, &dbv)) {
lstrcpy(lf->lfFaceName, fol[j].szDefFace);
} else {
lstrcpyn(lf->lfFaceName, dbv.ptszVal, SIZEOF(lf->lfFaceName));
@@ -302,9 +302,9 @@ static void FillBranch(HWND hwndTree, HTREEITEM hParent, struct branch_t *branch
tvis.item.pszText = TranslateTS(branch[i].szDescr);
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
if (branch[i].iMode)
- iState = ((M->GetDword("Chat", branch[i].szDBName, defaultval) & branch[i].iMode) & branch[i].iMode) != 0 ? 3 : 2;
+ iState = ((M.GetDword("Chat", branch[i].szDBName, defaultval) & branch[i].iMode) & branch[i].iMode) != 0 ? 3 : 2;
else
- iState = M->GetByte("Chat", branch[i].szDBName, branch[i].bDefault) != 0 ? 3 : 2;
+ iState = M.GetByte("Chat", branch[i].szDBName, branch[i].bDefault) != 0 ? 3 : 2;
tvis.item.state = INDEXTOSTATEIMAGEMASK(iState);
branch[i].hItem = TreeView_InsertItem(hwndTree, &tvis);
}
@@ -326,8 +326,8 @@ static void SaveBranch(HWND hwndTree, struct branch_t *branch, int nValues)
iState |= branch[i].iMode;
if (iState & GC_EVENT_ADDSTATUS)
iState |= GC_EVENT_REMOVESTATUS;
- M->WriteDword("Chat", branch[i].szDBName, (DWORD)iState);
- } else M->WriteByte("Chat", branch[i].szDBName, bChecked);
+ db_set_dw(0, "Chat", branch[i].szDBName, (DWORD)iState);
+ } else db_set_b(0, "Chat", branch[i].szDBName, bChecked);
}
}
@@ -386,7 +386,7 @@ static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM p
char szDir[MAX_PATH];
switch (uMsg) {
case BFFM_INITIALIZED:
- SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM)M->getUserDir());
+ SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM)M.getUserDir());
break;
case BFFM_SELCHANGED:
@@ -455,7 +455,7 @@ HICON LoadIconEx(int iIndex, char * pszIcoLibName, int iX, int iY)
static void InitSetting(TCHAR** ppPointer, char* pszSetting, TCHAR* pszDefault)
{
DBVARIANT dbv;
- if (!M->GetTString(NULL, "Chat", pszSetting, &dbv)) {
+ if (!db_get_ts(NULL, "Chat", pszSetting, &dbv)) {
replaceStr(ppPointer, dbv.ptszVal);
db_free(&dbv);
} else
@@ -588,16 +588,16 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
if (iLen > 0) {
pszText = (TCHAR *)realloc(pszText, (iLen + 2) * sizeof(TCHAR));
GetDlgItemText(hwndDlg, IDC_GROUP, pszText, iLen + 1);
- M->WriteTString(NULL, "Chat", "AddToGroup", pszText);
+ db_set_ts(NULL, "Chat", "AddToGroup", pszText);
} else
- M->WriteTString(NULL, "Chat", "AddToGroup", _T(""));
+ db_set_ts(NULL, "Chat", "AddToGroup", _T(""));
g_Settings.hGroup = 0;
if (pszText)
free(pszText);
- b = M->GetByte("Chat", "Tabs", 1);
+ b = M.GetByte("Chat", "Tabs", 1);
SaveBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), branch1, sizeof(branch1) / sizeof(branch1[0]));
SaveBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), branch2, sizeof(branch2) / sizeof(branch2[0]));
@@ -615,9 +615,9 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
case WM_DESTROY:
BYTE b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading1, TVIS_EXPANDED) & TVIS_EXPANDED ? 1 : 0;
- M->WriteByte("Chat", "Branch1Exp", b);
+ db_set_b(0, "Chat", "Branch1Exp", b);
b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading2, TVIS_EXPANDED) & TVIS_EXPANDED ? 1 : 0;
- M->WriteByte("Chat", "Branch2Exp", b);
+ db_set_b(0, "Chat", "Branch2Exp", b);
}
return FALSE;
}
@@ -833,7 +833,7 @@ int FontServiceFontsChanged(WPARAM,LPARAM)
DeleteObject(hFont);
g_Settings.LogTextIndent = iText;
g_Settings.LogTextIndent = g_Settings.LogTextIndent * 12 / 10;
- g_Settings.LogIndentEnabled = (M->GetByte("Chat", "LogIndentEnabled", 1) != 0) ? TRUE : FALSE;
+ g_Settings.LogIndentEnabled = (M.GetByte("Chat", "LogIndentEnabled", 1) != 0) ? TRUE : FALSE;
LoadGlobalSettings();
MM_FontsChanged();
@@ -848,7 +848,7 @@ int FontServiceFontsChanged(WPARAM,LPARAM)
FreeTabConfig();
ReloadTabConfig();
Skin->setupAeroSkins();
- M->BroadcastMessage(DM_OPTIONSAPPLIED, 1, 0);
+ M.BroadcastMessage(DM_OPTIONSAPPLIED, 1, 0);
return 0;
}
@@ -869,7 +869,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN2, UDM_SETRANGE, 0, MAKELONG(5000, 0));
SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN2, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, "Chat", "LogLimit", 100), 0));
SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN3, UDM_SETRANGE, 0, MAKELONG(255, 10));
- SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN3, UDM_SETPOS, 0, MAKELONG(M->GetByte("Chat", "NicklistRowDist", 12), 0));
+ SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN3, UDM_SETPOS, 0, MAKELONG(M.GetByte("Chat", "NicklistRowDist", 12), 0));
SetDlgItemText(hwndDlg, IDC_LOGTIMESTAMP, g_Settings.pszTimeStampLog);
SetDlgItemText(hwndDlg, IDC_TIMESTAMP, g_Settings.pszTimeStamp);
SetDlgItemText(hwndDlg, IDC_OUTSTAMP, g_Settings.pszOutgoingNick);
@@ -961,11 +961,11 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
*p1 = 0;
}
- mir_sntprintf(tszInitialDir, MAX_PATH, _T("%s%s"), M->getChatLogPath(), p);
+ mir_sntprintf(tszInitialDir, MAX_PATH, _T("%s%s"), M.getChatLogPath(), p);
if (PathFileExists(tszInitialDir))
ofn.lpstrInitialDir = tszInitialDir;
else {
- mir_sntprintf(tszInitialDir, MAX_PATH, _T("%s"), M->getChatLogPath());
+ mir_sntprintf(tszInitialDir, MAX_PATH, _T("%s"), M.getChatLogPath());
ofn.lpstrInitialDir = tszInitialDir;
}
@@ -1001,10 +1001,10 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
idList = SHBrowseForFolder(&bi);
if (idList) {
- const TCHAR *szUserDir = M->getUserDir();
+ const TCHAR *szUserDir = M.getUserDir();
SHGetPathFromIDList(idList, tszDirectory);
lstrcat(tszDirectory, _T("\\"));
- M->pathToRelative(tszDirectory, tszTemp, const_cast<TCHAR *>(szUserDir));
+ M.pathToRelative(tszDirectory, tszTemp, const_cast<TCHAR *>(szUserDir));
SetWindowText(GetDlgItem(hwndDlg, IDC_LOGDIRECTORY), lstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME);
}
psMalloc->Free(idList);
@@ -1039,13 +1039,13 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
if (iLen > 0) {
TCHAR *pszText1 = (TCHAR *)malloc(iLen*sizeof(TCHAR) + 2);
GetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, pszText1, iLen + 1);
- M->WriteTString(NULL, "Chat", "LogDirectory", pszText1);
+ db_set_ts(NULL, "Chat", "LogDirectory", pszText1);
free(pszText1);
g_Settings.LoggingEnabled = IsDlgButtonChecked(hwndDlg, IDC_LOGGING) == BST_CHECKED ? TRUE : FALSE;
- M->WriteByte("Chat", "LoggingEnabled", (BYTE)g_Settings.LoggingEnabled);
+ db_set_b(0, "Chat", "LoggingEnabled", (BYTE)g_Settings.LoggingEnabled);
} else {
db_unset(NULL, "Chat", "LogDirectory");
- M->WriteByte("Chat", "LoggingEnabled", 0);
+ db_set_b(0, "Chat", "LoggingEnabled", 0);
}
SM_InvalidateLogDirectories();
@@ -1054,7 +1054,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN3, UDM_GETPOS, 0, 0);
if (iLen > 0)
- M->WriteByte("Chat", "NicklistRowDist", (BYTE)iLen);
+ db_set_b(0, "Chat", "NicklistRowDist", (BYTE)iLen);
else
db_unset(NULL, "Chat", "NicklistRowDist");
@@ -1094,7 +1094,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
free(pszText);
if (hListBkgBrush)
DeleteObject(hListBkgBrush);
- hListBkgBrush = CreateSolidBrush(M->GetDword("Chat", "ColorNicklistBG", SRMSGDEFSET_BKGCOLOUR));
+ hListBkgBrush = CreateSolidBrush(M.GetDword("Chat", "ColorNicklistBG", SRMSGDEFSET_BKGCOLOUR));
if (PluginConfig.m_chat_enabled) {
LoadLogFonts();
@@ -1108,7 +1108,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
DeleteObject(hFont);
g_Settings.LogTextIndent = iText;
g_Settings.LogTextIndent = g_Settings.LogTextIndent * 12 / 10;
- g_Settings.LogIndentEnabled = (M->GetByte("Chat", "LogIndentEnabled", 1) != 0) ? TRUE : FALSE;
+ g_Settings.LogIndentEnabled = (M.GetByte("Chat", "LogIndentEnabled", 1) != 0) ? TRUE : FALSE;
LoadGlobalSettings();
MM_FontsChanged();
@@ -1172,10 +1172,10 @@ INT_PTR CALLBACK DlgProcOptions3(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
TranslateDialogDefault(hwndDlg);
if (PluginConfig.m_chat_enabled) {
- DWORD dwFilterFlags = M->GetDword("Chat", "FilterFlags", GC_EVENT_ALL);
- DWORD dwTrayFlags = M->GetDword("Chat", "TrayIconFlags", GC_EVENT_ALL);
- DWORD dwPopupFlags = M->GetDword("Chat", "PopupFlags", GC_EVENT_ALL);
- DWORD dwLogFlags = M->GetDword("Chat", "DiskLogFlags", GC_EVENT_ALL);
+ DWORD dwFilterFlags = M.GetDword("Chat", "FilterFlags", GC_EVENT_ALL);
+ DWORD dwTrayFlags = M.GetDword("Chat", "TrayIconFlags", GC_EVENT_ALL);
+ DWORD dwPopupFlags = M.GetDword("Chat", "PopupFlags", GC_EVENT_ALL);
+ DWORD dwLogFlags = M.GetDword("Chat", "DiskLogFlags", GC_EVENT_ALL);
for (int i = 0; _eventorder[i]; i++) {
if (_eventorder[i] != GC_EVENT_HIGHLIGHT) {
@@ -1191,8 +1191,8 @@ INT_PTR CALLBACK DlgProcOptions3(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
SendDlgItemMessage(hwndDlg, IDC_LOGICONTYPE, CB_SETCURSEL, (g_Settings.LogSymbols ? 2 : (g_Settings.dwIconFlags ? 1 : 0)), 0);
- CheckDlgButton(hwndDlg, IDC_NOPOPUPSFORCLOSEDWINDOWS, M->GetByte("Chat", "SkipWhenNoWindow", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_TRAYONLYFORINACTIVE, M->GetByte("Chat", "TrayIconInactiveOnly", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOPOPUPSFORCLOSEDWINDOWS, M.GetByte("Chat", "SkipWhenNoWindow", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TRAYONLYFORINACTIVE, M.GetByte("Chat", "TrayIconInactiveOnly", 0) ? BST_CHECKED : BST_UNCHECKED);
}
break;
@@ -1217,18 +1217,18 @@ INT_PTR CALLBACK DlgProcOptions3(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
dwPopupFlags |= (IsDlgButtonChecked(hwndDlg, IDC_P1 + i) ? _eventorder[i] : 0);
dwTrayFlags |= (IsDlgButtonChecked(hwndDlg, IDC_T1 + i) ? _eventorder[i] : 0);
}
- M->WriteDword("Chat", "FilterFlags", dwFilterFlags);
- M->WriteDword("Chat", "PopupFlags", dwPopupFlags);
- M->WriteDword("Chat", "TrayIconFlags", dwTrayFlags);
- M->WriteDword("Chat", "DiskLogFlags", dwLogFlags);
+ db_set_dw(0, "Chat", "FilterFlags", dwFilterFlags);
+ db_set_dw(0, "Chat", "PopupFlags", dwPopupFlags);
+ db_set_dw(0, "Chat", "TrayIconFlags", dwTrayFlags);
+ db_set_dw(0, "Chat", "DiskLogFlags", dwLogFlags);
LRESULT lr = SendDlgItemMessage(hwndDlg, IDC_LOGICONTYPE, CB_GETCURSEL, 0, 0);
- M->WriteDword("Chat", "IconFlags", lr == 1 ? 1 : 0);
- M->WriteByte("Chat", "LogSymbols", lr == 2 ? 1 : 0);
+ db_set_dw(0, "Chat", "IconFlags", lr == 1 ? 1 : 0);
+ db_set_b(0, "Chat", "LogSymbols", lr == 2 ? 1 : 0);
- M->WriteByte("Chat", "SkipWhenNoWindow", IsDlgButtonChecked(hwndDlg, IDC_NOPOPUPSFORCLOSEDWINDOWS) ? 1 : 0);
- M->WriteByte("Chat", "TrayIconInactiveOnly", IsDlgButtonChecked(hwndDlg, IDC_TRAYONLYFORINACTIVE) ? 1 : 0);
+ db_set_b(0, "Chat", "SkipWhenNoWindow", IsDlgButtonChecked(hwndDlg, IDC_NOPOPUPSFORCLOSEDWINDOWS) ? 1 : 0);
+ db_set_b(0, "Chat", "TrayIconInactiveOnly", IsDlgButtonChecked(hwndDlg, IDC_TRAYONLYFORINACTIVE) ? 1 : 0);
LoadGlobalSettings();
MM_FontsChanged();
SM_BroadcastMessage(NULL, GC_SETWNDPROPS, 0, 0, TRUE);
@@ -1246,53 +1246,53 @@ void LoadGlobalSettings(void)
LOGFONT lf;
char szBuf[40];
- g_Settings.LogLimitNames = M->GetByte("Chat", "LogLimitNames", 1);
- g_Settings.ShowTime = M->GetByte("Chat", "ShowTimeStamp", 1);
- g_Settings.ShowTimeIfChanged = (BOOL)M->GetByte("Chat", "ShowTimeStampIfChanged", 0);
- g_Settings.TimeStampEventColour = (BOOL)M->GetByte("Chat", "TimeStampEventColour", 0);
+ g_Settings.LogLimitNames = M.GetByte("Chat", "LogLimitNames", 1);
+ g_Settings.ShowTime = M.GetByte("Chat", "ShowTimeStamp", 1);
+ g_Settings.ShowTimeIfChanged = (BOOL)M.GetByte("Chat", "ShowTimeStampIfChanged", 0);
+ g_Settings.TimeStampEventColour = (BOOL)M.GetByte("Chat", "TimeStampEventColour", 0);
g_Settings.iEventLimit = db_get_w(NULL, "Chat", "LogLimit", 100);
g_Settings.iEventLimitThreshold = db_get_w(NULL, "Chat", "LogLimitThreshold", 20);
- g_Settings.dwIconFlags = M->GetDword("Chat", "IconFlags", 0x0000);
+ g_Settings.dwIconFlags = M.GetDword("Chat", "IconFlags", 0x0000);
g_Settings.LoggingLimit = (size_t)db_get_w(NULL, "Chat", "LoggingLimit", 100);
- g_Settings.LoggingEnabled = (BOOL)M->GetByte("Chat", "LoggingEnabled", 0);
- g_Settings.OpenInDefault = (BOOL)M->GetByte("Chat", "DefaultContainer", 1);
- g_Settings.FlashWindow = (BOOL)M->GetByte("Chat", "FlashWindow", 0);
- g_Settings.FlashWindowHightlight = (BOOL)M->GetByte("Chat", "FlashWindowHighlight", 0);
- g_Settings.HighlightEnabled = (BOOL)M->GetByte("Chat", "HighlightEnabled", 1);
- g_Settings.crUserListColor = (BOOL)M->GetDword(CHAT_FONTMODULE, "Font18Col", RGB(0, 0, 0));
- g_Settings.crUserListBGColor = (BOOL)M->GetDword("Chat", "ColorNicklistBG", SRMSGDEFSET_BKGCOLOUR);
- g_Settings.crUserListHeadingsColor = (BOOL)M->GetDword(CHAT_FONTMODULE, "Font19Col", RGB(170, 170, 170));
- g_Settings.StripFormat = (BOOL)M->GetByte("Chat", "StripFormatting", 0);
- g_Settings.TrayIconInactiveOnly = (BOOL)M->GetByte("Chat", "TrayIconInactiveOnly", 1);
- g_Settings.BBCodeInPopups = (BOOL)M->GetByte("Chat", "BBCodeInPopups", 0);
- g_Settings.AddColonToAutoComplete = (BOOL)M->GetByte("Chat", "AddColonToAutoComplete", 1);
- g_Settings.iPopupStyle = M->GetByte("Chat", "PopupStyle", 1);
+ g_Settings.LoggingEnabled = (BOOL)M.GetByte("Chat", "LoggingEnabled", 0);
+ g_Settings.OpenInDefault = (BOOL)M.GetByte("Chat", "DefaultContainer", 1);
+ g_Settings.FlashWindow = (BOOL)M.GetByte("Chat", "FlashWindow", 0);
+ g_Settings.FlashWindowHightlight = (BOOL)M.GetByte("Chat", "FlashWindowHighlight", 0);
+ g_Settings.HighlightEnabled = (BOOL)M.GetByte("Chat", "HighlightEnabled", 1);
+ g_Settings.crUserListColor = (BOOL)M.GetDword(CHAT_FONTMODULE, "Font18Col", RGB(0, 0, 0));
+ g_Settings.crUserListBGColor = (BOOL)M.GetDword("Chat", "ColorNicklistBG", SRMSGDEFSET_BKGCOLOUR);
+ g_Settings.crUserListHeadingsColor = (BOOL)M.GetDword(CHAT_FONTMODULE, "Font19Col", RGB(170, 170, 170));
+ g_Settings.StripFormat = (BOOL)M.GetByte("Chat", "StripFormatting", 0);
+ g_Settings.TrayIconInactiveOnly = (BOOL)M.GetByte("Chat", "TrayIconInactiveOnly", 1);
+ g_Settings.BBCodeInPopups = (BOOL)M.GetByte("Chat", "BBCodeInPopups", 0);
+ g_Settings.AddColonToAutoComplete = (BOOL)M.GetByte("Chat", "AddColonToAutoComplete", 1);
+ g_Settings.iPopupStyle = M.GetByte("Chat", "PopupStyle", 1);
g_Settings.iPopupTimeout = db_get_w(NULL, "Chat", "PopupTimeout", 3);
- g_Settings.crPUBkgColour = M->GetDword("Chat", "PopupColorBG", GetSysColor(COLOR_WINDOW));
- g_Settings.crPUTextColour = M->GetDword("Chat", "PopupColorText", 0);
- g_Settings.ClassicIndicators = M->GetByte("Chat", "ClassicIndicators", 0);
+ g_Settings.crPUBkgColour = M.GetDword("Chat", "PopupColorBG", GetSysColor(COLOR_WINDOW));
+ g_Settings.crPUTextColour = M.GetDword("Chat", "PopupColorText", 0);
+ g_Settings.ClassicIndicators = M.GetByte("Chat", "ClassicIndicators", 0);
//MAD
- g_Settings.LogClassicIndicators = M->GetByte("Chat", "LogClassicIndicators", 0);
- g_Settings.AlternativeSorting = M->GetByte("Chat", "AlternativeSorting", 1);
- g_Settings.AnnoyingHighlight = M->GetByte("Chat", "AnnoyingHighlight", 0);
- g_Settings.CreateWindowOnHighlight = M->GetByte("Chat", "CreateWindowOnHighlight", 1);
+ g_Settings.LogClassicIndicators = M.GetByte("Chat", "LogClassicIndicators", 0);
+ g_Settings.AlternativeSorting = M.GetByte("Chat", "AlternativeSorting", 1);
+ g_Settings.AnnoyingHighlight = M.GetByte("Chat", "AnnoyingHighlight", 0);
+ g_Settings.CreateWindowOnHighlight = M.GetByte("Chat", "CreateWindowOnHighlight", 1);
//MAD_
- g_Settings.LogSymbols = M->GetByte("Chat", "LogSymbols", 1);
- g_Settings.ClickableNicks = M->GetByte("Chat", "ClickableNicks", 1);
- g_Settings.ColorizeNicks = M->GetByte("Chat", "ColorizeNicks", 1);
- g_Settings.ColorizeNicksInLog = M->GetByte("Chat", "ColorizeNicksInLog", 1);
- g_Settings.ScaleIcons = M->GetByte("Chat", "ScaleIcons", 1);
- g_Settings.UseDividers = M->GetByte("Chat", "UseDividers", 1);
- g_Settings.DividersUsePopupConfig = M->GetByte("Chat", "DividersUsePopupConfig", 1);
- g_Settings.MathMod = ServiceExists(MATH_RTF_REPLACE_FORMULAE) && M->GetByte("Chat", "MathModSupport", 0);
-
- g_Settings.DoubleClick4Privat = (BOOL)M->GetByte("Chat", "DoubleClick4Privat", 0);
- g_Settings.ShowContactStatus = M->GetByte("Chat", "ShowContactStatus", 1);
- g_Settings.ContactStatusFirst = M->GetByte("Chat", "ContactStatusFirst", 0);
+ g_Settings.LogSymbols = M.GetByte("Chat", "LogSymbols", 1);
+ g_Settings.ClickableNicks = M.GetByte("Chat", "ClickableNicks", 1);
+ g_Settings.ColorizeNicks = M.GetByte("Chat", "ColorizeNicks", 1);
+ g_Settings.ColorizeNicksInLog = M.GetByte("Chat", "ColorizeNicksInLog", 1);
+ g_Settings.ScaleIcons = M.GetByte("Chat", "ScaleIcons", 1);
+ g_Settings.UseDividers = M.GetByte("Chat", "UseDividers", 1);
+ g_Settings.DividersUsePopupConfig = M.GetByte("Chat", "DividersUsePopupConfig", 1);
+ g_Settings.MathMod = ServiceExists(MATH_RTF_REPLACE_FORMULAE) && M.GetByte("Chat", "MathModSupport", 0);
+
+ g_Settings.DoubleClick4Privat = (BOOL)M.GetByte("Chat", "DoubleClick4Privat", 0);
+ g_Settings.ShowContactStatus = M.GetByte("Chat", "ShowContactStatus", 1);
+ g_Settings.ContactStatusFirst = M.GetByte("Chat", "ContactStatusFirst", 0);
if (hListBkgBrush)
DeleteObject(hListBkgBrush);
- hListBkgBrush = CreateSolidBrush(M->GetDword("Chat", "ColorNicklistBG", SRMSGDEFSET_BKGCOLOUR));
+ hListBkgBrush = CreateSolidBrush(M.GetDword("Chat", "ColorNicklistBG", SRMSGDEFSET_BKGCOLOUR));
InitSetting(&g_Settings.pszTimeStamp, "HeaderTime", _T("[%H:%M]"));
InitSetting(&g_Settings.pszTimeStampLog, "LogTimestamp", _T("[%d %b %y %H:%M]"));
@@ -1301,7 +1301,7 @@ void LoadGlobalSettings(void)
DBVARIANT dbv;
- if (!M->GetTString(NULL, "Chat", "LogDirectory", &dbv)) {
+ if (!db_get_ts(NULL, "Chat", "LogDirectory", &dbv)) {
lstrcpyn(g_Settings.pszLogDir, dbv.ptszVal, MAX_PATH);
db_free(&dbv);
}
@@ -1309,7 +1309,7 @@ void LoadGlobalSettings(void)
g_Settings.pszLogDir[MAX_PATH - 1] = 0;
- g_Settings.LogIndentEnabled = (M->GetByte("Chat", "LogIndentEnabled", 1) != 0) ? TRUE : FALSE;
+ g_Settings.LogIndentEnabled = (M.GetByte("Chat", "LogIndentEnabled", 1) != 0) ? TRUE : FALSE;
// nicklist
@@ -1329,14 +1329,14 @@ void LoadGlobalSettings(void)
ih = GetTextPixelSize(_T("AQGglo"), g_Settings.UserListFont, FALSE);
ih2 = GetTextPixelSize(_T("AQGglo"), g_Settings.UserListHeadingsFont, FALSE);
- g_Settings.iNickListFontHeight = max(M->GetByte("Chat", "NicklistRowDist", 12), (ih > ih2 ? ih : ih2));
+ g_Settings.iNickListFontHeight = max(M.GetByte("Chat", "NicklistRowDist", 12), (ih > ih2 ? ih : ih2));
for (int i=0; i < 7; i++) {
mir_snprintf(szBuf, 20, "NickColor%d", i);
- g_Settings.nickColors[i] = M->GetDword("Chat", szBuf, g_Settings.crUserListColor);
+ g_Settings.nickColors[i] = M.GetDword("Chat", szBuf, g_Settings.crUserListColor);
}
- g_Settings.nickColors[5] = M->GetDword("Chat", "NickColor5", GetSysColor(COLOR_HIGHLIGHT));
- g_Settings.nickColors[6] = M->GetDword("Chat", "NickColor6", GetSysColor(COLOR_HIGHLIGHTTEXT));
+ g_Settings.nickColors[5] = M.GetDword("Chat", "NickColor5", GetSysColor(COLOR_HIGHLIGHT));
+ g_Settings.nickColors[6] = M.GetDword("Chat", "NickColor6", GetSysColor(COLOR_HIGHLIGHTTEXT));
if (g_Settings.SelectionBGBrush)
DeleteObject(g_Settings.SelectionBGBrush);
g_Settings.SelectionBGBrush = CreateSolidBrush(g_Settings.nickColors[5]);
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp
index 2c656a335b..7ffaa7da02 100644
--- a/plugins/TabSRMM/src/chat/services.cpp
+++ b/plugins/TabSRMM/src/chat/services.cpp
@@ -82,7 +82,7 @@ int Chat_ModulesLoaded(WPARAM wParam, LPARAM lParam)
CList_SetAllOffline(TRUE, NULL);
- g_Settings.MathMod = ServiceExists(MATH_RTF_REPLACE_FORMULAE) && M->GetByte("Chat", "MathModSupport", 0);
+ g_Settings.MathMod = ServiceExists(MATH_RTF_REPLACE_FORMULAE) && M.GetByte("Chat", "MathModSupport", 0);
return 0;
}
@@ -226,8 +226,8 @@ INT_PTR Service_NewChat(WPARAM wParam, LPARAM lParam)
si->ptszName = a2tf(gcw->ptszName, gcw->dwFlags);
si->ptszStatusbarText = a2tf(gcw->ptszStatusbarText, gcw->dwFlags);
si->iSplitterX = g_Settings.iSplitterX;
- si->bFilterEnabled = M->GetByte(si->hContact, "Chat", "FilterEnabled", M->GetByte("Chat", "FilterEnabled", 0));
- si->bNicklistEnabled = M->GetByte("Chat", "ShowNicklist", 1);
+ si->bFilterEnabled = db_get_b(si->hContact, "Chat", "FilterEnabled", M.GetByte("Chat", "FilterEnabled", 0));
+ si->bNicklistEnabled = M.GetByte("Chat", "ShowNicklist", 1);
if (!(gcw->dwFlags & GC_UNICODE)) {
si->pszID = mir_strdup(gcw->pszID);
si->pszName = mir_strdup(gcw->pszName);
@@ -249,7 +249,7 @@ INT_PTR Service_NewChat(WPARAM wParam, LPARAM lParam)
db_set_s(si->hContact, si->pszModule , "Topic", "");
db_unset(si->hContact, "CList", "StatusMsg");
if (si->ptszStatusbarText)
- M->WriteTString(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
+ db_set_ts(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
else
db_set_s(si->hContact, si->pszModule, "StatusBar", "");
if (si->hContact)
@@ -305,7 +305,7 @@ static int DoControl(GCEVENT * gce, WPARAM wp)
si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
if (si) {
si->bInitDone = TRUE;
- if (wp != SESSION_INITDONE || M->GetByte("Chat", "PopupOnJoin", 0) == 0)
+ if (wp != SESSION_INITDONE || M.GetByte("Chat", "PopupOnJoin", 0) == 0)
ShowRoom(si, wp, TRUE);
return 0;
}
@@ -369,7 +369,7 @@ static int DoControl(GCEVENT * gce, WPARAM wp)
if (si) {
replaceStr(&si->ptszStatusbarText, gce->ptszText);
if (si->ptszStatusbarText)
- M->WriteTString(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
+ db_set_ts(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
else
db_set_s(si->hContact, si->pszModule, "StatusBar", "");
if (si->hWnd)
@@ -423,10 +423,10 @@ static void AddUser(GCEVENT * gce)
HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateTab, BOOL bPopupContainer, BOOL bWantPopup)
{
HANDLE hContact = si->hContact;
- if (M->FindWindow(hContact) != 0)
+ if (M.FindWindow(hContact) != 0)
return 0;
- if (hContact != 0 && M->GetByte("limittabs", 0) && !_tcsncmp(pContainer->szName, _T("default"), 6)) {
+ if (hContact != 0 && M.GetByte("limittabs", 0) && !_tcsncmp(pContainer->szName, _T("default"), 6)) {
if ((pContainer = FindMatchingContainer(_T("default"), hContact)) == NULL) {
TCHAR szName[CONTAINER_NAMELEN + 1];
@@ -449,7 +449,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT
TCHAR newcontactname[128];
if ( lstrlen(contactName) > 0) {
- if (M->GetByte("cuttitle", 0))
+ if (M.GetByte("cuttitle", 0))
CutContactName(contactName, newcontactname, SIZEOF(newcontactname));
else {
lstrcpyn(newcontactname, contactName, SIZEOF(newcontactname));
@@ -473,7 +473,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT
ShowWindow(pContainer->hwndActive, SW_HIDE);
{
- int iTabIndex_wanted = M->GetDword(hContact, "tabindex", pContainer->iChilds * 100);
+ int iTabIndex_wanted = M.GetDword(hContact, "tabindex", pContainer->iChilds * 100);
int iCount = TabCtrl_GetItemCount(hwndTab);
TCITEM item = {0};
HWND hwnd;
@@ -489,7 +489,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT
hwnd = (HWND)item.lParam;
dat = (struct TWindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (dat) {
- relPos = M->GetDword(dat->hContact, "tabindex", i * 100);
+ relPos = M.GetDword(dat->hContact, "tabindex", i * 100);
if (iTabIndex_wanted <= relPos)
pContainer->iTabIndex = i;
}
@@ -555,7 +555,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT
}
}
- if (PluginConfig.m_bIsWin7 && PluginConfig.m_useAeroPeek && CSkin::m_skinEnabled && !M->GetByte("forceAeroPeek", 0))
+ if (PluginConfig.m_bIsWin7 && PluginConfig.m_useAeroPeek && CSkin::m_skinEnabled && !M.GetByte("forceAeroPeek", 0))
CWarning::show(CWarning::WARN_AEROPEEK_SKIN, MB_ICONWARNING|MB_OK);
return hwndNew; // return handle of the new dialog
}
@@ -664,9 +664,9 @@ INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam)
if (si) {
if (gce->pszText) {
replaceStr(&si->ptszTopic, RemoveFormatting(gce->ptszText));
- M->WriteTString(si->hContact, si->pszModule , "Topic", /*RemoveFormatting*/(si->ptszTopic));
- if (M->GetByte("Chat", "TopicOnClist", 1))
- M->WriteTString(si->hContact, "CList" , "StatusMsg", /*RemoveFormatting*/(si->ptszTopic));
+ db_set_ts(si->hContact, si->pszModule , "Topic", /*RemoveFormatting*/(si->ptszTopic));
+ if (M.GetByte("Chat", "TopicOnClist", 1))
+ db_set_ts(si->hContact, "CList" , "StatusMsg", /*RemoveFormatting*/(si->ptszTopic));
if (si->hWnd)
SendMessage(si->hWnd, DM_INVALIDATEPANEL, 0, 0);
}
@@ -691,7 +691,7 @@ INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam)
if (!(gce->dwFlags & GC_UNICODE)) {
fFreeText = TRUE;
if (si)
- gce->ptszText = a2tf(gce->ptszText, gce->dwFlags, M->GetDword(si->hContact, "ANSIcodepage", 0));
+ gce->ptszText = a2tf(gce->ptszText, gce->dwFlags, M.GetDword(si->hContact, "ANSIcodepage", 0));
else
gce->ptszText = a2tf(gce->ptszText, gce->dwFlags);
}
@@ -830,7 +830,7 @@ int CreateServiceFunctions(void)
if (ServiceExists(MS_GC_REGISTER)) {
LRESULT result = CWarning::show(CWarning::WARN_CHAT_ENABLED, CWarning::CWF_NOALLOWHIDE | MB_YESNOCANCEL | MB_ICONQUESTION);
if (result == IDYES)
- M->WriteByte("PluginDisable", "chat.dll", 1);
+ db_set_b(0, "PluginDisable", "chat.dll", 1);
return 0;
}
PluginConfig.m_chat_enabled = true;
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp
index 5c0c745013..29ca57c044 100644
--- a/plugins/TabSRMM/src/chat/tools.cpp
+++ b/plugins/TabSRMM/src/chat/tools.cpp
@@ -220,7 +220,7 @@ static int ShowPopup(HANDLE hContact, SESSION_INFO* si, HICON hIcon, char* pszP
pd.colorBack = g_Settings.crPUBkgColour;
pd.colorText = g_Settings.crPUTextColour;
} else {
- pd.colorBack = M->GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR_MUC, SRMSGDEFSET_BKGCOLOUR);
+ pd.colorBack = M.GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR_MUC, SRMSGDEFSET_BKGCOLOUR);
pd.colorText = crBkg;
}
@@ -537,7 +537,7 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO* si, GCEVENT * gce, BOOL bHighligh
if (bHighlight) {
gce->pDest->iType |= GC_EVENT_HIGHLIGHT;
params->sound = "ChatHighlight";
- if (M->GetByte(si->hContact, "CList", "Hidden", 0) != 0)
+ if (db_get_b(si->hContact, "CList", "Hidden", 0) != 0)
db_unset(si->hContact, "CList", "Hidden");
if (params->bInactive) {
fFlagUnread = true;
@@ -705,7 +705,7 @@ void CheckColorsInModule(const char* pszModule)
{
MODULEINFO * pMod = MM_FindModule(pszModule);
COLORREF crFG;
- COLORREF crBG = (COLORREF)M->GetDword(FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR);
+ COLORREF crBG = (COLORREF)M.GetDword(FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR);
LoadLogfont(MSGFONTID_MESSAGEAREA, NULL, &crFG, FONTMODULE);
@@ -925,7 +925,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO
GCMENUITEMS gcmi = {0};
int i;
HMENU hSubMenu = 0;
- DWORD codepage = M->GetDword(si->hContact, "ANSIcodepage", 0);
+ DWORD codepage = M.GetDword(si->hContact, "ANSIcodepage", 0);
int pos;
*hMenu = GetSubMenu(g_hMenu, iIndex);
@@ -1052,7 +1052,7 @@ BOOL DoEventHookAsync(HWND hwnd, const TCHAR* pszID, const char* pszModule, int
return FALSE;
if (!(si->dwFlags & GC_UNICODE)) {
- DWORD dwCP = M->GetDword(si->hContact, "ANSIcodepage", 0);
+ DWORD dwCP = M.GetDword(si->hContact, "ANSIcodepage", 0);
gcd->pszID = t2a(pszID, 0);
gch->pszUID = t2a(pszUID, 0);
gch->pszText = t2a(pszText, dwCP);
@@ -1079,7 +1079,7 @@ BOOL DoEventHook(const TCHAR* pszID, const char* pszModule, int iType, const TCH
return FALSE;
if (!(si->dwFlags & GC_UNICODE)) {
- DWORD dwCP = M->GetDword(si->hContact, "ANSIcodepage", 0);
+ DWORD dwCP = M.GetDword(si->hContact, "ANSIcodepage", 0);
gcd.pszID = t2a(pszID, 0);
gch.pszUID = t2a(pszUID, 0);
gch.pszText = t2a(pszText, dwCP);
@@ -1212,18 +1212,18 @@ void Chat_SetFilters(SESSION_INFO *si)
if (si == NULL)
return;
- dwFlags_default = M->GetDword("Chat", "FilterFlags", 0x03E0);
- dwFlags_local = M->GetDword(si->hContact, "Chat", "FilterFlags", 0x03E0);
- dwMask = M->GetDword(si->hContact, "Chat", "FilterMask", 0);
+ dwFlags_default = M.GetDword("Chat", "FilterFlags", 0x03E0);
+ dwFlags_local = db_get_dw(si->hContact, "Chat", "FilterFlags", 0x03E0);
+ dwMask = db_get_dw(si->hContact, "Chat", "FilterMask", 0);
si->iLogFilterFlags = dwFlags_default;
for (int i=0; i < 32; i++)
if (dwMask & (1 << i))
si->iLogFilterFlags = (dwFlags_local & (1 << i) ? si->iLogFilterFlags | (1 << i) : si->iLogFilterFlags & ~(1 << i));
- dwFlags_default = M->GetDword("Chat", "PopupFlags", 0x03E0);
- dwFlags_local = M->GetDword(si->hContact, "Chat", "PopupFlags", 0x03E0);
- dwMask = M->GetDword(si->hContact, "Chat", "PopupMask", 0);
+ dwFlags_default = M.GetDword("Chat", "PopupFlags", 0x03E0);
+ dwFlags_local = db_get_dw(si->hContact, "Chat", "PopupFlags", 0x03E0);
+ dwMask = db_get_dw(si->hContact, "Chat", "PopupMask", 0);
si->iLogPopupFlags = dwFlags_default;
for (i=0; i < 32; i++) {
@@ -1231,9 +1231,9 @@ void Chat_SetFilters(SESSION_INFO *si)
si->iLogPopupFlags = (dwFlags_local & (1 << i) ? si->iLogPopupFlags | (1 << i) : si->iLogPopupFlags & ~(1 << i));
}
- dwFlags_default = M->GetDword("Chat", "TrayIconFlags", 0x03E0);
- dwFlags_local = M->GetDword(si->hContact, "Chat", "TrayIconFlags", 0x03E0);
- dwMask = M->GetDword(si->hContact, "Chat", "TrayIconMask", 0);
+ dwFlags_default = M.GetDword("Chat", "TrayIconFlags", 0x03E0);
+ dwFlags_local = db_get_dw(si->hContact, "Chat", "TrayIconFlags", 0x03E0);
+ dwMask = db_get_dw(si->hContact, "Chat", "TrayIconMask", 0);
si->iLogTrayFlags = dwFlags_default;
for (i=0; i < 32; i++) {
@@ -1241,7 +1241,7 @@ void Chat_SetFilters(SESSION_INFO *si)
si->iLogTrayFlags = (dwFlags_local & (1 << i) ? si->iLogTrayFlags | (1 << i) : si->iLogTrayFlags & ~(1 << i));
}
- dwFlags_default = M->GetDword("Chat", "DiskLogFlags", 0xFFFF);
+ dwFlags_default = M.GetDword("Chat", "DiskLogFlags", 0xFFFF);
si->iDiskLogFlags = dwFlags_default;
@@ -1318,8 +1318,8 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime)
dat.variables = rva;
tszParsedName = (TCHAR*) CallService(MS_UTILS_REPLACEVARS, (WPARAM)g_Settings.pszLogDir, (LPARAM)&dat);
- if (!M->pathIsAbsolute(tszParsedName))
- mir_sntprintf(si->pszLogFileName, MAX_PATH, _T("%s%s"), M->getChatLogPath(), tszParsedName);
+ if (!M.pathIsAbsolute(tszParsedName))
+ mir_sntprintf(si->pszLogFileName, MAX_PATH, _T("%s%s"), M.getChatLogPath(), tszParsedName);
else
mir_sntprintf(si->pszLogFileName, MAX_PATH, _T("%s"), tszParsedName);
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp
index 6f9beeffd2..ae8aff8aee 100644
--- a/plugins/TabSRMM/src/chat/window.cpp
+++ b/plugins/TabSRMM/src/chat/window.cpp
@@ -70,7 +70,7 @@ static const CLSID IID_ITextDocument= { 0x8CC497C0,0xA1DF,0x11CE, { 0x80,0x98, 0
static void Chat_SetMessageLog(TWindowData *dat)
{
- unsigned int iLogMode = M->GetByte("Chat", "useIEView", 0);
+ unsigned int iLogMode = M.GetByte("Chat", "useIEView", 0);
if (iLogMode == WANT_IEVIEW_LOG && dat->hwndIEView == 0) {
IEVIEWWINDOW ieWindow;
@@ -335,7 +335,7 @@ static void Chat_UpdateWindowState(TWindowData *dat, UINT msg)
dat->wParam = dat->lParam = 0;
}
}
- if (M->isAero())
+ if (M.isAero())
InvalidateRect(hwndTab, NULL, FALSE);
if (dat->pContainer->dwFlags & CNT_SIDEBAR)
dat->pContainer->SideBar->setActiveItem(dat);
@@ -351,7 +351,7 @@ static void Chat_UpdateWindowState(TWindowData *dat, UINT msg)
static void InitButtons(HWND hwndDlg, SESSION_INFO* si)
{
- BOOL isFlat = M->GetByte("tbflat", 1);
+ BOOL isFlat = M.GetByte("tbflat", 1);
BOOL isThemed = PluginConfig.m_bIsXP;
MODULEINFO *pInfo = si ? MM_FindModule(si->pszModule) : NULL;
BOOL bFilterEnabled = si ? si->bFilterEnabled : FALSE;
@@ -659,7 +659,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
MODULEINFO* mi = MM_FindModule(Parentsi->pszModule);
CHARRANGE sel, all = { 0, -1};
int iSelection;
- int iPrivateBG = M->GetByte(mwdat->hContact, "private_bg", 0);
+ int iPrivateBG = M.GetByte(mwdat->hContact, "private_bg", 0);
MessageWindowPopupData mwpd;
POINT pt;
int idFrom = IDC_CHAT_MESSAGE;
@@ -1062,7 +1062,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
if (mi && mi->bBkgColor) {
int index = Chat_GetColorIndex(Parentsi->pszModule, cf.crBackColor);
- COLORREF crB = (COLORREF)M->GetDword(FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR);
+ COLORREF crB = (COLORREF)M.GetDword(FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR);
u = IsDlgButtonChecked(hwndParent, IDC_BKGCOLOR);
if (index >= 0) {
@@ -1156,14 +1156,14 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
case WM_INITDIALOG:
{
si = (SESSION_INFO *)lParam;
- DWORD dwMask = M->GetDword(si->hContact, "Chat", "FilterMask", 0);
- DWORD dwFlags = M->GetDword(si->hContact, "Chat", "FilterFlags", 0);
+ DWORD dwMask = db_get_dw(si->hContact, "Chat", "FilterMask", 0);
+ DWORD dwFlags = db_get_dw(si->hContact, "Chat", "FilterFlags", 0);
- DWORD dwPopupMask = M->GetDword(si->hContact, "Chat", "PopupMask", 0);
- DWORD dwPopupFlags = M->GetDword(si->hContact, "Chat", "PopupFlags", 0);
+ DWORD dwPopupMask = db_get_dw(si->hContact, "Chat", "PopupMask", 0);
+ DWORD dwPopupFlags = db_get_dw(si->hContact, "Chat", "PopupFlags", 0);
- DWORD dwTrayMask = M->GetDword(si->hContact, "Chat", "TrayIconMask", 0);
- DWORD dwTrayFlags = M->GetDword(si->hContact, "Chat", "TrayIconFlags", 0);
+ DWORD dwTrayMask = db_get_dw(si->hContact, "Chat", "TrayIconMask", 0);
+ DWORD dwTrayFlags = db_get_dw(si->hContact, "Chat", "TrayIconFlags", 0);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)si);
@@ -1201,8 +1201,8 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
db_unset(si->hContact, "Chat", "FilterFlags");
db_unset(si->hContact, "Chat", "FilterMask");
} else {
- M->WriteDword(si->hContact, "Chat", "FilterFlags", iFlags);
- M->WriteDword(si->hContact, "Chat", "FilterMask", dwMask);
+ db_set_dw(si->hContact, "Chat", "FilterFlags", iFlags);
+ db_set_dw(si->hContact, "Chat", "FilterMask", dwMask);
}
}
@@ -1222,8 +1222,8 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
db_unset(si->hContact, "Chat", "PopupFlags");
db_unset(si->hContact, "Chat", "PopupMask");
} else {
- M->WriteDword(si->hContact, "Chat", "PopupFlags", iFlags);
- M->WriteDword(si->hContact, "Chat", "PopupMask", dwMask);
+ db_set_dw(si->hContact, "Chat", "PopupFlags", iFlags);
+ db_set_dw(si->hContact, "Chat", "PopupMask", dwMask);
}
}
@@ -1242,8 +1242,8 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
db_unset(si->hContact, "Chat", "TrayIconFlags");
db_unset(si->hContact, "Chat", "TrayIconMask");
} else {
- M->WriteDword(si->hContact, "Chat", "TrayIconFlags", iFlags);
- M->WriteDword(si->hContact, "Chat", "TrayIconMask", dwMask);
+ db_set_dw(si->hContact, "Chat", "TrayIconFlags", iFlags);
+ db_set_dw(si->hContact, "Chat", "TrayIconMask", dwMask);
}
Chat_SetFilters(si);
SendMessage(si->hWnd, GC_CHANGEFILTERFLAG, 0, (LPARAM)iFlags);
@@ -1274,7 +1274,7 @@ static LRESULT CALLBACK ButtonSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, L
HWND hColor = GetDlgItem(hwndParent, IDC_COLOR);
HWND hBGColor = GetDlgItem(hwndParent, IDC_BKGCOLOR);
- if (M->GetByte("Chat", "RightClickFilter", 0) != 0) {
+ if (M.GetByte("Chat", "RightClickFilter", 0) != 0) {
if (hFilter == hwnd)
SendMessage(hwndParent, GC_SHOWFILTERMENU, 0, 0);
if (hColor == hwnd)
@@ -1332,7 +1332,7 @@ static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
POINT pt={LOWORD(lParam), HIWORD(lParam)};
CheckCustomLink(hwnd, &pt, msg, wParam, lParam, TRUE);
}
- if (M->GetByte("autocopy", 1)) {
+ if (M.GetByte("autocopy", 1)) {
CHARRANGE sel;
SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&sel);
if (sel.cpMin != sel.cpMax) {
@@ -1782,7 +1782,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
else
nItemUnderMouse &= 0xFFFF;
- if (M->GetByte("adv_TipperTooltip", 1) && ServiceExists("mToolTip/HideTip")) {
+ if (M.GetByte("adv_TipperTooltip", 1) && ServiceExists("mToolTip/HideTip")) {
if ((int)nItemUnderMouse == currentHovered) break;
currentHovered = (int)nItemUnderMouse;
@@ -1800,7 +1800,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
}
else
{
- if (M->GetByte("adv_TipperTooltip", 1) && ServiceExists("mToolTip/HideTip")) {
+ if (M.GetByte("adv_TipperTooltip", 1) && ServiceExists("mToolTip/HideTip")) {
KillTimer(hwnd, 1);
if (isToolTip) {
CallService("mToolTip/HideTip", 0, 0);
@@ -1940,7 +1940,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
if (!dat->pContainer->settings->fPrivate)
psi->iSplitterY = g_Settings.iSplitterY;
else {
- if (M->GetByte("Chat", "SyncSplitter", 0))
+ if (M.GetByte("Chat", "SyncSplitter", 0))
psi->iSplitterY = dat->pContainer->settings->splitterPos - DPISCALEY_S(23);
else
psi->iSplitterY = g_Settings.iSplitterY;
@@ -1954,10 +1954,10 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
dat->fInsertMode = FALSE;
- dat->codePage = M->GetDword(dat->hContact, "ANSIcodepage", CP_ACP);
+ dat->codePage = M.GetDword(dat->hContact, "ANSIcodepage", CP_ACP);
dat->Panel->getVisibility();
dat->Panel->Configure();
- M->AddWindow(hwndDlg, dat->hContact);
+ M.AddWindow(hwndDlg, dat->hContact);
BroadCastContainer(dat->pContainer, DM_REFRESHTABINDEX, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_SETOLECALLBACK, 0, (LPARAM)mREOLECallback);
@@ -2049,7 +2049,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
case GC_SETWNDPROPS: {
//HICON hIcon;
- COLORREF colour = M->GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR);
+ COLORREF colour = M.GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR);
InitButtons(hwndDlg, si);
ConfigureSmileyButton(dat);
SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_SETBKGNDCOLOR, 0, colour);
@@ -2082,7 +2082,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
dat->wStatus = si->wStatus;
if (lstrlen(szNick) > 0) {
- if (M->GetByte("cuttitle", 0))
+ if (M.GetByte("cuttitle", 0))
CutContactName(szNick, dat->newtitle, SIZEOF(dat->newtitle));
else {
lstrcpyn(dat->newtitle, szNick, SIZEOF(dat->newtitle));
@@ -2493,7 +2493,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
goto LABEL_SHOWWINDOW;
case SESSION_INITDONE:
- if (M->GetByte("Chat", "PopupOnJoin", 0) != 0)
+ if (M.GetByte("Chat", "PopupOnJoin", 0) != 0)
return TRUE;
// fall through
case WINDOW_VISIBLE:
@@ -2564,7 +2564,7 @@ LABEL_SHOWWINDOW:
dat->Panel->setHeight(pt.y + 2);
dat->panelWidth = -1;
RedrawWindow(hwndDlg, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
- if (M->isAero())
+ if (M.isAero())
InvalidateRect(GetParent(hwndDlg), NULL, FALSE);
SendMessage(hwndDlg, WM_SIZE, DM_SPLITTERMOVED, 0);
break;
@@ -2787,7 +2787,7 @@ LABEL_SHOWWINDOW:
if ((uID > 800 && uID < 1400) || uID == CP_UTF8 || uID == 20866) {
dat->codePage = uID;
- M->WriteDword(dat->hContact, SRMSGMOD_T, "ANSIcodepage", dat->codePage);
+ db_set_dw(dat->hContact, SRMSGMOD_T, "ANSIcodepage", dat->codePage);
}
else if (uID == 500) {
dat->codePage = CP_ACP;
@@ -3233,13 +3233,13 @@ LABEL_SHOWWINDOW:
SendDlgItemMessage(hwndDlg, IDC_FILTER, BUTTONSETOVERLAYICON,
(LPARAM)(si->bFilterEnabled ? PluginConfig.g_iconOverlayEnabled : PluginConfig.g_iconOverlayDisabled), 0);
- if (si->bFilterEnabled && M->GetByte("Chat", "RightClickFilter", 0) == 0) {
+ if (si->bFilterEnabled && M.GetByte("Chat", "RightClickFilter", 0) == 0) {
SendMessage(hwndDlg, GC_SHOWFILTERMENU, 0, 0);
break;
}
SendMessage(hwndDlg, GC_REDRAWLOG, 0, 0);
SendMessage(hwndDlg, GC_UPDATETITLE, 0, 0);
- M->WriteByte(si->hContact, "Chat", "FilterEnabled", (BYTE)si->bFilterEnabled);
+ db_set_b(si->hContact, "Chat", "FilterEnabled", (BYTE)si->bFilterEnabled);
break;
case IDC_BKGCOLOR: {
@@ -3252,7 +3252,7 @@ LABEL_SHOWWINDOW:
break;
if (IsDlgButtonChecked(hwndDlg, IDC_BKGCOLOR)) {
- if (M->GetByte("Chat", "RightClickFilter", 0) == 0)
+ if (M.GetByte("Chat", "RightClickFilter", 0) == 0)
SendMessage(hwndDlg, GC_SHOWCOLORCHOOSER, 0, (LPARAM)IDC_BKGCOLOR);
else if (si->bBGSet) {
cf.dwMask = CFM_BACKCOLOR;
@@ -3261,7 +3261,7 @@ LABEL_SHOWWINDOW:
}
} else {
cf.dwMask = CFM_BACKCOLOR;
- cf.crBackColor = (COLORREF)M->GetDword(FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR);
+ cf.crBackColor = (COLORREF)M.GetDword(FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR);
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
}
}
@@ -3276,7 +3276,7 @@ LABEL_SHOWWINDOW:
break;
if (IsDlgButtonChecked(hwndDlg, IDC_COLOR)) {
- if (M->GetByte("Chat", "RightClickFilter", 0) == 0)
+ if (M.GetByte("Chat", "RightClickFilter", 0) == 0)
SendMessage(hwndDlg, GC_SHOWCOLORCHOOSER, 0, (LPARAM)IDC_COLOR);
else if (si->bFGSet) {
cf.dwMask = CFM_COLOR;
@@ -3335,7 +3335,7 @@ LABEL_SHOWWINDOW:
UINT item_ids[3] = {ID_EXTBKUSERLIST, ID_EXTBKHISTORY, ID_EXTBKINPUTAREA};
UINT ctl_ids[3] = {IDC_LIST, IDC_CHAT_LOG, IDC_CHAT_MESSAGE};
int i;
- bool fAero = M->isAero();
+ bool fAero = M.isAero();
bool fInfoPanel = dat->Panel->isActive();
HANDLE hbp = 0;
HDC hdcMem = 0;
@@ -3374,7 +3374,7 @@ LABEL_SHOWWINDOW:
else {
CSkin::FillBack(hdcMem, &rcClient);
- if (M->isAero()) {
+ if (M.isAero()) {
LONG temp = rcClient.bottom;
rcClient.bottom = dat->Panel->isActive() ? dat->Panel->getHeight() + 5 : 5;
FillRect(hdcMem, &rcClient, (HBRUSH)GetStockObject(BLACK_BRUSH));
@@ -3447,7 +3447,7 @@ LABEL_SHOWWINDOW:
char *szKey = "TAB_ContainersW";
_snprintf(szIndex, 8, "%d", iSelection - IDM_CONTAINERMENU);
if (iSelection - IDM_CONTAINERMENU >= 0) {
- if (!M->GetTString(NULL, szKey, szIndex, &dbv)) {
+ if (!db_get_ts(NULL, szKey, szIndex, &dbv)) {
SendMessage(hwndDlg, DM_CONTAINERSELECTED, 0, (LPARAM)dbv.ptszVal);
db_free(&dbv);
}
@@ -3490,7 +3490,7 @@ LABEL_SHOWWINDOW:
pNewContainer = FindContainerByName(szNewName);
if (pNewContainer == NULL)
pNewContainer = CreateContainer(szNewName, FALSE, dat->hContact);
- M->WriteTString(dat->hContact, SRMSGMOD_T, "containerW", szNewName);
+ db_set_ts(dat->hContact, SRMSGMOD_T, "containerW", szNewName);
PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_DOCREATETAB_CHAT, (WPARAM)pNewContainer, (LPARAM)hwndDlg);
if (iOldItems > 1) // there were more than 1 tab, container is still valid
SendMessage(dat->pContainer->hwndActive, WM_SIZE, 0, 0);
@@ -3763,7 +3763,7 @@ LABEL_SHOWWINDOW:
dat->pWnd = 0;
}
//MAD
- M->RemoveWindow(hwndDlg);
+ M.RemoveWindow(hwndDlg);
TABSRMM_FireEvent(dat->hContact, hwndDlg, MSG_WINDOW_EVT_CLOSE, 0);
break;