summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Popup/src/main.cpp2
-rw-r--r--plugins/Popup/src/services.cpp5
-rw-r--r--plugins/Popup/src/services.h1
-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
-rw-r--r--plugins/YAPP/src/popwin.cpp2
-rw-r--r--plugins/YAPP/src/services.cpp15
9 files changed, 35 insertions, 5 deletions
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp
index ffb00e74bd..93dd39d3f7 100644
--- a/plugins/Popup/src/main.cpp
+++ b/plugins/Popup/src/main.cpp
@@ -387,6 +387,8 @@ MIRAPI int Load(void)
CreateServiceFunction(MS_POPUP_UNREGISTERCLASS, Popup_UnregisterPopupClass);
CreateServiceFunction(MS_POPUP_ADDPOPUPCLASS, Popup_CreateClassPopup);
+ CreateServiceFunction(MS_POPUP_DESTROYPOPUP, Popup_DeletePopup);
+
// load icons / create hook
InitIcons();
HookEvent(ME_SKIN2_ICONSCHANGED, IconsChanged);
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp
index 7741604aaa..b2c3887c4c 100644
--- a/plugins/Popup/src/services.cpp
+++ b/plugins/Popup/src/services.cpp
@@ -470,3 +470,8 @@ INT_PTR Popup_CreateClassPopup(WPARAM wParam, LPARAM lParam)
return Popup_AddPopup2((WPARAM)&ppd2, pc->lParam);
}
+
+INT_PTR Popup_DeletePopup(WPARAM, LPARAM lParam)
+{
+ return (INT_PTR)SendMessage((HWND)lParam, UM_DESTROYPOPUP, 0, 0);
+} \ No newline at end of file
diff --git a/plugins/Popup/src/services.h b/plugins/Popup/src/services.h
index cea395b1bd..b47f04f397 100644
--- a/plugins/Popup/src/services.h
+++ b/plugins/Popup/src/services.h
@@ -51,5 +51,6 @@ INT_PTR Popup_RegisterVfx(WPARAM wParam, LPARAM lParam);
INT_PTR Popup_RegisterPopupClass(WPARAM wParam, LPARAM lParam);
INT_PTR Popup_UnregisterPopupClass(WPARAM wParam, LPARAM lParam);
INT_PTR Popup_CreateClassPopup(WPARAM wParam, LPARAM lParam);
+INT_PTR Popup_DeletePopup(WPARAM, LPARAM lParam);
#endif // __services_h__
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:
diff --git a/plugins/YAPP/src/popwin.cpp b/plugins/YAPP/src/popwin.cpp
index 01ba681cfe..44f2209b52 100644
--- a/plugins/YAPP/src/popwin.cpp
+++ b/plugins/YAPP/src/popwin.cpp
@@ -376,7 +376,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
// avatar & time if with avatar
if (options.av_layout != PAV_NONE && (pwd->have_av || options.time_layout == PT_WITHAV)) {
- RECT avr;
+ RECT avr = { 0 };
avr.top = options.av_padding;
if (options.av_layout == PAV_LEFT) {
diff --git a/plugins/YAPP/src/services.cpp b/plugins/YAPP/src/services.cpp
index bcee759527..88f6a65cfe 100644
--- a/plugins/YAPP/src/services.cpp
+++ b/plugins/YAPP/src/services.cpp
@@ -214,6 +214,7 @@ INT_PTR PopupQuery(WPARAM wParam, LPARAM)
{
bool enabled = db_get_b(0, "Popup", "ModuleIsEnabled", 1) != 0;
if (!enabled) db_set_b(0, "Popup", "ModuleIsEnabled", 1);
+ UpdateMenu();
return !enabled;
}
break;
@@ -221,18 +222,17 @@ INT_PTR PopupQuery(WPARAM wParam, LPARAM)
{
bool enabled = db_get_b(0, "Popup", "ModuleIsEnabled", 1) != 0;
if (enabled) db_set_b(0, "Popup", "ModuleIsEnabled", 0);
+ UpdateMenu();
return enabled;
}
break;
case PUQS_GETSTATUS:
return db_get_b(0, "Popup", "ModuleIsEnabled", 1);
-
default:
+ UpdateMenu();
return 1;
}
- UpdateMenu();
- return 0;
}
static INT_PTR TogglePopups(WPARAM, LPARAM)
@@ -410,6 +410,11 @@ static INT_PTR CreateClassPopup(WPARAM wParam, LPARAM lParam)
return 0;
}
+INT_PTR Popup_DeletePopup(WPARAM, LPARAM lParam)
+{
+ return (INT_PTR)SendMessage((HWND)lParam, UM_DESTROYPOPUP, 0, 0);
+}
+
//////////////////////////////////////////////////////////////////////////////
void InitServices()
@@ -429,10 +434,12 @@ void InitServices()
CreateServiceFunction(MS_POPUP_QUERY, PopupQuery);
CreateServiceFunction(MS_POPUP_SHOWMESSAGE, ShowMessage);
- CreateServiceFunction(MS_POPUP_SHOWMESSAGE"W", ShowMessageW);
+ CreateServiceFunction(MS_POPUP_SHOWMESSAGEW, ShowMessageW);
CreateServiceFunction(MS_POPUP_SHOWHISTORY, Popup_ShowHistory);
CreateServiceFunction("Popup/EnableDisableMenuCommand", TogglePopups);
+
+ CreateServiceFunction(MS_POPUP_DESTROYPOPUP, Popup_DeletePopup);
}
void DeinitServices()