]> git.mxchange.org Git - friendica.git/blobdiff - src/Security/Authentication.php
Flatten conditions and add call to HTML::checkRelMeLink in Worker\CheckRelMeProfileLink
[friendica.git] / src / Security / Authentication.php
index 61ac4fae00b11634117dcd17bfba73f8b76b1db3..5dcc399403004af1fafc9892b8f48aec42eb309d 100644 (file)
@@ -39,6 +39,7 @@ use Friendica\Util\Network;
 use LightOpenID;
 use Friendica\Core\L10n;
 use Friendica\Core\Worker;
+use Friendica\Model\Contact;
 use Psr\Log\LoggerInterface;
 
 /**
@@ -352,14 +353,16 @@ class Authentication
                $this->setXAccMgmtStatusHeader($user_record);
 
                if ($login_initial || $login_refresh) {
-                       $this->dba->update('user', ['login_date' => DateTimeFormat::utcNow()], ['uid' => $user_record['uid']]);
+                       $this->dba->update('user', ['last-activity' => DateTimeFormat::utcNow('Y-m-d'), 'login_date' => DateTimeFormat::utcNow()], ['uid' => $user_record['uid']]);
 
                        // Set the login date for all identities of the user
-                       $this->dba->update('user', ['login_date' => DateTimeFormat::utcNow()],
+                       $this->dba->update('user', ['last-activity' => DateTimeFormat::utcNow('Y-m-d'), 'login_date' => DateTimeFormat::utcNow()],
                                ['parent-uid' => $user_record['uid'], 'account_removed' => false]);
 
-                       // Update suggestions upon login
-                       Worker::add(Worker::PRIORITY_MEDIUM, 'UpdateSuggestions', $user_record['uid']);
+                       // Regularly update suggestions
+                       if (Contact\Relation::areSuggestionsOutdated($user_record['uid'])) {
+                               Worker::add(Worker::PRIORITY_MEDIUM, 'UpdateSuggestions', $user_record['uid']);
+                       }
                }
 
                if ($login_initial) {