btcpayserver/BTCPayServer/Services/Notifications/Blobs/NewVersionNotification.cs
d11n 5c61de3ae9
Different icons for notifications (#4632)
* Different icons for notifications

Closes #2510.

* Fix version appendix for SVG use attributes

* Fix SVGUse TagHelper

* Update icons
2023-02-21 11:06:27 +09:00

40 lines
1.4 KiB
C#

using BTCPayServer.Abstractions.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.Identifier = notification.Identifier;
vm.Type = notification.NotificationType;
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;
}
}