From c30eb758d6ad5c2bdd75e49a5fa7125fb2e439f0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 21 Aug 2024 18:23:54 +0300 Subject: =?UTF-8?q?fixes=20#4589=20(NewXStatusNotify:=20=D1=83=D0=B4=D0=B0?= =?UTF-8?q?=D0=BB=D0=B8=D1=82=D1=8C=20=D0=BF=D0=BE=D0=B4=D0=B4=D0=B5=D1=80?= =?UTF-8?q?=D0=B6=D0=BA=D1=83=20x=D0=A1=D1=82=D0=B0=D1=82=D1=83=D1=81?= =?UTF-8?q?=D0=BE=D0=B2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/NewXstatusNotify/res/resource.rc | 4 ---- plugins/NewXstatusNotify/src/main.cpp | 37 -------------------------------- plugins/NewXstatusNotify/src/options.cpp | 12 ++++------- plugins/NewXstatusNotify/src/options.h | 2 -- plugins/NewXstatusNotify/src/resource.h | 1 - plugins/NewXstatusNotify/src/xstatus.cpp | 23 -------------------- plugins/NewXstatusNotify/src/xstatus.h | 1 - 7 files changed, 4 insertions(+), 76 deletions(-) diff --git a/plugins/NewXstatusNotify/res/resource.rc b/plugins/NewXstatusNotify/res/resource.rc index a21bdb9b4a..afcae6ec15 100644 --- a/plugins/NewXstatusNotify/res/resource.rc +++ b/plugins/NewXstatusNotify/res/resource.rc @@ -172,8 +172,6 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN GROUPBOX "Notification",IDC_STATIC,3,6,299,50 CONTROL "Show Popups when I connect",IDC_XONCONNECT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,18,285,8 - CONTROL "Disable for extra status 'Music'",IDC_CHK_DISABLEMUSIC, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,30,285,8 CONTROL "Truncate message length to:",IDC_CHK_CUTMSG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,42,140,8 EDITTEXT IDC_ED_MSGLEN,153,38,34,14,ES_AUTOHSCROLL CONTROL "",IDC_UD_MSGLEN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,176,38,11,14 @@ -244,8 +242,6 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,36,272,8 CONTROL "Remove events from history when closing message window",IDC_XLOGTODB_REMOVE, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,26,47,264,10 - CONTROL "Disable for extra status 'Music'",IDC_CHK_DISABLEMUSIC, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,58,280,8 GROUPBOX "Templates",IDC_STATIC,3,75,294,156 CONTROL "Log when contact changes extra status",IDC_CHK_XSTATUSCHANGED, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,86,280,8 diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index 1bd2e9f3f6..5b947b20a8 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -569,43 +569,6 @@ int ProcessExtraStatus(DBCONTACTWRITESETTING *cws, MCONTACT hContact) return 1; } - if (strstr(cws->szSetting, "XStatus")) { - if (mir_strcmp(cws->szModule, szProto)) - return 0; - - if (mir_strcmp(cws->szSetting, "XStatusName") == 0) { - smi.compare = CompareStatusMsg(&smi, cws, "LastXStatusName"); - if (smi.compare == COMPARE_SAME) { - replaceStrW(smi.newstatusmsg, nullptr); - replaceStrW(smi.oldstatusmsg, nullptr); - } - - if (cws->value.type == DBVT_DELETED) - db_unset(hContact, "UserOnline", "LastXStatusName"); - else - db_set(hContact, "UserOnline", "LastXStatusName", &cws->value); - - xsc = NewXSC(hContact, szProto, TYPE_ICQ_XSTATUS, smi.compare, smi.newstatusmsg, nullptr); - ExtraStatusChanged(xsc); - } - else if (!mir_strcmp(cws->szSetting, "XStatusMsg")) { - smi.compare = CompareStatusMsg(&smi, cws, "LastXStatusMsg"); - if (smi.compare == COMPARE_SAME) { - replaceStrW(smi.newstatusmsg, nullptr); - replaceStrW(smi.oldstatusmsg, nullptr); - } - - if (cws->value.type == DBVT_DELETED) - db_unset(hContact, "UserOnline", "LastXStatusMsg"); - else - db_set(hContact, "UserOnline", "LastXStatusMsg", &cws->value); - - xsc = NewXSC(hContact, szProto, TYPE_ICQ_XSTATUS, smi.compare * 4, nullptr, smi.newstatusmsg); - ExtraStatusChanged(xsc); - } - return 1; - } - return 0; } diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp index fcd5c307d8..d6fd9cb558 100644 --- a/plugins/NewXstatusNotify/src/options.cpp +++ b/plugins/NewXstatusNotify/src/options.cpp @@ -68,7 +68,6 @@ void LoadOptions() // IDD_OPT_XPOPUP opt.PXOnConnect = g_plugin.getByte("PXOnConnect", 0); - opt.PXDisableForMusic = g_plugin.getByte("PXDisableForMusic", 1); opt.PXMsgTruncate = g_plugin.getByte("PXMsgTruncate", 0); opt.PXMsgLen = g_plugin.getDword("PXMsgLen", 64); @@ -103,7 +102,6 @@ void LoadOptions() opt.XLogToDB = g_plugin.getByte("XLogToDB", 0); opt.XLogToDB_WinOpen = g_plugin.getByte("XLogToDB_WinOpen", 1); opt.XLogToDB_Remove = g_plugin.getByte("XLogToDB_Remove", 0); - opt.XLogDisableForMusic = g_plugin.getByte("XLogDisableForMusic", 1); // IDD_OPT_SMPOPUP opt.PSMsgOnConnect = g_plugin.getByte("PSMsgOnConnect", 0); @@ -162,7 +160,6 @@ void SaveOptions() g_plugin.setByte("RightClickAction", opt.RightClickAction); // IDD_OPT_XPOPUP g_plugin.setByte("PXOnConnect", opt.PXOnConnect); - g_plugin.setByte("PXDisableForMusic", opt.PXDisableForMusic); g_plugin.setByte("PXMsgTruncate", opt.PXMsgTruncate); g_plugin.setDword("PXMsgLen", opt.PXMsgLen); // IDD_OPT_GENERAL @@ -174,10 +171,12 @@ void SaveOptions() g_plugin.setByte("BlinkIcon_Status", opt.BlinkIcon_Status); g_plugin.setByte("BlinkIcon_ForMsgs", opt.BlinkIcon_ForMsgs); g_plugin.setWString("LogFilePath", opt.LogFilePath); + // IDD_AUTODISABLE g_plugin.setByte("OnlyGlobalChanges", opt.OnlyGlobalChanges); g_plugin.setByte("DisablePopupGlobally", opt.DisablePopupGlobally); g_plugin.setByte("DisableSoundGlobally", opt.DisableSoundGlobally); + // IDD_OPT_LOG g_plugin.setByte("LogToFile", opt.LogToFile); g_plugin.setByte("LogToDB", opt.LogToDB); @@ -188,12 +187,13 @@ void SaveOptions() g_plugin.setByte("SMsgLogToDB", opt.SMsgLogToDB); g_plugin.setByte("SMsgLogToDB_WinOpen", opt.SMsgLogToDB_WinOpen); g_plugin.setByte("SMsgLogToDB_Remove", opt.SMsgLogToDB_Remove); + // IDD_OPT_XLOG g_plugin.setByte("XLogToFile", opt.XLogToFile); g_plugin.setByte("XLogToDB", opt.XLogToDB); g_plugin.setByte("XLogToDB_WinOpen", opt.XLogToDB_WinOpen); g_plugin.setByte("XLogToDB_Remove", opt.XLogToDB_Remove); - g_plugin.setByte("XLogDisableForMusic", opt.XLogDisableForMusic); + // IDD_OPT_SMPOPUP g_plugin.setByte("PSMsgOnConnect", opt.PSMsgOnConnect); g_plugin.setByte("PSMsgTruncate", opt.PSMsgTruncate); @@ -527,7 +527,6 @@ INT_PTR CALLBACK DlgProcXPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SendDlgItemMessage(hwndDlg, IDC_UD_MSGLEN, UDM_SETRANGE, 0, MAKELONG(999, 1)); CheckDlgButton(hwndDlg, IDC_XONCONNECT, opt.PXOnConnect ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_CHK_DISABLEMUSIC, opt.PXDisableForMusic ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_CHK_CUTMSG, opt.PXMsgTruncate ? BST_CHECKED : BST_UNCHECKED); SetDlgItemInt(hwndDlg, IDC_ED_MSGLEN, opt.PXMsgLen, FALSE); @@ -603,7 +602,6 @@ INT_PTR CALLBACK DlgProcXPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case WM_NOTIFY: if (((LPNMHDR)lParam)->code == PSN_APPLY) { opt.PXOnConnect = IsDlgButtonChecked(hwndDlg, IDC_XONCONNECT); - opt.PXDisableForMusic = IsDlgButtonChecked(hwndDlg, IDC_CHK_DISABLEMUSIC); opt.PXMsgTruncate = IsDlgButtonChecked(hwndDlg, IDC_CHK_CUTMSG); opt.PXMsgLen = GetDlgItemInt(hwndDlg, IDC_ED_MSGLEN, nullptr, FALSE); @@ -869,7 +867,6 @@ INT_PTR CALLBACK DlgProcXLogOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l CheckDlgButton(hwndDlg, IDC_XLOGTODB, opt.XLogToDB ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_XLOGTODB_WINOPEN, opt.XLogToDB_WinOpen ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_XLOGTODB_REMOVE, opt.XLogToDB_Remove ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_CHK_DISABLEMUSIC, opt.XLogDisableForMusic ? BST_CHECKED : BST_UNCHECKED); //Templates CheckDlgButton(hwndDlg, IDC_CHK_XSTATUSCHANGED, (templates.LogXFlags & NOTIFY_NEW_XSTATUS) ? BST_CHECKED : BST_UNCHECKED); @@ -952,7 +949,6 @@ INT_PTR CALLBACK DlgProcXLogOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l opt.XLogToDB = IsDlgButtonChecked(hwndDlg, IDC_XLOGTODB); opt.XLogToDB_WinOpen = IsDlgButtonChecked(hwndDlg, IDC_XLOGTODB_WINOPEN); opt.XLogToDB_Remove = IsDlgButtonChecked(hwndDlg, IDC_XLOGTODB_REMOVE); - opt.XLogDisableForMusic = IsDlgButtonChecked(hwndDlg, IDC_CHK_DISABLEMUSIC); templates.LogXFlags = 0; templates.LogXFlags |= (IsDlgButtonChecked(hwndDlg, IDC_CHK_XSTATUSCHANGED) ? NOTIFY_NEW_XSTATUS : 0) | diff --git a/plugins/NewXstatusNotify/src/options.h b/plugins/NewXstatusNotify/src/options.h index eec6be1b24..685e11eec3 100644 --- a/plugins/NewXstatusNotify/src/options.h +++ b/plugins/NewXstatusNotify/src/options.h @@ -40,7 +40,6 @@ struct OPTIONS // IDD_OPT_XPOPUP uint8_t PXOnConnect; - uint8_t PXDisableForMusic; uint8_t PXMsgTruncate; uint32_t PXMsgLen; @@ -75,7 +74,6 @@ struct OPTIONS uint8_t XLogToDB; uint8_t XLogToDB_WinOpen; uint8_t XLogToDB_Remove; - uint8_t XLogDisableForMusic; // IDD_OPT_SMPOPUP uint8_t PSMsgOnConnect; diff --git a/plugins/NewXstatusNotify/src/resource.h b/plugins/NewXstatusNotify/src/resource.h index d870a28716..1a1a34c6cc 100644 --- a/plugins/NewXstatusNotify/src/resource.h +++ b/plugins/NewXstatusNotify/src/resource.h @@ -30,7 +30,6 @@ #define IDC_CONNECTIONTIMEOUT_VALUE_SPIN 1009 #define IDC_STATUS_STATIC_SEC2 1010 #define IDC_READAWAYMSG 1011 -#define IDC_CHK_DISABLEMUSIC 1011 #define IDC_SHOWPREVIOUSSTATUS 1012 #define IDC_CHK_CUTMSG 1012 #define IDC_USEPOPUPCOLORS 1013 diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index 21e0c90d5a..8000ad64fe 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -74,8 +74,6 @@ wchar_t* GetStatusTypeAsString(int type, wchar_t *buff) mir_wstrcpy(buff, TranslateT("Mood")); return buff; case TYPE_JABBER_ACTIVITY: mir_wstrcpy(buff, TranslateT("Activity")); return buff; - case TYPE_ICQ_XSTATUS: - mir_wstrcpy(buff, TranslateT("xStatus")); return buff; default: mir_wstrcpy(buff, TranslateT("")); return buff; } @@ -169,10 +167,6 @@ void ShowXStatusPopup(XSTATUSCHANGE *xsc) db_free(&dbv); } break; - - case TYPE_ICQ_XSTATUS: - int statusId = db_get_b(xsc->hContact, xsc->szProto, "XStatusId", 0); - hIcon = (HICON)CallProtoService(xsc->szProto, PS_GETCUSTOMSTATUSICON, statusId, LR_SHARED); } if (hIcon == nullptr) @@ -232,9 +226,6 @@ void BlinkXStatusIcon(XSTATUSCHANGE *xsc) db_free(&dbv); } break; - case TYPE_ICQ_XSTATUS: - int statusId = db_get_b(xsc->hContact, xsc->szProto, "XStatusId", 0); - hIcon = (HICON)CallProtoService(xsc->szProto, PS_GETCUSTOMSTATUSICON, statusId, LR_SHARED); } } @@ -371,10 +362,6 @@ void ExtraStatusChanged(XSTATUSCHANGE *xsc) if (g_plugin.getByte(xsc->szProto, 1) == 0 && !opt.PXOnConnect) bEnablePopup = false; - int xstatusID = db_get_b(xsc->hContact, xsc->szProto, "XStatusId", 0); - if (opt.PXDisableForMusic && xsc->type == TYPE_ICQ_XSTATUS && xstatusID == XSTATUS_MUSIC) - bEnableSound = bEnablePopup = false; - if (bEnablePopup && g_plugin.getByte(xsc->hContact, "EnablePopups", 1) && g_plugin.bPopups) ShowXStatusPopup(xsc); @@ -384,9 +371,6 @@ void ExtraStatusChanged(XSTATUSCHANGE *xsc) if (opt.BlinkIcon && opt.BlinkIcon_ForMsgs && g_plugin.bPopups) BlinkXStatusIcon(xsc); - if (opt.XLogDisableForMusic && xsc->type == TYPE_ICQ_XSTATUS && xstatusID == XSTATUS_MUSIC) - bEnableLog = false; - if (!(templates.LogXFlags & xsc->action)) bEnableLog = false; @@ -482,13 +466,6 @@ void AddXStatusEventThread(void *arg) LogXstatusChange(hContact, szProto, TYPE_JABBER_ACTIVITY, stzTitle, stzText); } } - else { - GetIcqXStatus(hContact, szProto, "XStatusName", stzTitle, _countof(stzTitle)); - if (stzTitle[0]) { - GetIcqXStatus(hContact, szProto, "XStatusMsg", stzText, _countof(stzText)); - LogXstatusChange(hContact, szProto, TYPE_ICQ_XSTATUS, stzTitle, stzText); - } - } } void AddSMsgEventThread(void *arg) diff --git a/plugins/NewXstatusNotify/src/xstatus.h b/plugins/NewXstatusNotify/src/xstatus.h index 403400caba..ea7ef5e2b9 100644 --- a/plugins/NewXstatusNotify/src/xstatus.h +++ b/plugins/NewXstatusNotify/src/xstatus.h @@ -26,7 +26,6 @@ #define NOTIFY_REMOVE_MESSAGE 8 #define NOTIFY_OPENING_ML 16 -#define TYPE_ICQ_XSTATUS 1 #define TYPE_JABBER_MOOD 2 #define TYPE_JABBER_ACTIVITY 3 -- cgit v1.2.3