Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add notify bool parameter to Follow method #127

Open
wants to merge 1 commit into
base: v4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Mastonet/IMastodonClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ Task<Account> UpdateCredentials(bool? discoverable = null,
/// <param name="accountId"></param>
/// <param name="reblogs">Whether the followed account’s reblogs will show up in the home timeline</param>
/// <returns>Returns the target Account</returns>
Task<Relationship> Follow(string accountId, bool reblogs = true);
Task<Relationship> Follow(string accountId, bool reblogs = true, bool notify = false);

/// <summary>
/// Unfollowing an account
Expand Down
8 changes: 6 additions & 2 deletions Mastonet/MastodonClient.AccountActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ partial class MastodonClient
/// <param name="accountId"></param>
/// <param name="reblogs">Whether the followed account’s reblogs will show up in the home timeline</param>
/// <returns>Returns the target Account</returns>
public Task<Relationship> Follow(string accountId, bool reblogs = true)
public Task<Relationship> Follow(string accountId, bool reblogs = true, bool notify = false)
{
var data = reblogs ? null : Enumerable.Repeat(new KeyValuePair<string, string>("reblogs", "false"), 1);
var data = new List<KeyValuePair<string, string>>()
{
new KeyValuePair<string, string>("reblogs", reblogs.ToString()),
new KeyValuePair<string, string>("notify", notify.ToString().ToLowerInvariant())
};
return this.Post<Relationship>($"/api/v1/accounts/{accountId}/follow", data);
}

Expand Down