vmail 0.5.8 → 0.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -515,10 +515,10 @@ EOF
515
515
  end
516
516
 
517
517
 
518
- def new_message_template
518
+ def new_message_template(subject = nil)
519
519
  headers = {'from' => "#{@name} <#{@username}>",
520
520
  'to' => nil,
521
- 'subject' => nil
521
+ 'subject' => subject
522
522
  }
523
523
  format_headers(headers) + "\n\n" + signature
524
524
  end
@@ -550,7 +550,13 @@ EOF
550
550
 
551
551
  def forward_template
552
552
  original_body = @current_message.split(/\n-{20,}\n/, 2)[1]
553
- new_message_template +
553
+ formatter = Vmail::MessageFormatter.new(@current_mail)
554
+ headers = formatter.extract_headers
555
+ subject = headers['subject']
556
+ if subject !~ /Fwd: /
557
+ subject = "Fwd: #{subject}"
558
+ end
559
+ new_message_template(subject) +
554
560
  "\n---------- Forwarded message ----------\n" +
555
561
  original_body + signature
556
562
  end
@@ -23,6 +23,11 @@ module Vmail
23
23
  {'from' => "#@name <#@username>", 'to' => primary_recipient, 'cc' => cc, 'subject' => subject, :body => body}
24
24
  end
25
25
 
26
+ # just stick this here
27
+ def forward_headers
28
+
29
+ end
30
+
26
31
  def primary_recipient
27
32
  from = @mail.header['from']
28
33
  reply_to = @mail.header['reply-to']
@@ -1,3 +1,3 @@
1
1
  module Vmail
2
- VERSION = "0.5.8"
2
+ VERSION = "0.5.9"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 5
8
- - 8
9
- version: 0.5.8
8
+ - 9
9
+ version: 0.5.9
10
10
  platform: ruby
11
11
  authors:
12
12
  - Daniel Choi