about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-04-19 14:10:57 -0500
committermultiple creatures <dev@multiple-creature.party>2019-05-21 03:16:22 -0500
commita230a6038bae4cccb3f456ad25acf47cc5cf1ea8 (patch)
treef333a3f0535e65ddc7749a672822c6c21b7e80b6 /app
parent4088e0a6481546419d8a8714dea1a94ae4e84a8b (diff)
Make sure that local-only tokens still get detected when signature is enabled.
Diffstat (limited to 'app')
-rw-r--r--app/lib/bangtags.rb1
-rw-r--r--app/models/status.rb5
2 files changed, 4 insertions, 2 deletions
diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb
index 1ef818e8d..d1a179a76 100644
--- a/app/lib/bangtags.rb
+++ b/app/lib/bangtags.rb
@@ -379,6 +379,7 @@ class Bangtags
         next if name.blank?
         description = @vars["_they:are:#{name}"]
         next if description.blank?
+        status.local_only = true if Status::LOCAL_ONLY_TOKENS.match?(@chunks.last)
         @chunks << "\n\n---\n– #{description}"
       when 'media'
         media_idx = post_cmd[1]
diff --git a/app/models/status.rb b/app/models/status.rb
index b7bd5cc84..e6dd81cd4 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -39,6 +39,8 @@ class Status < ApplicationRecord
   include StatusThreadingConcern
 
   LOCAL_DOMAINS = ENV.fetch('LOCAL_DOMAINS', '').chomp.split(/\.?\s+/).freeze
+  # match both with and without U+FE0F (the emoji variation selector)
+  LOCAL_ONLY_TOKENS = /(?:#!|\u{1f441}\ufe0f?)\u200b?\z/
   FORCE_SENSITIVE = ENV.fetch('FORCE_SENSITIVE', '').chomp.split(/\.?\s+/).freeze
   FORCE_UNLISTED = ENV.fetch('FORCE_UNLISTED', '').chomp.split(/\.?\s+/).freeze
 
@@ -500,8 +502,7 @@ class Status < ApplicationRecord
   end
 
   def marked_local_only?
-    # match both with and without U+FE0F (the emoji variation selector)
-    /(?:#!|\u{1f441}\ufe0f?)\u200b?\z/.match?(content)
+    LOCAL_ONLY_TOKENS.match?(content)
   end
 
   def marked_no_replies?