Closes #7920 (cherry picked from commit e57e68c97a9d24f8344623ac8f731c2da220686b)pull/7974/head
parent
09642444d7
commit
72552b8084
@ -0,0 +1,40 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace NzbDrone.Core.Notifications.Gotify
|
||||
{
|
||||
public class GotifyMessage
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public string Message { get; set; }
|
||||
public int Priority { get; set; }
|
||||
public GotifyExtras Extras { get; set; }
|
||||
|
||||
public GotifyMessage()
|
||||
{
|
||||
Extras = new GotifyExtras();
|
||||
}
|
||||
|
||||
public void SetContentType(bool isMarkdown)
|
||||
{
|
||||
var contentType = isMarkdown ? "text/markdown" : "text/plain";
|
||||
|
||||
Extras.ClientDisplay = new GotifyClientDisplay(contentType);
|
||||
}
|
||||
}
|
||||
|
||||
public class GotifyExtras
|
||||
{
|
||||
[JsonProperty("client::display")]
|
||||
public GotifyClientDisplay ClientDisplay { get; set; }
|
||||
}
|
||||
|
||||
public class GotifyClientDisplay
|
||||
{
|
||||
public string ContentType { get; set; }
|
||||
|
||||
public GotifyClientDisplay(string contentType)
|
||||
{
|
||||
ContentType = contentType;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue