sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 75e7e6b51b3213331f18b8a78cf1357bd93a596d
parent ccf259a58486a3ac38f06ca889231da503892591
Author: Gaute Hope <eg@gaute.vetsj.com>
Date:   Mon,  7 Oct 2013 13:11:24 +0200

Merge #147: fix_encoding! in top_positing? and mentions_attachment?

Diffstat:
M lib/sup/modes/edit_message_mode.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/sup/modes/edit_message_mode.rb b/lib/sup/modes/edit_message_mode.rb
@@ -643,12 +643,12 @@ private
     if HookManager.enabled? "mentions-attachments"
       HookManager.run "mentions-attachments", :header => @header, :body => @body
     else
-      @body.any? {  |l| l =~ /^[^>]/ && l =~ /\battach(ment|ed|ing|)\b/i }
+      @body.any? {  |l| l.fix_encoding! =~ /^[^>]/ && l.fix_encoding! =~ /\battach(ment|ed|ing|)\b/i }
     end
   end
 
   def top_posting?
-    @body.join("\n") =~ /(\S+)\s*Excerpts from.*\n(>.*\n)+\s*\Z/
+    @body.map { |x| x.fix_encoding! }.join("\n").fix_encoding! =~ /(\S+)\s*Excerpts from.*\n(>.*\n)+\s*\Z/
   end
 
   def sig_lines