Skip to content

Commit

Permalink
Normalize newlines so they don't stop threading logic #17
Browse files Browse the repository at this point in the history
  • Loading branch information
Grant T. Olson committed Aug 7, 2013
1 parent 2cad1bd commit a0ee566
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/bmf/lib/message_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ def add_message msgid,m
m["subject"] = " " if m["subject"] == ""
m["subject"] = "Re: " if m["subject"] == "Re: "

if m["message"].include?("\r")
m["message"] = m["message"].gsub("\r\n","\n").gsub("\n\r","\n")
end


@messages[msgid] = m

to_address = m["toAddress"]
Expand Down
2 changes: 2 additions & 0 deletions lib/bmf/lib/threaded_messages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ def initialize
def insert message
msg = BMF::ThreadedMessage.new(message)

puts msg.message['message'].inspect

@children.each do |c|
c.suspected_orphan(msg)
end
Expand Down

0 comments on commit a0ee566

Please sign in to comment.