# Discourse 用户模型代码中的可能复制粘贴错误

**URL:** https://meta.discourse.org/t/possible-copy-paste-mistake-in-discourse-user-model-code/319634
**Category:** Bug
**Tags:** fixed
**Created:** [2024年八月1日 10:39 UTC](https://meta.discourse.org/t/possible-copy-paste-mistake-in-discourse-user-model-code/319634 "2024-08-01T10:39:24Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [2024年八月1日 10:39 UTC](https://meta.discourse.org/t/possible-copy-paste-mistake-in-discourse-user-model-code/319634/1 "2024-08-01T10:39:24Z")

</div>

我感觉第 401 行和 402 行的 `silencedTil` 应该改为 `suspendedTill`

> <https://github.com/discourse/discourse/blob/608e5682e2e706fec20fbe4b82b8b95cb962072d/app/assets/javascripts/discourse/app/models/user.js#L390-L408>

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [2024年八月1日 13:33 UTC](https://meta.discourse.org/t/possible-copy-paste-mistake-in-discourse-user-model-code/319634/3 "2024-08-01T13:33:30Z")

</div>

是的，你是正确的，但这并不影响行为，只是名称不正确。

这样就可以了：

> <https://github.com/discourse/discourse/pull/28193>
>
> Note this had no behavior impact, as the computed property was correct.

---

<div class="post-metadata">

### Author: ![Firepup650](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firepup650/32/465200_2.png) [@Firepup650](https://meta.discourse.org/u/Firepup650)
#### Post date: [2024年八月1日 13:35 UTC](https://meta.discourse.org/t/possible-copy-paste-mistake-in-discourse-user-model-code/319634/4 "2024-08-01T13:35:17Z")

</div>

第 397 行不也应该是 return 语句吗？

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [2024年八月1日 13:50 UTC](https://meta.discourse.org/t/possible-copy-paste-mistake-in-discourse-user-model-code/319634/5 "2024-08-01T13:50:56Z")

</div>

是的，确实应该如此，这是几个月前我们在重构时犯的一个行为更改错误。

> <https://github.com/discourse/discourse/pull/28194>
>
> \[Following a refactor\](https://github.com/discourse/discourse/commit/061e79297fb…986a2c2d08558416126992d3e1e39#diff-bd99ef6b155af0dab90541be2ed856f3521f78adef81e378f528d1c9e74615fc) we forgot to return the value.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [2024年八月3日 08:22 UTC](https://meta.discourse.org/t/possible-copy-paste-mistake-in-discourse-user-model-code/319634/6 "2024-08-03T08:22:28Z")

</div>


