feat(bridge): expose poke strength to Flutter
This commit is contained in:
@@ -1695,6 +1695,8 @@ pub enum BridgeEvent {
|
||||
message: String,
|
||||
/// Target scope (server/channel/private/poke).
|
||||
target: BridgeMessageTarget,
|
||||
/// Poke notification strength, present only for poke messages.
|
||||
poke_strength: Option<BridgePokeStrength>,
|
||||
},
|
||||
/// Human-readable server activity surfaced from protocol bookkeeping events.
|
||||
ServerActivity {
|
||||
@@ -1812,6 +1814,27 @@ impl From<chanora_core::MessageTarget> for BridgeMessageTarget {
|
||||
}
|
||||
}
|
||||
|
||||
/// Bridge poke notification strength.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum BridgePokeStrength {
|
||||
/// Poke should be surfaced at full strength.
|
||||
Strong,
|
||||
/// Poke is rate-limited but below overflow severity.
|
||||
Suppressed,
|
||||
/// Poke remains suppressed after repeated suppressed pokes.
|
||||
SuppressedOverflow,
|
||||
}
|
||||
|
||||
impl From<chanora_core::PokeStrength> for BridgePokeStrength {
|
||||
fn from(strength: chanora_core::PokeStrength) -> Self {
|
||||
match strength {
|
||||
chanora_core::PokeStrength::Strong => Self::Strong,
|
||||
chanora_core::PokeStrength::Suppressed => Self::Suppressed,
|
||||
chanora_core::PokeStrength::SuppressedOverflow => Self::SuppressedOverflow,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Bridge mirror of core join projection sync state.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum BridgeVoiceJoinSyncState {
|
||||
@@ -1958,11 +1981,13 @@ impl From<chanora_core::SessionEvent> for BridgeEvent {
|
||||
sender_name,
|
||||
message,
|
||||
target,
|
||||
poke_strength,
|
||||
} => BridgeEvent::ChatMessage {
|
||||
sender_id,
|
||||
sender_name,
|
||||
message,
|
||||
target: target.into(),
|
||||
poke_strength: poke_strength.map(Into::into),
|
||||
},
|
||||
chanora_core::SessionEvent::ServerActivity { message } => {
|
||||
BridgeEvent::ServerActivity { message }
|
||||
|
||||
Reference in New Issue
Block a user