2020-11-17 13:46:23 +01:00
|
|
|
using BTCPayServer.Abstractions.Contracts;
|
2020-06-11 01:00:41 -05:00
|
|
|
using BTCPayServer.Models.NotificationViewModels;
|
2020-05-27 18:41:00 -05:00
|
|
|
|
2020-06-14 23:47:11 -05:00
|
|
|
namespace BTCPayServer.Services.Notifications.Blobs
|
2020-05-27 18:41:00 -05:00
|
|
|
{
|
2020-10-20 13:09:09 +02:00
|
|
|
internal class NewVersionNotification:BaseNotification
|
2020-05-27 18:41:00 -05:00
|
|
|
{
|
2020-10-20 13:09:09 +02:00
|
|
|
private const string TYPE = "newversion";
|
2020-06-16 23:29:25 +09:00
|
|
|
internal class Handler : NotificationHandler<NewVersionNotification>
|
|
|
|
{
|
2020-10-20 13:09:09 +02:00
|
|
|
public override string NotificationType => TYPE;
|
|
|
|
public override (string identifier, string name)[] Meta
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return new (string identifier, string name)[] {(TYPE, "New version")};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-16 23:29:25 +09:00
|
|
|
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}";
|
|
|
|
}
|
|
|
|
}
|
2020-06-15 16:45:29 +09:00
|
|
|
public NewVersionNotification()
|
|
|
|
{
|
2020-06-13 18:40:30 -05:00
|
|
|
|
2020-06-15 16:45:29 +09:00
|
|
|
}
|
|
|
|
public NewVersionNotification(string version)
|
|
|
|
{
|
|
|
|
Version = version;
|
|
|
|
}
|
2020-05-27 18:41:00 -05:00
|
|
|
public string Version { get; set; }
|
2020-10-20 13:09:09 +02:00
|
|
|
public override string Identifier => TYPE;
|
|
|
|
public override string NotificationType => TYPE;
|
2020-05-27 18:41:00 -05:00
|
|
|
}
|
|
|
|
}
|