@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove mailing lists application

Summary: Ref T8387. This is now completely obsoleted by mailing list users.

Test Plan: Grepped for `mailinglist` and related symbols.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: eadler, epriestley

Maniphest Tasks: T8387

Differential Revision: https://secure.phabricator.com/D13129

+1 -714
-24
src/__phutil_library_map__.php
··· 2020 2020 'PhabricatorMailReplyHandler' => 'applications/metamta/replyhandler/PhabricatorMailReplyHandler.php', 2021 2021 'PhabricatorMailSetupCheck' => 'applications/config/check/PhabricatorMailSetupCheck.php', 2022 2022 'PhabricatorMailgunConfigOptions' => 'applications/config/option/PhabricatorMailgunConfigOptions.php', 2023 - 'PhabricatorMailingListDatasource' => 'applications/mailinglists/typeahead/PhabricatorMailingListDatasource.php', 2024 - 'PhabricatorMailingListListPHIDType' => 'applications/mailinglists/phid/PhabricatorMailingListListPHIDType.php', 2025 - 'PhabricatorMailingListQuery' => 'applications/mailinglists/query/PhabricatorMailingListQuery.php', 2026 - 'PhabricatorMailingListSearchEngine' => 'applications/mailinglists/query/PhabricatorMailingListSearchEngine.php', 2027 - 'PhabricatorMailingListsApplication' => 'applications/mailinglists/application/PhabricatorMailingListsApplication.php', 2028 - 'PhabricatorMailingListsController' => 'applications/mailinglists/controller/PhabricatorMailingListsController.php', 2029 - 'PhabricatorMailingListsEditController' => 'applications/mailinglists/controller/PhabricatorMailingListsEditController.php', 2030 - 'PhabricatorMailingListsListController' => 'applications/mailinglists/controller/PhabricatorMailingListsListController.php', 2031 - 'PhabricatorMailingListsManageCapability' => 'applications/mailinglists/capability/PhabricatorMailingListsManageCapability.php', 2032 2023 'PhabricatorMainMenuSearchView' => 'view/page/menu/PhabricatorMainMenuSearchView.php', 2033 2024 'PhabricatorMainMenuView' => 'view/page/menu/PhabricatorMainMenuView.php', 2034 2025 'PhabricatorManagementWorkflow' => 'infrastructure/management/PhabricatorManagementWorkflow.php', ··· 2067 2058 'PhabricatorMetaMTAMailableDatasource' => 'applications/metamta/typeahead/PhabricatorMetaMTAMailableDatasource.php', 2068 2059 'PhabricatorMetaMTAMailableFunctionDatasource' => 'applications/metamta/typeahead/PhabricatorMetaMTAMailableFunctionDatasource.php', 2069 2060 'PhabricatorMetaMTAMailgunReceiveController' => 'applications/metamta/controller/PhabricatorMetaMTAMailgunReceiveController.php', 2070 - 'PhabricatorMetaMTAMailingList' => 'applications/mailinglists/storage/PhabricatorMetaMTAMailingList.php', 2071 2061 'PhabricatorMetaMTAMemberQuery' => 'applications/metamta/query/PhabricatorMetaMTAMemberQuery.php', 2072 2062 'PhabricatorMetaMTAPermanentFailureException' => 'applications/metamta/exception/PhabricatorMetaMTAPermanentFailureException.php', 2073 2063 'PhabricatorMetaMTAReceivedMail' => 'applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php', ··· 5435 5425 'PhabricatorMailReceiverTestCase' => 'PhabricatorTestCase', 5436 5426 'PhabricatorMailSetupCheck' => 'PhabricatorSetupCheck', 5437 5427 'PhabricatorMailgunConfigOptions' => 'PhabricatorApplicationConfigOptions', 5438 - 'PhabricatorMailingListDatasource' => 'PhabricatorTypeaheadDatasource', 5439 - 'PhabricatorMailingListListPHIDType' => 'PhabricatorPHIDType', 5440 - 'PhabricatorMailingListQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 5441 - 'PhabricatorMailingListSearchEngine' => 'PhabricatorApplicationSearchEngine', 5442 - 'PhabricatorMailingListsApplication' => 'PhabricatorApplication', 5443 - 'PhabricatorMailingListsController' => 'PhabricatorController', 5444 - 'PhabricatorMailingListsEditController' => 'PhabricatorMailingListsController', 5445 - 'PhabricatorMailingListsListController' => 'PhabricatorMailingListsController', 5446 - 'PhabricatorMailingListsManageCapability' => 'PhabricatorPolicyCapability', 5447 5428 'PhabricatorMainMenuSearchView' => 'AphrontView', 5448 5429 'PhabricatorMainMenuView' => 'AphrontView', 5449 5430 'PhabricatorManagementWorkflow' => 'PhutilArgumentWorkflow', ··· 5477 5458 'PhabricatorMetaMTAMailableDatasource' => 'PhabricatorTypeaheadCompositeDatasource', 5478 5459 'PhabricatorMetaMTAMailableFunctionDatasource' => 'PhabricatorTypeaheadCompositeDatasource', 5479 5460 'PhabricatorMetaMTAMailgunReceiveController' => 'PhabricatorMetaMTAController', 5480 - 'PhabricatorMetaMTAMailingList' => array( 5481 - 'PhabricatorMetaMTADAO', 5482 - 'PhabricatorPolicyInterface', 5483 - 'PhabricatorDestructibleInterface', 5484 - ), 5485 5461 'PhabricatorMetaMTAMemberQuery' => 'PhabricatorQuery', 5486 5462 'PhabricatorMetaMTAPermanentFailureException' => 'Exception', 5487 5463 'PhabricatorMetaMTAReceivedMail' => 'PhabricatorMetaMTADAO',
-1
src/applications/differential/customfield/DifferentialSubscribersField.php
··· 78 78 array( 79 79 PhabricatorPeopleUserPHIDType::TYPECONST, 80 80 PhabricatorProjectProjectPHIDType::TYPECONST, 81 - PhabricatorMailingListListPHIDType::TYPECONST, 82 81 )); 83 82 } 84 83
-48
src/applications/mailinglists/application/PhabricatorMailingListsApplication.php
··· 1 - <?php 2 - 3 - final class PhabricatorMailingListsApplication extends PhabricatorApplication { 4 - 5 - public function getName() { 6 - return pht('Mailing Lists'); 7 - } 8 - 9 - public function getBaseURI() { 10 - return '/mailinglists/'; 11 - } 12 - 13 - public function getShortDescription() { 14 - return pht('Manage External Lists'); 15 - } 16 - 17 - public function getFontIcon() { 18 - return 'fa-mail-reply-all'; 19 - } 20 - 21 - public function getApplicationGroup() { 22 - return self::GROUP_ADMIN; 23 - } 24 - 25 - public function getRoutes() { 26 - return array( 27 - '/mailinglists/' => array( 28 - '(?:query/(?P<queryKey>[^/]+)/)?' 29 - => 'PhabricatorMailingListsListController', 30 - 'edit/(?:(?P<id>[1-9]\d*)/)?' 31 - => 'PhabricatorMailingListsEditController', 32 - ), 33 - ); 34 - } 35 - 36 - public function getTitleGlyph() { 37 - return '@'; 38 - } 39 - 40 - protected function getCustomCapabilities() { 41 - return array( 42 - PhabricatorMailingListsManageCapability::CAPABILITY => array( 43 - 'default' => PhabricatorPolicies::POLICY_ADMIN, 44 - ), 45 - ); 46 - } 47 - 48 - }
-16
src/applications/mailinglists/capability/PhabricatorMailingListsManageCapability.php
··· 1 - <?php 2 - 3 - final class PhabricatorMailingListsManageCapability 4 - extends PhabricatorPolicyCapability { 5 - 6 - const CAPABILITY = 'mailinglists.manage'; 7 - 8 - public function getCapabilityName() { 9 - return pht('Can Manage Lists'); 10 - } 11 - 12 - public function describeCapabilityRejection() { 13 - return pht('You do not have permission to manage mailing lists.'); 14 - } 15 - 16 - }
-45
src/applications/mailinglists/controller/PhabricatorMailingListsController.php
··· 1 - <?php 2 - 3 - abstract class PhabricatorMailingListsController extends PhabricatorController { 4 - 5 - public function buildSideNavView($for_app = false) { 6 - $user = $this->getRequest()->getUser(); 7 - 8 - $nav = new AphrontSideNavFilterView(); 9 - $nav->setBaseURI(new PhutilURI($this->getApplicationURI())); 10 - 11 - if ($for_app) { 12 - $nav->addFilter('edit', pht('Create List')); 13 - } 14 - 15 - id(new PhabricatorMailingListSearchEngine()) 16 - ->setViewer($user) 17 - ->addNavigationItems($nav->getMenu()); 18 - 19 - $nav->selectFilter(null); 20 - 21 - return $nav; 22 - } 23 - 24 - public function buildApplicationMenu() { 25 - return $this->buildSideNavView(true)->getMenu(); 26 - } 27 - 28 - protected function buildApplicationCrumbs() { 29 - $crumbs = parent::buildApplicationCrumbs(); 30 - 31 - $can_manage = $this->hasApplicationCapability( 32 - PhabricatorMailingListsManageCapability::CAPABILITY); 33 - 34 - $crumbs->addAction( 35 - id(new PHUIListItemView()) 36 - ->setName(pht('Create List')) 37 - ->setHref($this->getApplicationURI('edit/')) 38 - ->setIcon('fa-plus-square') 39 - ->setDisabled(!$can_manage) 40 - ->setWorkflow(!$can_manage)); 41 - 42 - return $crumbs; 43 - } 44 - 45 - }
-131
src/applications/mailinglists/controller/PhabricatorMailingListsEditController.php
··· 1 - <?php 2 - 3 - final class PhabricatorMailingListsEditController 4 - extends PhabricatorMailingListsController { 5 - 6 - public function handleRequest(AphrontRequest $request) { 7 - $request = $this->getRequest(); 8 - $viewer = $request->getUser(); 9 - 10 - $this->requireApplicationCapability( 11 - PhabricatorMailingListsManageCapability::CAPABILITY); 12 - 13 - $list_id = $request->getURIData('id'); 14 - if ($list_id) { 15 - $page_title = pht('Edit Mailing List'); 16 - $list = id(new PhabricatorMailingListQuery()) 17 - ->setViewer($viewer) 18 - ->withIDs(array($list_id)) 19 - ->executeOne(); 20 - if (!$list) { 21 - return new Aphront404Response(); 22 - } 23 - } else { 24 - $page_title = pht('Create Mailing List'); 25 - $list = new PhabricatorMetaMTAMailingList(); 26 - } 27 - 28 - $e_email = true; 29 - $e_uri = null; 30 - $e_name = true; 31 - $errors = array(); 32 - 33 - $crumbs = $this->buildApplicationCrumbs(); 34 - 35 - if ($request->isFormPost()) { 36 - $list->setName($request->getStr('name')); 37 - $list->setEmail($request->getStr('email')); 38 - $list->setURI($request->getStr('uri')); 39 - 40 - $e_email = null; 41 - $e_name = null; 42 - 43 - if (!strlen($list->getEmail())) { 44 - $e_email = pht('Required'); 45 - $errors[] = pht('Email is required.'); 46 - } 47 - 48 - if (!strlen($list->getName())) { 49 - $e_name = pht('Required'); 50 - $errors[] = pht('Name is required.'); 51 - } else if (preg_match('/[ ,]/', $list->getName())) { 52 - $e_name = pht('Invalid'); 53 - $errors[] = pht('Name must not contain spaces or commas.'); 54 - } 55 - 56 - if ($list->getURI()) { 57 - if (!PhabricatorEnv::isValidRemoteURIForLink($list->getURI())) { 58 - $e_uri = pht('Invalid'); 59 - $errors[] = pht('Mailing list URI must point to a valid web page.'); 60 - } 61 - } 62 - 63 - if (!$errors) { 64 - try { 65 - $list->save(); 66 - return id(new AphrontRedirectResponse()) 67 - ->setURI($this->getApplicationURI()); 68 - } catch (AphrontDuplicateKeyQueryException $ex) { 69 - $e_email = pht('Duplicate'); 70 - $errors[] = pht('Another mailing list already uses that address.'); 71 - } 72 - } 73 - } 74 - 75 - $form = new AphrontFormView(); 76 - $form->setUser($request->getUser()); 77 - if ($list->getID()) { 78 - $form->setAction($this->getApplicationURI('/edit/'.$list->getID().'/')); 79 - } else { 80 - $form->setAction($this->getApplicationURI('/edit/')); 81 - } 82 - 83 - $form 84 - ->appendChild( 85 - id(new AphrontFormTextControl()) 86 - ->setLabel(pht('Email')) 87 - ->setName('email') 88 - ->setValue($list->getEmail()) 89 - ->setCaption(pht('Email will be delivered to this address.')) 90 - ->setError($e_email)) 91 - ->appendChild( 92 - id(new AphrontFormTextControl()) 93 - ->setLabel(pht('Name')) 94 - ->setName('name') 95 - ->setError($e_name) 96 - ->setCaption(pht('Human-readable display and autocomplete name.')) 97 - ->setValue($list->getName())) 98 - ->appendChild( 99 - id(new AphrontFormTextControl()) 100 - ->setLabel(pht('URI')) 101 - ->setName('uri') 102 - ->setError($e_uri) 103 - ->setCaption(pht('Optional link to mailing list archives or info.')) 104 - ->setValue($list->getURI())) 105 - ->appendChild( 106 - id(new AphrontFormSubmitControl()) 107 - ->setValue(pht('Save')) 108 - ->addCancelButton($this->getApplicationURI())); 109 - 110 - if ($list->getID()) { 111 - $crumbs->addTextCrumb(pht('Edit Mailing List')); 112 - } else { 113 - $crumbs->addTextCrumb(pht('Create Mailing List')); 114 - } 115 - 116 - $form_box = id(new PHUIObjectBoxView()) 117 - ->setHeaderText($page_title) 118 - ->setFormErrors($errors) 119 - ->setForm($form); 120 - 121 - return $this->buildApplicationPage( 122 - array( 123 - $crumbs, 124 - $form_box, 125 - ), 126 - array( 127 - 'title' => $page_title, 128 - )); 129 - } 130 - 131 - }
-25
src/applications/mailinglists/controller/PhabricatorMailingListsListController.php
··· 1 - <?php 2 - 3 - final class PhabricatorMailingListsListController 4 - extends PhabricatorMailingListsController { 5 - 6 - private $queryKey; 7 - 8 - public function shouldAllowPublic() { 9 - return true; 10 - } 11 - 12 - public function willProcessRequest(array $data) { 13 - $this->queryKey = idx($data, 'queryKey'); 14 - } 15 - 16 - public function processRequest() { 17 - $controller = id(new PhabricatorApplicationSearchController()) 18 - ->setQueryKey($this->queryKey) 19 - ->setSearchEngine(new PhabricatorMailingListSearchEngine()) 20 - ->setNavigation($this->buildSideNavView()); 21 - 22 - return $this->delegateToController($controller); 23 - } 24 - 25 - }
-71
src/applications/mailinglists/phid/PhabricatorMailingListListPHIDType.php
··· 1 - <?php 2 - 3 - final class PhabricatorMailingListListPHIDType extends PhabricatorPHIDType { 4 - 5 - const TYPECONST = 'MLST'; 6 - 7 - public function getTypeName() { 8 - return pht('Mailing List'); 9 - } 10 - 11 - public function getTypeIcon() { 12 - return 'fa-envelope-o'; 13 - } 14 - 15 - public function newObject() { 16 - return new PhabricatorMetaMTAMailingList(); 17 - } 18 - 19 - protected function buildQueryForObjects( 20 - PhabricatorObjectQuery $query, 21 - array $phids) { 22 - 23 - return id(new PhabricatorMailingListQuery()) 24 - ->withPHIDs($phids); 25 - } 26 - 27 - public function loadHandles( 28 - PhabricatorHandleQuery $query, 29 - array $handles, 30 - array $objects) { 31 - 32 - foreach ($handles as $phid => $handle) { 33 - $list = $objects[$phid]; 34 - 35 - $handle->setName($list->getName()); 36 - $handle->setURI($list->getURI()); 37 - } 38 - } 39 - 40 - public function canLoadNamedObject($name) { 41 - return preg_match('/^.+@.+/', $name); 42 - } 43 - 44 - public function loadNamedObjects( 45 - PhabricatorObjectQuery $query, 46 - array $names) { 47 - 48 - $id_map = array(); 49 - foreach ($names as $name) { 50 - // Maybe normalize these some day? 51 - $id = $name; 52 - $id_map[$id][] = $name; 53 - } 54 - 55 - $objects = id(new PhabricatorMailingListQuery()) 56 - ->setViewer($query->getViewer()) 57 - ->withEmails(array_keys($id_map)) 58 - ->execute(); 59 - 60 - $results = array(); 61 - foreach ($objects as $id => $object) { 62 - $email = $object->getEmail(); 63 - foreach (idx($id_map, $email, array()) as $name) { 64 - $results[$name] = $object; 65 - } 66 - } 67 - 68 - return $results; 69 - } 70 - 71 - }
-86
src/applications/mailinglists/query/PhabricatorMailingListQuery.php
··· 1 - <?php 2 - 3 - final class PhabricatorMailingListQuery 4 - extends PhabricatorCursorPagedPolicyAwareQuery { 5 - 6 - private $phids; 7 - private $ids; 8 - private $emails; 9 - private $names; 10 - 11 - public function withIDs($ids) { 12 - $this->ids = $ids; 13 - return $this; 14 - } 15 - 16 - public function withPHIDs($phids) { 17 - $this->phids = $phids; 18 - return $this; 19 - } 20 - 21 - public function withEmails(array $emails) { 22 - $this->emails = $emails; 23 - return $this; 24 - } 25 - 26 - public function withNames(array $names) { 27 - $this->names = $names; 28 - return $this; 29 - } 30 - 31 - protected function loadPage() { 32 - $table = new PhabricatorMetaMTAMailingList(); 33 - $conn_r = $table->establishConnection('r'); 34 - 35 - $data = queryfx_all( 36 - $conn_r, 37 - 'SELECT * FROM %T %Q %Q %Q', 38 - $table->getTableName(), 39 - $this->buildWhereClause($conn_r), 40 - $this->buildOrderClause($conn_r), 41 - $this->buildLimitClause($conn_r)); 42 - 43 - return $table->loadAllFromArray($data); 44 - } 45 - 46 - protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { 47 - $where = array(); 48 - 49 - if ($this->ids) { 50 - $where[] = qsprintf( 51 - $conn_r, 52 - 'id IN (%Ld)', 53 - $this->ids); 54 - } 55 - 56 - if ($this->phids) { 57 - $where[] = qsprintf( 58 - $conn_r, 59 - 'phid IN (%Ls)', 60 - $this->phids); 61 - } 62 - 63 - if ($this->names) { 64 - $where[] = qsprintf( 65 - $conn_r, 66 - 'name IN (%Ls)', 67 - $this->names); 68 - } 69 - 70 - if ($this->emails) { 71 - $where[] = qsprintf( 72 - $conn_r, 73 - 'email IN (%Ls)', 74 - $this->emails); 75 - } 76 - 77 - $where[] = $this->buildPagingClause($conn_r); 78 - 79 - return $this->formatWhereClause($where); 80 - } 81 - 82 - public function getQueryApplicationClass() { 83 - return 'PhabricatorMailingListsApplication'; 84 - } 85 - 86 - }
-91
src/applications/mailinglists/query/PhabricatorMailingListSearchEngine.php
··· 1 - <?php 2 - 3 - final class PhabricatorMailingListSearchEngine 4 - extends PhabricatorApplicationSearchEngine { 5 - 6 - public function getResultTypeDescription() { 7 - return pht('Mailing Lists'); 8 - } 9 - 10 - public function getApplicationClassName() { 11 - return 'PhabricatorMailingListsApplication'; 12 - } 13 - 14 - public function buildSavedQueryFromRequest(AphrontRequest $request) { 15 - $saved = new PhabricatorSavedQuery(); 16 - 17 - return $saved; 18 - } 19 - 20 - public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) { 21 - $query = id(new PhabricatorMailingListQuery()); 22 - 23 - return $query; 24 - } 25 - 26 - public function buildSearchForm( 27 - AphrontFormView $form, 28 - PhabricatorSavedQuery $saved_query) { 29 - 30 - // This just makes it clear to the user that the lack of filters is 31 - // intentional, not a bug. 32 - $form->appendChild( 33 - id(new AphrontFormMarkupControl()) 34 - ->setValue(pht('No query filters are available for mailing lists.'))); 35 - } 36 - 37 - protected function getURI($path) { 38 - return '/mailinglists/'.$path; 39 - } 40 - 41 - protected function getBuiltinQueryNames() { 42 - return array( 43 - 'all' => pht('All Lists'), 44 - ); 45 - } 46 - 47 - public function buildSavedQueryFromBuiltin($query_key) { 48 - $query = $this->newSavedQuery(); 49 - $query->setQueryKey($query_key); 50 - 51 - switch ($query_key) { 52 - case 'all': 53 - return $query; 54 - } 55 - 56 - return parent::buildSavedQueryFromBuiltin($query_key); 57 - } 58 - 59 - protected function renderResultList( 60 - array $lists, 61 - PhabricatorSavedQuery $query, 62 - array $handles) { 63 - assert_instances_of($lists, 'PhabricatorMetaMTAMailingList'); 64 - 65 - $view = id(new PHUIObjectItemListView()); 66 - 67 - $can_manage = PhabricatorPolicyFilter::hasCapability( 68 - $this->requireViewer(), 69 - $this->getApplication(), 70 - PhabricatorMailingListsManageCapability::CAPABILITY); 71 - 72 - foreach ($lists as $list) { 73 - $item = new PHUIObjectItemView(); 74 - 75 - $item->setHeader($list->getName()); 76 - $item->setHref($list->getURI()); 77 - $item->addAttribute($list->getEmail()); 78 - $item->addAction( 79 - id(new PHUIListItemView()) 80 - ->setIcon('fa-pencil') 81 - ->setHref($this->getApplicationURI('/edit/'.$list->getID().'/')) 82 - ->setDisabled(!$can_manage) 83 - ->setWorkflow(!$can_manage)); 84 - 85 - $view->addItem($item); 86 - } 87 - 88 - return $view; 89 - } 90 - 91 - }
-77
src/applications/mailinglists/storage/PhabricatorMetaMTAMailingList.php
··· 1 - <?php 2 - 3 - final class PhabricatorMetaMTAMailingList extends PhabricatorMetaMTADAO 4 - implements 5 - PhabricatorPolicyInterface, 6 - PhabricatorDestructibleInterface { 7 - 8 - protected $name; 9 - protected $email; 10 - protected $uri; 11 - 12 - public function generatePHID() { 13 - return PhabricatorPHID::generateNewPHID( 14 - PhabricatorMailingListListPHIDType::TYPECONST); 15 - } 16 - 17 - protected function getConfiguration() { 18 - return array( 19 - self::CONFIG_AUX_PHID => true, 20 - self::CONFIG_COLUMN_SCHEMA => array( 21 - 'name' => 'text128', 22 - 'email' => 'text128', 23 - 'uri' => 'text255?', 24 - ), 25 - self::CONFIG_KEY_SCHEMA => array( 26 - 'key_phid' => null, 27 - 'phid' => array( 28 - 'columns' => array('phid'), 29 - 'unique' => true, 30 - ), 31 - 'email' => array( 32 - 'columns' => array('email'), 33 - 'unique' => true, 34 - ), 35 - 'name' => array( 36 - 'columns' => array('name'), 37 - 'unique' => true, 38 - ), 39 - ), 40 - ) + parent::getConfiguration(); 41 - } 42 - 43 - 44 - /* -( PhabricatorPolicyInterface )----------------------------------------- */ 45 - 46 - 47 - public function getCapabilities() { 48 - return array( 49 - PhabricatorPolicyCapability::CAN_VIEW, 50 - ); 51 - } 52 - 53 - public function getPolicy($capability) { 54 - return PhabricatorPolicies::getMostOpenPolicy(); 55 - } 56 - 57 - public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { 58 - return false; 59 - } 60 - 61 - public function describeAutomaticCapability($capability) { 62 - return null; 63 - } 64 - 65 - 66 - /* -( PhabricatorDestructibleInterface )----------------------------------- */ 67 - 68 - 69 - public function destroyObjectPermanently( 70 - PhabricatorDestructionEngine $engine) { 71 - 72 - $this->openTransaction(); 73 - $this->delete(); 74 - $this->saveTransaction(); 75 - } 76 - 77 - }
-39
src/applications/mailinglists/typeahead/PhabricatorMailingListDatasource.php
··· 1 - <?php 2 - 3 - final class PhabricatorMailingListDatasource 4 - extends PhabricatorTypeaheadDatasource { 5 - 6 - public function getBrowseTitle() { 7 - return pht('Browse Mailing Lists'); 8 - } 9 - 10 - public function getPlaceholderText() { 11 - return pht('Type a mailing list name...'); 12 - } 13 - 14 - public function getDatasourceApplicationClass() { 15 - return 'PhabricatorMailingListsApplication'; 16 - } 17 - 18 - public function loadResults() { 19 - $viewer = $this->getViewer(); 20 - $raw_query = $this->getRawQuery(); 21 - 22 - $query = id(new PhabricatorMailingListQuery()); 23 - $lists = $this->executeQuery($query); 24 - 25 - $results = array(); 26 - foreach ($lists as $list) { 27 - $results[] = id(new PhabricatorTypeaheadResult()) 28 - ->setName($list->getName()) 29 - ->setURI($list->getURI()) 30 - ->setPHID($list->getPHID()); 31 - } 32 - 33 - // TODO: It would be slightly preferable to do this as part of the query, 34 - // this is just simpler for the moment. 35 - 36 - return $this->filterResultsAgainstTokens($results); 37 - } 38 - 39 - }
-25
src/applications/metamta/query/PhabricatorMetaMTAActorQuery.php
··· 39 39 case PhabricatorPeopleExternalPHIDType::TYPECONST: 40 40 $this->loadExternalUserActors($actors, $phids); 41 41 break; 42 - case PhabricatorMailingListListPHIDType::TYPECONST: 43 - $this->loadMailingListActors($actors, $phids); 44 - break; 45 42 default: 46 43 $this->loadUnknownActors($actors, $phids); 47 44 break; ··· 124 121 } 125 122 } 126 123 127 - private function loadMailingListActors(array $actors, array $phids) { 128 - assert_instances_of($actors, 'PhabricatorMetaMTAActor'); 129 - 130 - $lists = id(new PhabricatorMailingListQuery()) 131 - ->setViewer($this->getViewer()) 132 - ->withPHIDs($phids) 133 - ->execute(); 134 - $lists = mpull($lists, null, 'getPHID'); 135 - 136 - foreach ($phids as $phid) { 137 - $actor = $actors[$phid]; 138 - 139 - $list = idx($lists, $phid); 140 - if (!$list) { 141 - $actor->setUndeliverable(PhabricatorMetaMTAActor::REASON_UNLOADABLE); 142 - continue; 143 - } 144 - 145 - $actor->setName($list->getName()); 146 - $actor->setEmailAddress($list->getEmail()); 147 - } 148 - } 149 124 150 125 private function loadUnknownActors(array $actors, array $phids) { 151 126 foreach ($phids as $phid) {
+1 -7
src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php
··· 100 100 } 101 101 $users = id(new PhabricatorUserEmail()) 102 102 ->loadAllWhere('address IN (%Ls)', $addresses); 103 - $user_phids = mpull($users, 'getUserPHID'); 104 - 105 - $mailing_lists = id(new PhabricatorMetaMTAMailingList()) 106 - ->loadAllWhere('email in (%Ls)', $addresses); 107 - $mailing_list_phids = mpull($mailing_lists, 'getPHID'); 108 - 109 - return array_merge($user_phids, $mailing_list_phids); 103 + return mpull($users, 'getUserPHID'); 110 104 } 111 105 112 106 public function processReceivedMail() {
-1
src/applications/metamta/typeahead/PhabricatorMetaMTAMailableDatasource.php
··· 19 19 return array( 20 20 new PhabricatorPeopleDatasource(), 21 21 new PhabricatorProjectDatasource(), 22 - new PhabricatorMailingListDatasource(), 23 22 ); 24 23 } 25 24
-1
src/applications/metamta/typeahead/PhabricatorMetaMTAMailableFunctionDatasource.php
··· 21 21 new PhabricatorPeopleDatasource(), 22 22 new PhabricatorProjectMembersDatasource(), 23 23 new PhabricatorProjectDatasource(), 24 - new PhabricatorMailingListDatasource(), 25 24 ); 26 25 } 27 26
-21
src/applications/phid/query/PhabricatorObjectListQuery.php
··· 143 143 } 144 144 } 145 145 146 - $mailing_list_app = PhabricatorApplication::getByClass( 147 - 'PhabricatorMailingListsApplication'); 148 - if ($mailing_list_app->isInstalled()) { 149 - if ($names) { 150 - // We still haven't been able to resolve everything; try mailing lists 151 - // by name as a last resort. 152 - $lists = id(new PhabricatorMailingListQuery()) 153 - ->setViewer($this->getViewer()) 154 - ->withNames($names) 155 - ->execute(); 156 - 157 - $lists = mpull($lists, null, 'getName'); 158 - foreach ($names as $key => $name) { 159 - if (isset($lists[$name])) { 160 - $results[$name] = $lists[$name]; 161 - unset($names[$key]); 162 - } 163 - } 164 - } 165 - } 166 - 167 146 return $results; 168 147 } 169 148
-1
src/applications/search/engine/PhabricatorApplicationSearchEngine.php
··· 484 484 $key, 485 485 array( 486 486 PhabricatorProjectProjectPHIDType::TYPECONST, 487 - PhabricatorMailingListListPHIDType::TYPECONST, 488 487 )); 489 488 } 490 489
-4
src/docs/book/phabricator.book
··· 137 137 "name": "Macro", 138 138 "include": "(^src/applications/macro/)" 139 139 }, 140 - "mailinglists": { 141 - "name": "Mailing Lists", 142 - "include": "(^src/applications/mailinglists/)" 143 - }, 144 140 "maniphest": { 145 141 "name": "Maniphest", 146 142 "include": "(^src/applications/maniphest/)"