3 class ComposeMode < EditMessageMode
4 attr_reader :body, :header
9 "From" => AccountManager.default_account.full_address,
10 "Message-Id" => gen_message_id,
13 @header["To"] = opts[:to].map { |p| p.full_address }.join(", ") if opts[:to]
14 @header["Cc"] = opts[:cc].map { |p| p.full_address }.join(", ") if opts[:cc]
15 @header["Bcc"] = opts[:bcc].map { |p| p.full_address }.join(", ") if opts[:bcc]
16 @header["Subject"] = opts[:subj] if opts[:subj]
18 @body = opts[:body] || sig_lines
22 def lines; @text.length; end
23 def [] i; @text[i]; end
27 def handle_new_text new_header, new_body
33 @text = header_lines(@header - EditMessageMode::NON_EDITABLE_HEADERS) + [""] + @body