From 0ae5ed8bdbfb668c432800627bff86c18e2ccf68 Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 23 Jul 2010 18:13:28 -0700 Subject: [PATCH 1/3] MS made safe pictures --- lib/common.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/common.rb b/lib/common.rb index 2359b2b70..6be3285f7 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -19,6 +19,7 @@ module Diaspora author[:service] = parse_service(doc) author[:feed_url] = parse_feed_url(doc) author[:avatar_thumbnail] = parse_avatar_thumbnail(doc) + author[:avatar_thumbnail] = nil if author[:avatar_thumbnail]== 0 author[:username] = parse_username(doc) author[:profile_url] = parse_profile_url(doc) author From 00159d1fb8ef7d37de17e83fe480337907116bd9 Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 23 Jul 2010 18:17:48 -0700 Subject: [PATCH 2/3] MS minor defaults change --- app/models/author.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/models/author.rb b/app/models/author.rb index 79c97dbb3..8b25ea831 100644 --- a/app/models/author.rb +++ b/app/models/author.rb @@ -8,10 +8,17 @@ class Author key :profile_url, String many :ostatus_posts, :class_name => 'OstatusPost', :foreign_key => :author_id - + before_save :set_defaults def self.instantiate(opts) author = Author.first(:feed_url => opts[:feed_url]) author ||= Author.create(opts) end + + private + + def set_defaults + self.avatar_thumbnail = nil if self.avatar_thumbnail == 0 + self.service = self.url if self.service == 0 + end end From 716fbc7bd485c6fe6e0c31c1526433117129e8bb Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 23 Jul 2010 18:18:31 -0700 Subject: [PATCH 3/3] fix url bug --- lib/common.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/common.rb b/lib/common.rb index 6be3285f7..2359b2b70 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -19,7 +19,6 @@ module Diaspora author[:service] = parse_service(doc) author[:feed_url] = parse_feed_url(doc) author[:avatar_thumbnail] = parse_avatar_thumbnail(doc) - author[:avatar_thumbnail] = nil if author[:avatar_thumbnail]== 0 author[:username] = parse_username(doc) author[:profile_url] = parse_profile_url(doc) author