From 613f2d114272a9f90dece1c9ce3243462be1bdb6 Mon Sep 17 00:00:00 2001 From: Dennis Schubert Date: Sat, 8 Nov 2014 21:20:44 +0100 Subject: [PATCH] Add Camo for comments --- app/models/comment.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/models/comment.rb b/app/models/comment.rb index b71fcaa22..abc89f302 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -83,6 +83,14 @@ class Comment < ActiveRecord::Base @message ||= Diaspora::MessageRenderer.new text end + def text + if AppConfig.privacy.camo.proxy_markdown_images? + Diaspora::Camo::from_markdown(self[:text]) + else + self[:text] + end + end + def text= text self[:text] = text.to_s.strip #to_s if for nil, for whatever reason end