From cb45e721ecf7ff7f98ee342bd7b8a224093a14b8 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Mon, 23 Dec 2019 12:00:35 -0600 Subject: add `queued:boosts` & `queued:posts` bangtags --- app/lib/bangtags.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'app') 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 = ['No action.'] 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 = ["

Queued roars


"] + @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 << "- #{preview}" + end + service_dm('announcer', @account, output.join("
"), content_type: 'text/html') + end end end -- cgit