mirror of
https://github.com/friendica/friendica
synced 2025-04-22 07:10:24 +00:00
Simplify "last-activity" handling
This commit is contained in:
parent
1d8c9276f3
commit
e5a531d3b5
5 changed files with 12 additions and 15 deletions
|
@ -94,18 +94,9 @@ class NoScrape extends BaseModule
|
|||
}
|
||||
|
||||
// We display the last activity (post or login), reduced to year and week number
|
||||
$last_active = 0;
|
||||
$condition = ['uid' => $owner['uid'], 'self' => true];
|
||||
$contact = DBA::selectFirst('contact', ['last-item'], $condition);
|
||||
if (DBA::isResult($contact)) {
|
||||
$last_active = strtotime($contact['last-item']);
|
||||
}
|
||||
|
||||
$user = User::getOwnerDataById($owner['uid']);
|
||||
if (DBA::isResult($user)) {
|
||||
if ($last_active < strtotime($user['last-activity'])) {
|
||||
$last_active = strtotime($user['last-activity']);
|
||||
}
|
||||
$last_active = strtotime($owner['last-item']);
|
||||
if ($last_active < strtotime($owner['last-activity'])) {
|
||||
$last_active = strtotime($owner['last-activity']);
|
||||
}
|
||||
$json_info['last-activity'] = date('o-W', $last_active);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue