@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.

Hide "Email Commands" in user menu when no inbound mail configured

Summary:
Only show "Email Commands" in the top bar user menu (when being in an application) when inbound mail is configured (means: when `metamta.reply-handler-domain` is set) in the Phorge instance.

As a side effect, your local Phorge admin may receive less mail every day from frustrated users desperately asking to improve the server config and can reallocate time on adding more Cat Facts.

Closes T16180

Test Plan:
* Do not have http://phorge.localhost/config/edit/metamta.reply-handler-domain/ configured
* Go to http://phorge.localhost/differential/ or http://phorge.localhost/pholio/ and open the user menu in the top bar
* Do not see an entry "Email Commands" anymore

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16180

Differential Revision: https://we.phorge.it/D26201

+14 -12
+14 -12
src/applications/base/PhabricatorApplication.php
··· 220 220 } 221 221 } 222 222 223 - $command_specs = $this->getMailCommandObjects(); 224 - if ($command_specs) { 225 - foreach ($command_specs as $key => $spec) { 226 - $object = $spec['object']; 223 + if (PhabricatorEnv::getEnvConfig('metamta.reply-handler-domain')) { 224 + $command_specs = $this->getMailCommandObjects(); 225 + if ($command_specs) { 226 + foreach ($command_specs as $key => $spec) { 227 + $object = $spec['object']; 227 228 228 - $class = get_class($this); 229 - $href = '/applications/mailcommands/'.$class.'/'.$key.'/'; 230 - $item = id(new PhabricatorActionView()) 231 - ->setName($spec['name']) 232 - ->setHref($href) 233 - ->addSigil('help-item') 234 - ->setOpenInNewWindow(true); 235 - $items[] = $item; 229 + $class = get_class($this); 230 + $href = '/applications/mailcommands/'.$class.'/'.$key.'/'; 231 + $item = id(new PhabricatorActionView()) 232 + ->setName($spec['name']) 233 + ->setHref($href) 234 + ->addSigil('help-item') 235 + ->setOpenInNewWindow(true); 236 + $items[] = $item; 237 + } 236 238 } 237 239 } 238 240