Add Camo for a profiles bio and location

yes, we do have Markdown there. But please don't tell anyone.
This commit is contained in:
Dennis Schubert 2014-11-08 22:54:38 +01:00
parent 0a619749f2
commit 89ad5b96ad

View file

@ -142,6 +142,22 @@ class Profile < ActiveRecord::Base
birthday.to_s(:long).gsub(', 1000', '') if birthday.present? birthday.to_s(:long).gsub(', 1000', '') if birthday.present?
end end
def bio
if AppConfig.privacy.camo.proxy_markdown_images?
Diaspora::Camo::from_markdown(self[:bio])
else
self[:bio]
end
end
def location
if AppConfig.privacy.camo.proxy_markdown_images?
Diaspora::Camo::from_markdown(self[:location])
else
self[:location]
end
end
def bio_message def bio_message
@bio_message ||= Diaspora::MessageRenderer.new(bio) @bio_message ||= Diaspora::MessageRenderer.new(bio)
end end