docs-matrix-spec/locales/zh-Hans/rooms/v9.md
2025-04-20 16:13:37 +08:00

86 lines
2.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: 房间版本 9
type: docs
weight: 90
version: 9
---
{{< boxes/warning >}}
本页面的翻译未经核对,可能存在翻译质量不佳、错翻、漏翻等情况。您可以在 <a href="https://codeberg.org/wholetrans/docs-matrix-spec">Forgejo 存储库</a> 打开 Issue、提交 Pull Request 或<a href="mailto:errata@wholetrans.org">邮件联系</a>我们提出改进建议和参与翻译与核对。
{{< /boxes/warning >}}
此房间版本是在 [版本 8](/rooms/v8) 的基础上,新增了在合并 v8 时意外遗漏的额外撤回redaction规则。
## 客户端注意事项
有关受限房间restricted rooms的具体新增细节请参考 [房间版本 8](/rooms/v8)。
在本地实现撤回算法的客户端,应参考下文的 [撤回](#redactions) 部分以获得全面概述。
### 撤回
{{% added-in v=9 %}} [`m.room.member`](/client-server-api#mroommember) 事件在被撤回时,除了保留原有的 `content` 键外,现在还会保留 `join_authorised_via_users_server`
{{% boxes/rationale %}}
如果没有 `join_authorised_via_users_server` 属性,被撤回的加入事件在验证事件授权链时可能变得无效,从而导致“脑裂”现象,即用户从某一服务器视角可以发言,但大多数其他服务器会持续拒绝其事件。
理论上可以通过重新加入大厅来规避该问题,前提是不要将出错的事件作为 `prev_events` 使用,不过建议优先选用 v9 房间来彻底避免此类情况。
更多信息请见 [Issue #3373](https://github.com/matrix-org/matrix-doc/issues/3373)。
{{% /boxes/rationale %}}
完整的撤回算法如下:
{{% rver-fragment name="v9-redactions" %}}
## 服务器实现组成部分
{{% boxes/warning %}}
本节信息仅面向服务器实现者。使用 Client-Server API 的应用通常不受此处细节影响。有关注意客户端实现的用例请参考前文关于客户端注意事项的部分。
{{% /boxes/warning %}}
房间版本 8 引入了一种新的 `restricted` 加入规则,允许一个房间的成员无需邀请即可加入另一个房间。房间版本 9 以 v8 为基础,并有以下补充说明。
### 撤回
[见上文](#redactions)。
## 保持与 v8 一致
下列部分自 v8 起未做修改,现为文档完整性起见一并收录。
### 处理撤回
{{% rver-fragment name="v3-handling-redactions" %}}
### 事件 ID
{{% rver-fragment name="v4-event-ids" %}}
### 事件格式
{{% rver-fragment name="v6-event-format" %}}
#### 已废弃的事件内容格式
{{% rver-fragment name="v1-deprecated-formatting-off-spec" %}}
{{% rver-fragment name="v1-stringy-power-levels" %}}
### 授权规则
{{% rver-fragment name="v8-auth-rules" %}}
### 状态解析
{{% rver-fragment name="v2-state-res" %}}
### 标准 JSON
{{% rver-fragment name="v6-canonical-json" %}}
### 签名密钥有效期
{{% rver-fragment name="v5-signing-requirements" %}}