summaryrefslogtreecommitdiff
path: root/plugins/WinterSpeak/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/WinterSpeak/src
parentee7e29d02e94e969c1154515cd0c408c591a2414 (diff)
Restore "Free for chat" status support (fixes #1963)
Diffstat (limited to 'plugins/WinterSpeak/src')
-rw-r--r--plugins/WinterSpeak/src/AnnounceDatabase.h1
-rw-r--r--plugins/WinterSpeak/src/AnnounceDialog.cpp3
-rw-r--r--plugins/WinterSpeak/src/ConfigDatabase.h1
-rw-r--r--plugins/WinterSpeak/src/DialogConfigActive.cpp3
-rw-r--r--plugins/WinterSpeak/src/SpeakAnnounce.cpp3
-rw-r--r--plugins/WinterSpeak/src/SpeakConfig.cpp3
-rw-r--r--plugins/WinterSpeak/src/UserInformation.cpp1
-rw-r--r--plugins/WinterSpeak/src/resource.h2
8 files changed, 17 insertions, 0 deletions
diff --git a/plugins/WinterSpeak/src/AnnounceDatabase.h b/plugins/WinterSpeak/src/AnnounceDatabase.h
index 1d1629851a..06014843ac 100644
--- a/plugins/WinterSpeak/src/AnnounceDatabase.h
+++ b/plugins/WinterSpeak/src/AnnounceDatabase.h
@@ -14,6 +14,7 @@ class AnnounceDatabase
StatusFlag_Dnd,
StatusFlag_Na,
StatusFlag_Occupied,
+ StatusFlag_FreeForChat,
StatusFlag_Invisible,
StatusFlag_SpeakStatusMsg,
StatusFlag_SuppressConnect,
diff --git a/plugins/WinterSpeak/src/AnnounceDialog.cpp b/plugins/WinterSpeak/src/AnnounceDialog.cpp
index 1fd67a492a..eb07e5fa5b 100644
--- a/plugins/WinterSpeak/src/AnnounceDialog.cpp
+++ b/plugins/WinterSpeak/src/AnnounceDialog.cpp
@@ -60,6 +60,7 @@ void AnnounceDialog::command(HWND window, int control)
case IDC_STATUS_DND:
case IDC_STATUS_NA:
case IDC_STATUS_OCCUPIED:
+ case IDC_STATUS_FREEFORCHAT:
case IDC_STATUS_INVISIBLE:
case IDC_SPEAK_STATUS_MSG:
case IDC_SUPPRESS_CONNECT:
@@ -96,6 +97,7 @@ AnnounceDialog::load(HWND window)
CheckDlgButton(window, IDC_STATUS_DND, m_db.getStatusFlag(AnnounceDatabase::StatusFlag_Dnd) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(window, IDC_STATUS_NA, m_db.getStatusFlag(AnnounceDatabase::StatusFlag_Na) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(window, IDC_STATUS_OCCUPIED, m_db.getStatusFlag(AnnounceDatabase::StatusFlag_Occupied) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(window, IDC_STATUS_FREEFORCHAT, m_db.getStatusFlag(AnnounceDatabase::StatusFlag_FreeForChat) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(window, IDC_STATUS_INVISIBLE, m_db.getStatusFlag(AnnounceDatabase::StatusFlag_Invisible) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(window, IDC_SPEAK_STATUS_MSG, m_db.getStatusFlag(AnnounceDatabase::StatusFlag_SpeakStatusMsg) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(window, IDC_SUPPRESS_CONNECT, m_db.getStatusFlag(AnnounceDatabase::StatusFlag_SuppressConnect) ? BST_CHECKED : BST_UNCHECKED);
@@ -123,6 +125,7 @@ AnnounceDialog::save(HWND window)
m_db.setStatusFlag(AnnounceDatabase::StatusFlag_Dnd, (IsDlgButtonChecked(window, IDC_STATUS_DND) != 0));
m_db.setStatusFlag(AnnounceDatabase::StatusFlag_Na, (IsDlgButtonChecked(window, IDC_STATUS_NA) != 0));
m_db.setStatusFlag(AnnounceDatabase::StatusFlag_Occupied, (IsDlgButtonChecked(window, IDC_STATUS_OCCUPIED) != 0));
+ m_db.setStatusFlag(AnnounceDatabase::StatusFlag_FreeForChat, (IsDlgButtonChecked(window, IDC_STATUS_FREEFORCHAT) != 0));
m_db.setStatusFlag(AnnounceDatabase::StatusFlag_Invisible, (IsDlgButtonChecked(window, IDC_STATUS_INVISIBLE) != 0));
m_db.setStatusFlag(AnnounceDatabase::StatusFlag_SpeakStatusMsg, (IsDlgButtonChecked(window, IDC_SPEAK_STATUS_MSG) != 0));
m_db.setStatusFlag(AnnounceDatabase::StatusFlag_SuppressConnect, (IsDlgButtonChecked(window, IDC_SUPPRESS_CONNECT) != 0));
diff --git a/plugins/WinterSpeak/src/ConfigDatabase.h b/plugins/WinterSpeak/src/ConfigDatabase.h
index 668f38d47d..4e7f546aa1 100644
--- a/plugins/WinterSpeak/src/ConfigDatabase.h
+++ b/plugins/WinterSpeak/src/ConfigDatabase.h
@@ -17,6 +17,7 @@ public:
ActiveFlag_Dnd,
ActiveFlag_Na,
ActiveFlag_Occupied,
+ ActiveFlag_FreeForChat,
ActiveFlag_Invisible
};
diff --git a/plugins/WinterSpeak/src/DialogConfigActive.cpp b/plugins/WinterSpeak/src/DialogConfigActive.cpp
index be288305d9..dad1d5153b 100644
--- a/plugins/WinterSpeak/src/DialogConfigActive.cpp
+++ b/plugins/WinterSpeak/src/DialogConfigActive.cpp
@@ -58,6 +58,7 @@ INT_PTR CALLBACK DialogConfigActive::process(HWND window, UINT message, WPARAM w
case IDC_ACTIVE_DND:
case IDC_ACTIVE_NA:
case IDC_ACTIVE_OCCUPIED:
+ case IDC_ACTIVE_FREEFORCHAT:
case IDC_ACTIVE_INVISIBLE:
m_instance->changed(window);
break;
@@ -149,6 +150,7 @@ void DialogConfigActive::load(HWND window)
CheckDlgButton(window, IDC_ACTIVE_DND, m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Dnd) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(window, IDC_ACTIVE_NA, m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Na) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(window, IDC_ACTIVE_OCCUPIED, m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Occupied) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(window, IDC_ACTIVE_FREEFORCHAT, m_db.getActiveFlag(ConfigDatabase::ActiveFlag_FreeForChat) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(window, IDC_ACTIVE_INVISIBLE, m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Invisible) ? BST_CHECKED : BST_UNCHECKED);
HWND listview = GetDlgItem(window, IDC_ACTIVE_USERS);
@@ -320,6 +322,7 @@ void DialogConfigActive::save(HWND window)
m_db.setActiveFlag(ConfigDatabase::ActiveFlag_Dnd, (IsDlgButtonChecked(window, IDC_ACTIVE_DND) != 0));
m_db.setActiveFlag(ConfigDatabase::ActiveFlag_Na, (IsDlgButtonChecked(window, IDC_ACTIVE_NA) != 0));
m_db.setActiveFlag(ConfigDatabase::ActiveFlag_Occupied, (IsDlgButtonChecked(window, IDC_ACTIVE_OCCUPIED) != 0));
+ m_db.setActiveFlag(ConfigDatabase::ActiveFlag_FreeForChat, (IsDlgButtonChecked(window, IDC_ACTIVE_FREEFORCHAT) != 0));
m_db.setActiveFlag(ConfigDatabase::ActiveFlag_Invisible, (IsDlgButtonChecked(window, IDC_ACTIVE_INVISIBLE) != 0));
for (auto &hContact : Contacts()) {
diff --git a/plugins/WinterSpeak/src/SpeakAnnounce.cpp b/plugins/WinterSpeak/src/SpeakAnnounce.cpp
index 87f01038d4..e9b8160138 100644
--- a/plugins/WinterSpeak/src/SpeakAnnounce.cpp
+++ b/plugins/WinterSpeak/src/SpeakAnnounce.cpp
@@ -48,6 +48,9 @@ void SpeakAnnounce::statusChange(DBCONTACTWRITESETTING *write_setting, MCONTACT
case ID_STATUS_OCCUPIED:
speak = m_db.getStatusFlag(AnnounceDatabase::StatusFlag_Occupied);
break;
+ case ID_STATUS_FREECHAT:
+ speak = m_db.getStatusFlag(AnnounceDatabase::StatusFlag_FreeForChat);
+ break;
case ID_STATUS_INVISIBLE:
speak = m_db.getStatusFlag(AnnounceDatabase::StatusFlag_Invisible);
break;
diff --git a/plugins/WinterSpeak/src/SpeakConfig.cpp b/plugins/WinterSpeak/src/SpeakConfig.cpp
index b02de945c3..1d0d4185d7 100644
--- a/plugins/WinterSpeak/src/SpeakConfig.cpp
+++ b/plugins/WinterSpeak/src/SpeakConfig.cpp
@@ -68,6 +68,9 @@ bool SpeakConfig::say(const std::wstring &sentence, MCONTACT user, bool message)
case ID_STATUS_OCCUPIED:
active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Occupied);
break;
+ case ID_STATUS_FREECHAT:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_FreeForChat);
+ break;
case ID_STATUS_INVISIBLE:
active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Invisible);
break;
diff --git a/plugins/WinterSpeak/src/UserInformation.cpp b/plugins/WinterSpeak/src/UserInformation.cpp
index bdf89ec6e6..7769261257 100644
--- a/plugins/WinterSpeak/src/UserInformation.cpp
+++ b/plugins/WinterSpeak/src/UserInformation.cpp
@@ -11,6 +11,7 @@ UserInformation::UserInformation() : m_status_info(), m_status_strings() {
m_status_strings[ID_STATUS_NA] = LPGENW("%u is not available");
m_status_strings[ID_STATUS_DND] = LPGENW("%u does not want to be disturbed");
m_status_strings[ID_STATUS_OCCUPIED] = LPGENW("%u is occupied");
+ m_status_strings[ID_STATUS_FREECHAT] = LPGENW("%u is free for chat");
}
//------------------------------------------------------------------------------
diff --git a/plugins/WinterSpeak/src/resource.h b/plugins/WinterSpeak/src/resource.h
index c7aca68d1a..a4e8e7ed1c 100644
--- a/plugins/WinterSpeak/src/resource.h
+++ b/plugins/WinterSpeak/src/resource.h
@@ -23,6 +23,7 @@
#define IDC_ACTIVE_DND 1011
#define IDC_ACTIVE_NA 1012
#define IDC_ACTIVE_OCCUPIED 1013
+#define IDC_ACTIVE_FREEFORCHAT 1014
#define IDC_ACTIVE_INVISIBLE 1015
#define IDC_BUTTON_TEST 1016
#define IDC_STATUS_OFFLINE 1100
@@ -31,6 +32,7 @@
#define IDC_STATUS_DND 1103
#define IDC_STATUS_NA 1104
#define IDC_STATUS_OCCUPIED 1105
+#define IDC_STATUS_FREEFORCHAT 1106
#define IDC_STATUS_INVISIBLE 1107
#define IDC_SPEAK_STATUS_MSG 1108
#define IDC_EVENT_MESSAGE 1109