Beispiel #1
0
        /// <summary>
        /// Revoke an outstanding contributor invite.
        /// </summary>
        /// <param name="user">reddit user.</param>
        public async Task <bool> RevokeContributorInviteAsync(RedditUser user)
        {
            var request = WebAgent.CreateRequest(RevokeContributorInviteUrl, "POST");

            WebAgent.WritePostBody(request, new
            {
                api_type = "json",
                id       = RedditUser.KindPrefix + user.Id
            });
            var response = await WebAgent.GetResponseAsync(request).ConfigureAwait(false);

            if (response.IsSuccessStatusCode)
            {
                return(true);
            }

            return(false);
        }
 /// <inheritdoc />
 protected internal WikiPageRevision(IWebAgent agent, JToken json) : base(agent, json)
 {
     Author = new RedditUser(agent, json["author"]);
 }
Beispiel #3
0
 /// <summary>
 /// Author of the item against which this moderation action was performed.
 /// </summary>
 //TODO discuss
 public Task <RedditUser> GetTargetAuthorAsync() =>
 RedditUser.GetUserAsync(WebAgent, TargetAuthorName);
Beispiel #4
0
 /// <summary>
 /// Set permissions on a contributor who has been invited but has not accepted.
 /// </summary>
 /// <param name="user"></param>
 /// <param name="permissions">Permissions to set.</param>
 public async Task <bool> SetInvitedContributorPermissionsAsync(RedditUser user, LiveUpdateEventPermission permissions)
 {
     return(await SetInvitedContributorPermissionsAsync(user.Name, permissions).ConfigureAwait(false));
 }
Beispiel #5
0
        /// <summary>
        /// Revoke an outstanding contributor invite.
        /// </summary>
        /// <param name="name">reddit username</param>
        public async Task <bool> RevokeContributorInviteAsync(string name)
        {
            var redditUser = await RedditUser.GetUserAsync(WebAgent, name);

            return(await RevokeContributorInviteAsync(redditUser).ConfigureAwait(false));
        }
Beispiel #6
0
        /// <summary>
        /// Remove a contributor from the live thread.
        /// </summary>
        /// <param name="userName">reddit username.</param>
        public async Task <bool> RemoveContributorAsync(string userName)
        {
            var redditUser = await RedditUser.GetUserAsync(WebAgent, userName);

            return(await RemoveContributorAsync(redditUser).ConfigureAwait(false));
        }