瀏覽代碼

Optimize regex to find parent of mail (#4440)

Made the Regex case insensitive and changed the regex to show only the lowercase (which will save some space). Added the aw and wg for german answer and forwarding.

I will add more languages based on this list https://en.wikipedia.org/wiki/List_of_email_subject_abbreviations after more research.
version-14
ci2014 7 年之前
committed by Rushabh Mehta
父節點
當前提交
9d608d7178
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. +2
    -2
      frappe/email/doctype/email_account/email_account.py

+ 2
- 2
frappe/email/doctype/email_account/email_account.py 查看文件

@@ -457,8 +457,8 @@ class EmailAccount(Document):
# try and match by subject and sender
# if sent by same sender with same subject,
# append it to old coversation
subject = frappe.as_unicode(strip(re.sub("(^\s*(Fw|FW|fwd)[^:]*:|\s*(Re|RE)[^:]*:\s*)*",
"", email.subject)))
subject = frappe.as_unicode(strip(re.sub("(^\s*(fw|fwd|wg)[^:]*:|\s*(re|aw)[^:]*:\s*)*",
"", email.subject, 0, flags=re.IGNORECASE)))

parent = frappe.db.get_all(self.append_to, filters={
self.sender_field: email.from_email,


Loading…
取消
儲存