Skip to content

Commit f7fd830

Browse files
committed
Adding unhide comment action.
1 parent 17c95f3 commit f7fd830

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

RedditSharp/Things/Comment.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class Comment : VotableThing
1717
private const string CommentUrl = "/api/comment";
1818
private const string EditUserTextUrl = "/api/editusertext";
1919
private const string SetAsReadUrl = "/api/read_message";
20+
private const string SetAsUnReadUrl = "/api/unread_message";
2021

2122
#pragma warning disable 1591
2223
public Comment(IWebAgent agent, JToken json, Thing sender) : base(agent, json) {
@@ -227,7 +228,20 @@ protected override async Task<JToken> SimpleActionAsync(string endpoint)
227228
/// </summary>
228229
public async Task SetAsReadAsync()
229230
{
230-
await WebAgent.Post(SetAsReadUrl, new
231+
await SetReadStatusAsync(SetAsReadUrl);
232+
}
233+
234+
/// <summary>
235+
/// Mark this comment as unread.
236+
/// </summary>
237+
public async Task SetAsUnReadAsync()
238+
{
239+
await SetReadStatusAsync(SetAsUnReadUrl);
240+
}
241+
242+
private async Task SetReadStatusAsync(string statusUrl)
243+
{
244+
await WebAgent.Post(statusUrl, new
231245
{
232246
id = FullName,
233247
api_type = "json"

0 commit comments

Comments
 (0)