def status_line(s, time_format, indent = 0)
return '' unless s
text = TermColor.escape(s.text)
color = config.plugins.stdout.colors[s.user.id.to_i % config.plugins.stdout.colors.size]
status_id = Termtter::Client.data_to_typable_id(s.id)
reply_to_status_id =
if s.in_reply_to_status_id.nil?
nil
else
Termtter::Client.data_to_typable_id(s.in_reply_to_status_id)
end
time = "(#{Time.parse(s.created_at).strftime(time_format)})"
source =
case s.source
when />(.*?)</ then $1
when 'web' then 'web'
end
erbed_text = ERB.new(config.plugins.stdout.timeline_format).result(binding)
indent_text = indent > 0 ? "#{' ' * (indent - 1)} ┗ " : ''
text = TermColor.parse(indent_text + erbed_text) + "\n"
text = TermColor.unescape(text)
if config.plugins.stdout.show_as_thread && s.in_reply_to_status_id
text << status_line(Status[s.in_reply_to_status_id], time_format, indent + 1)
end
text
end