R4 the client catches up: follow requests, followers, downvotes, dismissing, filtering a post, quote policies, statistics in detail
Build / Build (push) Successful in 1m8s
Build / Build (push) Successful in 1m8s
Follow requests answered on the persona's own profile and from the Notifications tab; its followers and the accounts it follows listed there, a follower removed (asked first). Downvotes on threadiverse posts, after the public-vote notice. A notification dismissed from its line. "Filter this post" from a card's menu, and the Filters page showing the posts a filter holds. Who may quote the persona's own posts, and revoking a quote of one. Statistics: a server in detail with "describe again", the ledger's events, the server's own days. The composer deletes an upload taken out before posting. MediaType.Documents goes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WpVCoDeM1qUTRp4fXQdfof
This commit is contained in:
1 parent
b731d8c8c0
commit
b8d7858acb
25 files changed
+1543
-61
No files matched your search
+20
-11
@@ -30,7 +30,7 @@ namespace decePubClient.Services
|
||||
|
||||
/// <summary>
|
||||
/// Accounts as the current persona sees them: a profile, its relationship to the persona, its posts, following,
|
||||
/// blocking and muting it, the persona's follow requests, and search across the fediverse (a remote handle or URL is
|
||||
/// blocking and muting it, the persona's follow requests, followers and following, and search across the fediverse (a remote handle or URL is
|
||||
/// resolved by PrivaPub, never by the browser). Lists come back empty and values null on failure; nothing throws.
|
||||
/// </summary>
|
||||
public class AccountService(IHttpService httpService, ILoggingService logger, CoalescingStringLocalizer localizer)
|
||||
@@ -154,16 +154,10 @@ namespace decePubClient.Services
|
||||
return [];
|
||||
}
|
||||
|
||||
/// <summary>The accounts waiting for the persona to accept their follow.</summary>
|
||||
public async Task<List<Account>> FollowRequests(CancellationToken cancellationToken = default)
|
||||
{
|
||||
using var response = await httpService.Get(APIs.Mastodon.GET_FollowRequests, ["limit=80"], cancellationToken: cancellationToken);
|
||||
if (response.IsSuccessStatusCode)
|
||||
return await response.MastodonReadFromJsonAsync<List<Account>>(cancellationToken) ?? [];
|
||||
|
||||
await LogFailure(response, nameof(FollowRequests), cancellationToken);
|
||||
return [];
|
||||
}
|
||||
/// <summary>A page of the accounts waiting for the persona to accept their follow, newest first; Data is an
|
||||
/// AccountPage (the next page's cursor from the Link header, when PrivaPub sends one).</summary>
|
||||
public Task<WebResult> FollowRequests(string maxId, CancellationToken cancellationToken = default) =>
|
||||
Accounts(APIs.Mastodon.GET_FollowRequests, maxId, cancellationToken);
|
||||
|
||||
/// <summary>Accepts (authorize) or refuses (reject) a follow request.</summary>
|
||||
public async Task<WebResult> Answer(string accountId, bool accept, CancellationToken cancellationToken = default)
|
||||
@@ -237,6 +231,21 @@ namespace decePubClient.Services
|
||||
public Task<WebResult> Following(string accountId, string maxId, CancellationToken cancellationToken = default) =>
|
||||
Accounts(APIs.Mastodon.GET_M_AccountFollowing(accountId), maxId, cancellationToken);
|
||||
|
||||
/// <summary>A page of the persona's followers (only the persona itself may read it: PrivaPub answers [] for anyone
|
||||
/// else's); Data is an AccountPage.</summary>
|
||||
public Task<WebResult> Followers(string accountId, string maxId, CancellationToken cancellationToken = default) =>
|
||||
Accounts(APIs.Mastodon.GET_M_AccountFollowers(accountId), maxId, cancellationToken);
|
||||
|
||||
/// <summary>Removes an account from the persona's followers (its server is told); Data is the new Relationship.</summary>
|
||||
public async Task<WebResult> RemoveFromFollowers(string accountId, CancellationToken cancellationToken = default)
|
||||
{
|
||||
using var response = await httpService.Post(APIs.Mastodon.POST_M_RemoveFromFollowers(accountId), cancellationToken: cancellationToken);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
return await response.Content.ReadWebResult(response.StatusCode, localizer, cancellationToken);
|
||||
|
||||
return new WebResult { Data = await response.MastodonReadFromJsonAsync<Relationship>(cancellationToken) };
|
||||
}
|
||||
|
||||
/// <summary>A page of the accounts the persona muted; Data is an AccountPage.</summary>
|
||||
public Task<WebResult> Mutes(string maxId, CancellationToken cancellationToken = default) =>
|
||||
Accounts(APIs.Mastodon.GET_Mutes, maxId, cancellationToken);
|
||||
|
||||
Reference in new issue
Block a user