[Feature Enhancement]: Support scoped mutes (`onlyReposts` / `onlyQuoteposts`) in `muteActor`

未关闭
#348 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@KC-2001MS 已经在做这个了。

开始于 2026年11月16日。

  • #349 来自 @KC-2001MS —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
swift
领域
api, backend

调研方向

Start by locating MuteActorRequestBody, muteActor(_:), and ViewerStateDefinition in the AppBskyLexicon and ATProtoKit sources, then read the existing request and viewer state tests. Add support for the two scope inputs and corresponding viewer state fields using the lexicon names in the issue. Done when scoped mute requests encode correctly, viewer state decodes both fields, and tests cover calls with and without a scope.

由索引模型根据 Issue 内容生成。

描述

enhancement
Summary

The app.bsky.graph.muteActor lexicon now accepts onlyReposts and onlyQuoteposts in its input, and app.bsky.actor.defs#viewerState now includes mutedOnlyReposts and mutedOnlyQuoteposts. ATProtoKit supports neither: MuteActorRequestBody only has actor, and ViewerStateDefinition has no properties for the two new fields.

Pain points
  • muteActor(_:) can only create a full mute, so a scoped mute (e.g. hiding only an account's reposts) can't be created.
  • ViewerStateDefinition has no mutedOnlyReposts / mutedOnlyQuoteposts, so there is no way to tell whether a scoped mute is active.
Considered Alternatives

Sending the muteActor request manually and fetching profiles as raw JSON to read the viewer state.

Is this a breaking change?

No

Additional Context

Proposed changes:

// AppBskyLexicon.Graph.MuteActorRequestBody
public let isOnlyReposts: Bool?      // "onlyReposts"
public let isOnlyQuotePosts: Bool?   // "onlyQuoteposts"

// ATProtoKit
public func muteActor(
    _ actor: String,
    isOnlyReposts: Bool? = nil,
    isOnlyQuotePosts: Bool? = nil
) async throws

// AppBskyLexicon.Actor.ViewerStateDefinition
public let areRepostsMuted: Bool?    // "mutedOnlyReposts"
public let areQuotePostsMuted: Bool? // "mutedOnlyQuoteposts"

Per the lexicon, calling muteActor again on an existing mute replaces its stored scope instead of merging it, and a call with no scope set creates a full mute. unmuteActor is unchanged.

主要语言
Swift
星标
226
派生
40
平均合并
2 小时 56 分钟
30 天内合并 PR
3

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

MasterJ93/ATProtoKit 的其他 Issue

查看 MasterJ93/ATProtoKit 的全部 Issue

相似的 Issue

更多 Swift Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。