mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-21 13:15:50 +00:00
Turn messages into stub SubscribeMessage struct
This commit is contained in:
@@ -13,8 +13,8 @@ use crate::{
|
||||
serve_session::ServeSession,
|
||||
web::{
|
||||
interface::{
|
||||
ErrorResponse, Instance, ReadResponse, ServerInfoResponse, SubscribeResponse,
|
||||
PROTOCOL_VERSION, SERVER_VERSION,
|
||||
ErrorResponse, Instance, ReadResponse, ServerInfoResponse, SubscribeMessage,
|
||||
SubscribeResponse, PROTOCOL_VERSION, SERVER_VERSION,
|
||||
},
|
||||
util::{json, json_ok},
|
||||
},
|
||||
@@ -90,11 +90,19 @@ impl<F: ImfsFetcher> ApiService<F> {
|
||||
}
|
||||
|
||||
Box::new(receiver.then(move |result| match result {
|
||||
Ok((message_cursor, messages)) => json_ok(SubscribeResponse {
|
||||
session_id,
|
||||
message_cursor,
|
||||
messages,
|
||||
}),
|
||||
Ok((message_cursor, messages)) => {
|
||||
// TODO: Transform applied patch sets into subscribe responses
|
||||
let api_messages = messages
|
||||
.into_iter()
|
||||
.map(|_message| SubscribeMessage)
|
||||
.collect();
|
||||
|
||||
json_ok(SubscribeResponse {
|
||||
session_id,
|
||||
message_cursor,
|
||||
messages: api_messages,
|
||||
})
|
||||
}
|
||||
Err(_) => json(
|
||||
ErrorResponse::internal_error("Message queue disconnected sender"),
|
||||
StatusCode::INTERNAL_SERVER_ERROR,
|
||||
|
||||
@@ -17,7 +17,8 @@ pub(crate) const SERVER_VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
pub const PROTOCOL_VERSION: u64 = 3;
|
||||
|
||||
// TODO
|
||||
pub type SubscribeMessage = ();
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct SubscribeMessage;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
|
||||
Reference in New Issue
Block a user