# Discourse Retort

**URL:** https://meta.discourse.org/t/discourse-retort/35903
**Category:** Plugin
**Tags:** end-of-life
**Created:** [2015年十一月22日 11:53 UTC](https://meta.discourse.org/t/discourse-retort/35903 "2015-11-22T11:53:58Z")
**Posts on this page:** 20
**Page:** 22

<div class="post-metadata">

### Author: ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)
#### Post date: [2021年三月19日 19:50 UTC](https://meta.discourse.org/t/discourse-retort/35903/440 "2021-03-19T19:50:10Z")

</div>

> [@wolftune](#):
>
> 遗憾的是，官方插件无法完全替代。 **它缺少发布多种反应的功能！**

Maker Forums 的成员们非常珍视能够使用多种表情符号进行反应的功能。如果 retort 停止维护，在迁移过程中失去这一功能将会让我们非常遗憾。

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2021年三月19日 23:28 UTC](https://meta.discourse.org/t/discourse-retort/35903/441 "2021-03-19T23:28:10Z")

</div>

Retort 将继续由 Pavilion 维护。

> [@angus](#):
>
> 鉴于此，在可预见的未来，我将按原样维护此插件，因为这是一个实质性的差异。不过我认为，迁移工作对大多数用户来说仍然有用。

@Ahmed_Gagan 您对以下内容有何看法？

> [@angus](#):
>
> 用户可能同时对某条帖子点了“赞”并进行了“回击”。在迁移过程中，遇到这种情况时，我将优先处理“回击”而非“赞”。然而，`ReactionManager.toggle!` 的访问保护机制不允许这样做。
> 
> 是否可以为迁移添加一个“强制”选项？或者您能建议其他方法吗？

---

<div class="post-metadata">

### Author: ![Ahmed\_Gagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ahmed_gagan/32/161985_2.png) [@Ahmed\_Gagan](https://meta.discourse.org/u/Ahmed_Gagan)
#### Post date: [2021年三月21日 08:23 UTC](https://meta.discourse.org/t/discourse-retort/35903/442 "2021-03-21T08:23:30Z")

</div>

如需优先处理回复反应，您可以使用以下代码：

```ruby
SiteSetting.post_undo_action_window_mins = 允许的最大分钟数

ReactionManager.new(first_retort_reaction_at_priority, by_user, Guardian.new(by_user), post).toggle!

```

这将处理所有相关事宜：如果用户已点赞该帖子，它将移除“点赞”并添加相应的反应。

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2021年三月22日 08:22 UTC](https://meta.discourse.org/t/discourse-retort/35903/443 "2021-03-22T08:22:33Z")

</div>

是的，我可以做到。不过这算是个变通方案 😉

我不确定这个变通方案长期来看是否依然可行，而且也存在一定风险。例如，如果我直接运行那段代码，用户的 `post_undo_action_window_mins` 站点设置就会被永久修改。虽然你可以在迁移结束时将其改回来，但为了绕过守护机制而临时修改设置并不是理想的做法。

我理想中的方案是对 `ReactionManager` 接口进行微调，以便能够可靠地将“回击”（retorts）迁移为“反应”（reactions）。目前该接口仅设计用于处理来自客户端的请求。

实现这一目标的一种方法是：

- 将 `toggle!` 中的守护逻辑抽象为 `ensure_can_toggle` 方法
- 使 `ensure_can_toggle` 方法支持 `force` 选项

这是 Discourse 其他部分处理迁移或后端导入时通常采用的方法（如果你在 `app/` 或 `lib/` 中搜索 `force`，就能看到一些示例）。

这样解释清楚吗？

---

<div class="post-metadata">

### Author: ![Ahmed\_Gagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ahmed_gagan/32/161985_2.png) [@Ahmed\_Gagan](https://meta.discourse.org/u/Ahmed_Gagan)
#### Post date: [2021年三月22日 09:17 UTC](https://meta.discourse.org/t/discourse-retort/35903/444 "2021-03-22T09:17:56Z")

</div>

我认为这里不需要使用该设置，因为我们并未触及帖子中已存在的点赞。这意味着我们正在为帖子创建新的反应。在这种情况下，`guardian.can_delete_reaction_user?` 将始终为 true。就个人而言，仅使用 `ReactionManager.toggle` 就足以满足此需求。

---

<div class="post-metadata">

### Author: ![debryc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/debryc/32/101652_2.png) [@debryc](https://meta.discourse.org/u/debryc)
#### Post date: [2021年四月9日 21:13 UTC](https://meta.discourse.org/t/discourse-retort/35903/445 "2021-04-09T21:13:34Z")

</div>

Discourse 通过“点赞”功能实现了许多操作，例如根据信任等级限制点赞数量，并依据点赞数授予用户徽章。

添加“反应”是否也会同时增加用户和主题的点赞计数？

---

<div class="post-metadata">

### Author: ![wolftune](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wolftune/32/103569_2.png) [@wolftune](https://meta.discourse.org/u/wolftune)
#### Post date: [2021年四月9日 21:25 UTC](https://meta.discourse.org/t/discourse-retort/35903/446 "2021-04-09T21:25:24Z")

</div>

你可以单独询问它与新的官方插件 [Discourse Reactions](https://meta.discourse.org/t/discourse-reactions-beyond-likes/183261/) 的交互情况。

但 Retort（与 Discourse Reactions 插件不同，它允许每个用户对每篇帖子进行多次反应）与“点赞”相关的信任等级和徽章完全没有交互。

---

<div class="post-metadata">

### Author: ![omano](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/omano/32/192639_2.png) [@omano](https://meta.discourse.org/u/omano)
#### Post date: [2021年五月5日 06:29 UTC](https://meta.discourse.org/t/discourse-retort/35903/447 "2021-05-05T06:29:24Z")

</div>

@gdpelican 这是从 [https://meta.discourse.org/t/reaction-emoji-seem-to-have-no-verification/189108](https://meta.discourse.org/t/reaction-emoji-seem-to-have-no-verification/189108) 转载的帖子，因为反应表情似乎不属于 Discourse 原生功能，所以我在此重新发布：

我认为我可能发现了一个 bug，但目前还没有完整的复现步骤，不过我可以轻松展示该问题的示例，并且我认为我的推测可能是正确的。

问题如下：用户可以添加不存在的表情符号到帖子反应中，结果会在帖子中出现 `:whateverYouWant:` 这样的反应。

你可以在 Manjaro 论坛上看到相关示例，我注意到某位用户的帖子经常包含这些不存在的表情符号。在向他询问了几个问题后，我推测他可能在使用某种浏览器自动翻译扩展程序，该程序可能会将类似 `:code:` 的表情符号代码翻译成他的语言。遗憾的是，我没有收到该用户的回复，因此无法确切了解他在浏览器中的具体设置。为了佐证我的推测，你可以看到他在以下链接的线程中引用他人时，其引用内容中包含了原始消息的翻译版本。

查看 Manjaro 论坛上的这条消息/线程：

> **[Who is the maintainer of the manjaro community edition LXQt?](https://forum.manjaro.org/t/who-is-the-maintainer-of-the-manjaro-community-edition-lxqt/64959/14?u=omano)**
>
> Another off topic one, promise last one, how do you type inexistent emoticon reaction to posts? It is not the first time I see you do that, I wanted to react to your post with :chorizzo: to test but it doesn’t allow me. //EDIT: I wonder are there...

查看反应中的示例，你可以清楚地看到所有正常的反应旁边都有一个无效的反应：

> **[Volunteers needed](https://forum.manjaro.org/t/volunteers-needed/65028)**
>
> @Manjaro-Team I want to thank all of you - you have let me into a wonderful world of open-source. I am aging considerably faster than I anticipated - my health are deteriorating - so I cannot keep up with a stable maintenance of the following...

因此，似乎由于缺乏对表情符号代码的验证，用户可以发送不存在的表情符号。

---

<div class="post-metadata">

### Author: ![th21](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/th21/32/211915_2.png) [@th21](https://meta.discourse.org/u/th21)
#### Post date: [2021年七月17日 23:22 UTC](https://meta.discourse.org/t/discourse-retort/35903/448 "2021-07-17T23:22:23Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/3X/9/5/956e2134c69bf7335492da047f4cc05495778c56.png)  
是否也有人遇到在小屏幕和移动设备上反应位置错乱的情况？

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2021年七月20日 04:35 UTC](https://meta.discourse.org/t/discourse-retort/35903/449 "2021-07-20T04:35:55Z")

</div>

我已更新此插件，使其与最新的 Discourse 代码兼容。

[https://github.com/gdpelican/retort/commit/2b94ca394e941342cba4a4ee4950daf54856fa61](https://github.com/gdpelican/retort/commit/2b94ca394e941342cba4a4ee4950daf54856fa61)

@th21 我还更新了 retort 的 HTML 结构，以更好地适应较长的回复列表，尤其是在移动设备上。

[https://github.com/gdpelican/retort/commit/a9740c2a84a1de89c66b5c5cf865e6118e535d72](https://github.com/gdpelican/retort/commit/a9740c2a84a1de89c66b5c5cf865e6118e535d72)

---

<div class="post-metadata">

### Author: ![th21](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/th21/32/211915_2.png) [@th21](https://meta.discourse.org/u/th21)
#### Post date: [2021年七月20日 20:39 UTC](https://meta.discourse.org/t/discourse-retort/35903/450 "2021-07-20T20:39:18Z")

</div>

谢谢，它起作用了！

---

<div class="post-metadata">

### Author: ![Vaping\_Community](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vaping_community/32/89248_2.png) [@Vaping\_Community](https://meta.discourse.org/u/Vaping_Community)
#### Post date: [2021年七月23日 15:42 UTC](https://meta.discourse.org/t/discourse-retort/35903/451 "2021-07-23T15:42:30Z")

</div>

在最新版本中，我的移动设备上的回复功能出问题了

 ![screenshot-vapingcommunity.co.uk-2021.07.23-16_40_15](https://global.discourse-cdn.com/meta/original/3X/2/0/2055a56095f3b53fb2d4e0ac7134b4c390bb927b.png)

---

<div class="post-metadata">

### Author: ![Vaping\_Community](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vaping_community/32/89248_2.png) [@Vaping\_Community](https://meta.discourse.org/u/Vaping_Community)
#### Post date: [2021年八月5日 14:50 UTC](https://meta.discourse.org/t/discourse-retort/35903/452 "2021-08-05T14:50:56Z")

</div>

我认为回复容器应该位于工具栏的上方或下方，最好是在上方，这样我们在 CSS 方面会有更多的操作空间。

---

<div class="post-metadata">

### Author: ![th21](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/th21/32/211915_2.png) [@th21](https://meta.discourse.org/u/th21)
#### Post date: [2022年一月20日 06:54 UTC](https://meta.discourse.org/t/discourse-retort/35903/453 "2022-01-20T06:54:36Z")

</div>

是否可以使用数据浏览器或控制台查找最常用的表情符号列表？🤔我查看了 `plugin_store_rows` 表，但没有找到有用的信息。

---

<div class="post-metadata">

### Author: ![bsawicki](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@bsawicki](https://meta.discourse.org/u/bsawicki)
#### Post date: [2022年八月3日 00:10 UTC](https://meta.discourse.org/t/discourse-retort/35903/454 "2022-08-03T00:10:12Z")

</div>

您好，用户用俏皮话做出反应的工具提示在移动设备上现在已损坏。我尝试调整了 z-index，但未能使用自定义 CSS 成功修复它。有人能帮忙看看吗？

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2022年八月3日 06:21 UTC](https://meta.discourse.org/t/discourse-retort/35903/455 "2022-08-03T06:21:10Z")

</div>

此插件已#生命周期结束。请使用 Reactions Plugin。

> [@Discourse Reactions](https://meta.discourse.org/t/discourse-reactions/183261):
>
> discourse2Summary Discourse Reactions allows users to React to a post from a choice of emojis, rather than only the Like heart. The available emoji selection can be set from the admin settings.open_bookInstall Guide This plugin is bundled with Discourse core. There is no need to install the plugin separately. Bored of likes in discourse? Here’s something you will definitely love. Overview Discourse-reactions is a plugin that allows user to add their reactions to the …

---

<div class="post-metadata">

### Author: ![wolftune](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wolftune/32/103569_2.png) [@wolftune](https://meta.discourse.org/u/wolftune)
#### Post date: [2022年八月3日 16:18 UTC](https://meta.discourse.org/t/discourse-retort/35903/456 "2022-08-03T16:18:36Z")

</div>

Discourse Reactions 是一个_糟糕_的替代品，原因只有一个：它将反应限制为每帖一个。与 Retort 相比，这大大降低了反应的效用，Retort 允许人们对同一帖子给出多个反应。

因此，我真希望 Retort 能够得到维护。更好的解决方案是更新 Discourse Reactions 以允许多个反应。

---

<div class="post-metadata">

### Author: ![bsawicki](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@bsawicki](https://meta.discourse.org/u/bsawicki)
#### Post date: [2022年八月3日 22:17 UTC](https://meta.discourse.org/t/discourse-retort/35903/457 "2022-08-03T22:17:30Z")

</div>

> [@wolftune](#):
>
> 我真的很希望 Retort 能因此得到维护。更好的解决方案是更新 Discourse Reactions，允许进行多个反应。

另一个很大的不足是，Retort 允许你从所有可用的表情符号中进行选择，而你必须为 Discourse Reactions 定义一组表情符号。如果 Discourse Reactions 具备了这两个功能，我很乐意放弃 Retort，但在此之前，如果我告诉用户他们将失去 95% 的表情符号反应的访问权限，他们是不会高兴的。

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [2022年八月3日 22:30 UTC](https://meta.discourse.org/t/discourse-retort/35903/458 "2022-08-03T22:30:03Z")

</div>

有一个 #Contribute > Feature 话题看起来颇有前景……

> [@在Discourse Reactions中添加...选项](https://meta.discourse.org/t/add-option-to-discourse-reactions/227785):
>
> 添加一个选项，将 discourse-reactions 限制为固定数量的反应。 在某些社区中，提供完全的灵活性，以便人们可以选择 rainbow 表情符号中的任何反应是有意义的。 这个想法是： 如果插件启用了 enable all reactions。 在反应菜单中渲染一个 ... 点击后让用户从完整的反应列表中选择 在默认托盘中保留最后 3 个非标准选择@j.jaffeux 有什么想法吗？

---

<div class="post-metadata">

### Author: ![bsawicki](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@bsawicki](https://meta.discourse.org/u/bsawicki)
#### Post date: [2022年八月3日 23:00 UTC](https://meta.discourse.org/t/discourse-retort/35903/459 "2022-08-03T23:00:36Z")

</div>

是的，如果这一切都实现了，我认为我可以轻松地说服我的用户群迁移。只是在这一切完全可用之前就淘汰替代方案有点糟糕。

[上一頁](https://meta.discourse.org/t/discourse-retort/35903.md?page=21)

[下一頁](https://meta.discourse.org/t/discourse-retort/35903.md?page=23)
