summaryrefslogtreecommitdiff
path: root/plugins/StatusChange/src
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2019-07-21 19:59:18 +0300
committerdartraiden <wowemuh@gmail.com>2019-07-21 19:59:18 +0300
commitb078dfb78c89aea87cd422eae52694738e473cf3 (patch)
treeca896e82a8a5ce81f80d041f4aee7fdeeb007162 /plugins/StatusChange/src
parentee7e29d02e94e969c1154515cd0c408c591a2414 (diff)
Restore "Free for chat" status support (fixes #1963)
Diffstat (limited to 'plugins/StatusChange/src')
-rw-r--r--plugins/StatusChange/src/main.cpp13
-rw-r--r--plugins/StatusChange/src/resource.h6
-rw-r--r--plugins/StatusChange/src/stdafx.h1
3 files changed, 18 insertions, 2 deletions
diff --git a/plugins/StatusChange/src/main.cpp b/plugins/StatusChange/src/main.cpp
index 723cb289c3..cfe19ada93 100644
--- a/plugins/StatusChange/src/main.cpp
+++ b/plugins/StatusChange/src/main.cpp
@@ -42,6 +42,7 @@ void LoadOptions()
Options.IfNA = (BOOL)g_plugin.getByte("IfNA", TRUE);
Options.IfOccupied = (BOOL)g_plugin.getByte("IfOccupied", FALSE);
Options.IfDND = (BOOL)g_plugin.getByte("IfDND", FALSE);
+ Options.IfFreeforchat = (BOOL)g_plugin.getByte("IfFreeforchat", FALSE);
Options.IfInvisible = (BOOL)g_plugin.getByte("IfInvisible", FALSE);
}
@@ -66,6 +67,7 @@ static int StatusChangeGetMessage(WPARAM, LPARAM hDbEvent)
case ID_STATUS_NA: change_status = Options.IfNA; break;
case ID_STATUS_OCCUPIED: change_status = Options.IfOccupied; break;
case ID_STATUS_DND: change_status = Options.IfDND; break;
+ case ID_STATUS_FREECHAT: change_status = Options.IfFreeforchat; break;
case ID_STATUS_INVISIBLE: change_status = Options.IfInvisible; break;
default: change_status = FALSE; break;
}
@@ -127,6 +129,7 @@ static INT_PTR CALLBACK DlgProcStatusChangeOpts(HWND hwndDlg, UINT msg, WPARAM w
case ID_STATUS_DND: CheckDlgButton(hwndDlg, IDC_RAD_DND, BST_CHECKED); break;
case ID_STATUS_NA: CheckDlgButton(hwndDlg, IDC_RAD_NA, BST_CHECKED); break;
case ID_STATUS_OCCUPIED: CheckDlgButton(hwndDlg, IDC_RAD_OCCUPIED, BST_CHECKED); break;
+ case ID_STATUS_FREECHAT: CheckDlgButton(hwndDlg, IDC_RAD_FREECHAT, BST_CHECKED); break;
case ID_STATUS_INVISIBLE: CheckDlgButton(hwndDlg, IDC_RAD_INVISIBLE, BST_CHECKED); break;
}
@@ -136,6 +139,7 @@ static INT_PTR CALLBACK DlgProcStatusChangeOpts(HWND hwndDlg, UINT msg, WPARAM w
CheckDlgButton(hwndDlg, IDC_CHK_DND, Options.IfDND ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CHK_NA, Options.IfNA ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CHK_OCCUPIED, Options.IfOccupied ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHK_FREECHAT, Options.IfFreeforchat ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CHK_INVISIBLE, Options.IfInvisible ? BST_CHECKED : BST_UNCHECKED);
return TRUE;
@@ -182,6 +186,10 @@ static INT_PTR CALLBACK DlgProcStatusChangeOpts(HWND hwndDlg, UINT msg, WPARAM w
Options.ChangeTo = ID_STATUS_OCCUPIED;
PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
+ case IDC_RAD_FREECHAT:
+ Options.ChangeTo = ID_STATUS_FREECHAT;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
case IDC_RAD_INVISIBLE:
Options.ChangeTo = ID_STATUS_INVISIBLE;
PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -211,6 +219,10 @@ static INT_PTR CALLBACK DlgProcStatusChangeOpts(HWND hwndDlg, UINT msg, WPARAM w
Options.IfOccupied = !Options.IfOccupied;
PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
+ case IDC_CHK_FREECHAT:
+ Options.IfFreeforchat = !Options.IfFreeforchat;
+ PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
case IDC_CHK_INVISIBLE:
Options.IfInvisible = !Options.IfInvisible;
PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -238,6 +250,7 @@ static INT_PTR CALLBACK DlgProcStatusChangeOpts(HWND hwndDlg, UINT msg, WPARAM w
g_plugin.setByte("IfNA", (BYTE)Options.IfNA);
g_plugin.setByte("IfDND", (BYTE)Options.IfDND);
g_plugin.setByte("IfOccupied", (BYTE)Options.IfOccupied);
+ g_plugin.setByte("IfFreeforchat", (BYTE)Options.IfFreeforchat);
g_plugin.setByte("IfInvisible", (BYTE)Options.IfInvisible);
return TRUE;
}
diff --git a/plugins/StatusChange/src/resource.h b/plugins/StatusChange/src/resource.h
index 1b0a7294da..0c576b576e 100644
--- a/plugins/StatusChange/src/resource.h
+++ b/plugins/StatusChange/src/resource.h
@@ -9,14 +9,16 @@
#define IDC_CHK_DND 1004
#define IDC_CHK_NA 1005
#define IDC_CHK_OCCUPIED 1006
-#define IDC_CHK_INVISIBLE 1007
+#define IDC_CHK_FREECHAT 1007
+#define IDC_CHK_INVISIBLE 1008
#define IDC_RAD_OFFLINE 2001
#define IDC_RAD_ONLINE 2002
#define IDC_RAD_AWAY 2003
#define IDC_RAD_DND 2004
#define IDC_RAD_NA 2005
#define IDC_RAD_OCCUPIED 2006
-#define IDC_RAD_INVISIBLE 2007
+#define IDC_RAD_FREECHAT 2007
+#define IDC_RAD_INVISIBLE 2008
#define IDC_CHK_MESSAGEREAD 3001
#define IDC_CHK_MESSAGESEND 3002
#define IDC_CHK_FILEREAD 3005
diff --git a/plugins/StatusChange/src/stdafx.h b/plugins/StatusChange/src/stdafx.h
index 5424e7de8d..2b0485647d 100644
--- a/plugins/StatusChange/src/stdafx.h
+++ b/plugins/StatusChange/src/stdafx.h
@@ -38,5 +38,6 @@ struct TOPTIONS
BOOL IfNA;
BOOL IfOccupied;
BOOL IfDND;
+ BOOL IfFreeforchat;
BOOL IfInvisible;
};