forked from jmug/stoatchat
Add basic presence tracking.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use crate::database::*;
|
||||
use crate::{database::*, notifications::websocket::is_online};
|
||||
use crate::util::result::{Error, Result};
|
||||
|
||||
use rocket_contrib::json::JsonValue;
|
||||
@@ -31,5 +31,7 @@ pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
|
||||
target.relationship = Some(RelationshipStatus::User);
|
||||
}
|
||||
|
||||
target.online = Some(is_online(&target.id));
|
||||
|
||||
Ok(json!(target))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user