From 7f195145277d8e4e10ae086a99a30a83ec41b58d Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Thu, 18 Jul 2019 12:06:45 -0500 Subject: better handling of bangtag-only posts that produce no output --- app/lib/bangtags.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'app/lib') diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb index 40714097b..536606065 100644 --- a/app/lib/bangtags.rb +++ b/app/lib/bangtags.rb @@ -730,10 +730,14 @@ class Bangtags account.user.save - status.text = @chunks.join - status.save - - postprocess_after_save + text = @chunks.join + if text.blank? + RemoveStatusService.new.call(@status) + else + status.text = text + status.save + postprocess_after_save + end end private -- cgit