a
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::collections::HashMap;
|
||||
|
||||
use chrono::{DateTime, Duration};
|
||||
use chrono::Duration;
|
||||
|
||||
use crate::{config, entity, state, web::ws};
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ use axum::{
|
||||
};
|
||||
|
||||
use crate::{
|
||||
entity::{LongId, ShortId},
|
||||
entity::LongId,
|
||||
state::AppState,
|
||||
web::{self, ws},
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@ use axum::{
|
||||
};
|
||||
|
||||
use crate::{
|
||||
entity::{LongId, ShortId},
|
||||
entity::ShortId,
|
||||
state::AppState,
|
||||
web::{self, ws},
|
||||
};
|
||||
|
||||
@@ -49,13 +49,9 @@ pub async fn follow_user(
|
||||
|
||||
state.database.follow_user(context.user.id, user_id).await?;
|
||||
|
||||
ws::broadcast_message(
|
||||
ws::Message::FollowUser {
|
||||
user_id,
|
||||
},
|
||||
&state,
|
||||
|key| key.user_id == context.user.id,
|
||||
)
|
||||
ws::broadcast_message(ws::Message::FollowUser { user_id }, &state, |key| {
|
||||
key.user_id == context.user.id
|
||||
})
|
||||
.await;
|
||||
|
||||
Ok(())
|
||||
@@ -87,13 +83,9 @@ pub async fn unfollow_user(
|
||||
.unfollow_user(context.user.id, user_id)
|
||||
.await?;
|
||||
|
||||
ws::broadcast_message(
|
||||
ws::Message::UnfollowUser {
|
||||
user_id,
|
||||
},
|
||||
&state,
|
||||
|key| key.user_id == context.user.id,
|
||||
)
|
||||
ws::broadcast_message(ws::Message::UnfollowUser { user_id }, &state, |key| {
|
||||
key.user_id == context.user.id
|
||||
})
|
||||
.await;
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user