summaryrefslogtreecommitdiff
path: root/protocols/ICQ-WIM
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-03-05 21:10:22 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-03-05 21:10:22 +0300
commitd9fddc0cfa9066eb1b5ad3f4807b37426ae6ca88 (patch)
treef09baaf9b91477d009cedc5bd77449b0fa3e3af7 /protocols/ICQ-WIM
parent8a1ff32e54b39ceef22df61bda17bbfda94918fc (diff)
Popup:
- wiping out checks for service presence; - code cleaning
Diffstat (limited to 'protocols/ICQ-WIM')
-rw-r--r--protocols/ICQ-WIM/src/main.cpp3
-rw-r--r--protocols/ICQ-WIM/src/server.cpp39
-rw-r--r--protocols/ICQ-WIM/src/stdafx.h2
-rw-r--r--protocols/ICQ-WIM/src/utils.cpp18
4 files changed, 28 insertions, 34 deletions
diff --git a/protocols/ICQ-WIM/src/main.cpp b/protocols/ICQ-WIM/src/main.cpp
index 21232e7d25..5b5449eb8e 100644
--- a/protocols/ICQ-WIM/src/main.cpp
+++ b/protocols/ICQ-WIM/src/main.cpp
@@ -20,7 +20,7 @@
#include "stdafx.h"
-bool g_bPopupService, g_bSecureIM, g_bMessageState;
+bool g_bSecureIM, g_bMessageState;
HWND g_hwndHeartbeat;
@@ -96,7 +96,6 @@ static INT_PTR ICQPermitDeny(WPARAM hContact, LPARAM, LPARAM bAllow)
static int ModuleLoad(WPARAM, LPARAM)
{
g_bSecureIM = ServiceExists("SecureIM/IsContactSecured");
- g_bPopupService = ServiceExists(MS_POPUP_ADDPOPUPW);
g_bMessageState = ServiceExists(MS_MESSAGESTATE_UPDATE);
return 0;
}
diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp
index ce82808092..21f0b57ddb 100644
--- a/protocols/ICQ-WIM/src/server.cpp
+++ b/protocols/ICQ-WIM/src/server.cpp
@@ -126,28 +126,25 @@ void CIcqProto::ConnectionFailed(int iReason, int iErrorCode)
{
debugLogA("ConnectionFailed -> reason %d", iReason);
- if (g_bPopupService) {
- 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;
- }
-
- CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&Popup, 0);
+ 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;
}
+ PUAddPopupW(&Popup);
ProtoBroadcastAck(0, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, iReason);
ShutdownSession();
diff --git a/protocols/ICQ-WIM/src/stdafx.h b/protocols/ICQ-WIM/src/stdafx.h
index e229041482..b216ec459a 100644
--- a/protocols/ICQ-WIM/src/stdafx.h
+++ b/protocols/ICQ-WIM/src/stdafx.h
@@ -103,5 +103,5 @@ int StatusFromString(const CMStringW&);
char* time2text(time_t time);
extern HWND g_hwndHeartbeat;
-extern bool g_bPopupService, g_bSecureIM, g_bMessageState;
+extern bool g_bSecureIM, g_bMessageState;
extern IconItem iconList[];
diff --git a/protocols/ICQ-WIM/src/utils.cpp b/protocols/ICQ-WIM/src/utils.cpp
index 988984d781..7004bfa6c1 100644
--- a/protocols/ICQ-WIM/src/utils.cpp
+++ b/protocols/ICQ-WIM/src/utils.cpp
@@ -320,16 +320,14 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
void CIcqProto::EmailNotification(const wchar_t *pwszText)
{
- if (g_bPopupService) {
- POPUPDATAW Popup = {};
- Popup.lchIcon = IcoLib_GetIconByHandle(iconList[0].hIcolib);
- wcsncpy_s(Popup.lpwzText, pwszText, _TRUNCATE);
- wcsncpy_s(Popup.lpwzContactName, m_tszUserName, _TRUNCATE);
- Popup.iSeconds = 20;
- Popup.PluginData = this;
- Popup.PluginWindowProc = PopupDlgProc;
- PUAddPopupW(&Popup);
- }
+ POPUPDATAW Popup = {};
+ Popup.lchIcon = IcoLib_GetIconByHandle(iconList[0].hIcolib);
+ wcsncpy_s(Popup.lpwzText, pwszText, _TRUNCATE);
+ wcsncpy_s(Popup.lpwzContactName, m_tszUserName, _TRUNCATE);
+ Popup.iSeconds = 20;
+ Popup.PluginData = this;
+ Popup.PluginWindowProc = PopupDlgProc;
+ PUAddPopupW(&Popup);
if (m_bUseTrayIcon) {
char szServiceFunction[MAX_PATH];