feat(core): propagate poke strength events

This commit is contained in:
Edison Jwa
2026-06-08 22:52:08 +09:00
parent 31cf45ce35
commit 5c7a4b64c9
3 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -1,5 +1,5 @@
use chanora_audio::{AudioRoute, PttBackendDescriptor};
use chanora_protocol::MessageTarget;
use chanora_protocol::{MessageTarget, PokeStrength};
/// Privacy-safe snapshot of the active PTT capability.
#[derive(Debug, Clone, PartialEq, Eq)]
@@ -139,6 +139,8 @@ pub enum SessionEvent {
message: String,
/// Target scope (server/channel/private/poke).
target: MessageTarget,
/// Poke notification strength, present only for poke messages.
poke_strength: Option<PokeStrength>,
},
/// Human-readable TeamSpeak-style server activity.
ServerActivity {
+2 -1
View File
@@ -68,7 +68,7 @@ pub use chanora_diagnostics::{
};
pub use chanora_protocol::{
ChannelInfo, ChatMessage, ClientInfo, ClientProfile, ConnectConfig, DisconnectReason,
MessageTarget, ProtocolError, ServerActivity, ServerSnapshot,
MessageTarget, PokeStrength, ProtocolError, ServerActivity, ServerSnapshot,
};
pub use chanora_storage::{Bookmark, BookmarkRepository, IdentityFileStore};
pub use events::{
@@ -1674,6 +1674,7 @@ fn spawn_event_forwarders(
sender_name: msg.sender_name,
message: msg.message,
target: msg.target,
poke_strength: msg.poke_strength,
});
}
});
+1
View File
@@ -615,6 +615,7 @@ mod tests {
sender_name: "Alice".into(),
message: "hello".into(),
target: MessageTarget::Channel,
poke_strength: None,
};
let disconnected = reduce(&mut state, StateEvent::ChatReceived(msg.clone()));
assert!(disconnected.deltas.is_empty());