summaryrefslogtreecommitdiff
path: root/protocols/ICQ-WIM/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/ICQ-WIM/src')
-rw-r--r--protocols/ICQ-WIM/src/options.cpp8
-rw-r--r--protocols/ICQ-WIM/src/proto.cpp1
-rw-r--r--protocols/ICQ-WIM/src/proto.h1
-rw-r--r--protocols/ICQ-WIM/src/resource.h3
-rw-r--r--protocols/ICQ-WIM/src/server.cpp38
5 files changed, 29 insertions, 22 deletions
diff --git a/protocols/ICQ-WIM/src/options.cpp b/protocols/ICQ-WIM/src/options.cpp
index 03ecb37ad9..545b5e353b 100644
--- a/protocols/ICQ-WIM/src/options.cpp
+++ b/protocols/ICQ-WIM/src/options.cpp
@@ -23,7 +23,7 @@
struct CIcqRegistrationDlg : public CProtoDlgBase<CIcqProto>
{
CMStringA szTrans, szMsisdn;
- int iErrorCode;
+ int iErrorCode = 0;
CCtrlEdit edtPhone, edtCode;
CCtrlButton btnSendSms;
@@ -158,7 +158,7 @@ void CIcqProto::OnLoginViaPhone(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pRe
class CIcqOptionsDlg : public CProtoDlgBase<CIcqProto>
{
CCtrlEdit edtUin, edtPassword;
- CCtrlCheck chkHideChats, chkTrayIcon, chkLaunchMailbox;
+ CCtrlCheck chkHideChats, chkTrayIcon, chkLaunchMailbox, chkShowErrorPopups;
CCtrlButton btnCreate;
CMStringW wszOldPass;
@@ -170,7 +170,8 @@ public:
edtPassword(this, IDC_PASSWORD),
chkTrayIcon(this, IDC_USETRAYICON),
chkHideChats(this, IDC_HIDECHATS),
- chkLaunchMailbox(this, IDC_LAUNCH_MAILBOX)
+ chkLaunchMailbox(this, IDC_LAUNCH_MAILBOX),
+ chkShowErrorPopups(this, IDC_SHOWERRORPOPUPS)
{
btnCreate.OnClick = Callback(this, &CIcqOptionsDlg::onClick_Register);
@@ -180,6 +181,7 @@ public:
CreateLink(chkHideChats, ppro->m_bHideGroupchats);
CreateLink(chkTrayIcon, ppro->m_bUseTrayIcon);
CreateLink(chkLaunchMailbox, ppro->m_bLaunchMailbox);
+ CreateLink(chkShowErrorPopups, ppro->m_bErrorPopups);
chkTrayIcon.OnChange = Callback(this, &CIcqOptionsDlg::onChange_Tray);
}
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp
index ea9e7f21f9..87b5f337f3 100644
--- a/protocols/ICQ-WIM/src/proto.cpp
+++ b/protocols/ICQ-WIM/src/proto.cpp
@@ -53,6 +53,7 @@ CIcqProto::CIcqProto(const char* aProtoName, const wchar_t* aUserName) :
m_szPassword(this, "Password"),
m_bHideGroupchats(this, "HideChats", true),
m_bUseTrayIcon(this, "UseTrayIcon", false),
+ m_bErrorPopups(this, "ShowErrorPopups", true),
m_bLaunchMailbox(this, "LaunchMailbox", true)
{
db_set_resident(m_szModuleName, "IdleTS");
diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h
index 7461dcdd6c..fcdded5f6c 100644
--- a/protocols/ICQ-WIM/src/proto.h
+++ b/protocols/ICQ-WIM/src/proto.h
@@ -352,6 +352,7 @@ public:
CMOption<wchar_t*> m_szPassword; // password, if present
CMOption<BYTE> m_bHideGroupchats; // don't pop up group chat windows on startup
CMOption<BYTE> m_bUseTrayIcon; // use tray icon notifications
+ CMOption<BYTE> m_bErrorPopups; // display popups with errors
CMOption<BYTE> m_bLaunchMailbox; // launch browser to view email
CMOption<DWORD> m_iTimeDiff1; // set this status to m_iStatus1 after this interval of secs
CMOption<DWORD> m_iStatus1;
diff --git a/protocols/ICQ-WIM/src/resource.h b/protocols/ICQ-WIM/src/resource.h
index 32ab58a703..72d0870920 100644
--- a/protocols/ICQ-WIM/src/resource.h
+++ b/protocols/ICQ-WIM/src/resource.h
@@ -31,6 +31,7 @@
#define IDC_STATUS1 1019
#define IDC_USETRAYICON 1020
#define IDC_LAUNCH_MAILBOX 1021
+#define IDC_SHOWERRORPOPUPS 1022
#define IDC_DIFF2 1023
#define IDC_SPIN2 1024
#define IDC_STATUS2 1025
@@ -41,7 +42,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 110
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1021
+#define _APS_NEXT_CONTROL_VALUE 1023
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp
index 8f4e7c621e..47ef4bf077 100644
--- a/protocols/ICQ-WIM/src/server.cpp
+++ b/protocols/ICQ-WIM/src/server.cpp
@@ -126,25 +126,27 @@ void CIcqProto::ConnectionFailed(int iReason, int iErrorCode)
{
debugLogA("ConnectionFailed -> reason %d", iReason);
- POPUPDATAW Popup = {};
- Popup.lchIcon = IcoLib_GetIconByHandle(Skin_GetIconHandle(SKINICON_ERROR), true);
- wcscpy_s(Popup.lpwzContactName, m_tszUserName);
- switch (iReason) {
- case LOGINERR_BADUSERID:
- mir_snwprintf(Popup.lpwzText, LPGENW("You have not entered an ICQ number.\nConfigure this in Options -> Network -> ICQ and try again."));
- break;
- case LOGINERR_WRONGPASSWORD:
- mir_snwprintf(Popup.lpwzText, LPGENW("Connection failed.\nYour ICQ number or password was rejected (%d)."), iErrorCode);
- break;
- case LOGINERR_NONETWORK:
- case LOGINERR_NOSERVER:
- mir_snwprintf(Popup.lpwzText, LPGENW("Connection failed.\nThe server is temporarily unavailable (%d)."), iErrorCode);
- break;
- default:
- mir_snwprintf(Popup.lpwzText, LPGENW("Connection failed.\nUnknown error during sign on: %d"), iErrorCode);
- break;
+ if (m_bErrorPopups) {
+ POPUPDATAW Popup = {};
+ Popup.lchIcon = IcoLib_GetIconByHandle(Skin_GetIconHandle(SKINICON_ERROR), true);
+ wcscpy_s(Popup.lpwzContactName, m_tszUserName);
+ switch (iReason) {
+ case LOGINERR_BADUSERID:
+ mir_snwprintf(Popup.lpwzText, TranslateT("You have not entered an ICQ number.\nConfigure this in Options -> Network -> ICQ and try again."));
+ break;
+ case LOGINERR_WRONGPASSWORD:
+ mir_snwprintf(Popup.lpwzText, TranslateT("Connection failed.\nYour ICQ number or password was rejected (%d)."), iErrorCode);
+ break;
+ case LOGINERR_NONETWORK:
+ case LOGINERR_NOSERVER:
+ mir_snwprintf(Popup.lpwzText, TranslateT("Connection failed.\nThe server is temporarily unavailable (%d)."), iErrorCode);
+ break;
+ default:
+ mir_snwprintf(Popup.lpwzText, TranslateT("Connection failed.\nUnknown error during sign on: %d"), iErrorCode);
+ break;
+ }
+ PUAddPopupW(&Popup);
}
- PUAddPopupW(&Popup);
ProtoBroadcastAck(0, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, iReason);
ShutdownSession();