mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
Signaling reference pass, bugfixing reference to deserialized blob
This commit is contained in:
@@ -36,9 +36,8 @@ namespace BTCPayServer.Models.NotificationViewModels
|
|||||||
|
|
||||||
var fullTypeName = baseType.FullName.Replace(nameof(BaseNotification), data.NotificationType, StringComparison.OrdinalIgnoreCase);
|
var fullTypeName = baseType.FullName.Replace(nameof(BaseNotification), data.NotificationType, StringComparison.OrdinalIgnoreCase);
|
||||||
var parsedType = baseType.Assembly.GetType(fullTypeName);
|
var parsedType = baseType.Assembly.GetType(fullTypeName);
|
||||||
var instance = Activator.CreateInstance(parsedType) as BaseNotification;
|
|
||||||
|
|
||||||
var casted = JsonConvert.DeserializeObject(ZipUtils.Unzip(data.Blob), parsedType);
|
var casted = (BaseNotification)JsonConvert.DeserializeObject(ZipUtils.Unzip(data.Blob), parsedType);
|
||||||
var obj = new NotificationViewModel
|
var obj = new NotificationViewModel
|
||||||
{
|
{
|
||||||
Id = data.Id,
|
Id = data.Id,
|
||||||
@@ -46,7 +45,7 @@ namespace BTCPayServer.Models.NotificationViewModels
|
|||||||
Seen = data.Seen
|
Seen = data.Seen
|
||||||
};
|
};
|
||||||
|
|
||||||
instance.FillViewModel(obj);
|
casted.FillViewModel(ref obj);
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,6 @@ namespace BTCPayServer.Services.Notifications.Blobs
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void FillViewModel(NotificationViewModel data);
|
public abstract void FillViewModel(ref NotificationViewModel data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace BTCPayServer.Services.Notifications.Blobs
|
|||||||
|
|
||||||
public string Version { get; set; }
|
public string Version { get; set; }
|
||||||
|
|
||||||
public override void FillViewModel(NotificationViewModel vm)
|
public override void FillViewModel(ref NotificationViewModel vm)
|
||||||
{
|
{
|
||||||
vm.Body = $"New version {Version} released!";
|
vm.Body = $"New version {Version} released!";
|
||||||
vm.ActionLink = $"https://github.com/btcpayserver/btcpayserver/releases/tag/v{Version}";
|
vm.ActionLink = $"https://github.com/btcpayserver/btcpayserver/releases/tag/v{Version}";
|
||||||
|
|||||||
Reference in New Issue
Block a user