Added GroupPinnedStatuses
• Added: - GroupPinnedStatuses - controllers for timeline, creation, deletion - redux actions, reducers for creation, deletion - timeline fetching in timelines action - options to pin, unpin in status options popover for group admin
This commit is contained in:
@@ -11,6 +11,7 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
||||
attribute :muted, if: :current_user?
|
||||
attribute :bookmarked, if: :current_user?
|
||||
attribute :pinned, if: :pinnable?
|
||||
attribute :pinned_by_group, if: :pinnable_by_group?
|
||||
|
||||
attribute :content, unless: :source_requested?
|
||||
attribute :rich_content, unless: :source_requested?
|
||||
@@ -141,6 +142,22 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
||||
%w(public unlisted).include?(object.visibility)
|
||||
end
|
||||
|
||||
def pinned_by_group
|
||||
if instance_options && instance_options[:relationships]
|
||||
instance_options[:relationships].group_pins_map[object.id] || false
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def pinnable_by_group?
|
||||
if object.group_id?
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def source_requested?
|
||||
instance_options[:source_requested]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user