From 53fe3e46177d17b4941610de19f5cc6210700cb4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 12 Nov 2018 21:44:56 +0300 Subject: db_* functions replaced with g_plugin calls --- plugins/SeenPlugin/src/history.cpp | 4 +- plugins/SeenPlugin/src/main.cpp | 10 ++--- plugins/SeenPlugin/src/menu.cpp | 4 +- plugins/SeenPlugin/src/missed.cpp | 2 +- plugins/SeenPlugin/src/options.cpp | 80 +++++++++++++++++++------------------- plugins/SeenPlugin/src/utils.cpp | 26 ++++++------- 6 files changed, 63 insertions(+), 63 deletions(-) (limited to 'plugins/SeenPlugin/src') diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp index 750f8ee3a8..befb0be96e 100644 --- a/plugins/SeenPlugin/src/history.cpp +++ b/plugins/SeenPlugin/src/history.cpp @@ -34,7 +34,7 @@ char* BuildSetting(int historyLast) void HistoryWrite(MCONTACT hContact) { - int historyMax = db_get_w(NULL, S_MOD, "HistoryMax", 10); + int historyMax = db_get_w(0, S_MOD, "HistoryMax", 10); if (historyMax < 0) historyMax = 0; else if (historyMax > 99) @@ -68,7 +68,7 @@ void HistoryWrite(MCONTACT hContact) void LoadHistoryList(MCONTACT hContact, HWND hwnd, int nList) { SendDlgItemMessage(hwnd, nList, LB_RESETCONTENT, 0, 0); - int historyMax = db_get_w(NULL, S_MOD, "HistoryMax", 10); + int historyMax = db_get_w(0, S_MOD, "HistoryMax", 10); if (historyMax < 0) historyMax = 0; else if (historyMax > 99) diff --git a/plugins/SeenPlugin/src/main.cpp b/plugins/SeenPlugin/src/main.cpp index 12f4ab156b..0882cee00f 100644 --- a/plugins/SeenPlugin/src/main.cpp +++ b/plugins/SeenPlugin/src/main.cpp @@ -69,13 +69,13 @@ void UninitHistoryDialog(void); static int MainInit(WPARAM, LPARAM) { - if (g_bFileActive = db_get_b(NULL, S_MOD, "FileOutput", 0)) + if (g_bFileActive = db_get_b(0, S_MOD, "FileOutput", 0)) InitFileOutput(); - if (db_get_b(NULL, S_MOD, "MenuItem", 1)) + if (db_get_b(0, S_MOD, "MenuItem", 1)) InitMenuitem(); - if (db_get_b(NULL, S_MOD, "UserinfoTab", 1)) + if (db_get_b(0, S_MOD, "UserinfoTab", 1)) ehuserinfo = HookEvent(ME_USERINFO_INITIALISE, UserinfoInit); if (ServiceExists(MS_TIPPER_ADDTRANSLATION)) @@ -102,9 +102,9 @@ int CMPlugin::Load() HookEvent(ME_DB_CONTACT_SETTINGCHANGED, UpdateValues); HookEvent(ME_PROTO_ACK, ModeChange); - includeIdle = (BOOL)db_get_b(NULL, S_MOD, "IdleSupport", 1); + includeIdle = (BOOL)db_get_b(0, S_MOD, "IdleSupport", 1); - if (db_get_b(NULL, S_MOD, "MissedOnes", 0)) + if (db_get_b(0, S_MOD, "MissedOnes", 0)) ehmissed_proto = HookEvent(ME_PROTO_ACK, ModeChange_mo); LoadWatchedProtos(); diff --git a/plugins/SeenPlugin/src/menu.cpp b/plugins/SeenPlugin/src/menu.cpp index 7127318474..40c673ce79 100644 --- a/plugins/SeenPlugin/src/menu.cpp +++ b/plugins/SeenPlugin/src/menu.cpp @@ -37,7 +37,7 @@ INT_PTR MenuitemClicked(WPARAM hContact, LPARAM) int BuildContactMenu(WPARAM hContact, LPARAM) { char *szProto = GetContactProto(hContact); - if (!IsWatchedProtocol(szProto) || db_get_b(hContact, szProto, "ChatRoom", false) || !db_get_b(NULL, S_MOD, "MenuItem", 1)) { + if (!IsWatchedProtocol(szProto) || db_get_b(hContact, szProto, "ChatRoom", false) || !db_get_b(0, S_MOD, "MenuItem", 1)) { Menu_ShowItem(hmenuitem, false); return 0; } @@ -57,7 +57,7 @@ int BuildContactMenu(WPARAM hContact, LPARAM) else flags |= CMIF_HIDDEN; } - else if (db_get_b(NULL, S_MOD, "ShowIcon", 1)) { + else if (db_get_b(0, S_MOD, "ShowIcon", 1)) { int isetting = db_get_w(hContact, S_MOD, "StatusTriger", -1); hIcon = Skin_LoadProtoIcon(szProto, isetting | 0x8000); } diff --git a/plugins/SeenPlugin/src/missed.cpp b/plugins/SeenPlugin/src/missed.cpp index aef95a6350..b39024baa0 100644 --- a/plugins/SeenPlugin/src/missed.cpp +++ b/plugins/SeenPlugin/src/missed.cpp @@ -108,7 +108,7 @@ int ShowMissed(void) CMStringW buf; for (int loop = 0; loop < mcs.count; loop++) { buf.Append(Clist_GetContactDisplayName(mcs.wpcontact[loop])); - if (db_get_b(NULL, S_MOD, "MissedOnes_Count", 0)) + if (db_get_b(0, S_MOD, "MissedOnes_Count", 0)) buf.AppendFormat(L" [%i]", mcs.times[loop]); buf.AppendChar('\n'); diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp index 4dc20f51ec..f9bf061943 100644 --- a/plugins/SeenPlugin/src/options.cpp +++ b/plugins/SeenPlugin/src/options.cpp @@ -97,7 +97,7 @@ INT_PTR CALLBACK OptsPopupsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp ShowWindow(GetDlgItem(hdlg, IDC_LABTEXT), hasPopups ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(hdlg, IDC_LABTTITLE), hasPopups ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(hdlg, IDC_POPUPSTAMPTEXT), hasPopups ? SW_SHOW : SW_HIDE); - CheckDlgButton(hdlg, IDC_POPUPS, (db_get_b(NULL, S_MOD, "UsePopups", 0) & hasPopups) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hdlg, IDC_POPUPS, (db_get_b(0, S_MOD, "UsePopups", 0) & hasPopups) ? BST_CHECKED : BST_UNCHECKED); EnableWindow(GetDlgItem(hdlg, IDC_POPUPS), hasPopups); hasPopups = IsDlgButtonChecked(hdlg, IDC_POPUPS); EnableWindow(GetDlgItem(hdlg, IDC_POPUPSTAMP), hasPopups); @@ -105,7 +105,7 @@ INT_PTR CALLBACK OptsPopupsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) { char szSetting[100]; mir_snprintf(szSetting, "Col_%d", i - ID_STATUS_OFFLINE); - DWORD sett = db_get_dw(NULL, S_MOD, szSetting, StatusColors15bits[i - ID_STATUS_OFFLINE]); + DWORD sett = db_get_dw(0, S_MOD, szSetting, StatusColors15bits[i - ID_STATUS_OFFLINE]); COLORREF back, text; GetColorsFromDWord(&back, &text, sett); @@ -187,14 +187,14 @@ INT_PTR CALLBACK OptsPopupsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp switch (((LPNMHDR)lparam)->code) { case PSN_APPLY: GetDlgItemText(hdlg, IDC_POPUPSTAMP, szstamp, _countof(szstamp)); - db_set_ws(NULL, S_MOD, "PopupStamp", szstamp); + db_set_ws(0, S_MOD, "PopupStamp", szstamp); GetDlgItemText(hdlg, IDC_POPUPSTAMPTEXT, szstamp, _countof(szstamp)); - db_set_ws(NULL, S_MOD, "PopupStampText", szstamp); + db_set_ws(0, S_MOD, "PopupStampText", szstamp); bchecked = (BYTE)IsDlgButtonChecked(hdlg, IDC_POPUPS); - if (db_get_b(NULL, S_MOD, "UsePopups", 0) != bchecked) - db_set_b(NULL, S_MOD, "UsePopups", bchecked); + if (db_get_b(0, S_MOD, "UsePopups", 0) != bchecked) + db_set_b(0, S_MOD, "UsePopups", bchecked); for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) { COLORREF back = SendDlgItemMessage(hdlg, i, CPM_GETCOLOUR, 0, 0); @@ -204,7 +204,7 @@ INT_PTR CALLBACK OptsPopupsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp char szSetting[100]; mir_snprintf(szSetting, "Col_%d", i - ID_STATUS_OFFLINE); if (sett != StatusColors15bits[i - ID_STATUS_OFFLINE]) - db_set_dw(NULL, S_MOD, szSetting, sett); + db_set_dw(0, S_MOD, szSetting, sett); else db_unset(NULL, S_MOD, szSetting); } @@ -227,15 +227,15 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM case WM_INITDIALOG: TranslateDialogDefault(hdlg); - CheckDlgButton(hdlg, IDC_MENUITEM, db_get_b(NULL, S_MOD, "MenuItem", 1) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hdlg, IDC_USERINFO, db_get_b(NULL, S_MOD, "UserinfoTab", 1) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hdlg, IDC_MENUITEM, db_get_b(0, S_MOD, "MenuItem", 1) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hdlg, IDC_USERINFO, db_get_b(0, S_MOD, "UserinfoTab", 1) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hdlg, IDC_FILE, g_bFileActive ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hdlg, IDC_HISTORY, db_get_b(NULL, S_MOD, "KeepHistory", 0) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hdlg, IDC_IGNOREOFFLINE, db_get_b(NULL, S_MOD, "IgnoreOffline", 1) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hdlg, IDC_MISSEDONES, db_get_b(NULL, S_MOD, "MissedOnes", 0) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hdlg, IDC_SHOWICON, db_get_b(NULL, S_MOD, "ShowIcon", 1) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hdlg, IDC_COUNT, db_get_b(NULL, S_MOD, "MissedOnes_Count", 0) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hdlg, IDC_IDLESUPPORT, db_get_b(NULL, S_MOD, "IdleSupport", 1) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hdlg, IDC_HISTORY, db_get_b(0, S_MOD, "KeepHistory", 0) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hdlg, IDC_IGNOREOFFLINE, db_get_b(0, S_MOD, "IgnoreOffline", 1) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hdlg, IDC_MISSEDONES, db_get_b(0, S_MOD, "MissedOnes", 0) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hdlg, IDC_SHOWICON, db_get_b(0, S_MOD, "ShowIcon", 1) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hdlg, IDC_COUNT, db_get_b(0, S_MOD, "MissedOnes_Count", 0) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hdlg, IDC_IDLESUPPORT, db_get_b(0, S_MOD, "IdleSupport", 1) ? BST_CHECKED : BST_UNCHECKED); EnableWindow(GetDlgItem(hdlg, IDC_MENUSTAMP), IsDlgButtonChecked(hdlg, IDC_MENUITEM)); EnableWindow(GetDlgItem(hdlg, IDC_SHOWICON), IsDlgButtonChecked(hdlg, IDC_MENUITEM)); @@ -276,7 +276,7 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM } else SetDlgItemText(hdlg, IDC_HISTORYSTAMP, DEFAULT_HISTORYSTAMP); - SetDlgItemInt(hdlg, IDC_HISTORYSIZE, db_get_w(NULL, S_MOD, "HistoryMax", 10 - 1) - 1, FALSE); + SetDlgItemInt(hdlg, IDC_HISTORYSIZE, db_get_w(0, S_MOD, "HistoryMax", 10 - 1) - 1, FALSE); // load protocol list SetWindowLongPtr(GetDlgItem(hdlg, IDC_PROTOCOLLIST), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hdlg, IDC_PROTOCOLLIST), GWL_STYLE) | TVS_CHECKBOXES); @@ -344,32 +344,32 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM switch (((LPNMHDR)lparam)->code) { case PSN_APPLY: GetDlgItemText(hdlg, IDC_MENUSTAMP, szstamp, _countof(szstamp)); - db_set_ws(NULL, S_MOD, "MenuStamp", szstamp); + db_set_ws(0, S_MOD, "MenuStamp", szstamp); GetDlgItemText(hdlg, IDC_USERSTAMP, szstamp, _countof(szstamp)); - db_set_ws(NULL, S_MOD, "UserStamp", szstamp); + db_set_ws(0, S_MOD, "UserStamp", szstamp); GetDlgItemText(hdlg, IDC_FILESTAMP, szstamp, _countof(szstamp)); - db_set_ws(NULL, S_MOD, "FileStamp", szstamp); + db_set_ws(0, S_MOD, "FileStamp", szstamp); GetDlgItemText(hdlg, IDC_FILENAME, szstamp, _countof(szstamp)); - db_set_ws(NULL, S_MOD, "FileName", szstamp); + db_set_ws(0, S_MOD, "FileName", szstamp); GetDlgItemText(hdlg, IDC_HISTORYSTAMP, szstamp, _countof(szstamp)); - db_set_ws(NULL, S_MOD, "HistoryStamp", szstamp); + db_set_ws(0, S_MOD, "HistoryStamp", szstamp); - db_set_w(NULL, S_MOD, "HistoryMax", (WORD)(GetDlgItemInt(hdlg, IDC_HISTORYSIZE, nullptr, FALSE) + 1)); + db_set_w(0, S_MOD, "HistoryMax", (WORD)(GetDlgItemInt(hdlg, IDC_HISTORYSIZE, nullptr, FALSE) + 1)); BOOL bchecked = IsDlgButtonChecked(hdlg, IDC_MENUITEM); - if (db_get_b(NULL, S_MOD, "MenuItem", 1) != bchecked) { - db_set_b(NULL, S_MOD, "MenuItem", bchecked); + if (db_get_b(0, S_MOD, "MenuItem", 1) != bchecked) { + db_set_b(0, S_MOD, "MenuItem", bchecked); if (hmenuitem == nullptr && bchecked) InitMenuitem(); } bchecked = IsDlgButtonChecked(hdlg, IDC_USERINFO); - if (db_get_b(NULL, S_MOD, "UserinfoTab", 1) != bchecked) { - db_set_b(NULL, S_MOD, "UserinfoTab", bchecked); + if (db_get_b(0, S_MOD, "UserinfoTab", 1) != bchecked) { + db_set_b(0, S_MOD, "UserinfoTab", bchecked); if (bchecked) ehuserinfo = HookEvent(ME_USERINFO_INITIALISE, UserinfoInit); else @@ -379,7 +379,7 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM bchecked = IsDlgButtonChecked(hdlg, IDC_FILE); if (g_bFileActive != bchecked) { g_bFileActive = bchecked; - db_set_b(NULL, S_MOD, "FileOutput", bchecked); + db_set_b(0, S_MOD, "FileOutput", bchecked); if (bchecked) InitFileOutput(); else @@ -387,16 +387,16 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM } bchecked = IsDlgButtonChecked(hdlg, IDC_HISTORY); - if (db_get_b(NULL, S_MOD, "KeepHistory", 0) != bchecked) - db_set_b(NULL, S_MOD, "KeepHistory", bchecked); + if (db_get_b(0, S_MOD, "KeepHistory", 0) != bchecked) + db_set_b(0, S_MOD, "KeepHistory", bchecked); bchecked = IsDlgButtonChecked(hdlg, IDC_IGNOREOFFLINE); - if (db_get_b(NULL, S_MOD, "IgnoreOffline", 1) != bchecked) - db_set_b(NULL, S_MOD, "IgnoreOffline", bchecked); + if (db_get_b(0, S_MOD, "IgnoreOffline", 1) != bchecked) + db_set_b(0, S_MOD, "IgnoreOffline", bchecked); bchecked = IsDlgButtonChecked(hdlg, IDC_MISSEDONES); - if (db_get_b(NULL, S_MOD, "MissedOnes", 0) != bchecked) { - db_set_b(NULL, S_MOD, "MissedOnes", bchecked); + if (db_get_b(0, S_MOD, "MissedOnes", 0) != bchecked) { + db_set_b(0, S_MOD, "MissedOnes", bchecked); if (bchecked) ehmissed_proto = HookEvent(ME_PROTO_ACK, ModeChange_mo); else @@ -404,16 +404,16 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM } bchecked = IsDlgButtonChecked(hdlg, IDC_SHOWICON); - if (db_get_b(NULL, S_MOD, "ShowIcon", 1) != bchecked) - db_set_b(NULL, S_MOD, "ShowIcon", bchecked); + if (db_get_b(0, S_MOD, "ShowIcon", 1) != bchecked) + db_set_b(0, S_MOD, "ShowIcon", bchecked); bchecked = IsDlgButtonChecked(hdlg, IDC_COUNT); - if (db_get_b(NULL, S_MOD, "MissedOnes_Count", 0) != bchecked) - db_set_b(NULL, S_MOD, "MissedOnes_Count", bchecked); + if (db_get_b(0, S_MOD, "MissedOnes_Count", 0) != bchecked) + db_set_b(0, S_MOD, "MissedOnes_Count", bchecked); includeIdle = IsDlgButtonChecked(hdlg, IDC_IDLESUPPORT); - if (db_get_b(NULL, S_MOD, "IdleSupport", 1) != includeIdle) - db_set_b(NULL, S_MOD, "IdleSupport", (BYTE)includeIdle); + if (db_get_b(0, S_MOD, "IdleSupport", 1) != includeIdle) + db_set_b(0, S_MOD, "IdleSupport", (BYTE)includeIdle); // save protocol list HWND hwndTreeView = GetDlgItem(hdlg, IDC_PROTOCOLLIST); @@ -439,7 +439,7 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM } hItem = TreeView_GetNextSibling(hwndTreeView, hItem); } - db_set_s(NULL, S_MOD, "WatchedAccounts", watchedProtocols); + db_set_s(0, S_MOD, "WatchedAccounts", watchedProtocols); UnloadWatchedProtos(); LoadWatchedProtos(); diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index 4a74383b56..626b77ba3a 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -33,7 +33,7 @@ void LoadWatchedProtos() if (szProtosOld != NULL) { CMStringA tmp(szProtosOld); tmp.Replace(" ", "\n"); - db_set_s(NULL, S_MOD, "WatchedAccounts", tmp.c_str()); + db_set_s(0, S_MOD, "WatchedAccounts", tmp.c_str()); db_unset(NULL, S_MOD, "WatchedProtocols"); } @@ -471,13 +471,13 @@ void ShowPopup(MCONTACT hcontact, const char * lpzProto, int newStatus) if (!ServiceExists(MS_POPUP_QUERY)) return; - if (!db_get_b(NULL, S_MOD, "UsePopups", 0) || !db_get_b(hcontact, "CList", "Hidden", 0)) + if (!db_get_b(0, S_MOD, "UsePopups", 0) || !db_get_b(hcontact, "CList", "Hidden", 0)) return; DBVARIANT dbv; char szSetting[10]; mir_snprintf(szSetting, "Col_%d", newStatus - ID_STATUS_OFFLINE); - DWORD sett = db_get_dw(NULL, S_MOD, szSetting, StatusColors15bits[newStatus - ID_STATUS_OFFLINE]); + DWORD sett = db_get_dw(0, S_MOD, szSetting, StatusColors15bits[newStatus - ID_STATUS_OFFLINE]); POPUPDATAT ppd = { 0 }; GetColorsFromDWord(&ppd.colorBack, &ppd.colorText, sett); @@ -582,24 +582,24 @@ int UpdateValues(WPARAM hContact, LPARAM lparam) char str[MAXMODULELABELLENGTH + 9]; mir_snprintf(str, "OffTime-%s", szProto); - DWORD t = db_get_dw(NULL, S_MOD, str, 0); + DWORD t = db_get_dw(0, S_MOD, str, 0); if (!t) t = time(0); DBWriteTimeTS(t, hContact); } - if (!db_get_b(NULL, S_MOD, "IgnoreOffline", 1)) { + if (!db_get_b(0, S_MOD, "IgnoreOffline", 1)) { if (g_bFileActive) FileWrite(hContact); char *sProto = GetContactProto(hContact); if (Proto_GetStatus(sProto) > ID_STATUS_OFFLINE) { myPlaySound(hContact, ID_STATUS_OFFLINE, prevStatus); - if (db_get_b(NULL, S_MOD, "UsePopups", 0)) + if (db_get_b(0, S_MOD, "UsePopups", 0)) ShowPopup(hContact, sProto, ID_STATUS_OFFLINE); } - if (db_get_b(NULL, S_MOD, "KeepHistory", 0)) + if (db_get_b(0, S_MOD, "KeepHistory", 0)) HistoryWrite(hContact); if (db_get_b(hContact, S_MOD, "OnlineAlert", 0)) @@ -615,11 +615,11 @@ int UpdateValues(WPARAM hContact, LPARAM lparam) if (g_bFileActive) FileWrite(hContact); if (prevStatus != cws->value.wVal) myPlaySound(hContact, cws->value.wVal, prevStatus); - if (db_get_b(NULL, S_MOD, "UsePopups", 0)) + if (db_get_b(0, S_MOD, "UsePopups", 0)) if (prevStatus != cws->value.wVal) ShowPopup(hContact, GetContactProto(hContact), cws->value.wVal | 0x8000); - if (db_get_b(NULL, S_MOD, "KeepHistory", 0)) HistoryWrite(hContact); + if (db_get_b(0, S_MOD, "KeepHistory", 0)) HistoryWrite(hContact); if (db_get_b(hContact, S_MOD, "OnlineAlert", 0)) ShowHistory(hContact, 1); db_set_b(hContact, S_MOD, "Offline", 0); } @@ -685,7 +685,7 @@ int ModeChange(WPARAM, LPARAM lparam) isetting = ID_STATUS_OFFLINE; if ((isetting > ID_STATUS_OFFLINE) && ((UINT_PTR)ack->hProcess <= ID_STATUS_OFFLINE)) { //we have just loged-in - db_set_dw(NULL, "UserOnline", ack->szModule, GetTickCount()); + db_set_dw(0, "UserOnline", ack->szModule, GetTickCount()); if (!Miranda_IsTerminated() && IsWatchedProtocol(ack->szModule)) { logthread_info *info = (logthread_info *)mir_alloc(sizeof(logthread_info)); mir_strncpy(info->sProtoName, courProtoName, _countof(info->sProtoName)); @@ -703,14 +703,14 @@ int ModeChange(WPARAM, LPARAM lparam) time(&t); mir_snprintf(str, "OffTime-%s", ack->szModule); - db_set_dw(NULL, S_MOD, str, t); + db_set_dw(0, S_MOD, str, t); } } - if (isetting == db_get_w(NULL, S_MOD, courProtoName, ID_STATUS_OFFLINE)) + if (isetting == db_get_w(0, S_MOD, courProtoName, ID_STATUS_OFFLINE)) return 0; - db_set_w(NULL, S_MOD, courProtoName, isetting); + db_set_w(0, S_MOD, courProtoName, isetting); if (g_bFileActive) FileWrite(NULL); -- cgit v1.2.3