@@ -135,7 +135,7 @@ public enum DistinguishType
135
135
[ JsonProperty ( "user_reports" ) ]
136
136
[ JsonConverter ( typeof ( ReportCollectionConverter ) ) ]
137
137
public ICollection < Report > UserReports { get ; private set ; }
138
-
138
+
139
139
/// <summary>
140
140
/// Reports someone
141
141
/// </summary>
@@ -174,7 +174,8 @@ public async Task ReportAsync(ReportType reportType, string otherReason = null)
174
174
/// Distinguishes (or undistinguishes) an item
175
175
/// </summary>
176
176
/// <param name="distinguishType">Type you want to distinguish <see cref="DistinguishType"/></param>
177
- public async Task DistinguishAsync ( DistinguishType distinguishType )
177
+ /// <param name="sticky">Stickies the Thing if applicable</param>
178
+ public async Task DistinguishAsync ( DistinguishType distinguishType , bool sticky = false )
178
179
{
179
180
180
181
string how ;
@@ -196,7 +197,8 @@ public async Task DistinguishAsync(DistinguishType distinguishType)
196
197
var json = await WebAgent . Post ( DistinguishUrl , new
197
198
{
198
199
how ,
199
- id = Id
200
+ id = FullName , //oAuth requires the full ID
201
+ sticky = sticky
200
202
} ) . ConfigureAwait ( false ) ;
201
203
if ( json [ "jquery" ] . Count ( i => i [ 0 ] . Value < int > ( ) == 11 && i [ 1 ] . Value < int > ( ) == 12 ) == 0 )
202
204
throw new Exception ( "You are not permitted to distinguish this comment." ) ;
@@ -229,7 +231,7 @@ public Task RemoveSpamAsync()
229
231
return RemoveImplAsync ( true ) ;
230
232
}
231
233
232
- #pragma warning disable 1591
234
+ #pragma warning disable 1591
233
235
protected async Task RemoveImplAsync ( bool spam )
234
236
{
235
237
await WebAgent . Post ( RemoveUrl , new
@@ -238,7 +240,7 @@ protected async Task RemoveImplAsync(bool spam)
238
240
spam = spam
239
241
} ) . ConfigureAwait ( false ) ;
240
242
}
241
- #pragma warning restore 1591
243
+ #pragma warning restore 1591
242
244
243
245
/// <summary>
244
246
/// Delete this item.
@@ -276,8 +278,10 @@ public Task UnIgnoreReportsAsync()
276
278
/// <param name="agent"><see cref="IWebAgent"/> used to send post</param>
277
279
/// <param name="fullname">FullName of thing to act on. eg. t1_66666</param>
278
280
/// <returns></returns>
279
- public static Task RemoveAsync ( IWebAgent agent , string fullname ) {
280
- return agent . Post ( RemoveUrl , new {
281
+ public static Task RemoveAsync ( IWebAgent agent , string fullname )
282
+ {
283
+ return agent . Post ( RemoveUrl , new
284
+ {
281
285
id = fullname ,
282
286
spam = false
283
287
} ) ;
@@ -289,8 +293,10 @@ public static Task RemoveAsync( IWebAgent agent, string fullname ) {
289
293
/// <param name="agent"><see cref="IWebAgent"/> used to send post</param>
290
294
/// <param name="fullname">FullName of thing to act on. eg. t1_66666</param>
291
295
/// <returns></returns>
292
- public static Task SpamAsync ( IWebAgent agent , string fullname ) {
293
- return agent . Post ( RemoveUrl , new {
296
+ public static Task SpamAsync ( IWebAgent agent , string fullname )
297
+ {
298
+ return agent . Post ( RemoveUrl , new
299
+ {
294
300
id = fullname ,
295
301
spam = true
296
302
} ) ;
@@ -301,7 +307,8 @@ public static Task SpamAsync( IWebAgent agent, string fullname ) {
301
307
/// <param name="agent"><see cref="IWebAgent"/> used to send post</param>
302
308
/// <param name="fullname">FullName of thing to act on. eg. t1_66666</param>
303
309
/// <returns></returns>
304
- public static Task ApproveAsync ( IWebAgent agent , string fullname ) {
310
+ public static Task ApproveAsync ( IWebAgent agent , string fullname )
311
+ {
305
312
return Thing . SimpleActionAsync ( agent , fullname , ApproveUrl ) ;
306
313
}
307
314
@@ -312,10 +319,12 @@ public static Task ApproveAsync( IWebAgent agent, string fullname ) {
312
319
/// <param name="otherReason">If your reason is "Other", say why you're reporting them</param>
313
320
/// <param name="agent"><see cref="IWebAgent"/> used to send post</param>
314
321
/// <param name="fullname">FullName of thing to act on. eg. t1_66666</param>
315
- public static Task ReportAsync ( IWebAgent agent , string fullname , ReportType reportType , string otherReason = null ) {
322
+ public static Task ReportAsync ( IWebAgent agent , string fullname , ReportType reportType , string otherReason = null )
323
+ {
316
324
317
325
string reportReason ;
318
- switch ( reportType ) {
326
+ switch ( reportType )
327
+ {
319
328
case ReportType . Spam :
320
329
reportReason = "spam" ; break ;
321
330
case ReportType . VoteManipulation :
@@ -330,7 +339,8 @@ public static Task ReportAsync( IWebAgent agent, string fullname, ReportType rep
330
339
reportReason = "other" ; break ;
331
340
}
332
341
333
- return agent . Post ( ReportUrl , new {
342
+ return agent . Post ( ReportUrl , new
343
+ {
334
344
api_type = "json" ,
335
345
reason = reportReason ,
336
346
other_reason = otherReason ?? "" ,
0 commit comments