store last login time of session

Signed-off-by: IAmTomahawkx <iamtomahawkx@gmail.com>
This commit is contained in:
IAmTomahawkx
2025-02-19 21:51:53 -08:00
parent c4728c696d
commit df91b8c990
6 changed files with 1527 additions and 1039 deletions

View File

@@ -17,6 +17,7 @@ use redis_kiss::{PayloadType, REDIS_PAYLOAD_TYPE, REDIS_URI};
use revolt_config::report_internal_error;
use revolt_database::{
events::{client::EventV1, server::ClientMessage},
iso8601_timestamp::Timestamp,
Database, User, UserHint,
};
use revolt_presence::{create_session, delete_session};
@@ -100,6 +101,10 @@ pub async fn client(db: &'static Database, stream: TcpStream, addr: SocketAddr)
info!("User {addr:?} authenticated as @{}", user.username);
let _ = db
.update_session_last_seen(&session_id, Timestamp::now_utc())
.await;
// Create local state.
let mut state = State::from(user, session_id);
let user_id = state.cache.user_id.clone();