diff --git a/libs/chat/src/api.rs b/libs/chat/src/api.rs index 2547a1892..41b29fab9 100644 --- a/libs/chat/src/api.rs +++ b/libs/chat/src/api.rs @@ -36,10 +36,20 @@ pub enum ChatOp { /// Find a Post by timestamp and Author PostFind, PostFlag, + /// Run or stop the busy animation. + SetBusyAnimationState, + /// Update just the state of the busy animation, if any. Internal opcode. + UpdateBusy, /// exit the application Quit, } +#[derive(Debug, num_derive::FromPrimitive, num_derive::ToPrimitive)] +pub(crate) enum BusyAnimOp { + Start, + Pump, +} + #[derive(Debug, num_derive::FromPrimitive, num_derive::ToPrimitive)] pub enum IconOp { PostMenu = 0, @@ -120,3 +130,11 @@ pub enum AuthorFlag { Hidden, Right, } + +#[derive(Archive, Serialize, Deserialize, Debug)] +pub struct BusyMessage { + /// If None, restores the last non-busy status bar message, and stops the animation. + /// If Some, updates the status bar to contain the busy message and + /// starts the animation running. + pub busy_msg: Option>, +}