Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13982006
D12848.id30914.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D12848.id30914.diff
View Options
diff --git a/src/applications/people/conduit/UserConduitAPIMethod.php b/src/applications/people/conduit/UserConduitAPIMethod.php
--- a/src/applications/people/conduit/UserConduitAPIMethod.php
+++ b/src/applications/people/conduit/UserConduitAPIMethod.php
@@ -6,7 +6,10 @@
return PhabricatorApplication::getByClass('PhabricatorPeopleApplication');
}
- protected function buildUserInformationDictionary(PhabricatorUser $user) {
+ protected function buildUserInformationDictionary(
+ PhabricatorUser $user,
+ $with_email = false,
+ $with_availability = false) {
$roles = array();
if ($user->getIsDisabled()) {
@@ -40,18 +43,23 @@
'phid' => $user->getPHID(),
'userName' => $user->getUserName(),
'realName' => $user->getRealName(),
- 'primaryEmail' => $email,
'image' => $user->getProfileImageURI(),
'uri' => PhabricatorEnv::getURI('/p/'.$user->getUsername().'/'),
'roles' => $roles,
);
- // TODO: Modernize this once we have a more long-term view of what the
- // data looks like.
- $until = $user->getAwayUntil();
- if ($until) {
- $return['currentStatus'] = 'away';
- $return['currentStatusUntil'] = $until;
+ if ($with_email) {
+ $return['primaryEmail'] = $email;
+ }
+
+ if ($with_availability) {
+ // TODO: Modernize this once we have a more long-term view of what the
+ // data looks like.
+ $until = $user->getAwayUntil();
+ if ($until) {
+ $return['currentStatus'] = 'away';
+ $return['currentStatusUntil'] = $until;
+ }
}
return $return;
diff --git a/src/applications/people/conduit/UserQueryConduitAPIMethod.php b/src/applications/people/conduit/UserQueryConduitAPIMethod.php
--- a/src/applications/people/conduit/UserQueryConduitAPIMethod.php
+++ b/src/applications/people/conduit/UserQueryConduitAPIMethod.php
@@ -71,7 +71,10 @@
$results = array();
foreach ($users as $user) {
- $results[] = $this->buildUserInformationDictionary($user);
+ $results[] = $this->buildUserInformationDictionary(
+ $user,
+ $with_email = false,
+ $with_availability = true);
}
return $results;
}
diff --git a/src/applications/people/conduit/UserWhoAmIConduitAPIMethod.php b/src/applications/people/conduit/UserWhoAmIConduitAPIMethod.php
--- a/src/applications/people/conduit/UserWhoAmIConduitAPIMethod.php
+++ b/src/applications/people/conduit/UserWhoAmIConduitAPIMethod.php
@@ -29,7 +29,10 @@
->withPHIDs(array($request->getUser()->getPHID()))
->executeOne();
- return $this->buildUserInformationDictionary($person);
+ return $this->buildUserInformationDictionary(
+ $person,
+ $with_email = true,
+ $with_availability = false);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 20, 8:41 PM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6737359
Default Alt Text
D12848.id30914.diff (2 KB)
Attached To
Mode
D12848: Fix an issue with user.whoami
Attached
Detach File
Event Timeline
Log In to Comment