mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-25 07:07:31 +01:00
26 lines
861 B
C#
26 lines
861 B
C#
using BTCPayServer.Data;
|
|
using BTCPayServer.Models.NotificationViewModels;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace BTCPayServer.Events.Notifications
|
|
{
|
|
internal class NewVersionNotification : NotificationEventBase
|
|
{
|
|
public string Version { get; set; }
|
|
|
|
public override NotificationViewModel ToViewModel(NotificationData data)
|
|
{
|
|
var casted = JsonConvert.DeserializeObject<NewVersionNotification>(ZipUtils.Unzip(data.Blob));
|
|
var obj = new NotificationViewModel
|
|
{
|
|
Id = data.Id,
|
|
Created = data.Created,
|
|
Body = $"New version {casted.Version} released!",
|
|
ActionLink = "https://github.com/btcpayserver/btcpayserver/releases/tag/v" + casted.Version,
|
|
Seen = data.Seen
|
|
};
|
|
|
|
return obj;
|
|
}
|
|
}
|
|
}
|