discourse/app/serializers/reviewable_queued_post_serializer.rb
Robin Ward e47e0af123
FEATURE: Allow viewing of raw emails for reviewable queued posts (#7910)
If a post arrives via email but must be reviewed, we now show an
icon that can be clicked to view the raw contents of the email.

This is useful if Discourse's email parser is acting odd and the user
reviewing the post wants to know what the original contents were before
approving/rejecting the post.
2019-07-19 11:56:14 -04:00

33 lines
610 B
Ruby

# frozen_string_literal: true
class ReviewableQueuedPostSerializer < ReviewableSerializer
attributes :reply_to_post_number
payload_attributes(
:raw,
:title,
:archetype,
:category,
:visible,
:is_warning,
:first_post_checks,
:featured_link,
:is_poll,
:typing_duration_msecs,
:composer_open_duration_msecs,
:tags,
:via_email,
:raw_email
)
def reply_to_post_number
object.payload['reply_to_post_number'].to_i
end
def include_reply_to_post_number?
object.payload.present? && object.payload['reply_to_post_number'].present?
end
end