diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-05 22:27:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-05 22:27:16 +0000 |
commit | 007b4c7301f0d26a72f89f74e9929f42e24eb3e6 (patch) | |
tree | b1ee30b70c6e36d1a06aed6885cb80dc560a68ca /plugins/SimpleStatusMsg/src | |
parent | f4a1bbc6ba4b8137cb868639ac146aa97e97e9df (diff) |
- rest of menus cleared;
- old database macroses wiped out from all plugins (left in m_database.h for compatibility)
git-svn-id: http://svn.miranda-ng.org/main/trunk@4324 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SimpleStatusMsg/src')
-rw-r--r-- | plugins/SimpleStatusMsg/src/awaymsg.cpp | 69 | ||||
-rw-r--r-- | plugins/SimpleStatusMsg/src/main.cpp | 172 | ||||
-rw-r--r-- | plugins/SimpleStatusMsg/src/msgbox.cpp | 126 | ||||
-rw-r--r-- | plugins/SimpleStatusMsg/src/options.cpp | 204 | ||||
-rw-r--r-- | plugins/SimpleStatusMsg/src/utils.cpp | 8 |
5 files changed, 283 insertions, 296 deletions
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp index 60d26d3b56..e286a13dbd 100644 --- a/plugins/SimpleStatusMsg/src/awaymsg.cpp +++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp @@ -26,9 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "commonheaders.h"
-static HANDLE hAwayMsgMenuItem;
-static HANDLE hCopyMsgMenuItem;
-static HANDLE hGoToURLMenuItem;
+static HGENMENU hAwayMsgMenuItem, hCopyMsgMenuItem, hGoToURLMenuItem;
static HANDLE hWindowList;
static HANDLE hWindowList2;
@@ -106,7 +104,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP TCHAR str[256], format[128];
TCHAR *contactName = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)dat->hContact, GCDNF_TCHAR);
char *szProto = GetContactProto(dat->hContact);
- WORD dwStatus = DBGetContactSettingWord(dat->hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ WORD dwStatus = db_get_w(dat->hContact, szProto, "Status", ID_STATUS_OFFLINE);
TCHAR *status = (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, dwStatus, GSMDF_TCHAR);
GetWindowText(hwndDlg, format, SIZEOF(format));
@@ -335,20 +333,20 @@ static INT_PTR GoToURLMsgCommand(WPARAM wParam, LPARAM lParam) char *szMsg;
- int unicode = !DBGetContactSetting((HANDLE)wParam, "CList", "StatusMsg", &dbv) && (dbv.type == DBVT_UTF8 || dbv.type == DBVT_WCHAR);
- DBFreeVariant(&dbv);
+ int unicode = !db_get((HANDLE)wParam, "CList", "StatusMsg", &dbv) && (dbv.type == DBVT_UTF8 || dbv.type == DBVT_WCHAR);
+ db_free(&dbv);
if (unicode)
{
- DBGetContactSettingWString((HANDLE)wParam, "CList", "StatusMsg", &dbv);
+ db_get_ws((HANDLE)wParam, "CList", "StatusMsg", &dbv);
szMsg = mir_u2a(dbv.pwszVal);
}
else
{
- DBGetContactSettingString((HANDLE)wParam, "CList", "StatusMsg", &dbv);
+ db_get_s((HANDLE)wParam, "CList", "StatusMsg", &dbv);
szMsg = mir_strdup(dbv.pszVal);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
char *szURL = StrFindURL(szMsg);
if (szURL != NULL)
@@ -374,7 +372,7 @@ static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM lParam) {
TCHAR str[128];
char *szProto = GetContactProto((HANDLE)wParam);
- int iHidden = szProto ? DBGetContactSettingByte((HANDLE)wParam, szProto, "ChatRoom", 0) : 0;
+ int iHidden = szProto ? db_get_b((HANDLE)wParam, szProto, "ChatRoom", 0) : 0;
char *szMsg;
int iStatus;
@@ -382,14 +380,11 @@ static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM lParam) clmi.cbSize = sizeof(clmi);
clmi.flags = CMIM_FLAGS | CMIF_HIDDEN | CMIF_TCHAR;
- if (!iHidden)
- {
+ if (!iHidden) {
iHidden = 1;
- iStatus = DBGetContactSettingWord((HANDLE)wParam, szProto, "Status", ID_STATUS_OFFLINE);
- if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1,0) & PF1_MODEMSGRECV)
- {
- if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3,0) & Proto_Status2Flag(iStatus == ID_STATUS_OFFLINE ? ID_STATUS_INVISIBLE : iStatus))
- {
+ iStatus = db_get_w((HANDLE)wParam, szProto, "Status", ID_STATUS_OFFLINE);
+ if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1,0) & PF1_MODEMSGRECV) {
+ if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3,0) & Proto_Status2Flag(iStatus == ID_STATUS_OFFLINE ? ID_STATUS_INVISIBLE : iStatus)) {
iHidden = 0;
clmi.flags = CMIM_FLAGS | CMIM_NAME | CMIM_ICON | CMIF_TCHAR;
clmi.hIcon = LoadSkinnedProtoIcon(szProto, iStatus);
@@ -398,51 +393,43 @@ static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM lParam) }
}
}
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hAwayMsgMenuItem, (LPARAM)&clmi);
+ Menu_ModifyItem(hAwayMsgMenuItem, &clmi);
Skin_ReleaseIcon(clmi.hIcon);
- clmi.flags = CMIM_FLAGS | CMIF_HIDDEN | CMIF_TCHAR;
- if (!iHidden)
- {
+ clmi.flags = CMIM_FLAGS | CMIF_HIDDEN | CMIF_TCHAR;
+ if (!iHidden) {
DBVARIANT dbv;
- int unicode = !DBGetContactSetting((HANDLE)wParam, "CList", "StatusMsg", &dbv) && (dbv.type == DBVT_UTF8 || dbv.type == DBVT_WCHAR);
- DBFreeVariant(&dbv);
- if (unicode)
- {
- DBGetContactSettingWString((HANDLE)wParam, "CList", "StatusMsg", &dbv);
+ int unicode = !db_get((HANDLE)wParam, "CList", "StatusMsg", &dbv) && (dbv.type == DBVT_UTF8 || dbv.type == DBVT_WCHAR);
+ db_free(&dbv);
+ if (unicode) {
+ db_get_ws((HANDLE)wParam, "CList", "StatusMsg", &dbv);
szMsg = mir_u2a(dbv.pwszVal);
}
- else
-
- {
- DBGetContactSettingString((HANDLE)wParam, "CList", "StatusMsg", &dbv);
+ else {
+ db_get_s((HANDLE)wParam, "CList", "StatusMsg", &dbv);
szMsg = mir_strdup(dbv.pszVal);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ShowCopy", 1) && szMsg && *szMsg != '\0')
- {
+ if (db_get_b(NULL, "SimpleStatusMsg", "ShowCopy", 1) && szMsg && *szMsg != '\0') {
clmi.flags = CMIM_FLAGS | CMIM_NAME | CMIF_TCHAR;
mir_sntprintf(str, SIZEOF(str), TranslateT("Copy %s Message"), (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, iStatus, GSMDF_TCHAR));
clmi.ptszName = str;
}
}
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hCopyMsgMenuItem, (LPARAM)&clmi);
- clmi.flags = CMIM_FLAGS | CMIF_HIDDEN | CMIF_TCHAR;
+ Menu_ModifyItem(hCopyMsgMenuItem, &clmi);
- if (!iHidden)
- {
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ShowGoToURL", 1) && StrFindURL(szMsg) != NULL)
- {
+ clmi.flags = CMIM_FLAGS | CMIF_HIDDEN | CMIF_TCHAR;
+ if (!iHidden) {
+ if (db_get_b(NULL, "SimpleStatusMsg", "ShowGoToURL", 1) && StrFindURL(szMsg) != NULL) {
clmi.flags = CMIM_FLAGS | CMIM_NAME | CMIF_TCHAR;
mir_sntprintf(str, SIZEOF(str), TranslateT("&Go to URL in %s Message"), (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, iStatus, GSMDF_TCHAR));
clmi.ptszName = str;
}
mir_free(szMsg);
}
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hGoToURLMenuItem, (LPARAM)&clmi);
-
+ Menu_ModifyItem(hGoToURLMenuItem, &clmi);
return 0;
}
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index b534c8d0b3..92676a3b32 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -152,7 +152,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) for (i = 0; msg[i]; i++)
{
- if (msg[i] == 0x0D && DBGetContactSettingByte(NULL, "SimpleStatusMsg", "RemoveCR", 0))
+ if (msg[i] == 0x0D && db_get_b(NULL, "SimpleStatusMsg", "RemoveCR", 0))
{
TCHAR *p = msg + i;
if (i + 1 <= 1024 && msg[i + 1])
@@ -186,7 +186,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) g_ptszWinampSong = mir_tstrdup(ptszWinampTitle);
}
else if (g_ptszWinampSong && lstrcmp(g_ptszWinampSong, _T("SimpleStatusMsg"))
- && DBGetContactSettingByte(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1))
+ && db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1))
{
ptszWinampTitle = mir_tstrdup(g_ptszWinampSong);
}
@@ -353,7 +353,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) BOOL rmark[25];
for (k = 0; k < SIZEOF(rmark); k++) rmark[k] = FALSE;
- maxk = DBGetContactSettingByte(NULL, "SimpleStatusMsg", "MaxHist", 10);
+ maxk = db_get_b(NULL, "SimpleStatusMsg", "MaxHist", 10);
if (maxk == 0) rmark[0] = TRUE;
while (!rmark[0])
@@ -365,15 +365,15 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) if (k2 == maxk || k2 > maxk) rmark[0] = TRUE;
mir_snprintf(buff, SIZEOF(buff), "SMsg%d", k);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", buff, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv))
{
if (dbv.ptszVal == NULL)
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
continue;
}
lstrcpy(substituteStr, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else continue;
@@ -401,7 +401,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) BOOL rmark[25];
for (k = 0; k < SIZEOF(rmark); k++) rmark[k] = FALSE;
- maxk = DBGetContactSettingWord(NULL, "SimpleStatusMsg", "DefMsgCount", 0);
+ maxk = db_get_w(NULL, "SimpleStatusMsg", "DefMsgCount", 0);
if (maxk == 0) rmark[0] = TRUE;
while (!rmark[0])
@@ -413,15 +413,15 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) if (k2 == maxk || k2 > maxk) rmark[0] = TRUE;
mir_snprintf(buff, SIZEOF(buff), "DefMsg%d", k);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", buff, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv))
{
if (dbv.ptszVal == NULL)
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
continue;
}
lstrcpy(substituteStr, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else continue;
@@ -449,7 +449,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) {
char szSetting[80];
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sMaxLen", szProto);
- len = DBGetContactSettingWord(NULL, "SimpleStatusMsg", szSetting, 1024);
+ len = db_get_w(NULL, "SimpleStatusMsg", szSetting, 1024);
if (len < lstrlen(msg))
{
msg = (TCHAR *)mir_realloc(msg, len * sizeof(TCHAR));
@@ -462,7 +462,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) TCHAR *InsertVarsIntoMsg(TCHAR *tszMsg, const char *szProto, int iStatus, HANDLE hContact)
{
- if (ServiceExists(MS_VARS_FORMATSTRING) && DBGetContactSettingByte(NULL, "SimpleStatusMsg", "EnableVariables", 1))
+ if (ServiceExists(MS_VARS_FORMATSTRING) && db_get_b(NULL, "SimpleStatusMsg", "EnableVariables", 1))
{
FORMATINFO fInfo = {0};
fInfo.cbSize = sizeof(fInfo);
@@ -489,7 +489,7 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto) TCHAR *format;
mir_snprintf(szSetting, SIZEOF(szSetting), "%sFlags", szProto ? szProto : "");
- flags = DBGetContactSettingByte(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(iStatus, szSetting), STATUS_DEFAULT);
+ flags = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(iStatus, szSetting), STATUS_DEFAULT);
if (flags & STATUS_EMPTY_MSG)
return mir_tstrdup(_T(""));
@@ -501,11 +501,11 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto) else
mir_snprintf(szSetting, SIZEOF(szSetting), "Msg");
- if (DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting), &dbv))
+ if (db_get_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting), &dbv))
return NULL; //mir_tstrdup(_T(""));
format = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else if (flags & STATUS_LAST_MSG)
{
@@ -514,18 +514,18 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto) else
mir_snprintf(szSetting, SIZEOF(szSetting), "LastMsg");
- if (DBGetContactSetting(NULL, "SimpleStatusMsg", szSetting, &dbv2))
+ if (db_get(NULL, "SimpleStatusMsg", szSetting, &dbv2))
return NULL; //mir_tstrdup(_T(""));
- if (DBGetContactSettingTString(NULL, "SimpleStatusMsg", dbv2.pszVal, &dbv))
+ if (db_get_ts(NULL, "SimpleStatusMsg", dbv2.pszVal, &dbv))
{
- DBFreeVariant(&dbv2);
+ db_free(&dbv2);
return NULL; //mir_tstrdup(_T(""));
}
format = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
- DBFreeVariant(&dbv2);
+ db_free(&dbv);
+ db_free(&dbv2);
}
else if (flags & STATUS_THIS_MSG)
{
@@ -534,11 +534,11 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto) else
mir_snprintf(szSetting, SIZEOF(szSetting), "Default");
- if (DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting), &dbv))
+ if (db_get_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting), &dbv))
return mir_tstrdup(_T(""));
format = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
format = mir_tstrdup(GetDefaultMessage(iStatus));
@@ -549,9 +549,9 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto) void DBWriteMessage(char *szSetting, TCHAR *tszMsg)
{
if (tszMsg && lstrlen(tszMsg))
- DBWriteContactSettingTString(NULL, "SimpleStatusMsg", szSetting, tszMsg);
+ db_set_ts(NULL, "SimpleStatusMsg", szSetting, tszMsg);
else
- DBDeleteContactSetting(NULL, "SimpleStatusMsg", szSetting);
+ db_unset(NULL, "SimpleStatusMsg", szSetting);
}
void SaveMessageToDB(const char *szProto, TCHAR *tszMsg, BOOL bIsFormat)
@@ -601,7 +601,7 @@ void SaveStatusAsCurrent(const char *szProto, int iStatus) {
char szSetting[80];
mir_snprintf(szSetting, SIZEOF(szSetting), "Cur%sStatus", szProto);
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", szSetting, (WORD)iStatus);
+ db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)iStatus);
}
static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, HANDLE hContact)
@@ -613,10 +613,10 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, {
DBVARIANT dbv;
mir_snprintf(szSetting, SIZEOF(szSetting), "FCur%sMsg", szProto);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", szSetting, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
format = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
//else
// format = mir_tstrdup(_T(""));
@@ -632,7 +632,7 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, return NULL;
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", szProto ? szProto : "");
- flags = DBGetContactSettingByte(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
+ flags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
//if (flags & PROTO_NO_MSG)
//{
@@ -643,10 +643,10 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, {
DBVARIANT dbv;
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sDefault", szProto);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", szSetting, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
format = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
format = mir_tstrdup(_T(""));
@@ -655,10 +655,10 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, {
DBVARIANT dbv;
mir_snprintf(szSetting, SIZEOF(szSetting), "FCur%sMsg", szProto);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", szSetting, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
format = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
//else
// format = mir_tstrdup(_T(""));
@@ -682,10 +682,10 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, int CheckProtoSettings(const char *szProto, int iInitialStatus)
{
- int iSetting = DBGetContactSettingWord(NULL, szProto, "LeaveStatus", -1); //GG settings
+ int iSetting = db_get_w(NULL, szProto, "LeaveStatus", -1); //GG settings
if (iSetting != -1)
return iSetting ? iSetting : iInitialStatus;
- iSetting = DBGetContactSettingWord(NULL, szProto, "OfflineMessageOption", -1); //TLEN settings
+ iSetting = db_get_w(NULL, szProto, "OfflineMessageOption", -1); //TLEN settings
if (iSetting != -1)
{
switch (iSetting)
@@ -752,7 +752,7 @@ int HasProtoStaticStatusMsg(const char *szProto, int iInitialStatus, int iStatus int flags;
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", szProto);
- flags = DBGetContactSettingByte(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
+ flags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
if (flags & PROTO_NO_MSG)
{
@@ -767,11 +767,11 @@ int HasProtoStaticStatusMsg(const char *szProto, int iInitialStatus, int iStatus TCHAR *msg;
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sDefault", szProto);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", szSetting, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
SaveMessageToDB(szProto, dbv.ptszVal, TRUE);
msg = InsertVarsIntoMsg(dbv.ptszVal, szProto, iStatus, NULL);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
Proto_SetStatus(szProto, iInitialStatus, iStatus, msg);
SaveMessageToDB(szProto, msg, FALSE);
mir_free(msg);
@@ -802,7 +802,7 @@ INT_PTR SetStatusModeFromExtern(WPARAM wParam, LPARAM lParam) if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) &~ CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
continue;
- if (DBGetContactSettingByte(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
+ if (db_get_b(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
continue;
if (wParam == ID_STATUS_CURRENT || wParam == 0)
@@ -896,7 +896,7 @@ void SetStatusMessage(const char *szProto, int iInitialStatus, int iStatus, TCHA if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
continue;
- if (!bOnStartup && DBGetContactSettingByte(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
+ if (!bOnStartup && db_get_b(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
continue;
if (iProfileStatus)
@@ -904,11 +904,11 @@ void SetStatusMessage(const char *szProto, int iInitialStatus, int iStatus, TCHA int iProfileNumber = iStatus - 40083;
char szSetting[128];
mir_snprintf(szSetting, SIZEOF(szSetting), "%d_%s", iProfileNumber, accounts->pa[i]->szModuleName);
- iStatus = DBGetContactSettingWord(NULL, "StartupStatus", szSetting, ID_STATUS_OFFLINE);
+ iStatus = db_get_w(NULL, "StartupStatus", szSetting, ID_STATUS_OFFLINE);
if (iStatus == ID_STATUS_IDLE) // the same as ID_STATUS_LAST in StartupStatus
{
mir_snprintf(szSetting, SIZEOF(szSetting), "last_%s", accounts->pa[i]->szModuleName);
- iStatus = DBGetContactSettingWord(NULL, "StartupStatus", szSetting, ID_STATUS_OFFLINE);
+ iStatus = db_get_w(NULL, "StartupStatus", szSetting, ID_STATUS_OFFLINE);
}
else if (iStatus == ID_STATUS_CURRENT)
iStatus = GetCurrentStatus(accounts->pa[i]->szModuleName);
@@ -1124,7 +1124,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) }
mir_snprintf(szSetting, SIZEOF(szSetting), "%sFlags", szProto ? szProto : "");
- iDlgFlags = DBGetContactSettingByte(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(iStatus, szSetting), STATUS_DEFAULT);
+ iDlgFlags = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(iStatus, szSetting), STATUS_DEFAULT);
bShowDlg = iDlgFlags & STATUS_SHOW_DLG || bOnStartup;
SystemParametersInfo(SPI_GETSCREENSAVERRUNNING, 0, &bScreenSaverRunning, 0);
@@ -1151,7 +1151,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) }
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", szProto);
- iProtoFlags = DBGetContactSettingByte(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
+ iProtoFlags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
if (iProtoFlags & PROTO_NO_MSG || iProtoFlags & PROTO_THIS_MSG)
{
if (HasProtoStaticStatusMsg(szProto, iStatus, iStatus))
@@ -1163,10 +1163,10 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) TCHAR *msg = NULL;
mir_snprintf(szSetting, SIZEOF(szSetting), "FCur%sMsg", szProto);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", szSetting, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
msg = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
//else
// msg = mir_tstrdup(_T(""));
@@ -1218,7 +1218,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) if (iStatus == ID_STATUS_OFFLINE || (!(accounts->statusMsgFlags & Proto_Status2Flag(iStatus)) && iStatus != ID_STATUS_CURRENT))
return 0;
- iProtoFlags = DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ProtoFlags", PROTO_DEFAULT);
+ iProtoFlags = db_get_b(NULL, "SimpleStatusMsg", "ProtoFlags", PROTO_DEFAULT);
if (!bShowDlg || bScreenSaverRunning || (iProtoFlags & PROTO_NOCHANGE && !bOnStartup))
{
TCHAR *msg = NULL;
@@ -1230,7 +1230,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
continue;
- if (DBGetContactSettingByte(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
+ if (db_get_b(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
continue;
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iStatus)) ||
@@ -1241,10 +1241,10 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) {
DBVARIANT dbv;
mir_snprintf(szSetting, SIZEOF(szSetting), "FCur%sMsg", accounts->pa[i]->szModuleName);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", szSetting, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
msg = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
//else
// msg = mir_tstrdup(_T(""));
@@ -1397,7 +1397,7 @@ int SetStartupStatus(int i) }
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", accounts->pa[i]->szModuleName);
- flags = DBGetContactSettingByte(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
+ flags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
if (flags & PROTO_NO_MSG || flags & PROTO_THIS_MSG)
{
if (HasProtoStaticStatusMsg(accounts->pa[i]->szModuleName, ID_STATUS_OFFLINE, iStatus))
@@ -1407,10 +1407,10 @@ int SetStartupStatus(int i) {
DBVARIANT dbv;
mir_snprintf(szSetting, SIZEOF(szSetting), "FCur%sMsg", accounts->pa[i]->szModuleName);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", szSetting, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
fmsg = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
//else
// fmsg = mir_tstrdup(_T(""));
@@ -1468,7 +1468,7 @@ VOID CALLBACK SetStartupStatusGlobal(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWO }
// popup status msg dialog at startup?
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "StartupPopupDlg", 1) && accounts->statusMsgFlags)
+ if (db_get_b(NULL, "SimpleStatusMsg", "StartupPopupDlg", 1) && accounts->statusMsgFlags)
{
if (globalstatus)
{
@@ -1477,7 +1477,7 @@ VOID CALLBACK SetStartupStatusGlobal(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWO else
{
// pseudo-currentDesiredStatusMode ;-)
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", "StartupStatus", (WORD)temp_status_mode);
+ db_set_w(NULL, "SimpleStatusMsg", "StartupStatus", (WORD)temp_status_mode);
ChangeStatusMessage((WPARAM)ID_STATUS_CURRENT, (LPARAM)"SimpleStatusMsgGlobalStartupStatus");
}
return;
@@ -1491,7 +1491,7 @@ VOID CALLBACK SetStartupStatusGlobal(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWO if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
continue;
-// if (DBGetContactSettingByte(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
+// if (db_get_b(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
// continue;
SetStartupStatus(i);
@@ -1533,7 +1533,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD d MIRANDA_IDLE_INFO mii = {0};
mii.cbSize = sizeof(mii);
CallService(MS_IDLE_GETIDLEINFO, 0, (LPARAM)&mii);
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "NoUpdateOnIdle", 1) && mii.idleType)
+ if (db_get_b(NULL, "SimpleStatusMsg", "NoUpdateOnIdle", 1) && mii.idleType)
return;
if (!hwndSAMsgDialog)
@@ -1559,22 +1559,22 @@ VOID CALLBACK UpdateMsgTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD d continue;
mir_snprintf(szBuffer, SIZEOF(szBuffer), "FCur%sMsg", accounts->pa[i]->szModuleName);
- if (DBGetContactSettingTString(NULL, "SimpleStatusMsg", szBuffer, &dbv))
+ if (db_get_ts(NULL, "SimpleStatusMsg", szBuffer, &dbv))
continue;
tszMsg = InsertVarsIntoMsg(dbv.ptszVal, accounts->pa[i]->szModuleName, iCurrentStatus, NULL);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szBuffer, SIZEOF(szBuffer), "Cur%sMsg", accounts->pa[i]->szModuleName);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", szBuffer, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", szBuffer, &dbv))
{
if (tszMsg && dbv.ptszVal && !lstrcmp(tszMsg, dbv.ptszVal) || !tszMsg && !dbv.ptszVal)
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_free(tszMsg);
continue;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (tszMsg && lstrlen(tszMsg))
@@ -1647,7 +1647,7 @@ static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam) CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB | CMIF_TCHAR;
- if (!DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ShowStatusMenuItem", 1))
+ if (!db_get_b(NULL, "SimpleStatusMsg", "ShowStatusMenuItem", 1))
mi.flags |= CMIF_HIDDEN;
mi.icolibItem = GetIconHandle(IDI_CSMSG);
mi.pszService = MS_SIMPLESTATUSMSG_SHOWDIALOGINT;
@@ -1676,7 +1676,7 @@ static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam) continue;
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", pa[i]->szModuleName);
- iProtoFlags = DBGetContactSettingByte(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
+ iProtoFlags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
if (iProtoFlags & PROTO_NO_MSG || iProtoFlags & PROTO_THIS_MSG)
continue;
@@ -1717,7 +1717,7 @@ static int OnIdleChanged(WPARAM, LPARAM lParam) if (!IsAccountEnabled(accounts->pa[i]))
continue;
- if (DBGetContactSettingByte(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
+ if (db_get_b(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
continue;
int iStatusBits = CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0);
@@ -1734,7 +1734,7 @@ static int OnIdleChanged(WPARAM, LPARAM lParam) if (iCurrentStatus < ID_STATUS_ONLINE || iCurrentStatus == ID_STATUS_INVISIBLE)
continue;
- if ((lParam & IDF_ISIDLE && (DBGetContactSettingByte(NULL, "AutoAway", accounts->pa[i]->szModuleName, 0) ||
+ if ((lParam & IDF_ISIDLE && (db_get_b(NULL, "AutoAway", accounts->pa[i]->szModuleName, 0) ||
iCurrentStatus == ID_STATUS_ONLINE || iCurrentStatus == ID_STATUS_FREECHAT)) ||
(!(lParam & IDF_ISIDLE) && !mii.aaLock))
{
@@ -1791,11 +1791,11 @@ static int CSStatusChange(WPARAM wParam, LPARAM lParam) #ifdef _DEBUG
log2file("CSStatusChange(): Set \"%s\" status message for %s.", ps[i]->szMsg, ps[i]->szName);
#endif
- max_hist_msgs = DBGetContactSettingByte(NULL, "SimpleStatusMsg", "MaxHist", 10);
+ max_hist_msgs = db_get_b(NULL, "SimpleStatusMsg", "MaxHist", 10);
for (j = 1; j <= max_hist_msgs; j++)
{
mir_snprintf(buff, SIZEOF(buff), "SMsg%d", j);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", buff, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv))
{
if (!lstrcmp(dbv.ptszVal, szMsgW))
@@ -1803,8 +1803,8 @@ static int CSStatusChange(WPARAM wParam, LPARAM lParam) {
found = TRUE;
mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sMsg", ps[i]->szName);
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", szSetting, buff);
- DBFreeVariant(&dbv);
+ db_set_s(NULL, "SimpleStatusMsg", szSetting, buff);
+ db_free(&dbv);
break;
}
}
@@ -1814,12 +1814,12 @@ static int CSStatusChange(WPARAM wParam, LPARAM lParam) {
mir_snprintf(buff, SIZEOF(buff), "FCur%sMsg", ps[i]->szName);
mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sMsg", ps[i]->szName);
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", szSetting, buff);
+ db_set_s(NULL, "SimpleStatusMsg", szSetting, buff);
}
mir_snprintf(szSetting, SIZEOF(szSetting), "%sMsg", ps[i]->szName);
- DBWriteContactSettingWString(NULL, "SRAway", StatusModeToDbSetting(status_mode, szSetting), szMsgW);
+ db_set_ws(NULL, "SRAway", StatusModeToDbSetting(status_mode, szSetting), szMsgW);
msg = InsertVarsIntoMsg(szMsgW, ps[i]->szName, status_mode, NULL);
SaveMessageToDB(ps[i]->szName, szMsgW, TRUE);
mir_free(szMsgW);
@@ -1847,7 +1847,7 @@ static TCHAR *ParseWinampSong(ARGUMENTSINFO *ai) mir_free(g_ptszWinampSong);
g_ptszWinampSong = mir_tstrdup(ptszWinampTitle);
}
- else if (g_ptszWinampSong && lstrcmp(g_ptszWinampSong, _T("SimpleStatusMsg")) && DBGetContactSettingByte(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1))
+ else if (g_ptszWinampSong && lstrcmp(g_ptszWinampSong, _T("SimpleStatusMsg")) && db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1))
ptszWinampTitle = mir_tstrdup(g_ptszWinampSong);
return ptszWinampTitle;
@@ -1886,7 +1886,7 @@ static int OnICQStatusMsgRequest(WPARAM wParam, LPARAM lParam, LPARAM lMirParam) log2file("OnICQStatusMsgRequest(): UIN: %d on %s", (int)lParam, (char *)lMirParam);
#endif
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "NoUpdateOnICQReq", 1))
+ if (db_get_b(NULL, "SimpleStatusMsg", "NoUpdateOnICQReq", 1))
return 0;
HANDLE hContact;
@@ -1897,7 +1897,7 @@ static int OnICQStatusMsgRequest(WPARAM wParam, LPARAM lParam, LPARAM lMirParam) while (hContact)
{
szProto = GetContactProto(hContact);
- if (szProto != NULL && !strcmp(szProto, (char *)lMirParam) && DBGetContactSettingDword(hContact, szProto, "UIN", 0) == (DWORD)lParam)
+ if (szProto != NULL && !strcmp(szProto, (char *)lMirParam) && db_get_dw(hContact, szProto, "UIN", 0) == (DWORD)lParam)
{
bContactFound = TRUE;
break;
@@ -1991,7 +1991,7 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam) tr.szHelpText = LPGEN("External Applications\tretrieves song name of the song currently playing in Winamp (Simple Status Message compatible)");
CallService(MS_VARS_REGISTERTOKEN, 0, (LPARAM)&tr);
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ExclDateToken", 0) != 0)
+ if (db_get_b(NULL, "SimpleStatusMsg", "ExclDateToken", 0) != 0)
{
tr.tszTokenString = _T("date");
tr.parseFunctionT = ParseDate;
@@ -2000,13 +2000,13 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam) }
}
-/* if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1))*/ {
+/* if (db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1))*/ {
DBVARIANT dbv;
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", "AmpLastTitle", &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", "AmpLastTitle", &dbv))
{
g_ptszWinampSong = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
g_ptszWinampSong = mir_tstrdup(_T("SimpleStatusMsg"));
@@ -2014,8 +2014,8 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam) /* else
g_ptszWinampSong = mir_tstrdup(_T("SimpleStatusMsg"));*/
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "UpdateMsgOn", 1))
- g_uUpdateMsgTimer = SetTimer(NULL, 0, DBGetContactSettingWord(NULL, "SimpleStatusMsg", "UpdateMsgInt", 10) * 1000, (TIMERPROC)UpdateMsgTimerProc);
+ if (db_get_b(NULL, "SimpleStatusMsg", "UpdateMsgOn", 1))
+ g_uUpdateMsgTimer = SetTimer(NULL, 0, db_get_w(NULL, "SimpleStatusMsg", "UpdateMsgInt", 10) * 1000, (TIMERPROC)UpdateMsgTimerProc);
if (ServiceExists(MS_CS_SETSTATUSEX))
HookEvent(ME_CS_STATUSCHANGEEX, CSStatusChange);
@@ -2025,9 +2025,9 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam) if (!ServiceExists(MS_SS_GETPROFILECOUNT))
{
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "GlobalStatusDelay", 1))
+ if (db_get_b(NULL, "SimpleStatusMsg", "GlobalStatusDelay", 1))
{
- SetTimer(NULL, 0, DBGetContactSettingWord(NULL, "SimpleStatusMsg", "SetStatusDelay", 300), (TIMERPROC)SetStartupStatusGlobal);
+ SetTimer(NULL, 0, db_get_w(NULL, "SimpleStatusMsg", "SetStatusDelay", 300), (TIMERPROC)SetStartupStatusGlobal);
}
else
{
@@ -2043,7 +2043,7 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam) continue;
mir_snprintf(szSetting, SIZEOF(szSetting), "Set%sStatusDelay", accounts->pa[i]->szModuleName);
- g_uSetStatusTimer[i] = SetTimer(NULL, 0, DBGetContactSettingWord(NULL, "SimpleStatusMsg", szSetting, 300), (TIMERPROC)SetStartupStatusProc);
+ g_uSetStatusTimer[i] = SetTimer(NULL, 0, db_get_w(NULL, "SimpleStatusMsg", szSetting, 300), (TIMERPROC)SetStartupStatusProc);
}
}
}
@@ -2066,10 +2066,10 @@ static int OnOkToExit(WPARAM wParam, LPARAM lParam) continue;
mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sStatus", accounts->pa[i]->szModuleName);
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", szSetting, (WORD)CallProtoService(accounts->pa[i]->szModuleName, PS_GETSTATUS, 0, 0));
+ db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)CallProtoService(accounts->pa[i]->szModuleName, PS_GETSTATUS, 0, 0));
}
- if (g_ptszWinampSong && lstrcmp(g_ptszWinampSong, _T("SimpleStatusMsg")) /*&& DBGetContactSettingByte(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1)*/)
+ if (g_ptszWinampSong && lstrcmp(g_ptszWinampSong, _T("SimpleStatusMsg")) /*&& db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1)*/)
DBWriteMessage("AmpLastTitle", g_ptszWinampSong);
}
@@ -2119,7 +2119,7 @@ extern "C" int __declspec(dllexport) Load(void) hwndSAMsgDialog = NULL;
accounts = (PROTOACCOUNTS *)mir_alloc(sizeof(PROTOACCOUNTS));
- DBWriteContactSettingWord(NULL, "CList", "Status", (WORD)ID_STATUS_OFFLINE);
+ db_set_w(NULL, "CList", "Status", (WORD)ID_STATUS_OFFLINE);
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
HookEvent(ME_PROTO_ACCLISTCHANGED, OnAccListChanged);
diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp index e7b4a7c436..b98b9d5c40 100644 --- a/plugins/SimpleStatusMsg/src/msgbox.cpp +++ b/plugins/SimpleStatusMsg/src/msgbox.cpp @@ -242,7 +242,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) else
cbei.mask = CBEIF_LPARAM | CBEIF_TEXT | CBEIF_IMAGE | CBEIF_SELECTEDIMAGE;
- j = DBGetContactSettingWord(NULL, "SimpleStatusMsg", "LMMsg", 1);
+ j = db_get_w(NULL, "SimpleStatusMsg", "LMMsg", 1);
for (i = 1; i <= data->max_hist_msgs; ++i)
{
@@ -250,7 +250,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) if (j < 1) j = data->max_hist_msgs;
mir_snprintf(buff, SIZEOF(buff), "SMsg%d", j);
j--;
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", buff, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv))
{
if (dbv.ptszVal != NULL && dbv.ptszVal != '\0')
{
@@ -269,11 +269,11 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) if (SendMessage(handle, CBEM_INSERTITEM, 0, (LPARAM)&cbei) == -1)
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
break;
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -361,13 +361,13 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) {
// predefined messages
mir_snprintf(buff, SIZEOF(buff), "DefMsg%d", i);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", buff, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv))
{
if (dbv.ptszVal)
{
if (!lstrlen(dbv.ptszVal))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
continue;
}
@@ -386,11 +386,11 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) if (SendMessage(handle,CBEM_INSERTITEM,0,(LPARAM)&cbei) == -1)
break;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "PutDefInList", 0))
+ if (db_get_b(NULL, "SimpleStatusMsg", "PutDefInList", 0))
{
cbei.iItem = -1;
cbei.pszText = (LPTSTR)GetDefaultMessage(data->m_iStatus);
@@ -704,9 +704,9 @@ void ClearHistory(struct MsgBoxData *data, int cur_sel) for (i = 1; i <= data->max_hist_msgs; i++)
{
mir_snprintf(text, SIZEOF(text), "SMsg%d", i);
- DBWriteContactSettingTString(NULL, "SimpleStatusMsg", text, _T(""));
+ db_set_ts(NULL, "SimpleStatusMsg", text, _T(""));
}
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", "LastMsg", "");
+ db_set_s(NULL, "SimpleStatusMsg", "LastMsg", "");
for (i = 0; i < accounts->count; i++)
{
if (!IsAccountEnabled(accounts->pa[i]))
@@ -719,9 +719,9 @@ void ClearHistory(struct MsgBoxData *data, int cur_sel) continue;
mir_snprintf(buff2, SIZEOF(buff2), "Last%sMsg", accounts->pa[i]->szModuleName);
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", buff2, "");
+ db_set_s(NULL, "SimpleStatusMsg", buff2, "");
}
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", "LMMsg", (WORD)data->max_hist_msgs);
+ db_set_w(NULL, "SimpleStatusMsg", "LMMsg", (WORD)data->max_hist_msgs);
SendMessage(data->recent_cbex, CB_SETCURSEL, -1, 0);
num_items = SendMessage(data->recent_cbex, CB_GETCOUNT, 0, 0);
if (num_items == CB_ERR)
@@ -750,7 +750,7 @@ void DisplayCharsCount(struct MsgBoxData *dlg_data, HWND hwndDlg) return;
len = GetDlgItemText(hwndDlg, IDC_EDIT1, msg, SIZEOF(msg));
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "RemoveCR", 0))
+ if (db_get_b(NULL, "SimpleStatusMsg", "RemoveCR", 0))
{
int index, num_lines = SendMessage(GetDlgItem(hwndDlg, IDC_EDIT1), EM_GETLINECOUNT, 0, 0);
for (int i = 1; i < num_lines; ++i)
@@ -773,7 +773,7 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) num_start -= data->num_def_msgs + 1;
mir_snprintf(setting, SIZEOF(setting), "%sFlags", data->m_szProto ? data->m_szProto : "");
- flags = DBGetContactSettingByte(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(iStatus, setting), STATUS_DEFAULT);
+ flags = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(iStatus, setting), STATUS_DEFAULT);
if (flags & STATUS_LAST_MSG)
{
@@ -782,11 +782,11 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) else
mir_snprintf(setting, SIZEOF(setting), "LastMsg");
- if (!DBGetContactSetting(NULL, "SimpleStatusMsg", setting, &dbv))
+ if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv))
{
if (dbv.pszVal)
{
- if (strlen(dbv.pszVal) && !DBGetContactSettingTString(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2))
+ if (strlen(dbv.pszVal) && !db_get_ts(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2))
{
if (dbv2.ptszVal && lstrlen(dbv2.ptszVal))
{
@@ -795,17 +795,17 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) if (fcursel != CB_ERR)
SendMessage(data->recent_cbex, CB_SETCURSEL, (WPARAM)fcursel, 0);
}
- DBFreeVariant(&dbv2);
+ db_free(&dbv2);
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else if (flags & STATUS_DEFAULT_MSG)
{
SetDlgItemText(hwndDlg, IDC_EDIT1, GetDefaultMessage(iStatus));
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "PutDefInList", 0))
+ if (db_get_b(NULL, "SimpleStatusMsg", "PutDefInList", 0))
{
fcursel = SendMessage(data->recent_cbex, CB_FINDSTRINGEXACT, num_start, (LPARAM)GetDefaultMessage(iStatus));
if (fcursel != CB_ERR)
@@ -819,13 +819,13 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) else
mir_snprintf(setting, SIZEOF(setting), "Default");
- if (!DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting), &dbv))
+ if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting), &dbv))
{
SetDlgItemText(hwndDlg, IDC_EDIT1, dbv.ptszVal);
fcursel = SendMessage(data->recent_cbex, CB_FINDSTRINGEXACT, num_start, (LPARAM)dbv.ptszVal);
if (fcursel != CB_ERR)
SendMessage(data->recent_cbex, CB_SETCURSEL, (WPARAM)fcursel, 0);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else if (flags & STATUS_LAST_STATUS_MSG)
@@ -835,13 +835,13 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) else
mir_snprintf(setting, SIZEOF(setting), "Msg");
- if (!DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting), &dbv))
+ if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting), &dbv))
{
SetDlgItemText(hwndDlg, IDC_EDIT1, dbv.ptszVal);
fcursel = SendMessage(data->recent_cbex, CB_FINDSTRINGEXACT, num_start, (LPARAM)dbv.ptszVal);
if (fcursel != CB_ERR)
SendMessage(data->recent_cbex, CB_SETCURSEL, (WPARAM)fcursel, 0);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -1021,9 +1021,9 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA HookEventMessage(ME_SYSTEM_PRESHUTDOWN, hwndDlg, DM_SIMPAWAY_SHUTDOWN);
HookEventMessage(ME_SKIN2_ICONSCHANGED, hwndDlg, DM_SIMPAWAY_CHANGEICONS);
- copy_init_data->num_def_msgs = DBGetContactSettingWord(NULL, "SimpleStatusMsg", "DefMsgCount", 0);
- copy_init_data->max_hist_msgs = DBGetContactSettingByte(NULL, "SimpleStatusMsg", "MaxHist", 10);
- copy_init_data->m_iDlgFlags = DBGetContactSettingByte(NULL, "SimpleStatusMsg", "DlgFlags", DLG_SHOW_DEFAULT);
+ copy_init_data->num_def_msgs = db_get_w(NULL, "SimpleStatusMsg", "DefMsgCount", 0);
+ copy_init_data->max_hist_msgs = db_get_b(NULL, "SimpleStatusMsg", "MaxHist", 10);
+ copy_init_data->m_iDlgFlags = db_get_b(NULL, "SimpleStatusMsg", "DlgFlags", DLG_SHOW_DEFAULT);
copy_init_data->m_szProto = init_data->m_szProto;
copy_init_data->m_iStatus = init_data->m_iStatus;
copy_init_data->m_iStatusModes = init_data->m_iStatusModes;
@@ -1144,9 +1144,9 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA }
}
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "AutoClose", 1) && init_data->m_bOnEvent)
+ if (db_get_b(NULL, "SimpleStatusMsg", "AutoClose", 1) && init_data->m_bOnEvent)
{
- copy_init_data->m_iCountdown = DBGetContactSettingByte(NULL, "SimpleStatusMsg", "DlgTime", 5);
+ copy_init_data->m_iCountdown = db_get_b(NULL, "SimpleStatusMsg", "DlgTime", 5);
SendMessage(hwndDlg, WM_TIMER, 0, 0);
SetTimer(hwndDlg, 1, 1000, 0);
}
@@ -1170,7 +1170,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA else
SetFocus(GetDlgItem(hwndDlg, IDC_OK));
- if (!DBGetContactSettingByte(NULL, "SimpleStatusMsg", "WinCentered", 1))
+ if (!db_get_b(NULL, "SimpleStatusMsg", "WinCentered", 1))
{
WINDOWPLACEMENT wp;
int x, y;
@@ -1178,8 +1178,8 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA wp.length = sizeof(wp);
GetWindowPlacement(hwndDlg, &wp);
- x = (int)DBGetContactSettingDword(NULL, "SimpleStatusMsg", "Winx", -1);
- y = (int)DBGetContactSettingDword(NULL, "SimpleStatusMsg", "Winy", -1);
+ x = (int)db_get_dw(NULL, "SimpleStatusMsg", "Winx", -1);
+ y = (int)db_get_dw(NULL, "SimpleStatusMsg", "Winy", -1);
if (x !=- 1)
{
@@ -1238,14 +1238,14 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (msgbox_data->m_szProto)
{
mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sMsg", msgbox_data->m_szProto);
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", szSetting, "");
+ db_set_s(NULL, "SimpleStatusMsg", szSetting, "");
mir_snprintf(szSetting, SIZEOF(szSetting), "%sMsg", msgbox_data->m_szProto);
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, szSetting), _T(""));
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, szSetting), _T(""));
}
else
{
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", "LastMsg", "");
+ db_set_s(NULL, "SimpleStatusMsg", "LastMsg", "");
for (int j = 0; j < accounts->count; j++)
{
if (!IsAccountEnabled(accounts->pa[j]))
@@ -1254,21 +1254,21 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (!CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
continue;
- if (DBGetContactSettingByte(NULL, accounts->pa[j]->szModuleName, "LockMainStatus", 0))
+ if (db_get_b(NULL, accounts->pa[j]->szModuleName, "LockMainStatus", 0))
continue;
if (!(CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sMsg", accounts->pa[j]->szModuleName);
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", szSetting, "");
+ db_set_s(NULL, "SimpleStatusMsg", szSetting, "");
mir_snprintf(szSetting, SIZEOF(szSetting), "%sMsg", accounts->pa[j]->szModuleName);
iStatus = msgbox_data->m_bOnStartup ? GetStartupStatus(accounts->pa[j]->szModuleName) : GetCurrentStatus(accounts->pa[j]->szModuleName);
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting), _T(""));
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting), _T(""));
}
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, "Msg"), _T("")); // for compatibility with some plugins
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, "Msg"), _T("")); // for compatibility with some plugins
}
if (bCurrentStatus)
@@ -1287,7 +1287,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA for (int i = 1; i <= msgbox_data->max_hist_msgs; i++)
{
mir_snprintf(buff, SIZEOF(buff), "SMsg%d", i);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", buff, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv))
{
if (!lstrcmp(dbv.ptszVal, tszMsg))
{
@@ -1295,14 +1295,14 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (msgbox_data->m_szProto)
{
mir_snprintf(buff2, SIZEOF(buff2), "Last%sMsg", msgbox_data->m_szProto);
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", buff2, buff);
+ db_set_s(NULL, "SimpleStatusMsg", buff2, buff);
mir_snprintf(buff2, SIZEOF(buff2), "%sMsg", msgbox_data->m_szProto);
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, buff2), tszMsg);
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, buff2), tszMsg);
}
else
{
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", "LastMsg", buff);
+ db_set_s(NULL, "SimpleStatusMsg", "LastMsg", buff);
for (int j = 0; j < accounts->count; j++)
{
if (!IsAccountEnabled(accounts->pa[j]))
@@ -1311,21 +1311,21 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (!CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
continue;
- if (DBGetContactSettingByte(NULL, accounts->pa[j]->szModuleName, "LockMainStatus", 0))
+ if (db_get_b(NULL, accounts->pa[j]->szModuleName, "LockMainStatus", 0))
continue;
if (!(CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
mir_snprintf(buff2, SIZEOF(buff2), "Last%sMsg", accounts->pa[j]->szModuleName);
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", buff2, buff);
+ db_set_s(NULL, "SimpleStatusMsg", buff2, buff);
mir_snprintf(buff2, SIZEOF(buff2), "%sMsg", accounts->pa[j]->szModuleName);
iStatus = msgbox_data->m_bOnStartup ? GetStartupStatus(accounts->pa[j]->szModuleName) : GetCurrentStatus(accounts->pa[j]->szModuleName);
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(iStatus, buff2), tszMsg);
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, buff2), tszMsg);
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
break;
}
}
@@ -1333,7 +1333,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (!found)
{
- int last_modified_msg = DBGetContactSettingWord(NULL, "SimpleStatusMsg", "LMMsg", msgbox_data->max_hist_msgs);
+ int last_modified_msg = db_get_w(NULL, "SimpleStatusMsg", "LMMsg", msgbox_data->max_hist_msgs);
if (last_modified_msg == msgbox_data->max_hist_msgs)
last_modified_msg = 1;
@@ -1341,19 +1341,19 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA last_modified_msg++;
mir_snprintf(buff, SIZEOF(buff), "SMsg%d", last_modified_msg);
- DBWriteContactSettingTString(NULL, "SimpleStatusMsg", buff, tszMsg);
+ db_set_ts(NULL, "SimpleStatusMsg", buff, tszMsg);
if (msgbox_data->m_szProto)
{
mir_snprintf(buff2, SIZEOF(buff2), "Last%sMsg", msgbox_data->m_szProto);
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", buff2, buff);
+ db_set_s(NULL, "SimpleStatusMsg", buff2, buff);
mir_snprintf(buff2, SIZEOF(buff2), "%sMsg", msgbox_data->m_szProto);
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, buff2), tszMsg);
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, buff2), tszMsg);
}
else
{
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", "LastMsg", buff);
+ db_set_s(NULL, "SimpleStatusMsg", "LastMsg", buff);
for (int j = 0; j < accounts->count; j++)
{
if (!IsAccountEnabled(accounts->pa[j]))
@@ -1362,25 +1362,25 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (!CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
continue;
- if (DBGetContactSettingByte(NULL, accounts->pa[j]->szModuleName, "LockMainStatus", 0))
+ if (db_get_b(NULL, accounts->pa[j]->szModuleName, "LockMainStatus", 0))
continue;
if (!(CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
mir_snprintf(buff2, SIZEOF(buff2), "Last%sMsg", accounts->pa[j]->szModuleName);
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", buff2, buff);
+ db_set_s(NULL, "SimpleStatusMsg", buff2, buff);
mir_snprintf(buff2, SIZEOF(buff2), "%sMsg", accounts->pa[j]->szModuleName);
iStatus = msgbox_data->m_bOnStartup ? GetStartupStatus(accounts->pa[j]->szModuleName) : GetCurrentStatus(accounts->pa[j]->szModuleName);
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(iStatus, buff2), tszMsg);
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, buff2), tszMsg);
}
}
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", "LMMsg", (WORD)last_modified_msg);
+ db_set_w(NULL, "SimpleStatusMsg", "LMMsg", (WORD)last_modified_msg);
}
if (!msgbox_data->m_szProto)
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, "Msg"), tszMsg); // for compatibility with some plugins
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, "Msg"), tszMsg); // for compatibility with some plugins
if (bCurrentStatus)
SetStatusMessage(msgbox_data->m_szProto, msgbox_data->m_iInitialStatus, ID_STATUS_CURRENT, tszMsg, msgbox_data->m_bOnStartup);
@@ -1526,7 +1526,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA {
char szSetting[16];
mir_snprintf(szSetting, SIZEOF(szSetting), "SMsg%d", (int)HIWORD(histitem.lParam));
- DBWriteContactSettingTString(NULL, "SimpleStatusMsg", szSetting, _T(""));
+ db_set_ts(NULL, "SimpleStatusMsg", szSetting, _T(""));
SendMessage(msgbox_data->recent_cbex, CBEM_DELETEITEM, (WPARAM)msgbox_data->curr_sel_msg, 0);
}
if (LOWORD(histitem.lParam) == PREDEFINED_MSG)
@@ -1660,7 +1660,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (LOWORD(histitem.lParam) == HISTORY_MSG)
{
mir_snprintf(buff, SIZEOF(buff), "SMsg%d", (int)HIWORD(histitem.lParam));
- DBWriteContactSettingTString(NULL, "SimpleStatusMsg", buff, _T(""));
+ db_set_ts(NULL, "SimpleStatusMsg", buff, _T(""));
}
else if (LOWORD(histitem.lParam) == PREDEFINED_MSG)
{
@@ -1737,8 +1737,8 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA WINDOWPLACEMENT wp;
wp.length = sizeof(wp);
GetWindowPlacement(hwndDlg, &wp);
- DBWriteContactSettingDword(NULL, "SimpleStatusMsg", "Winx", wp.rcNormalPosition.left);
- DBWriteContactSettingDword(NULL, "SimpleStatusMsg", "Winy", wp.rcNormalPosition.top);
+ db_set_dw(NULL, "SimpleStatusMsg", "Winx", wp.rcNormalPosition.left);
+ db_set_dw(NULL, "SimpleStatusMsg", "Winy", wp.rcNormalPosition.top);
if (msgbox_data->m_bPredefChanged)
{
@@ -1761,13 +1761,13 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (LOWORD(cbitem.lParam) == PREDEFINED_MSG)
{
new_num_def_msgs++;
- DBWriteContactSettingTString(NULL, "SimpleStatusMsg", buff, text);
+ db_set_ts(NULL, "SimpleStatusMsg", buff, text);
}
else
- DBDeleteContactSetting(NULL, "SimpleStatusMsg", buff);
+ db_unset(NULL, "SimpleStatusMsg", buff);
num_items--;
}
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", "DefMsgCount", (WORD)new_num_def_msgs);
+ db_set_w(NULL, "SimpleStatusMsg", "DefMsgCount", (WORD)new_num_def_msgs);
}
ImageList_Destroy(msgbox_data->status_icons);
diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index 4aef49ef2d..e803be5784 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -138,13 +138,13 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_SETITEMDATA, (WPARAM)index, (LPARAM)i - ID_STATUS_ONLINE);
- val = DBGetContactSettingByte(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(i, "Flags"), STATUS_DEFAULT);
+ val = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(i, "Flags"), STATUS_DEFAULT);
data->status_msg[0].flags[i - ID_STATUS_ONLINE] = val;
- if (DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(i, "Default"), &dbv))
+ if (db_get_ts(NULL, "SRAway", StatusModeToDbSetting(i, "Default"), &dbv))
dbv.ptszVal = mir_tstrdup(GetDefaultMessage(i));
lstrcpy(data->status_msg[0].msg[i - ID_STATUS_ONLINE], dbv.ptszVal);
mir_free(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
for (j = 0; j < accounts->count; j++)
{
@@ -152,14 +152,14 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L continue;
mir_snprintf(setting, SIZEOF(setting), "%sFlags", accounts->pa[j]->szModuleName);
- val = DBGetContactSettingByte(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(i, setting), STATUS_DEFAULT);
+ val = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(i, setting), STATUS_DEFAULT);
data->status_msg[j+1].flags[i-ID_STATUS_ONLINE] = val;
mir_snprintf(setting, SIZEOF(setting), "%sDefault", accounts->pa[j]->szModuleName);
- if (DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(i, setting), &dbv))
+ if (db_get_ts(NULL, "SRAway", StatusModeToDbSetting(i, setting), &dbv))
dbv.ptszVal = mir_tstrdup(GetDefaultMessage(i));
lstrcpy(data->status_msg[j + 1].msg[i - ID_STATUS_ONLINE], dbv.ptszVal);
mir_free(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
@@ -190,7 +190,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L {
data->proto_msg[0].msg = NULL;
- val = DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ProtoFlags", PROTO_DEFAULT);
+ val = db_get_b(NULL, "SimpleStatusMsg", "ProtoFlags", PROTO_DEFAULT);
data->proto_msg[0].flags = val;
data->proto_msg[0].max_length = 0;
SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_SETITEMDATA, (WPARAM)index, 0);
@@ -211,19 +211,19 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L if (index != CB_ERR && index != CB_ERRSPACE)
{
mir_snprintf(setting, SIZEOF(setting), "Proto%sDefault", accounts->pa[i]->szModuleName);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", setting, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", setting, &dbv))
{
data->proto_msg[i+1].msg = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
data->proto_msg[i+1].msg = NULL;
mir_snprintf(setting, SIZEOF(setting), "Proto%sFlags", accounts->pa[i]->szModuleName);
- val = DBGetContactSettingByte(NULL, "SimpleStatusMsg", setting, PROTO_DEFAULT);
+ val = db_get_b(NULL, "SimpleStatusMsg", setting, PROTO_DEFAULT);
data->proto_msg[i+1].flags = val;
mir_snprintf(setting, SIZEOF(setting), "Proto%sMaxLen", accounts->pa[i]->szModuleName);
- val = DBGetContactSettingWord(NULL, "SimpleStatusMsg", setting, 1024);
+ val = db_get_w(NULL, "SimpleStatusMsg", setting, 1024);
data->proto_msg[i+1].max_length = val;
SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_SETITEMDATA, (WPARAM)index, (LPARAM)i + 1);
}
@@ -242,7 +242,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_CBOPTPROTO, CBN_SELCHANGE), (LPARAM)GetDlgItem(hwndDlg, IDC_CBOPTPROTO));
}
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "PutDefInList", 0))
+ if (db_get_b(NULL, "SimpleStatusMsg", "PutDefInList", 0))
CheckDlgButton(hwndDlg, IDC_COPTMSG2, BST_CHECKED);
if (ServiceExists(MS_VARS_FORMATSTRING))
@@ -464,19 +464,19 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L mir_snprintf(setting, SIZEOF(setting), "LastMsg");
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T(""));
- if (!DBGetContactSetting(NULL, "SimpleStatusMsg", setting, &dbv))
+ if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv))
{
if (dbv.pszVal)
{
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2) && strlen(dbv.pszVal))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2) && strlen(dbv.pszVal))
{
if ((dbv2.ptszVal) && (lstrlen(dbv2.ptszVal)))
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, dbv2.ptszVal);
- DBFreeVariant(&dbv2);
+ db_free(&dbv2);
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
EnableWindow(GetDlgItem(hwndDlg, IDC_OPTEDIT1), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_VARSHELP), FALSE);
@@ -507,10 +507,10 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L else
mir_snprintf(setting, SIZEOF(setting), "Msg");
- if (!DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting), &dbv))
+ if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting), &dbv))
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T(""));
@@ -619,18 +619,18 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L mir_snprintf(setting, SIZEOF(setting), "LastMsg");
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T(""));
- if (!DBGetContactSetting(NULL, "SimpleStatusMsg", setting, &dbv))
+ if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv))
{
if (dbv.pszVal)
{
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2) && strlen(dbv.pszVal))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2) && strlen(dbv.pszVal))
{
if (dbv2.ptszVal && lstrlen(dbv2.ptszVal))
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, dbv2.ptszVal);
- DBFreeVariant(&dbv2);
+ db_free(&dbv2);
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
EnableWindow(GetDlgItem(hwndDlg, IDC_OPTEDIT1), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_VARSHELP), FALSE);
@@ -661,10 +661,10 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L else
mir_snprintf(setting, SIZEOF(setting), "Msg");
- if (!DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting), &dbv))
+ if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting), &dbv))
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T(""));
@@ -719,18 +719,18 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L mir_snprintf(setting, SIZEOF(setting), "LastMsg");
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T(""));
- if (!DBGetContactSetting(NULL, "SimpleStatusMsg", setting, &dbv))
+ if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv))
{
if (dbv.pszVal)
{
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2) && strlen(dbv.pszVal))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2) && strlen(dbv.pszVal))
{
if (dbv2.ptszVal && lstrlen(dbv2.ptszVal))
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, dbv2.ptszVal);
- DBFreeVariant(&dbv2);
+ db_free(&dbv2);
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
EnableWindow(GetDlgItem(hwndDlg, IDC_OPTEDIT1), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_VARSHELP), FALSE);
@@ -753,10 +753,10 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L else
mir_snprintf(setting, SIZEOF(setting), "Msg");
- if (!DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(i + ID_STATUS_ONLINE, setting), &dbv))
+ if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(i + ID_STATUS_ONLINE, setting), &dbv))
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T(""));
@@ -833,18 +833,18 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L mir_snprintf(setting, SIZEOF(setting), "LastMsg");
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T(""));
- if (!DBGetContactSetting(NULL, "SimpleStatusMsg", setting, &dbv))
+ if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv))
{
if (dbv.pszVal)
{
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2) && strlen(dbv.pszVal))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2) && strlen(dbv.pszVal))
{
if (dbv2.ptszVal && lstrlen(dbv2.ptszVal))
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, dbv2.ptszVal);
- DBFreeVariant(&dbv2);
+ db_free(&dbv2);
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
EnableWindow(GetDlgItem(hwndDlg, IDC_OPTEDIT1), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_VARSHELP), FALSE);
@@ -867,10 +867,10 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L else
mir_snprintf(setting, SIZEOF(setting), "Msg");
- if (!DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(i+ID_STATUS_ONLINE, setting), &dbv))
+ if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(i+ID_STATUS_ONLINE, setting), &dbv))
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T(""));
@@ -1032,8 +1032,8 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L {
if (accounts->statusMsgFlags & Proto_Status2Flag(i))
{
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(i, "Default"), data->status_msg[0].msg[i - ID_STATUS_ONLINE]);
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", StatusModeToDbSetting(i, "Flags"), (BYTE)data->status_msg[0].flags[i - ID_STATUS_ONLINE]);
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(i, "Default"), data->status_msg[0].msg[i - ID_STATUS_ONLINE]);
+ db_set_b(NULL, "SimpleStatusMsg", StatusModeToDbSetting(i, "Flags"), (BYTE)data->status_msg[0].flags[i - ID_STATUS_ONLINE]);
for (int j = 0; j < accounts->count; j++)
{
@@ -1046,20 +1046,20 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L if (CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(i))
{
mir_snprintf(szSetting, SIZEOF(szSetting), "%sDefault", accounts->pa[j]->szModuleName);
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(i, szSetting), data->status_msg[j + 1].msg[i - ID_STATUS_ONLINE]);
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(i, szSetting), data->status_msg[j + 1].msg[i - ID_STATUS_ONLINE]);
mir_snprintf(szSetting, SIZEOF(szSetting), "%sFlags", accounts->pa[j]->szModuleName);
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", StatusModeToDbSetting(i, szSetting), (BYTE)data->status_msg[j + 1].flags[i - ID_STATUS_ONLINE]);
+ db_set_b(NULL, "SimpleStatusMsg", StatusModeToDbSetting(i, szSetting), (BYTE)data->status_msg[j + 1].flags[i - ID_STATUS_ONLINE]);
}
}
}
}
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "PutDefInList", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_COPTMSG2) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "PutDefInList", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_COPTMSG2) == BST_CHECKED));
if (data->proto_ok)
{
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "ProtoFlags", (BYTE)data->proto_msg[0].flags);
+ db_set_b(NULL, "SimpleStatusMsg", "ProtoFlags", (BYTE)data->proto_msg[0].flags);
for (i = 0; i < accounts->count; i++)
{
@@ -1074,15 +1074,15 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sDefault", accounts->pa[i]->szModuleName);
if (data->proto_msg[i+1].msg && (data->proto_msg[i+1].flags & PROTO_THIS_MSG))
- DBWriteContactSettingTString(NULL, "SimpleStatusMsg", szSetting, data->proto_msg[i+1].msg);
+ db_set_ts(NULL, "SimpleStatusMsg", szSetting, data->proto_msg[i+1].msg);
// else
- // DBDeleteContactSetting(NULL, "SimpleStatusMsg", szSetting);
+ // db_unset(NULL, "SimpleStatusMsg", szSetting);
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sMaxLen", accounts->pa[i]->szModuleName);
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", szSetting, (WORD)data->proto_msg[i+1].max_length);
+ db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)data->proto_msg[i+1].max_length);
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", accounts->pa[i]->szModuleName);
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", szSetting, (BYTE)data->proto_msg[i+1].flags);
+ db_set_b(NULL, "SimpleStatusMsg", szSetting, (BYTE)data->proto_msg[i+1].flags);
}
}
RebuildStatusMenu();
@@ -1116,17 +1116,17 @@ static INT_PTR CALLBACK DlgVariablesOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM SendDlgItemMessage(hwndDlg, IDC_SSECUPDTMSG, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_ESECUPDTMSG), 0);
SendDlgItemMessage(hwndDlg, IDC_SSECUPDTMSG, UDM_SETRANGE32, 1, 999);
- SendDlgItemMessage(hwndDlg, IDC_SSECUPDTMSG, UDM_SETPOS, 0, MAKELONG((short)DBGetContactSettingWord(NULL, "SimpleStatusMsg", "UpdateMsgInt", 10), 0));
+ SendDlgItemMessage(hwndDlg, IDC_SSECUPDTMSG, UDM_SETPOS, 0, MAKELONG((short)db_get_w(NULL, "SimpleStatusMsg", "UpdateMsgInt", 10), 0));
SendDlgItemMessage(hwndDlg, IDC_ESECUPDTMSG, EM_LIMITTEXT, 3, 0);
- CheckDlgButton(hwndDlg, IDC_CUPDATEMSG, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "UpdateMsgOn", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CNOIDLE, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "NoUpdateOnIdle", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CNOICQREQ, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "NoUpdateOnICQReq", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLEAVEWINAMP, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CUPDATEMSG, db_get_b(NULL, "SimpleStatusMsg", "UpdateMsgOn", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CNOIDLE, db_get_b(NULL, "SimpleStatusMsg", "NoUpdateOnIdle", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CNOICQREQ, db_get_b(NULL, "SimpleStatusMsg", "NoUpdateOnICQReq", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLEAVEWINAMP, db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1) ? BST_CHECKED : BST_UNCHECKED);
if (ServiceExists(MS_VARS_FORMATSTRING))
{
- CheckDlgButton(hwndDlg, IDC_CVARIABLES, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "EnableVariables", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CDATEPARSING, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ExclDateToken", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CVARIABLES, db_get_b(NULL, "SimpleStatusMsg", "EnableVariables", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CDATEPARSING, db_get_b(NULL, "SimpleStatusMsg", "ExclDateToken", 0) ? BST_CHECKED : BST_UNCHECKED);
}
else
{
@@ -1179,25 +1179,25 @@ static INT_PTR CALLBACK DlgVariablesOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM KillTimer(NULL, g_uUpdateMsgTimer);
int val = SendDlgItemMessage(hwndDlg, IDC_SSECUPDTMSG, UDM_GETPOS, 0, 0);
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", "UpdateMsgInt", (WORD)val);
+ db_set_w(NULL, "SimpleStatusMsg", "UpdateMsgInt", (WORD)val);
if (IsDlgButtonChecked(hwndDlg, IDC_CUPDATEMSG) == BST_CHECKED && val)
{
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "UpdateMsgOn", (BYTE)1);
+ db_set_b(NULL, "SimpleStatusMsg", "UpdateMsgOn", (BYTE)1);
g_uUpdateMsgTimer = SetTimer(NULL, 0, val * 1000, (TIMERPROC)UpdateMsgTimerProc);
}
else
{
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "UpdateMsgOn", (BYTE)0);
+ db_set_b(NULL, "SimpleStatusMsg", "UpdateMsgOn", (BYTE)0);
}
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "NoUpdateOnIdle", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CNOIDLE) == BST_CHECKED));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "NoUpdateOnICQReq", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CNOICQREQ) == BST_CHECKED));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "AmpLeaveTitle", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CLEAVEWINAMP) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "NoUpdateOnIdle", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CNOIDLE) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "NoUpdateOnICQReq", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CNOICQREQ) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CLEAVEWINAMP) == BST_CHECKED));
if (ServiceExists(MS_VARS_FORMATSTRING))
{
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "EnableVariables", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CVARIABLES) == BST_CHECKED));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "ExclDateToken", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CDATEPARSING) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "EnableVariables", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CVARIABLES) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "ExclDateToken", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CDATEPARSING) == BST_CHECKED));
}
return TRUE;
}
@@ -1210,19 +1210,19 @@ static BOOL IsHistoryMsgsFound(HWND hwndDlg, int histMax) {
char szSetting[16];
DBVARIANT dbv;
- int j = DBGetContactSettingWord(NULL, "SimpleStatusMsg", "LMMsg", 1);
+ int j = db_get_w(NULL, "SimpleStatusMsg", "LMMsg", 1);
for (int i = 1; i <= histMax; ++i, --j)
{
if (j < 1) j = histMax;
mir_snprintf(szSetting, SIZEOF(szSetting), "SMsg%d", j);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", szSetting, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
if (dbv.ptszVal != NULL && *dbv.ptszVal != '\0')
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return TRUE;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
return FALSE;
@@ -1248,7 +1248,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTBUTTONS), CB_SETITEMDATA, (WPARAM)i_btndownflat, DLG_SHOW_BUTTONS_FLAT);
SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTBUTTONS), CB_SETITEMDATA, (WPARAM)i_btnlist, DLG_SHOW_BUTTONS_INLIST);
- settingValue = DBGetContactSettingByte(NULL, "SimpleStatusMsg", "DlgFlags", DLG_SHOW_DEFAULT);
+ settingValue = db_get_b(NULL, "SimpleStatusMsg", "DlgFlags", DLG_SHOW_DEFAULT);
CheckDlgButton(hwndDlg, IDC_CSTATUSLIST, settingValue & DLG_SHOW_STATUS ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CPROFILES, settingValue & DLG_SHOW_STATUS_PROFILES ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CICONS1, settingValue & DLG_SHOW_STATUS_ICONS ? BST_CHECKED : BST_UNCHECKED);
@@ -1279,7 +1279,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w }
// Misc.
- settingValue = DBGetContactSettingByte(NULL, "SimpleStatusMsg", "MaxHist", 10);
+ settingValue = db_get_b(NULL, "SimpleStatusMsg", "MaxHist", 10);
SendDlgItemMessage(hwndDlg, IDC_SMAXHIST, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_EMAXHIST), 0);
SendDlgItemMessage(hwndDlg, IDC_SMAXHIST, UDM_SETRANGE32, 0, 25);
@@ -1290,19 +1290,19 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w EnableWindow(GetDlgItem(hwndDlg, IDC_CICONS2), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_BOPTHIST), IsHistoryMsgsFound(hwndDlg, settingValue));
- EnableWindow(GetDlgItem(hwndDlg, IDC_BOPTDEF), DBGetContactSettingWord(NULL, "SimpleStatusMsg", "DefMsgCount", 0) != 0);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BOPTDEF), db_get_w(NULL, "SimpleStatusMsg", "DefMsgCount", 0) != 0);
SendDlgItemMessage(hwndDlg, IDC_STIMEOUT, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_ETIMEOUT), 0);
SendDlgItemMessage(hwndDlg, IDC_STIMEOUT, UDM_SETRANGE32, 1, 60);
- SendDlgItemMessage(hwndDlg, IDC_STIMEOUT, UDM_SETPOS, 0, MAKELONG((short)DBGetContactSettingByte(NULL, "SimpleStatusMsg", "DlgTime", 5), 0));
+ SendDlgItemMessage(hwndDlg, IDC_STIMEOUT, UDM_SETPOS, 0, MAKELONG((short)db_get_b(NULL, "SimpleStatusMsg", "DlgTime", 5), 0));
SendDlgItemMessage(hwndDlg, IDC_ETIMEOUT, EM_LIMITTEXT, 2, 0);
- CheckDlgButton(hwndDlg, IDC_CCLOSEWND, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "AutoClose", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CRPOSWND, !DBGetContactSettingByte(NULL, "SimpleStatusMsg", "WinCentered", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CREMOVECR, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "RemoveCR", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CSHOWCOPY, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ShowCopy", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CSHOWGURL, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ShowGoToURL", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CSHOWSMSG, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ShowStatusMenuItem", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CCLOSEWND, db_get_b(NULL, "SimpleStatusMsg", "AutoClose", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CRPOSWND, !db_get_b(NULL, "SimpleStatusMsg", "WinCentered", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CREMOVECR, db_get_b(NULL, "SimpleStatusMsg", "RemoveCR", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CSHOWCOPY, db_get_b(NULL, "SimpleStatusMsg", "ShowCopy", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CSHOWGURL, db_get_b(NULL, "SimpleStatusMsg", "ShowGoToURL", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CSHOWSMSG, db_get_b(NULL, "SimpleStatusMsg", "ShowStatusMenuItem", 1) ? BST_CHECKED : BST_UNCHECKED);
SendMessage(hwndDlg, WM_USER + 2, 0, 0);
return TRUE;
@@ -1364,13 +1364,13 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w if (hwndSAMsgDialog) DestroyWindow(hwndSAMsgDialog);
- max_hist_msgs = DBGetContactSettingByte(NULL, "SimpleStatusMsg", "MaxHist", 10);
+ max_hist_msgs = db_get_b(NULL, "SimpleStatusMsg", "MaxHist", 10);
for (i = 1; i <= max_hist_msgs; i++)
{
mir_snprintf(text, SIZEOF(text), "SMsg%d", i);
- DBWriteContactSettingTString(NULL, "SimpleStatusMsg", text, _T(""));
+ db_set_ts(NULL, "SimpleStatusMsg", text, _T(""));
}
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", "LastMsg", "");
+ db_set_s(NULL, "SimpleStatusMsg", "LastMsg", "");
for (i = 0; i < accounts->count; i++)
{
if (!IsAccountEnabled(accounts->pa[i]))
@@ -1383,9 +1383,9 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w continue;
mir_snprintf(setting, SIZEOF(setting), "Last%sMsg", accounts->pa[i]->szModuleName);
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", setting, "");
+ db_set_s(NULL, "SimpleStatusMsg", setting, "");
}
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", "LMMsg", (WORD)max_hist_msgs);
+ db_set_w(NULL, "SimpleStatusMsg", "LMMsg", (WORD)max_hist_msgs);
EnableWindow(GetDlgItem(hwndDlg, IDC_BOPTHIST), FALSE);
}
return 0;
@@ -1398,13 +1398,13 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w if (hwndSAMsgDialog) DestroyWindow(hwndSAMsgDialog);
- nDefMSgCount = DBGetContactSettingWord(NULL, "SimpleStatusMsg", "DefMsgCount", 0);
+ nDefMSgCount = db_get_w(NULL, "SimpleStatusMsg", "DefMsgCount", 0);
for (int i = 1; i <= nDefMSgCount; i++)
{
mir_snprintf(szSetting, SIZEOF(szSetting), "DefMsg%d", i);
- DBDeleteContactSetting(NULL, "SimpleStatusMsg", szSetting);
+ db_unset(NULL, "SimpleStatusMsg", szSetting);
}
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", "DefMsgCount", 0);
+ db_set_w(NULL, "SimpleStatusMsg", "DefMsgCount", 0);
EnableWindow(GetDlgItem(hwndDlg, IDC_BOPTDEF), FALSE);
}
return 0;
@@ -1427,17 +1427,17 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w if (curSel != CB_ERR)
flags |= SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTBUTTONS), CB_GETITEMDATA, (WPARAM)curSel, 0);
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "DlgFlags", (BYTE)flags);
+ db_set_b(NULL, "SimpleStatusMsg", "DlgFlags", (BYTE)flags);
// Misc.
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "MaxHist", (BYTE)GetDlgItemInt(hwndDlg, IDC_EMAXHIST, NULL, FALSE));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "AutoClose", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CCLOSEWND) == BST_CHECKED));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "DlgTime", (BYTE)GetDlgItemInt(hwndDlg, IDC_ETIMEOUT, NULL, FALSE));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "WinCentered", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CRPOSWND) != BST_CHECKED));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "RemoveCR", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CREMOVECR) == BST_CHECKED));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "ShowCopy", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CSHOWCOPY) == BST_CHECKED));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "ShowGoToURL", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CSHOWGURL) == BST_CHECKED));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "ShowStatusMenuItem", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CSHOWSMSG) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "MaxHist", (BYTE)GetDlgItemInt(hwndDlg, IDC_EMAXHIST, NULL, FALSE));
+ db_set_b(NULL, "SimpleStatusMsg", "AutoClose", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CCLOSEWND) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "DlgTime", (BYTE)GetDlgItemInt(hwndDlg, IDC_ETIMEOUT, NULL, FALSE));
+ db_set_b(NULL, "SimpleStatusMsg", "WinCentered", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CRPOSWND) != BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "RemoveCR", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CREMOVECR) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "ShowCopy", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CSHOWCOPY) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "ShowGoToURL", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CSHOWGURL) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "ShowStatusMenuItem", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CSHOWSMSG) == BST_CHECKED));
RebuildStatusMenu();
return TRUE;
@@ -1480,22 +1480,22 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa {
char setting[80];
mir_snprintf(setting, SIZEOF(setting), "Startup%sStatus", accounts->pa[i]->szModuleName);
- data->status[i] = DBGetContactSettingWord(NULL, "SimpleStatusMsg", setting, ID_STATUS_OFFLINE);
+ data->status[i] = db_get_w(NULL, "SimpleStatusMsg", setting, ID_STATUS_OFFLINE);
mir_snprintf(setting, SIZEOF(setting), "Set%sStatusDelay", accounts->pa[i]->szModuleName);
- data->setdelay[i] = DBGetContactSettingWord(NULL, "SimpleStatusMsg", setting, 300);
+ data->setdelay[i] = db_get_w(NULL, "SimpleStatusMsg", setting, 300);
SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_SETITEMDATA, (WPARAM)index, (LPARAM)i);
}
}
SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_SETCURSEL, 0, 0);
SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_LISTPROTO, LBN_SELCHANGE), (LPARAM)GetDlgItem(hwndDlg, IDC_LISTPROTO));
- data->setglobaldelay = DBGetContactSettingWord(NULL, "SimpleStatusMsg", "SetStatusDelay", 300);
+ data->setglobaldelay = db_get_w(NULL, "SimpleStatusMsg", "SetStatusDelay", 300);
SendMessage(GetDlgItem(hwndDlg, IDC_SSETSTATUS), UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_ESETSTATUS), 0);
SendMessage(GetDlgItem(hwndDlg, IDC_SSETSTATUS), UDM_SETRANGE32, 0, 9000);
SendMessage(GetDlgItem(hwndDlg, IDC_ESETSTATUS), EM_LIMITTEXT, 4, 0);
- if (!DBGetContactSettingByte(NULL, "SimpleStatusMsg", "GlobalStatusDelay", 1))
+ if (!db_get_b(NULL, "SimpleStatusMsg", "GlobalStatusDelay", 1))
{
CheckDlgButton(hwndDlg, IDC_SPECSET, BST_CHECKED);
i = SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_GETCURSEL, 0, 0), 0);
@@ -1507,7 +1507,7 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa SetDlgItemInt(hwndDlg, IDC_ESETSTATUS, data->setglobaldelay, FALSE);
}
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "StartupPopupDlg", 1))
+ if (db_get_b(NULL, "SimpleStatusMsg", "StartupPopupDlg", 1))
{
CheckDlgButton(hwndDlg, IDC_POPUPDLG, BST_CHECKED);
if (IsDlgButtonChecked(hwndDlg, IDC_SPECSET) == BST_CHECKED)
@@ -1662,14 +1662,14 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa continue;
mir_snprintf(szSetting, SIZEOF(szSetting), "Startup%sStatus", accounts->pa[i]->szModuleName);
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", szSetting, (WORD)data->status[i]);
+ db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)data->status[i]);
mir_snprintf(szSetting, SIZEOF(szSetting), "Set%sStatusDelay", accounts->pa[i]->szModuleName);
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", szSetting, (WORD)data->setdelay[i]);
+ db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)data->setdelay[i]);
}
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", "SetStatusDelay", (WORD)data->setglobaldelay);
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "GlobalStatusDelay", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SPECSET) != BST_CHECKED));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "StartupPopupDlg", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_POPUPDLG) == BST_CHECKED));
+ db_set_w(NULL, "SimpleStatusMsg", "SetStatusDelay", (WORD)data->setglobaldelay);
+ db_set_b(NULL, "SimpleStatusMsg", "GlobalStatusDelay", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SPECSET) != BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "StartupPopupDlg", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_POPUPDLG) == BST_CHECKED));
return TRUE;
}
break;
diff --git a/plugins/SimpleStatusMsg/src/utils.cpp b/plugins/SimpleStatusMsg/src/utils.cpp index d730f03caa..eef790fc8a 100644 --- a/plugins/SimpleStatusMsg/src/utils.cpp +++ b/plugins/SimpleStatusMsg/src/utils.cpp @@ -137,7 +137,7 @@ int GetCurrentStatus(const char *szProto) {
char szSetting[80];
mir_snprintf(szSetting, SIZEOF(szSetting), "Cur%sStatus", szProto);
- return (int)DBGetContactSettingWord(NULL, "SimpleStatusMsg", szSetting, ID_STATUS_OFFLINE);
+ return (int)db_get_w(NULL, "SimpleStatusMsg", szSetting, ID_STATUS_OFFLINE);
}
return CallService(MS_CLIST_GETSTATUSMODE, 0, 0);
@@ -151,14 +151,14 @@ int GetStartupStatus(const char *szProto) char szSetting[80];
mir_snprintf(szSetting, SIZEOF(szSetting), "Startup%sStatus", szProto);
- status_mode = DBGetContactSettingWord(NULL, "SimpleStatusMsg", szSetting, ID_STATUS_OFFLINE);
+ status_mode = db_get_w(NULL, "SimpleStatusMsg", szSetting, ID_STATUS_OFFLINE);
if (status_mode == ID_STATUS_CURRENT)
{
// load status used for this proto last time
mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sStatus", szProto);
- status_mode = DBGetContactSettingWord(NULL, "SimpleStatusMsg", szSetting, ID_STATUS_OFFLINE);
+ status_mode = db_get_w(NULL, "SimpleStatusMsg", szSetting, ID_STATUS_OFFLINE);
}
return status_mode;
}
- return (int)DBGetContactSettingWord(NULL, "SimpleStatusMsg", "StartupStatus", ID_STATUS_OFFLINE);
+ return (int)db_get_w(NULL, "SimpleStatusMsg", "StartupStatus", ID_STATUS_OFFLINE);
}
|