Permalink
Browse files

strip email improvements

  • Loading branch information...
1 parent 1b3cd73 commit d8ca280a378df05e1eb3d636e50fa5c8d897825d Fabrizio Sestito committed Dec 16, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 threaded_messages/utils.py
@@ -83,7 +83,7 @@ def reply_to_thread(thread,sender, body):
"message": new_message}, sender=sender)
return (thread, new_message)
-
+
def get_lines(body):
body = body.replace('\r', ' ')
@@ -112,7 +112,8 @@ def strip_mail(body):
while not lines[popme]:
lines.pop(popme)
popme -=1
- lines.pop(popme)
+ if re.search(r'^.*?([0-1][0-9]|[2][0-3]):([0-5][0-9]).*?$', lines[popme]) or re.search(r'[\w-]+@([\w-]+\.)+[\w-]+', lines[popme]):
+ lines.pop(popme)
break
stripped_lines = [s for s in lines if not s.lstrip().startswith('>')]

0 comments on commit d8ca280

Please sign in to comment.