Explorar el Código

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 hace 7 años
committed by Rushabh Mehta
padre
commit
9d608d7178
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. +2
    -2
      frappe/email/doctype/email_account/email_account.py

+ 2
- 2
frappe/email/doctype/email_account/email_account.py Ver fichero

@@ -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,


Cargando…
Cancelar
Guardar