parent
4c1aff8142
commit
f31fb3bcdc
|
@ -11,7 +11,7 @@ type AppState = Arc<Mutex<State>>;
|
|||
#[derive(Default)]
|
||||
pub struct State {
|
||||
uid: IdCounter,
|
||||
message: String,
|
||||
message: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
|
|
|
@ -42,7 +42,7 @@ pub enum MessageBody {
|
|||
ReadOk {
|
||||
msg_id: u64,
|
||||
in_reply_to: u64,
|
||||
message: String,
|
||||
message: Vec<String>,
|
||||
},
|
||||
Default,
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use axum::{extract::State, http::StatusCode, Json};
|
||||
use tracing::{info};
|
||||
use tracing::info;
|
||||
|
||||
use crate::{
|
||||
messages::{Message, MessageBody},
|
||||
|
@ -51,7 +51,7 @@ pub async fn challenge(
|
|||
let in_reply_to = msg_id;
|
||||
{
|
||||
let mut local_state = state.lock().unwrap();
|
||||
local_state.message = message;
|
||||
local_state.message.push(message);
|
||||
}
|
||||
MessageBody::BroadcastOk {
|
||||
msg_id,
|
||||
|
|
|
@ -85,7 +85,7 @@ async fn test_rw() {
|
|||
"type": "read_ok",
|
||||
"msg_id": 2,
|
||||
"in_reply_to": 2,
|
||||
"message": message
|
||||
"message": vec![message]
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue