watch-party/src/events.rs

20 lines
405 B
Rust
Raw Normal View History

2021-10-24 22:48:10 +00:00
use serde::{Deserialize, Serialize};
#[derive(Clone, Serialize, Deserialize)]
#[serde(tag = "op", content = "data")]
pub enum WatchEvent {
2021-10-25 01:59:52 +00:00
SetPlaying {
playing: bool,
time: u64,
},
2021-10-24 22:48:10 +00:00
SetTime(u64),
2021-10-25 01:59:52 +00:00
UserJoin(String),
UserLeave(String),
ChatMessage {
#[serde(default = "String::new")]
user: String,
message: String,
},
2021-10-24 22:48:10 +00:00
}