From 89ad5b96ad10c50c89fb6774cf3d7d1d84d7e06f Mon Sep 17 00:00:00 2001 From: Dennis Schubert Date: Sat, 8 Nov 2014 22:54:38 +0100 Subject: [PATCH] Add Camo for a profiles bio and location yes, we do have Markdown there. But please don't tell anyone. --- app/models/profile.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/models/profile.rb b/app/models/profile.rb index 11d44cd4f..6d8b4722b 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -142,6 +142,22 @@ class Profile < ActiveRecord::Base birthday.to_s(:long).gsub(', 1000', '') if birthday.present? 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 @bio_message ||= Diaspora::MessageRenderer.new(bio) end