Added avatar deletion and uploading ( v1 api )

This commit is contained in:
Shiroyasha 2024-07-01 17:47:59 +03:00
parent 64d1111522
commit e8bf52dfd1
Signed by: shiroyashik
GPG key ID: E4953D3940D7860A
6 changed files with 65 additions and 29 deletions

View file

@ -155,7 +155,7 @@ pub async fn delete_avatar(Token(token): Token, State(state): State<AppState>) -
Ok("ok".to_string())
}
fn send_event(broadcasts: &Arc<DashMap<Uuid, Sender<Vec<u8>>>>, uuid: &Uuid) {
pub fn send_event(broadcasts: &Arc<DashMap<Uuid, Sender<Vec<u8>>>>, uuid: &Uuid) {
if let Some(broadcast) = broadcasts.get(&uuid) {
if broadcast.send(S2CMessage::Event(*uuid).to_vec()).is_err() {
debug!("[WebSocket] Failed to send Event! There is no one to send. UUID: {uuid}")