Skip to content

Commit

Permalink
FIX: Use split hide profile and presence options (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
jancernik authored Nov 13, 2024
1 parent 6991131 commit 3607d1b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions .discourse-compatibility
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 1 addition & 3 deletions plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/whos_online_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3607d1b

Please sign in to comment.