diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/lib/bangtags.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb index a9b7d747b..fb502ea70 100644 --- a/app/lib/bangtags.rb +++ b/app/lib/bangtags.rb @@ -888,6 +888,27 @@ class Bangtags end output = ['<em>No action.</em>'] if output.blank? chunk = output.join("\n") + "\n" + when 'queued', 'scheduled' + chunk = nil + next if cmd[1].nil? + case cmd[1].downcase + when 'boosts', 'repeats' + output = ["# Queued boosts\n"] + @account.queued_boosts.find_each do |q| + output << "\\- [#{q.status_id}](#{TagManager.instance.url_for(q.status_id)})" + end + service_dm('announcer', @account, output.join("\n")) + when 'posts', 'statuses', 'roars' + output = ["<h1>Queued roars</h1><br>"] + @account.scheduled_statuses.find_each do |s| + preview = s.params['spoiler_text'] || s.params['text'] + preview = '[no body text]' if preview.blank? + preview = preview[0..50] + preview = html_entities.encode(preview) + output << "- <a href=\"#{TagManager.instance.url_for(s.status_id)}\">#{preview}</a>" + end + service_dm('announcer', @account, output.join("<br>"), content_type: 'text/html') + end end end |