Improve status title more

This commit is contained in:
noellabo 2020-05-12 09:26:35 +09:00
parent fc8d4a7a0c
commit e93cd2b5f2

View file

@ -22,9 +22,9 @@ class RSS::Serializer
return "#{status.account.acct} deleted status" if status.destroyed? return "#{status.account.acct} deleted status" if status.destroyed?
preview = status.proper.spoiler_text.presence || status.proper.text preview = status.proper.spoiler_text.presence || status.proper.text
if preview.length > 30 || preview[0, 30].include?("\n") if preview.length > 60 || preview[0, 60].include?("\n")
preview = preview[0, 30] preview = preview[0, 60]
preview = preview[0, preview.index("\n").presence || 30] + '…' preview = preview[0, preview.index("\n").presence || 60] + '…'
end end
preview = "#{status.proper.spoiler_text.present? ? 'CW ' : ''}#{preview}#{status.proper.sensitive? ? ' (sensitive)' : ''}" preview = "#{status.proper.spoiler_text.present? ? 'CW ' : ''}#{preview}#{status.proper.sensitive? ? ' (sensitive)' : ''}"