summaryrefslogtreecommitdiff
path: root/plugins/Toaster
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Toaster')
-rw-r--r--plugins/Toaster/src/services.cpp7
-rw-r--r--plugins/Toaster/src/toast_event_handler.cpp5
-rw-r--r--plugins/Toaster/src/toast_event_handler.h1
-rw-r--r--plugins/Toaster/src/toast_notification.h2
4 files changed, 15 insertions, 0 deletions
diff --git a/plugins/Toaster/src/services.cpp b/plugins/Toaster/src/services.cpp
index 973625c35f..d930426906 100644
--- a/plugins/Toaster/src/services.cpp
+++ b/plugins/Toaster/src/services.cpp
@@ -259,6 +259,11 @@ static INT_PTR ShowMessage(WPARAM wParam, LPARAM lParam)
return ShowMessageW(tszText, lParam);
}
+static INT_PTR HideToast(WPARAM, LPARAM lParam)
+{
+ static_cast<ToastNotification*>(reinterpret_cast<ToastEventHandler*>(lParam)->GetToastNotification())->Hide();
+ return 0;
+}
void __stdcall HideAllToasts(void*)
{
mir_cslock lck(csNotifications);
@@ -283,4 +288,6 @@ void InitServices()
CreateServiceFunction(MS_POPUP_GETPLUGINDATA, GetPopupData);
CreateServiceFunction(MS_POPUP_GETCONTACT, GetPopupContact);
+
+ CreateServiceFunction(MS_POPUP_DESTROYPOPUP, HideToast);
} \ No newline at end of file
diff --git a/plugins/Toaster/src/toast_event_handler.cpp b/plugins/Toaster/src/toast_event_handler.cpp
index a31a0d342b..6248cf9eaa 100644
--- a/plugins/Toaster/src/toast_event_handler.cpp
+++ b/plugins/Toaster/src/toast_event_handler.cpp
@@ -99,4 +99,9 @@ void* ToastEventHandler::GetPluginData()
MCONTACT ToastEventHandler::GetContact()
{
return _thd->hContact;
+}
+
+void* ToastEventHandler::GetToastNotification()
+{
+ return _thd->tstNotification;
} \ No newline at end of file
diff --git a/plugins/Toaster/src/toast_event_handler.h b/plugins/Toaster/src/toast_event_handler.h
index a0efcbac2e..2626436540 100644
--- a/plugins/Toaster/src/toast_event_handler.h
+++ b/plugins/Toaster/src/toast_event_handler.h
@@ -24,6 +24,7 @@ public:
void* GetPluginData();
MCONTACT GetContact();
+ void* GetToastNotification();
private:
ULONG _ref;
diff --git a/plugins/Toaster/src/toast_notification.h b/plugins/Toaster/src/toast_notification.h
index 30bb591f3d..4399248848 100644
--- a/plugins/Toaster/src/toast_notification.h
+++ b/plugins/Toaster/src/toast_notification.h
@@ -1,6 +1,8 @@
#ifndef _TOAST_NOTIFICATION_H_
#define _TOAST_NOTIFICATION_H_
+struct ToastHandlerData;
+
class ToastNotification
{
private: