Skip to content

Commit def723f

Browse files
committed
refactored more objects
1 parent 77a5540 commit def723f

22 files changed

Lines changed: 180 additions & 330 deletions

Amino.NET/Client.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ public Task kick_from_chat(string userId, string chatId, bool allowRejoin = true
970970
if ((int)response.StatusCode != 200) { throw new Exception(response.Content); }
971971
if (debug) { Trace.WriteLine(response.Content); }
972972
dynamic jsonObj = (JObject)JsonConvert.DeserializeObject(response.Content);
973-
JArray chatMessageList = jsonObj["messageList"];
973+
JArray chatMessageList = jsonObj["messageList"]; // no need
974974
foreach (JObject chatMessage in chatMessageList)
975975
{
976976
Objects.MessageCollection message = new Objects.MessageCollection(chatMessage, JObject.Parse(response.Content));

Amino.NET/Objects/AdvancedCommunityInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class AdvancedCommunityInfo
1414
// Base JSON key: community
1515

1616
public bool IsCurrentUserJoined { get; set; } // MUST BE SET AFTER
17-
public string json { get; set; } // MUST BE SET AFTER
17+
public string Json { get; set; } // MUST BE SET AFTER
1818
[JsonPropertyName("searchable")] public bool Searchable { get; set; }
1919
[JsonPropertyName("isStandaloneAppDepricated")] public bool IsStandaloneAppDeprecated { get; set; }
2020
[JsonPropertyName("listedStatus")] public int ListedStatus { get; set; }

Amino.NET/Objects/Blog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Amino.Objects
1111
{
1212
public class Blog
1313
{
14-
public string json { get; set; } // NEEDS TO BE ADDED AFTER
14+
public string Json { get; set; } // NEEDS TO BE ADDED AFTER
1515
[JsonPropertyName("globalVotesCount")]public int GlobalVotesCount { get; set; } = 0;
1616
[JsonPropertyName("globalVotedValue")]public int GlobalVotedValue { get; set; } = 0;
1717
[JsonPropertyName("votedValue")]public int VotedValue { get; set; } = 0;

Amino.NET/Objects/Chat.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Amino.Objects
77
{
88
public class Chat
99
{
10-
public string json { get; set; } // NEEDS TO BE ADDED LATER
10+
public string Json { get; set; } // NEEDS TO BE ADDED LATER
1111
[JsonPropertyName("uid")]public string UserId { get; set; }
1212
[JsonPropertyName("membersQuota")]public int MembersQuota { get; set; }
1313
[JsonPropertyName("threadId")]public string ThreadId { get; set; }

Amino.NET/Objects/ChatAnnouncement.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Amino.Objects
77
// ROOT JSON ELEMENT: o/chatMessage
88
public class ChatAnnouncement
99
{
10-
public string json { get; set; } // NEEDS TO BE SET AFTER
10+
public string Json { get; set; } // NEEDS TO BE SET AFTER
1111
public SocketBase SocketBase { get; set; } // NEEDS TO BE SET AFTER
1212
[JsonPropertyName("threadId")]public string ChatId { get; set; }
1313
[JsonPropertyName("mediaType")]public int MediaType { get; set; }

Amino.NET/Objects/ChatEvent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Amino.Objects
88
// ROOT JSON ELEMENT: o/chatMessage
99
public class ChatEvent
1010
{
11-
public string json { get; set; } // NEEDS TO BE SET AFTER
11+
public string Json { get; set; } // NEEDS TO BE SET AFTER
1212
public SocketBase SocketBase { get; set; } // NEEDS TO BE SET AFTER
1313

1414
[JsonPropertyName("threadId")]public string ChatId { get; set; }

Amino.NET/Objects/ChatTip.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Amino.Objects
77
// ROOT JSON ELEMENT: o/chatMessage
88
public class ChatTip
99
{
10-
public string json { get; set; } // NEEDS TO BE SET AFTER
10+
public string Json { get; set; } // NEEDS TO BE SET AFTER
1111
public SocketBase SocketBase { get; set; } // NEEDS TO BE SET AFTER
1212

1313
[JsonPropertyName("threadId")]public string ChatId { get; set; }

Amino.NET/Objects/ChatTipToggle.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Amino.Objects
88
// ROOT JSON ELEMENT: o/chatMessage
99
public class ChatTipToggle
1010
{
11-
public string json { get; set; } // NEEDS TO BE ADDED AFTER
11+
public string Json { get; set; } // NEEDS TO BE ADDED AFTER
1212
public SocketBase SocketBase { get; set; } // NEEDS TO BE ADDED AFTER
1313

1414
[JsonPropertyName("threadId")]public string ChatId { get; set; }

Amino.NET/Objects/FromCode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Amino.Objects
88
// ROOT JSON ELEMENT: linkInfoV2
99
public class FromCode
1010
{
11-
public string json { get; set; } // NEEDS TO BE SET AFTER
11+
public string Json { get; set; } // NEEDS TO BE SET AFTER
1212
[JsonPropertyName("path")]public string Path { get; set; }
1313
[JsonPropertyName("extensions")]public LinkInfoExtensions Extensions { get; set; }
1414

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Text.Json.Serialization;
6+
using System.Threading.Tasks;
7+
8+
namespace Amino.Objects
9+
{
10+
11+
public class GenericMessage
12+
{
13+
[JsonPropertyName("includedInSummary")] public bool IncludedInSummary { get; set; }
14+
[JsonPropertyName("uid")] public string AuthorId { get; set; }
15+
[JsonPropertyName("isHidden")] public bool IsHidden { get; set; }
16+
[JsonPropertyName("messageId")] public string MessageId { get; set; }
17+
[JsonPropertyName("mediaType")] public int MediaType { get; set; }
18+
[JsonPropertyName("content")] public string Content { get; set; }
19+
[JsonPropertyName("chatBubbleId")] public string ChatBubbleId { get; set; }
20+
[JsonPropertyName("clientRefId")] public int ClientRefId { get; set; }
21+
[JsonPropertyName("threadId")] public string ChatId { get; set; }
22+
[JsonPropertyName("createdTime")] public string CreatedTime { get; set; }
23+
[JsonPropertyName("type")] public int Type { get; set; }
24+
[JsonPropertyName("mediaUrl")] public string MediaUrl { get; set; }
25+
[JsonPropertyName("author")] public GenericProfile Author { get; set; }
26+
}
27+
}

0 commit comments

Comments
 (0)