]> git.openstreetmap.org Git - rails.git/commitdiff
Remove backported code now we are using mail 2.4.1
authorTom Hughes <tom@compton.nu>
Mon, 30 Jan 2012 22:53:40 +0000 (22:53 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 15 Feb 2012 17:48:16 +0000 (17:48 +0000)
config/initializers/mail.rb

index d44854414cc6af91fb28b8ade61840261afae902..b93c3f6d25749619fd91be8f6dd980dd8470fda7 100644 (file)
@@ -22,38 +22,4 @@ module Mail
       str
     end
   end
-
-  class Message
-    def decoded_with_text
-      if self.text?
-        decode_body_as_text
-      else
-        decoded_without_text
-      end
-    end
-
-    alias_method_chain :decoded, :text
-
-    def text?
-      has_content_type? ? !!(main_type =~ /^text$/i) : false
-    end
-
-  private
-
-    def decode_body_as_text
-      body_text = body.decoded
-      if charset
-        if RUBY_VERSION < '1.9'
-          require 'iconv'
-          return Iconv.conv("UTF-8//TRANSLIT//IGNORE", charset, body_text)
-        else
-          if encoding = Encoding.find(charset) rescue nil
-            body_text.force_encoding(encoding)
-            return body_text.encode(Encoding::UTF_8)
-          end
-        end
-      end
-      body_text
-    end    
-  end
 end