From 2615c785260ea168f0eb8d9fe2a8a6576a5392dd Mon Sep 17 00:00:00 2001 From: Jefferson Stachelski Date: Wed, 18 Nov 2015 19:36:33 -0200 Subject: Issue #494 - Fixed reply when the replayer is the sender --- service/pixelated/adapter/mailstore/leap_mailstore.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'service/pixelated') diff --git a/service/pixelated/adapter/mailstore/leap_mailstore.py b/service/pixelated/adapter/mailstore/leap_mailstore.py index e7b183db..21c85b74 100644 --- a/service/pixelated/adapter/mailstore/leap_mailstore.py +++ b/service/pixelated/adapter/mailstore/leap_mailstore.py @@ -152,21 +152,11 @@ class LeapMail(Mail): recipients = self.remove_duplicates(recipients) ccs = self._decoded_header_utf_8(self._reply_recipient('Cc')) - result['single'] = self._single_reply_recipient(recipients, sender_mail) + result['single'] = sender_mail result['all']['to-field'] = recipients result['all']['cc-field'] = ccs return result - def _single_reply_recipient(self, recipients, sender_mail): - """ - Currently the domain model expects only one single recipient for reply action. But it should support an array, - or even better: there should not be any conceptual difference between reply and reply all for this logic - """ - if self._parsed_mail_matches(sender_mail, InputMail.FROM_EMAIL_ADDRESS): - return recipients[0] - else: - return sender_mail - def remove_duplicates(self, recipients): return list(set(recipients)) @@ -175,7 +165,7 @@ class LeapMail(Mail): if not recipients: recipients = [] - return [recipient for recipient in recipients if not self._parsed_mail_matches(recipient, InputMail.FROM_EMAIL_ADDRESS)] + return recipients def _parsed_mail_matches(self, to_parse, expected): if InputMail.FROM_EMAIL_ADDRESS is None: -- cgit v1.2.3