about summary refs log tree commit diff
path: root/app/models/account.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-26 15:45:35 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-26 15:45:35 +0100
commit8a4913fde0715f6fd6dafb3127c0017eaeb6f302 (patch)
tree3efca45dfb011ccbfb313dd3b7660102a2401f7d /app/models/account.rb
parent054138797f6f8a9d58ba14c806e8efeed8083abb (diff)
Public and hashtag timelines now exclude reblogs and replies
Fix #289 - don't download avatar unless the URL is http/https
Fix #293 - reblog/reblogged is now boost/boosted
Diffstat (limited to 'app/models/account.rb')
-rw-r--r--app/models/account.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index 870de8b7c..65fad2f47 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -116,7 +116,11 @@ class Account < ApplicationRecord
   end
 
   def avatar_remote_url=(url)
-    self.avatar = URI.parse(url) unless self[:avatar_remote_url] == url
+    parsed_url = URI.parse(url)
+
+    return if !%w(http https).include?(parsed_url.scheme) || self[:avatar_remote_url] == url
+
+    self.avatar              = parsed_url
     self[:avatar_remote_url] = url
   rescue OpenURI::HTTPError => e
     Rails.logger.debug "Error fetching remote avatar: #{e}"