Permalink
Browse files

Fix for Mail 2.4.1

  • Loading branch information...
1 parent 52e26c6 commit 5ece48c6b612ee4571c673753b1ce264ae866425 @rust rust committed Jan 23, 2012
Showing with 9 additions and 10 deletions.
  1. +1 −1 Gemfile
  2. +1 −1 Rakefile
  3. +7 −8 lib/jpmobile/mail.rb
View
@@ -2,7 +2,7 @@ source 'http://rubygems.org'
group :development, :test do
gem 'jeweler'
- gem 'rails', '~> 3.2.0.rc1'
+ gem 'rails', '~> 3.2.0'
gem 'rspec'
gem 'rspec-rails'
gem 'webrat'
View
@@ -22,7 +22,7 @@ begin
gem.files.exclude 'spec'
gem.files.exclude 'vendor'
- gem.add_development_dependency('rails', '>=3.1.0')
+ gem.add_development_dependency('rails', '>=3.2.0')
gem.add_development_dependency('jeweler', '>=1.5.1')
gem.add_development_dependency('rspec', '>=2.6.0')
gem.add_development_dependency('rspec-rails', '>=2.6.0')
View
@@ -66,7 +66,7 @@ def encoded_with_jpmobile
self.body.charset = @charset
self.body.mobile = @mobile
- self.header['Content-Transfer-Encoding'] = @mobile.content_transfer_encoding(self.header)
+ self.header['Content-Transfer-Encoding'].value = @mobile.content_transfer_encoding(self.header)
if @mobile.decorated?
unless self.content_type.match(/image\//)
self.header['Content-ID'] = nil
@@ -131,10 +131,6 @@ def process_body_raw_with_jpmobile
end
end
- def body_lazy_with_jpmobile(value, index)
- body_lazy_without_jpmobile(value, index)
- end
-
alias_method :encoded_without_jpmobile, :encoded
alias_method :encoded, :encoded_with_jpmobile
@@ -144,9 +140,6 @@ def body_lazy_with_jpmobile(value, index)
alias_method :process_body_raw_without_jpmobile, :process_body_raw
alias_method :process_body_raw, :process_body_raw_with_jpmobile
- alias_method :body_lazy_without_jpmobile, :body_lazy
- alias_method :body_lazy, :body_lazy_with_jpmobile
-
# -- docomo
# multipart/mixed
# |- multipart/related
@@ -424,6 +417,12 @@ class UnstructuredField
attr_accessor :mobile
end
+ class OptionalField
+ def charset
+ @charset =~ /iso-2022-jp/i ? 'UTF-8' : @charset
+ end
+ end
+
# for subject
class SubjectField < UnstructuredField
def encoded_with_jpmobile

0 comments on commit 5ece48c

Please sign in to comment.