mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 16:03:41 +08:00
234133bd3b
It splits the hide_profile_and_presence user option and the default_hide_profile_and_presence site setting for more granular control. It keeps the option to hide the profile under /u/username/preferences/interface and adds the presence toggle in the quick user menu. Co-authored-by: Régis Hanol <regis@hanol.fr>
17 lines
368 B
Ruby
17 lines
368 B
Ruby
# frozen_string_literal: true
|
|
|
|
module UserStatusMixin
|
|
def self.included(klass)
|
|
klass.attributes :status
|
|
end
|
|
|
|
def include_status?
|
|
@options[:include_status] && SiteSetting.enable_user_status &&
|
|
!object.user_option&.hide_profile && object.has_status?
|
|
end
|
|
|
|
def status
|
|
UserStatusSerializer.new(object.user_status, root: false).as_json
|
|
end
|
|
end
|