anotherim-desktop/plugins/windows-notification/src/windows_notifications_plugin.vala

36 lines
932 B
Vala
Raw Normal View History

2020-10-24 22:05:35 +00:00
using Dino.Entities;
2021-02-18 09:24:53 +00:00
using Dino.Plugins.WindowsNotification.Vapi;
using winrt.Windows.UI.Notifications;
using Xmpp;
2020-10-24 22:05:35 +00:00
namespace Dino.Plugins.WindowsNotification {
public class Plugin : RootInterface, Object {
2020-10-24 22:05:35 +00:00
private static string AUMID = "org.dino.Dino";
public void registered(Dino.Application app) {
2021-03-26 11:22:55 +00:00
if (!winrt.InitApartment())
{
// log error, return
}
2021-03-26 11:22:55 +00:00
2021-03-05 22:15:09 +00:00
if (!Win32Api.SetProcessAumid(AUMID))
{
// log error, return
}
2021-03-05 22:15:09 +00:00
if (!ShortcutCreator.EnsureAumiddedShortcutExists(AUMID))
{
// log error, return
}
2021-03-26 11:22:55 +00:00
app.stream_interactor.get_module(NotificationEvents.IDENTITY)
.register_notification_provider(new WindowsNotificationProvider(app, new ToastNotifier(AUMID)));
}
2020-10-24 22:05:35 +00:00
public void shutdown() {
}
2020-10-25 11:07:31 +00:00
}
2020-10-24 22:05:35 +00:00
}