Skip to content

Commit e1b1ec3

Browse files
committed
Add noted user for rel items that contain a note of some sort.
1 parent 2fa8aab commit e1b1ec3

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

RedditSharp/Things/BannedUser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace RedditSharp.Things
88
/// <summary>
99
/// A user that is banned in a subreddit.
1010
/// </summary>
11-
public class BannedUser : RelUser
11+
public class BannedUser : NotedUser
1212
{
1313
/// <inheritdoc />
1414
public BannedUser(IWebAgent agent, JToken json) : base(agent, json) {
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using Newtonsoft.Json;
3+
using Newtonsoft.Json.Linq;
4+
5+
namespace RedditSharp.Things.User
6+
{
7+
public class NotedUser : RelUser
8+
{
9+
public NotedUser(IWebAgent agent, JToken json) : base(agent, json)
10+
{
11+
}
12+
13+
[JsonProperty("note")]
14+
public String Note { get; internal set; }
15+
}
16+
}

RedditSharp/Things/User/RelUser.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,27 @@
44

55
namespace RedditSharp.Things.User
66
{
7+
/// <summary>
8+
/// Represents a user that was added to a user list or listing at a
9+
/// time.
10+
/// </summary>
711
public class RelUser : PartialUser
812
{
913
public RelUser(IWebAgent agent, JToken json) : base(agent, json)
1014
{
1115
}
1216

17+
/// <summary>
18+
/// The base-36 fullname of the rel item
19+
/// </summary>
20+
[JsonProperty("rel_id")]
21+
public String RelFullName { get; internal set; }
22+
1323
/// <summary>
1424
/// UTC time of when this user was added to the list
1525
/// </summary>
1626
[JsonProperty("date")]
1727
[JsonConverter(typeof(UnixTimestampConverter))]
18-
public DateTime? DateUTC { get; set; }
28+
public DateTime? DateUTC { get; internal set; }
1929
}
2030
}

0 commit comments

Comments
 (0)