about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-01-25 11:37:49 +0100
committerThibaut Girka <thib@sitedethib.com>2019-01-25 11:37:49 +0100
commit04e2c673898203683a8a56f4910d07ba0685ed86 (patch)
tree25578e5b80973833f6d25380a1abb32cc116018a /app/services
parentafec6b43eb856547ccc7083dbb677096d78821bf (diff)
parente1ec3a9f09add8a34b1a77ce217be8e51ebd4936 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/services')
-rw-r--r--app/services/post_status_service.rb5
-rw-r--r--app/services/verify_link_service.rb2
2 files changed, 5 insertions, 2 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index 68cffe915..e4b61ee35 100644
--- a/app/services/post_status_service.rb
+++ b/app/services/post_status_service.rb
@@ -69,7 +69,10 @@ class PostStatusService < BaseService
   end
 
   def schedule_status!
-    if @account.statuses.build(status_attributes).valid?
+    status_for_validation = @account.statuses.build(status_attributes)
+    if status_for_validation.valid?
+      status_for_validation.destroy
+
       # The following transaction block is needed to wrap the UPDATEs to
       # the media attachments when the scheduled status is created
 
diff --git a/app/services/verify_link_service.rb b/app/services/verify_link_service.rb
index c65578761..878a2188d 100644
--- a/app/services/verify_link_service.rb
+++ b/app/services/verify_link_service.rb
@@ -10,7 +10,7 @@ class VerifyLinkService < BaseService
     return unless link_back_present?
 
     field.mark_verified!
-  rescue HTTP::Error, Addressable::URI::InvalidURIError, Mastodon::HostValidationError, Mastodon::LengthValidationError => e
+  rescue OpenSSL::SSL::SSLError, HTTP::Error, Addressable::URI::InvalidURIError, Mastodon::HostValidationError, Mastodon::LengthValidationError => e
     Rails.logger.debug "Error fetching link #{@url}: #{e}"
     nil
   end