about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-08-02 20:55:21 -0500
committermultiple creatures <dev@multiple-creature.party>2019-08-02 20:55:21 -0500
commitf0094fd14389622ed0bc8a5ca3f0ef9e6f9c4f17 (patch)
tree8f9ba0a0ef11c8483703aaa01740ec02bd62d58c /app
parentcf333d3699635258e57b7792ee5f688c169ecd01 (diff)
allow abandoning any thread; add `thread:leave`/`thread:part` bangtags
Diffstat (limited to 'app')
-rw-r--r--app/javascript/flavours/glitch/components/status_action_bar.js6
-rw-r--r--app/lib/bangtags.rb6
2 files changed, 8 insertions, 4 deletions
diff --git a/app/javascript/flavours/glitch/components/status_action_bar.js b/app/javascript/flavours/glitch/components/status_action_bar.js
index f753bb6be..38edcdc4c 100644
--- a/app/javascript/flavours/glitch/components/status_action_bar.js
+++ b/app/javascript/flavours/glitch/components/status_action_bar.js
@@ -210,10 +210,8 @@ export default class StatusActionBar extends ImmutablePureComponent {
 
     menu.push(null);
 
-    if (status.getIn(['account', 'id']) === me || withDismiss) {
-      menu.push({ text: intl.formatMessage(mutingConversation ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMuteClick });
-      menu.push(null);
-    }
+    menu.push({ text: intl.formatMessage(mutingConversation ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMuteClick });
+    menu.push(null);
 
     if (status.getIn(['account', 'id']) === me) {
       if (pinnableStatus) {
diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb
index ec90f5014..e859b8f1b 100644
--- a/app/lib/bangtags.rb
+++ b/app/lib/bangtags.rb
@@ -16,6 +16,9 @@ class Bangtags
       'permalink' => ['link'],
       'cloudroot' => ['link'],
       'blogroot' => ['link'],
+
+      'leave' => ['thread'],
+      'part' => ['thread'],
     }
 
     @aliases = {
@@ -264,6 +267,9 @@ class Bangtags
           chunk = nil
           next if cmd[1].nil?
           case cmd[1].downcase
+          when 'leave', 'part'
+            next if status.conversation_id.nil?
+            @account.mute_conversation!(status.conversation)
           when 'reall'
             if status.conversation_id.present?
               participants = Status.where(conversation_id: status.conversation_id)