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

Make the new "Unverified Email" behavior more clear to other users

Summary:
Ref T12268. Ref T12157. When you mention or interact with a user who is unlikely to be able to respond (for example, because their account is disabled), we try to show a colored dot to provide a hint about this.

Recently, we no longer send any normal mail to unverified addresses. However, the rules for showing a dot haven't been updated yet, so they only care about this if `auth.require-verification` is set. This can be misleading, because if you say `Hey @alice, what do you think about this?` and she hasn't verified her email, you may not get a response.

Update the rule so users with unverified email addresses get a grey dot in all cases. The hint is basically "you shouldn't expect a response from this user".

Make the meaning of this hint more clear on the hovercard and profile.

Also:

- Allow the non-ajax version of the hovercard page (which is basically only useful for testing hovercards) accept `?names=...` so you can just plug usernames, hashtags, etc., in there.
- Fix a bug where the user's join date was based on their profile creation date instead of account creation date on the hovercard. Users may not have a profile creation date (if they never changed any account details), and it may be different from their account creation date.

Test Plan: {F2998517}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12268, T12157

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

+81 -10
+2
src/applications/people/controller/PhabricatorPeopleProfileController.php
··· 103 103 104 104 if ($user->getIsDisabled()) { 105 105 $header->setStatus('fa-ban', 'red', pht('Disabled')); 106 + } else if (!$user->getIsEmailVerified()) { 107 + $header->setStatus('fa-envelope', 'red', pht('Email Not Verified')); 106 108 } else { 107 109 $header->setStatus($profile_icon, 'bluegrey', $profile_title); 108 110 }
+1 -1
src/applications/people/markup/PhabricatorMentionRemarkupRule.php
··· 150 150 $tag->addClass('phabricator-remarkup-mention-nopermission'); 151 151 } 152 152 153 - if (!$user->isUserActivated()) { 153 + if (!$user->isResponsive()) { 154 154 $tag->setDotColor(PHUITagView::COLOR_GREY); 155 155 } else { 156 156 if ($user->getAwayUntil()) {
+1 -1
src/applications/people/phid/PhabricatorPeopleUserPHIDType.php
··· 61 61 } 62 62 63 63 $availability = null; 64 - if (!$user->isUserActivated()) { 64 + if (!$user->isResponsive()) { 65 65 $availability = PhabricatorObjectHandle::AVAILABILITY_DISABLED; 66 66 } else { 67 67 $until = $user->getAwayUntil();
+26
src/applications/people/storage/PhabricatorUser.php
··· 120 120 return true; 121 121 } 122 122 123 + 124 + /** 125 + * Is this a user who we can reasonably expect to respond to requests? 126 + * 127 + * This is used to provide a grey "disabled/unresponsive" dot cue when 128 + * rendering handles and tags, so it isn't a surprise if you get ignored 129 + * when you ask things of users who will not receive notifications or could 130 + * not respond to them (because they are disabled, unapproved, do not have 131 + * verified email addresses, etc). 132 + * 133 + * @return bool True if this user can receive and respond to requests from 134 + * other humans. 135 + */ 136 + public function isResponsive() { 137 + if (!$this->isUserActivated()) { 138 + return false; 139 + } 140 + 141 + if (!$this->getIsEmailVerified()) { 142 + return false; 143 + } 144 + 145 + return true; 146 + } 147 + 148 + 123 149 public function canEstablishWebSessions() { 124 150 if ($this->getIsMailingList()) { 125 151 return false;
+34 -7
src/applications/people/view/PhabricatorUserCardView.php
··· 52 52 53 53 require_celerity_resource('project-card-view-css'); 54 54 55 - $profile_icon = PhabricatorPeopleIconSet::getIconIcon($profile->getIcon()); 56 - $profile_title = $profile->getDisplayTitle(); 55 + // We don't have a ton of room on the hovercard, so we're trying to show 56 + // the most important tag. Users can click through to the profile to get 57 + // more details. 58 + 59 + if ($user->getIsDisabled()) { 60 + $tag_icon = 'fa-ban'; 61 + $tag_title = pht('Disabled'); 62 + $tag_shade = PHUITagView::COLOR_RED; 63 + } else if (!$user->getIsApproved()) { 64 + $tag_icon = 'fa-ban'; 65 + $tag_title = pht('Unapproved Account'); 66 + $tag_shade = PHUITagView::COLOR_RED; 67 + } else if (!$user->getIsEmailVerified()) { 68 + $tag_icon = 'fa-envelope'; 69 + $tag_title = pht('Email Not Verified'); 70 + $tag_shade = PHUITagView::COLOR_RED; 71 + } else if ($user->getIsAdmin()) { 72 + $tag_icon = 'fa-star'; 73 + $tag_title = pht('Administrator'); 74 + $tag_shade = PHUITagView::COLOR_INDIGO; 75 + } else { 76 + $tag_icon = PhabricatorPeopleIconSet::getIconIcon($profile->getIcon()); 77 + $tag_title = $profile->getDisplayTitle(); 78 + $tag_shade = null; 79 + } 57 80 58 81 $tag = id(new PHUITagView()) 59 - ->setIcon($profile_icon) 60 - ->setName($profile_title) 61 - ->addClass('project-view-header-tag') 82 + ->setIcon($tag_icon) 83 + ->setName($tag_title) 62 84 ->setType(PHUITagView::TYPE_SHADE); 85 + 86 + if ($tag_shade !== null) { 87 + $tag->setShade($tag_shade); 88 + } 63 89 64 90 $header = id(new PHUIHeaderView()) 65 - ->setHeader(array($user->getFullName(), $tag)) 91 + ->setHeader($user->getFullName()) 92 + ->addTag($tag) 66 93 ->setUser($viewer) 67 94 ->setImage($picture); 68 95 ··· 70 97 71 98 $body[] = $this->addItem( 72 99 pht('User Since'), 73 - phabricator_date($profile->getDateCreated(), $viewer)); 100 + phabricator_date($user->getDateCreated(), $viewer)); 74 101 75 102 if (PhabricatorApplication::isClassInstalledForViewer( 76 103 'PhabricatorCalendarApplication',
+17 -1
src/applications/search/controller/PhabricatorSearchHovercardController.php
··· 9 9 10 10 public function handleRequest(AphrontRequest $request) { 11 11 $viewer = $this->getViewer(); 12 - $phids = $request->getArr('phids'); 12 + $phids = $request->getStrList('phids'); 13 + 14 + // If object names are provided, look them up and pretend they were 15 + // passed as additional PHIDs. This is primarily useful for debugging, 16 + // since you don't have to go look up user PHIDs to preview their 17 + // hovercards. 18 + $names = $request->getStrList('names'); 19 + if ($names) { 20 + $named_objects = id(new PhabricatorObjectQuery()) 21 + ->setViewer($viewer) 22 + ->withNames($names) 23 + ->execute(); 24 + 25 + foreach ($named_objects as $object) { 26 + $phids[] = $object->getPHID(); 27 + } 28 + } 13 29 14 30 $handles = id(new PhabricatorHandleQuery()) 15 31 ->setViewer($viewer)