summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM
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/FacebookRM
parent8a1ff32e54b39ceef22df61bda17bbfda94918fc (diff)
Popup:
- wiping out checks for service presence; - code cleaning
Diffstat (limited to 'protocols/FacebookRM')
-rw-r--r--protocols/FacebookRM/src/events.cpp31
-rw-r--r--protocols/FacebookRM/src/process.cpp18
2 files changed, 21 insertions, 28 deletions
diff --git a/protocols/FacebookRM/src/events.cpp b/protocols/FacebookRM/src/events.cpp
index 7f2cfaae14..fdcc2029af 100644
--- a/protocols/FacebookRM/src/events.cpp
+++ b/protocols/FacebookRM/src/events.cpp
@@ -68,24 +68,21 @@ HWND FacebookProto::NotifyEvent(const wchar_t* title, const wchar_t* text, MCONT
}
if (!getByte(FACEBOOK_KEY_SYSTRAY_NOTIFY, DEFAULT_SYSTRAY_NOTIFY)) {
- if (ServiceExists(MS_POPUP_ADDPOPUPCLASS)) {
- POPUPDATACLASS pd = { sizeof(pd) };
- pd.pwszTitle = title;
- pd.pwszText = text;
- pd.pszClassName = name;
- pd.hContact = contact;
-
- if (url != nullptr || notification_id != nullptr) {
- popup_data *data = new popup_data(this);
- if (url != nullptr)
- data->url = *url;
- if (notification_id != nullptr)
- data->notification_id = *notification_id;
- pd.PluginData = data;
- }
-
- return (HWND)CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&pd);
+ POPUPDATACLASS pd = { sizeof(pd) };
+ pd.pwszTitle = title;
+ pd.pwszText = text;
+ pd.pszClassName = name;
+ pd.hContact = contact;
+
+ if (url != nullptr || notification_id != nullptr) {
+ popup_data *data = new popup_data(this);
+ if (url != nullptr)
+ data->url = *url;
+ if (notification_id != nullptr)
+ data->notification_id = *notification_id;
+ pd.PluginData = data;
}
+ return (HWND)CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&pd);
}
else {
if (!Clist_TrayNotifyW(m_szModuleName, title, text, type == EVENT_CLIENT ? NIIF_WARNING : NIIF_INFO, 10000))
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp
index 705e1ae521..21293f11b3 100644
--- a/protocols/FacebookRM/src/process.cpp
+++ b/protocols/FacebookRM/src/process.cpp
@@ -328,10 +328,7 @@ void FacebookProto::LoadHistory(void *pParam)
wcsncpy(pd.lpwzContactName, m_tszUserName, MAX_CONTACTNAME);
wcsncpy(pd.lpwzText, TranslateT("Loading history started."), MAX_SECONDLINE);
- HWND popupHwnd = nullptr;
- if (ServiceExists(MS_POPUP_ADDPOPUPW)) {
- popupHwnd = (HWND)CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&pd, (LPARAM)APF_RETURN_HWND);
- }
+ HWND popupHwnd = (HWND)PUAddPopupW(&pd, (LPARAM)APF_RETURN_HWND);
std::vector<facebook_message> messages;
std::string firstTimestamp;
@@ -409,13 +406,12 @@ void FacebookProto::LoadHistory(void *pParam)
CMStringW text;
text.AppendFormat(TranslateT("Loading messages: %d/%d"), loadedMessages, messagesCount);
- if (ServiceExists(MS_POPUP_CHANGETEXTW) && popupHwnd) {
+ if (popupHwnd)
PUChangeTextW(popupHwnd, text);
- }
- else if (ServiceExists(MS_POPUP_ADDPOPUPW)) {
+ else {
wcsncpy(pd.lpwzText, text, MAX_SECONDLINE);
pd.iSeconds = 1;
- popupHwnd = (HWND)CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&pd, (LPARAM)0);
+ popupHwnd = (HWND)PUAddPopupW(&pd);
}
// There is no more messages
@@ -431,12 +427,12 @@ void FacebookProto::LoadHistory(void *pParam)
// Reset loading history flag
facy.loading_history = false;
- if (ServiceExists(MS_POPUP_CHANGETEXTW) && popupHwnd)
+ if (popupHwnd)
PUChangeTextW(popupHwnd, TranslateT("Loading history completed."));
- else if (ServiceExists(MS_POPUP_ADDPOPUPW)) {
+ else {
pd.iSeconds = 5;
wcsncpy(pd.lpwzText, TranslateT("Loading history completed."), MAX_SECONDLINE);
- popupHwnd = (HWND)CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&pd, (LPARAM)0);
+ popupHwnd = (HWND)PUAddPopupW(&pd);
}
}