summaryrefslogtreecommitdiff
path: root/plugins/SimpleAR/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/SimpleAR/src
parentee7e29d02e94e969c1154515cd0c408c591a2414 (diff)
Restore "Free for chat" status support (fixes #1963)
Diffstat (limited to 'plugins/SimpleAR/src')
-rw-r--r--plugins/SimpleAR/src/Main.cpp8
-rw-r--r--plugins/SimpleAR/src/Options.cpp12
2 files changed, 10 insertions, 10 deletions
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp
index d3c87a0104..d189657681 100644
--- a/plugins/SimpleAR/src/Main.cpp
+++ b/plugins/SimpleAR/src/Main.cpp
@@ -98,7 +98,7 @@ INT CheckDefaults(WPARAM, LPARAM)
mir_free(ptszVal);
for (int c = ID_STATUS_ONLINE; c < ID_STATUS_IDLE; c++) {
- if (c == ID_STATUS_ONLINE || c == ID_STATUS_INVISIBLE)
+ if (c == ID_STATUS_ONLINE || c == ID_STATUS_FREECHAT || c == ID_STATUS_INVISIBLE)
continue;
else {
char szStatus[6] = { 0 };
@@ -106,7 +106,7 @@ INT CheckDefaults(WPARAM, LPARAM)
ptszVal = g_plugin.getWStringA(szStatus);
if (ptszVal == nullptr) {
wchar_t *ptszDefault;
- if (c < ID_STATUS_OCCUPIED)
+ if (c < ID_STATUS_FREECHAT)
// This mode does not have a preset message
ptszDefault = ptszDefaultMsg[c - ID_STATUS_ONLINE - 1];
else
@@ -131,11 +131,11 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent)
{
BOOL fEnabled = g_plugin.getByte(KEY_ENABLED, 1);
if (!fEnabled || !hContact || !hDBEvent)
- return FALSE; /// unspecifyed error
+ return FALSE; /// unspecified error
char *pszProto = GetContactProto(hContact);
int status = Proto_GetStatus(pszProto);
- if (status == ID_STATUS_ONLINE || status == ID_STATUS_INVISIBLE)
+ if (status == ID_STATUS_ONLINE || status == ID_STATUS_FREECHAT || status == ID_STATUS_INVISIBLE)
return FALSE;
// detect size of msg
diff --git a/plugins/SimpleAR/src/Options.cpp b/plugins/SimpleAR/src/Options.cpp
index 391020267b..9ffef53047 100644
--- a/plugins/SimpleAR/src/Options.cpp
+++ b/plugins/SimpleAR/src/Options.cpp
@@ -23,13 +23,13 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
for (INT c = ID_STATUS_ONLINE; c < ID_STATUS_IDLE; c++) {
mir_snprintf(tszStatus, "%d", c);
wchar_t *pszStatus = Clist_GetStatusModeDescription(c, 0);
- if (c == ID_STATUS_ONLINE || c == ID_STATUS_INVISIBLE)
+ if (c == ID_STATUS_ONLINE || c == ID_STATUS_FREECHAT || c == ID_STATUS_INVISIBLE)
continue;
else {
SendDlgItemMessage(hwndDlg, IDC_STATUSMODE, CB_ADDSTRING, 0, (LPARAM)pszStatus);
if (!g_plugin.getWString(tszStatus, &dbv)) {
- if (c < ID_STATUS_OCCUPIED)
+ if (c < ID_STATUS_FREECHAT)
ptszMessage[c - ID_STATUS_ONLINE - 1] = wcsdup(dbv.pwszVal);
else if (c > ID_STATUS_INVISIBLE)
ptszMessage[c - ID_STATUS_ONLINE - 3] = wcsdup(dbv.pwszVal);
@@ -99,13 +99,13 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
GetDlgItemText(hwndDlg, IDC_MESSAGE, ptszMessage[lastIndex], size);
for (int c = ID_STATUS_ONLINE; c < ID_STATUS_IDLE; c++) {
- if (c == ID_STATUS_ONLINE || c == ID_STATUS_INVISIBLE)
+ if (c == ID_STATUS_ONLINE || c == ID_STATUS_FREECHAT || c == ID_STATUS_INVISIBLE)
continue;
else {
char szStatus[6] = { 0 };
mir_snprintf(szStatus, "%d", c);
- if (c < ID_STATUS_OCCUPIED && ptszMessage[c - ID_STATUS_ONLINE - 1])
+ if (c < ID_STATUS_FREECHAT && ptszMessage[c - ID_STATUS_ONLINE - 1])
g_plugin.setWString(szStatus, ptszMessage[c - ID_STATUS_ONLINE - 1]);
else if (c > ID_STATUS_INVISIBLE && ptszMessage[c - ID_STATUS_ONLINE - 3])
g_plugin.setWString(szStatus, ptszMessage[c - ID_STATUS_ONLINE - 3]);
@@ -119,10 +119,10 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
case WM_DESTROY:
for (int c = ID_STATUS_ONLINE; c < ID_STATUS_IDLE; c++) {
- if (c == ID_STATUS_ONLINE || c == ID_STATUS_INVISIBLE)
+ if (c == ID_STATUS_ONLINE || c == ID_STATUS_FREECHAT || c == ID_STATUS_INVISIBLE)
continue;
- if (c < ID_STATUS_OCCUPIED)
+ if (c < ID_STATUS_FREECHAT)
ptszMessage[c - ID_STATUS_ONLINE - 1] = nullptr;
else if (c > ID_STATUS_INVISIBLE)
ptszMessage[c - ID_STATUS_ONLINE - 3] = nullptr;