mirror of
https://github.com/friendica/friendica
synced 2025-04-29 03:04:22 +02:00
New field to show the day of the last activity
This commit is contained in:
parent
fbcc56d42d
commit
f905220923
8 changed files with 50 additions and 4 deletions
|
@ -260,6 +260,17 @@ class Relation
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the cached suggestion is outdated
|
||||
*
|
||||
* @param integer $uid
|
||||
* @return boolean
|
||||
*/
|
||||
static public function areSuggestionsOutdated(int $uid): bool
|
||||
{
|
||||
return DI::pConfig()->get($uid, 'suggestion', 'last_update') + 3600 < time();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update contact suggestions for a given user
|
||||
*
|
||||
|
@ -268,7 +279,7 @@ class Relation
|
|||
*/
|
||||
static public function updateCachedSuggestions(int $uid)
|
||||
{
|
||||
if (DI::pConfig()->get($uid, 'suggestion', 'last_update') + 3600 > time()) {
|
||||
if (!self::areSuggestionsOutdated($uid)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue