From 3607d1bf059063235ff71e6b7c37995c50ebdc5f Mon Sep 17 00:00:00 2001 From: Jan Cernik <66427541+jancernik@users.noreply.github.com> Date: Tue, 12 Nov 2024 23:04:04 -0300 Subject: [PATCH] FIX: Use split hide profile and presence options (#110) --- .discourse-compatibility | 1 + plugin.rb | 4 +--- spec/integration/whos_online_spec.rb | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.discourse-compatibility b/.discourse-compatibility index fe8f357..ac6f8bb 100644 --- a/.discourse-compatibility +++ b/.discourse-compatibility @@ -1,3 +1,4 @@ +< 3.4.0.beta3-dev: 699113133bcdff762c42823aace5164161ac50d7 < 3.4.0.beta1-dev: be99b48d01d65ffdb1f646996e9917b96da78bdc < 3.3.0.beta1-dev: 98b5a78d48a18fedb6075bb9c4eeaf7e3ebf96cc 3.1.0.beta3: aeee51e439fae887b08b0eba29e8201b0bb1b88c diff --git a/plugin.rb b/plugin.rb index 904ab30..f2f6cde 100644 --- a/plugin.rb +++ b/plugin.rb @@ -31,9 +31,7 @@ module ::DiscourseWhosOnline on(:user_seen) do |user| hidden = false - hidden ||= user.user_option.hide_profile_and_presence if defined?( - user.user_option.hide_profile_and_presence - ) + hidden ||= user.user_option.hide_presence if defined?(user.user_option.hide_presence) hidden ||= user.id < 0 next if hidden PresenceChannel.new(DiscourseWhosOnline::CHANNEL_NAME).present( diff --git a/spec/integration/whos_online_spec.rb b/spec/integration/whos_online_spec.rb index fa1f2a1..78faf3a 100644 --- a/spec/integration/whos_online_spec.rb +++ b/spec/integration/whos_online_spec.rb @@ -65,7 +65,7 @@ expect(c.user_ids).to contain_exactly(user.id) user2 = Fabricate(:user) - user2.user_option.update(hide_profile_and_presence: true) + user2.user_option.update(hide_presence: true) sign_in(user2) get "/latest.json" expect(c.user_ids).to contain_exactly(user.id)