From f0a2a6c875e9294f0ea1d4c6bc90529e41a2dc37 Mon Sep 17 00:00:00 2001 From: beatrix Date: Mon, 9 Oct 2017 09:56:17 -0400 Subject: try to tighten up local only toot stuff, like... properly (#163) * try to tighten up local only toot stuff, like... properly * try to un-break tests --- app/models/status.rb | 5 +++++ app/models/stream_entry.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'app/models') diff --git a/app/models/status.rb b/app/models/status.rb index ea4c097bf..e1697b8af 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -257,6 +257,11 @@ class Status < ApplicationRecord end end + def local_only? + # match both with and without U+FE0F (the emoji variation selector) + /👁\ufe0f?\z/.match?(content) + end + private def store_uri diff --git a/app/models/stream_entry.rb b/app/models/stream_entry.rb index 44aac39b3..cff232916 100644 --- a/app/models/stream_entry.rb +++ b/app/models/stream_entry.rb @@ -28,7 +28,7 @@ class StreamEntry < ApplicationRecord scope :recent, -> { reorder(id: :desc) } scope :with_includes, -> { includes(:account, status: STATUS_INCLUDES) } - delegate :target, :title, :content, :thread, + delegate :target, :title, :content, :thread, :local_only?, to: :status, allow_nil: true -- cgit