From 64543a9476b44e6bcc46d938dce65acdbb412020 Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Sat, 26 Jan 2013 17:12:52 -0800 Subject: [PATCH] attempt 3 at fixing conpherence mail handler Summary: you have to attach files and participants before you can start editing the conpherenece Test Plan: push it live and try again Reviewers: chad, epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2399 Differential Revision: https://secure.phabricator.com/D4674 --- .../conpherence/mail/ConpherenceReplyHandler.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/applications/conpherence/mail/ConpherenceReplyHandler.php b/src/applications/conpherence/mail/ConpherenceReplyHandler.php index aaa87db471..60aa0e152e 100644 --- a/src/applications/conpherence/mail/ConpherenceReplyHandler.php +++ b/src/applications/conpherence/mail/ConpherenceReplyHandler.php @@ -31,6 +31,22 @@ final class ConpherenceReplyHandler extends PhabricatorMailReplyHandler { protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { $conpherence = $this->getMailReceiver(); $user = $this->getActor(); + if (!$conpherence->getPHID()) { + $conpherence + ->attachParticipants(array()) + ->attachFilePHIDs(array()); + } else { + $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE; + $file_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( + $conpherence->getPHID(), + $edge_type + ); + $conpherence->attachFilePHIDs($file_phids); + $participants = id(new ConpherenceParticipant()) + ->loadAllWhere('conpherencePHID = %s', $conpherence->getPHID()); + $participants = mpull($participants, null, 'getParticipantPHID'); + $conpherence->attachParticipants($participants); + } $body = $mail->getCleanTextBody(); $body = trim($body);