Skip to content

Commit 33f8d67

Browse files
committed
add in stuff missed
Async and one synchronous function was missed. Adding those.
1 parent 1b9b171 commit 33f8d67

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

RedditSharp/Things/More.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,12 @@ public IEnumerable<Thing> Things()
5757
}
5858

5959
}
60+
61+
internal async Task<Thing> InitAsync(Reddit reddit, JToken json, IWebAgent webAgent)
62+
{
63+
CommonInit(reddit, json, webAgent);
64+
await JsonConvert.PopulateObjectAsync(json["data"].ToString(), this, reddit.JsonSerializerSettings);
65+
return this;
66+
}
6067
}
6168
}

RedditSharp/Things/Thing.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ public static async Task<Thing> ParseAsync(Reddit reddit, JToken json, IWebAgent
6969
return await new Subreddit().InitAsync(reddit, json, webAgent);
7070
case "modaction":
7171
return await new ModAction().InitAsync(reddit, json, webAgent);
72+
case "more":
73+
return await new More().InitAsync(reddit, json, webAgent);
7274
default:
7375
return null;
7476
}
@@ -132,6 +134,10 @@ public static async Task<Thing> ParseAsync<T>(Reddit reddit, JToken json, IWebAg
132134
{
133135
return await new BannedUser().InitAsync(reddit, json, webAgent);
134136
}
137+
else if(typeof(T) == typeof(More))
138+
{
139+
return await new More().InitAsync(reddit, json, webAgent);
140+
}
135141
}
136142
return result;
137143
}
@@ -156,6 +162,10 @@ public static Thing Parse<T>(Reddit reddit, JToken json, IWebAgent webAgent) whe
156162
{
157163
return new BannedUser().Init(reddit, json, webAgent);
158164
}
165+
else if(typeof(T) == typeof(More))
166+
{
167+
return new More().Init(reddit, json, webAgent);
168+
}
159169
}
160170
return result;
161171
}

0 commit comments

Comments
 (0)