mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Big update. Replaced Newtonsoft with System.Text.Json where possible, removed Spectre, tried to suppress the pile of compiler warnings I get on the GUI project, and tried to correct an issue where sometimes the session token retrieved is not usable.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using KickWsClient.Converters;
|
||||
|
||||
namespace KickWsClient.Models;
|
||||
|
||||
@@ -9,17 +10,18 @@ public class PusherModels
|
||||
/// <summary>
|
||||
/// Name of the event
|
||||
/// </summary>
|
||||
[JsonProperty("event")]
|
||||
[JsonPropertyName("event")]
|
||||
public required string Event { get; set; }
|
||||
/// <summary>
|
||||
/// Stringified JSON payload
|
||||
/// </summary>
|
||||
[JsonProperty("data")]
|
||||
[JsonPropertyName("data")]
|
||||
[JsonConverter(typeof(StringOrObjectConverter<string>))]
|
||||
public required string Data { get; set; }
|
||||
/// <summary>
|
||||
/// Channel where event originates. Only included events where a channel is applicable
|
||||
/// </summary>
|
||||
[JsonProperty("channel")]
|
||||
[JsonPropertyName("channel")]
|
||||
public string? Channel { get; set; }
|
||||
}
|
||||
|
||||
@@ -28,12 +30,12 @@ public class PusherModels
|
||||
/// <summary>
|
||||
/// Name of the event
|
||||
/// </summary>
|
||||
[JsonProperty("event")]
|
||||
[JsonPropertyName("event")]
|
||||
public required string Event { get; set; }
|
||||
/// <summary>
|
||||
/// Data as object. It's only stringified for responses
|
||||
/// </summary>
|
||||
[JsonProperty("data")]
|
||||
[JsonPropertyName("data")]
|
||||
public required object Data { get; set; }
|
||||
}
|
||||
|
||||
@@ -42,12 +44,12 @@ public class PusherModels
|
||||
/// <summary>
|
||||
/// Internal socket ID
|
||||
/// </summary>
|
||||
[JsonProperty("socket_id")]
|
||||
[JsonPropertyName("socket_id")]
|
||||
public required string SocketId { get; set; }
|
||||
/// <summary>
|
||||
/// Timeout on no activity in seconds
|
||||
/// </summary>
|
||||
[JsonProperty("activity_timeout")]
|
||||
[JsonPropertyName("activity_timeout")]
|
||||
public int ActivityTimeout { get; set; }
|
||||
}
|
||||
|
||||
@@ -56,12 +58,12 @@ public class PusherModels
|
||||
/// <summary>
|
||||
/// Token to authenticate with, use an empty string for guest.
|
||||
/// </summary>
|
||||
[JsonProperty("auth")]
|
||||
[JsonPropertyName("auth")]
|
||||
public string Auth { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Channel you wish to subscribe to. 'channel.2515504' for stream events. 'chatrooms.2515504.v2' for chat where 2515504 is the channel ID
|
||||
/// </summary>
|
||||
[JsonProperty("channel")]
|
||||
[JsonPropertyName("channel")]
|
||||
public required string Channel { get; set; }
|
||||
}
|
||||
|
||||
@@ -70,7 +72,7 @@ public class PusherModels
|
||||
/// <summary>
|
||||
/// Channel you wish to unsubscribe from, e.g. 'channel.2515504'
|
||||
/// </summary>
|
||||
[JsonProperty("channel")]
|
||||
[JsonPropertyName("channel")]
|
||||
public required string Channel { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user