mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 14:04:26 +01:00
* Allow disabling notifications per user and disabling specific notifications per use closes #1974 * Add disable notifs for all users * fix term generator for notifications * sow checkboxes instead of multiselect when js is enabled * remove js dependency * fix notif conditions
39 lines
1.3 KiB
C#
39 lines
1.3 KiB
C#
using BTCPayServer.Contracts;
|
|
using BTCPayServer.Models.NotificationViewModels;
|
|
|
|
namespace BTCPayServer.Services.Notifications.Blobs
|
|
{
|
|
internal class NewVersionNotification:BaseNotification
|
|
{
|
|
private const string TYPE = "newversion";
|
|
internal class Handler : NotificationHandler<NewVersionNotification>
|
|
{
|
|
public override string NotificationType => TYPE;
|
|
public override (string identifier, string name)[] Meta
|
|
{
|
|
get
|
|
{
|
|
return new (string identifier, string name)[] {(TYPE, "New version")};
|
|
}
|
|
}
|
|
|
|
protected override void FillViewModel(NewVersionNotification notification, NotificationViewModel vm)
|
|
{
|
|
vm.Body = $"New version {notification.Version} released!";
|
|
vm.ActionLink = $"https://github.com/btcpayserver/btcpayserver/releases/tag/v{notification.Version}";
|
|
}
|
|
}
|
|
public NewVersionNotification()
|
|
{
|
|
|
|
}
|
|
public NewVersionNotification(string version)
|
|
{
|
|
Version = version;
|
|
}
|
|
public string Version { get; set; }
|
|
public override string Identifier => TYPE;
|
|
public override string NotificationType => TYPE;
|
|
}
|
|
}
|