Skip to content

Commit 3dea876

Browse files
Brian MitchellBrian Mitchell
authored andcommitted
Added allow_images to SubredditSettings
1 parent b8a488f commit 3dea876

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

RedditSharp/Subreddit Information/SubredditSettings.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public SubredditSettings(Reddit reddit, Subreddit subreddit, IWebAgent webAgent)
2424
WebAgent = webAgent;
2525
// Default settings, for use when reduced information is given
2626
AllowAsDefault = true;
27+
AllowImages = false;
2728
Domain = null;
2829
Sidebar = string.Empty;
2930
Language = "en";
@@ -46,6 +47,7 @@ public SubredditSettings(Subreddit subreddit, Reddit reddit, JObject json, IWebA
4647
{
4748
var data = json["data"];
4849
AllowAsDefault = data["default_set"].ValueOrDefault<bool>();
50+
AllowImages = data["allow_images"].ValueOrDefault<bool>();
4951
Domain = data["domain"].ValueOrDefault<string>();
5052
Sidebar = HttpUtility.HtmlDecode(data["description"].ValueOrDefault<string>() ?? string.Empty);
5153
Language = data["language"].ValueOrDefault<string>();
@@ -131,6 +133,7 @@ public SubredditSettings(Subreddit subreddit, Reddit reddit, JObject json, IWebA
131133
public int WikiEditAge { get; set; }
132134
public ContentOptions ContentOptions { get; set; }
133135
public SpamFilterSettings SpamFilter { get; set; }
136+
public bool AllowImages { get; set; }
134137

135138
public void UpdateSettings()
136139
{
@@ -178,6 +181,7 @@ public void UpdateSettings()
178181
WebAgent.WritePostBody(stream, new
179182
{
180183
allow_top = AllowAsDefault,
184+
allow_images = AllowImages,
181185
description = Sidebar,
182186
domain = Domain,
183187
lang = Language,

0 commit comments

Comments
 (0)