feat(core): propagate poke strength events
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
use chanora_audio::{AudioRoute, PttBackendDescriptor};
|
use chanora_audio::{AudioRoute, PttBackendDescriptor};
|
||||||
use chanora_protocol::MessageTarget;
|
use chanora_protocol::{MessageTarget, PokeStrength};
|
||||||
|
|
||||||
/// Privacy-safe snapshot of the active PTT capability.
|
/// Privacy-safe snapshot of the active PTT capability.
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
@@ -139,6 +139,8 @@ pub enum SessionEvent {
|
|||||||
message: String,
|
message: String,
|
||||||
/// Target scope (server/channel/private/poke).
|
/// Target scope (server/channel/private/poke).
|
||||||
target: MessageTarget,
|
target: MessageTarget,
|
||||||
|
/// Poke notification strength, present only for poke messages.
|
||||||
|
poke_strength: Option<PokeStrength>,
|
||||||
},
|
},
|
||||||
/// Human-readable TeamSpeak-style server activity.
|
/// Human-readable TeamSpeak-style server activity.
|
||||||
ServerActivity {
|
ServerActivity {
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ pub use chanora_diagnostics::{
|
|||||||
};
|
};
|
||||||
pub use chanora_protocol::{
|
pub use chanora_protocol::{
|
||||||
ChannelInfo, ChatMessage, ClientInfo, ClientProfile, ConnectConfig, DisconnectReason,
|
ChannelInfo, ChatMessage, ClientInfo, ClientProfile, ConnectConfig, DisconnectReason,
|
||||||
MessageTarget, ProtocolError, ServerActivity, ServerSnapshot,
|
MessageTarget, PokeStrength, ProtocolError, ServerActivity, ServerSnapshot,
|
||||||
};
|
};
|
||||||
pub use chanora_storage::{Bookmark, BookmarkRepository, IdentityFileStore};
|
pub use chanora_storage::{Bookmark, BookmarkRepository, IdentityFileStore};
|
||||||
pub use events::{
|
pub use events::{
|
||||||
@@ -1674,6 +1674,7 @@ fn spawn_event_forwarders(
|
|||||||
sender_name: msg.sender_name,
|
sender_name: msg.sender_name,
|
||||||
message: msg.message,
|
message: msg.message,
|
||||||
target: msg.target,
|
target: msg.target,
|
||||||
|
poke_strength: msg.poke_strength,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -615,6 +615,7 @@ mod tests {
|
|||||||
sender_name: "Alice".into(),
|
sender_name: "Alice".into(),
|
||||||
message: "hello".into(),
|
message: "hello".into(),
|
||||||
target: MessageTarget::Channel,
|
target: MessageTarget::Channel,
|
||||||
|
poke_strength: None,
|
||||||
};
|
};
|
||||||
let disconnected = reduce(&mut state, StateEvent::ChatReceived(msg.clone()));
|
let disconnected = reduce(&mut state, StateEvent::ChatReceived(msg.clone()));
|
||||||
assert!(disconnected.deltas.is_empty());
|
assert!(disconnected.deltas.is_empty());
|
||||||
|
|||||||
Reference in New Issue
Block a user