New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the time a user was last seen to UsersManager::getU… #12107
Conversation
…sers if the time exists
plugins/UsersManager/API.php
Outdated
$lastSeen = $this->addLastSeen($user); | ||
|
||
if ($lastSeen) { | ||
$user['last_seen'] = $lastSeen; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be better to always set the last_seen
, so the returned data has a consistent format. We could set it to 0
or false
if it would be empty
I'm a bit worried about performance and wondering if we could rather have a new API for that? We have a couple of usages even within Piwik where we call |
…nt return field 0
This PR may need to be re-worked now. There's a method in UsersManager\API to add last_seen to multiple users: enrichUsersWithLastSeen. Used in a new API method. |
@Morerice if you could look at the last comments and maybe tweak the PR that would be great 👍 |
Thank you for this proposed pull request. Because it was last updated more than one month ago, it is our policy to close pull requests opened for a long time without updates. If you would like to continue work on the pull request, please simply ping us to have it re-opened (after you have pushed a new commit). We hope you understand this and we look forward to seeing an update from you on this pull request or another one! Thanks. |
last_seen variable is added to API UsersManager/API::getUsers if it exists.