Ticket #188: update-by-subject-enhancement.patch
File update-by-subject-enhancement.patch, 1.4 KB (added by Konstantin Ryabitsev <icon@…>, 14 years ago) |
---|
-
email2trac.py.in
old new 949 950 matched_id = None 950 951 if self.parameters.ticket_update and self.parameters.ticket_update_by_subject: 951 952 952 SUBJECT_RE = re.compile(r'^( RE|AW|VS|SV):(.*:)*\s*(.*)', re.IGNORECASE)953 SUBJECT_RE = re.compile(r'^(?:(?:RE|AW|VS|SV|FW|FWD):\s*)+(.*)', re.IGNORECASE) 953 954 result = SUBJECT_RE.search(subject) 954 955 955 956 if result: 956 957 ## This is a reply 957 958 # 958 orig_subject = result.group( 3)959 orig_subject = result.group(1) 959 960 960 961 self.logger.debug('subject search string: %s' %(orig_subject)) 961 962 … … 985 986 986 987 if matched_id: 987 988 matched_id = '#%d' % matched_id 988 return matched_id 989 return (matched_id, orig_subject) 990 991 subject = orig_subject 989 992 990 return matched_id993 return (matched_id, subject) 991 994 992 995 993 996 def new_ticket(self, msg, subject, spam, set_fields = None): … … 1586 1590 1587 1591 else: 1588 1592 self.system = 'ticket' 1589 result= self.ticket_update_by_subject(subject)1590 if result:1591 if not self.ticket_update(m, result, spam_msg):1593 (matched_id, subject) = self.ticket_update_by_subject(subject) 1594 if matched_id: 1595 if not self.ticket_update(m, matched_id, spam_msg): 1592 1596 self.new_ticket(m, subject, spam_msg) 1593 1597 else: 1594 1598 ## No update by subject, so just create a new ticket