Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15343202
D14997.id36230.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D14997.id36230.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -257,7 +257,6 @@
'ConpherenceConstants' => 'applications/conpherence/constants/ConpherenceConstants.php',
'ConpherenceController' => 'applications/conpherence/controller/ConpherenceController.php',
'ConpherenceCreateThreadConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceCreateThreadConduitAPIMethod.php',
- 'ConpherenceCreateThreadMailReceiver' => 'applications/conpherence/mail/ConpherenceCreateThreadMailReceiver.php',
'ConpherenceDAO' => 'applications/conpherence/storage/ConpherenceDAO.php',
'ConpherenceDurableColumnView' => 'applications/conpherence/view/ConpherenceDurableColumnView.php',
'ConpherenceEditor' => 'applications/conpherence/editor/ConpherenceEditor.php',
@@ -4193,7 +4192,6 @@
'ConpherenceConstants' => 'Phobject',
'ConpherenceController' => 'PhabricatorController',
'ConpherenceCreateThreadConduitAPIMethod' => 'ConpherenceConduitAPIMethod',
- 'ConpherenceCreateThreadMailReceiver' => 'PhabricatorMailReceiver',
'ConpherenceDAO' => 'PhabricatorLiskDAO',
'ConpherenceDurableColumnView' => 'AphrontTagView',
'ConpherenceEditor' => 'PhabricatorApplicationTransactionEditor',
diff --git a/src/applications/conpherence/mail/ConpherenceCreateThreadMailReceiver.php b/src/applications/conpherence/mail/ConpherenceCreateThreadMailReceiver.php
deleted file mode 100644
--- a/src/applications/conpherence/mail/ConpherenceCreateThreadMailReceiver.php
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-
-final class ConpherenceCreateThreadMailReceiver
- extends PhabricatorMailReceiver {
-
- public function isEnabled() {
- $app_class = 'PhabricatorConpherenceApplication';
- return PhabricatorApplication::isClassInstalled($app_class);
- }
-
- public function canAcceptMail(PhabricatorMetaMTAReceivedMail $mail) {
- $usernames = $this->getMailUsernames($mail);
- if (!$usernames) {
- return false;
- }
-
- $users = $this->loadMailUsers($mail);
- if (count($users) != count($usernames)) {
- // At least some of the addresses are not users, so don't accept this as
- // a new Conpherence thread.
- return false;
- }
-
- return true;
- }
-
- private function getMailUsernames(PhabricatorMetaMTAReceivedMail $mail) {
- $usernames = array();
- foreach ($mail->getToAddresses() as $to_address) {
- $address = self::stripMailboxPrefix($to_address);
- $usernames[] = id(new PhutilEmailAddress($address))->getLocalPart();
- }
-
- return array_unique($usernames);
- }
-
- private function loadMailUsers(PhabricatorMetaMTAReceivedMail $mail) {
- $usernames = $this->getMailUsernames($mail);
- if (!$usernames) {
- return array();
- }
-
- return id(new PhabricatorUser())->loadAllWhere(
- 'username in (%Ls)',
- $usernames);
- }
-
- protected function processReceivedMail(
- PhabricatorMetaMTAReceivedMail $mail,
- PhabricatorUser $sender) {
-
- $users = $this->loadMailUsers($mail);
- $phids = mpull($users, 'getPHID');
-
- $conpherence = id(new ConpherenceReplyHandler())
- ->setMailReceiver(ConpherenceThread::initializeNewRoom($sender))
- ->setMailAddedParticipantPHIDs($phids)
- ->setActor($sender)
- ->setExcludeMailRecipientPHIDs($mail->loadAllRecipientPHIDs())
- ->processEmail($mail);
-
- if ($conpherence) {
- $mail->setRelatedPHID($conpherence->getPHID());
- }
- }
-
-}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mar 10 2025, 10:15 PM (4 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7475890
Default Alt Text
D14997.id36230.diff (3 KB)
Attached To
Mode
D14997: Remove "username@phabricator.mycompany.com" creating a Conpherence
Attached
Detach File
Event Timeline
Log In to Comment