def match(self, message): reporter = emailaddr2user(self.env, message['from']) reply_to_ticket = ReplyToTicket(self.env) perm = PermissionCache(self.env, reporter) if 'TICKET_ADD_HOURS' in perm('ticket', reply_to_ticket.ticket(message).id): return bool(reply_to_ticket.ticket(message)) else: return False
def match(self, message): reporter = emailaddr2user(self.env, message['from']) reply_to_ticket = ReplyToTicket(self.env) perm = PermissionCache(self.env, reporter) if not perm.has_permission('TICKET_ADD_HOURS'): return False return bool(reply_to_ticket.ticket(message))
def invoke(self, message, warnings): reply_to_ticket = ReplyToTicket(self.env) ticket = reply_to_ticket.ticket(message) payload = message.get_payload() if isinstance(payload, basestring): if message.get('Content-Disposition', 'inline') == 'inline' and message.get_content_maintype() == 'text': message.set_payload(self.munge_comment(payload, ticket)) else: for _message in payload: self.invoke(_message, warnings) return message
def invoke(self, message, warnings): reply_to_ticket = ReplyToTicket(self.env) ticket = reply_to_ticket.ticket(message) payload = message.get_payload() if isinstance(payload, basestring): if message.get('Content-Disposition', 'inline') == 'inline' \ and message.get_content_maintype() == 'text': message.set_payload(self.munge_comment(payload, ticket)) else: for _message in payload: self.invoke(_message, warnings) return message