mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Initial commit
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace KfChatDotNetWsClient.Models.Json;
|
||||
|
||||
public class DeleteMessagesJsonModel
|
||||
{
|
||||
[JsonProperty("delete")]
|
||||
public List<int> MessageIdsToDelete { get; set; }
|
||||
}
|
||||
12
KfChatDotNetWsClient/Models/Json/EditMessageJsonModel.cs
Normal file
12
KfChatDotNetWsClient/Models/Json/EditMessageJsonModel.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace KfChatDotNetWsClient.Models.Json;
|
||||
|
||||
public class EditMessageJsonModel
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
59
KfChatDotNetWsClient/Models/Json/MessagesJsonModel.cs
Normal file
59
KfChatDotNetWsClient/Models/Json/MessagesJsonModel.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace KfChatDotNetWsClient.Models.Json;
|
||||
|
||||
// {
|
||||
// "messages": [
|
||||
// {
|
||||
// "author": {
|
||||
// "id": 110635,
|
||||
// "username": "felted",
|
||||
// "avatar_url": "https://kiwifarms.net/data/avatars/m/110/110635.jpg?1657300618"
|
||||
// },
|
||||
// "message": "Nigger.",
|
||||
// "message_id": 4390866,
|
||||
// "message_edit_date": 0,
|
||||
// "message_date": 1657317093,
|
||||
// "message_raw": "Nigger.",
|
||||
// "room_id": 10
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
|
||||
// message_raw contains the original bbcode for the message
|
||||
// message is the HTML-version the web client renders with emotes transformed into images, etc.
|
||||
|
||||
public class MessagesJsonModel
|
||||
{
|
||||
public class AuthorModel
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public int Id { get; set; }
|
||||
[JsonProperty("username")]
|
||||
public string Username { get; set; }
|
||||
[JsonProperty("avatar_url")]
|
||||
public Uri AvatarUrl { get; set; }
|
||||
}
|
||||
|
||||
public class MessageModel
|
||||
{
|
||||
[JsonProperty("author")]
|
||||
public AuthorModel Author { get; set; }
|
||||
[JsonProperty("message")]
|
||||
public string Message { get; set; }
|
||||
[JsonProperty("message_id")]
|
||||
public int MessageId { get; set; }
|
||||
[JsonProperty("message_edit_date")]
|
||||
public int MessageEditDate { get; set; }
|
||||
[JsonProperty("message_date")]
|
||||
public int MessageDate { get; set; }
|
||||
[JsonProperty("message_raw")]
|
||||
public string MessageRaw { get; set; }
|
||||
[JsonProperty("room_id")]
|
||||
public int RoomId { get; set; }
|
||||
}
|
||||
|
||||
[JsonProperty("messages")]
|
||||
public List<MessageModel> Messages { get; set; }
|
||||
}
|
||||
32
KfChatDotNetWsClient/Models/Json/UsersJsonModel.cs
Normal file
32
KfChatDotNetWsClient/Models/Json/UsersJsonModel.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace KfChatDotNetWsClient.Models.Json;
|
||||
|
||||
// {
|
||||
// "users": {
|
||||
// "1337": {
|
||||
// "id": 1337,
|
||||
// "username": "Example User",
|
||||
// "avatar_url": "https://kiwifarms.net/data/avatars/m/13/1337.jpg?1648885311",
|
||||
// "last_activity": 1657316000
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
public class UsersJsonModel
|
||||
{
|
||||
public class UserModel
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public int Id { get; set; }
|
||||
[JsonProperty("username")]
|
||||
public string Username { get; set; }
|
||||
[JsonProperty("avatar_url")]
|
||||
public Uri AvatarUrl { get; set; }
|
||||
[JsonProperty("last_activity")]
|
||||
public int LastActivity { get; set; }
|
||||
}
|
||||
|
||||
[JsonProperty("users")]
|
||||
public Dictionary<string, UserModel> Users { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user