Make sure that local-only tokens still get detected when signature is enabled.
parent
4088e0a648
commit
a230a6038b
|
@ -379,6 +379,7 @@ class Bangtags
|
||||||
next if name.blank?
|
next if name.blank?
|
||||||
description = @vars["_they:are:#{name}"]
|
description = @vars["_they:are:#{name}"]
|
||||||
next if description.blank?
|
next if description.blank?
|
||||||
|
status.local_only = true if Status::LOCAL_ONLY_TOKENS.match?(@chunks.last)
|
||||||
@chunks << "\n\n---\n– #{description}"
|
@chunks << "\n\n---\n– #{description}"
|
||||||
when 'media'
|
when 'media'
|
||||||
media_idx = post_cmd[1]
|
media_idx = post_cmd[1]
|
||||||
|
|
|
@ -39,6 +39,8 @@ class Status < ApplicationRecord
|
||||||
include StatusThreadingConcern
|
include StatusThreadingConcern
|
||||||
|
|
||||||
LOCAL_DOMAINS = ENV.fetch('LOCAL_DOMAINS', '').chomp.split(/\.?\s+/).freeze
|
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_SENSITIVE = ENV.fetch('FORCE_SENSITIVE', '').chomp.split(/\.?\s+/).freeze
|
||||||
FORCE_UNLISTED = ENV.fetch('FORCE_UNLISTED', '').chomp.split(/\.?\s+/).freeze
|
FORCE_UNLISTED = ENV.fetch('FORCE_UNLISTED', '').chomp.split(/\.?\s+/).freeze
|
||||||
|
|
||||||
|
@ -500,8 +502,7 @@ class Status < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def marked_local_only?
|
def marked_local_only?
|
||||||
# match both with and without U+FE0F (the emoji variation selector)
|
LOCAL_ONLY_TOKENS.match?(content)
|
||||||
/(?:#!|\u{1f441}\ufe0f?)\u200b?\z/.match?(content)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def marked_no_replies?
|
def marked_no_replies?
|
||||||
|
|
Loading…
Reference in New Issue