vmail 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -100,6 +100,7 @@ module Vmail
100
100
  end
101
101
 
102
102
  def clear_cached_message
103
+ log "CLEARING CACHED MESSAGE"
103
104
  @current_mail = nil
104
105
  @current_message_index = nil
105
106
  @current_message = nil
@@ -441,6 +442,7 @@ module Vmail
441
442
  mail = data[:mail]
442
443
  size = data[:size]
443
444
  @current_message_index = index
445
+ log "- setting @current_mail"
444
446
  @current_mail = mail # used later to show raw message or extract attachments if any
445
447
  @current_message = data[:message_text]
446
448
  rescue
@@ -549,7 +551,6 @@ EOF
549
551
  end
550
552
  end
551
553
 
552
- clear_cached_message
553
554
  end
554
555
  end
555
556
 
@@ -677,13 +678,16 @@ EOF
677
678
 
678
679
  def reply_template(replyall=false)
679
680
  log "sending reply template"
681
+ if @current_mail.nil?
682
+ log "- missing @current mail!"
683
+ return nil
684
+ end
680
685
  # user reply_template class
681
686
  reply_headers = Vmail::ReplyTemplate.new(@current_mail, @username, @name, replyall).reply_headers
682
687
  body = reply_headers.delete(:body)
683
688
  format_headers(reply_headers) + "\n\n\n" + body + signature
684
689
  end
685
690
 
686
-
687
691
  def signature
688
692
  return '' unless @signature
689
693
  "\n\n#@signature"
@@ -21,14 +21,6 @@ module Vmail
21
21
  quote_header = "On #{date.strftime('%a, %b %d, %Y at %I:%M %p')}, #{sender} wrote:\n\n"
22
22
  body = quote_header + formatter.process_body.gsub(/^(?=>)/, ">").gsub(/^(?!>)/, "> ")
23
23
  {'from' => "#@name <#@username>", 'to' => primary_recipient, 'cc' => cc, 'subject' => subject, :body => body}
24
- rescue NoMethodError
25
- # a total hack TODO but stopgap
26
- if try_again
27
- sleep 0.3
28
- return reply_headers(false) # try one more time
29
- else
30
- raise
31
- end
32
24
  end
33
25
 
34
26
  def primary_recipient
@@ -1,3 +1,3 @@
1
1
  module Vmail
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.7"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 6
9
- version: 1.0.6
8
+ - 7
9
+ version: 1.0.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Daniel Choi