use libp2p::PeerId;
#[derive(Debug, Clone)]
pub struct DiscoveredRoom {
pub room_id: String,
pub name: String,
pub encrypted: bool,
pub member_count: u32,
pub creator_fingerprint: String,
pub last_seen: i64,
}
#[derive(Debug, Clone)]
pub enum AppEvent {
RoomDiscovered(DiscoveredRoom),
RoomLost { room_id: String },
RoomJoined { room_id: String },
RoomLeft { room_id: String },
MemberJoined {
room_id: String,
fingerprint: String,
},
MemberLeft {
room_id: String,
fingerprint: String,
},
MessageReceived {
room_id: String,
sender_fingerprint: String,
body: String,
sent_at: i64,
},
MessageSent {
room_id: String,
body: String,
message_id: i64,
},
ListeningOn { address: String },
PeerDiscovered { peer_id: PeerId },
Dialing { address: String },
DialSucceeded { address: String, peer_id: PeerId },
DialFailed { address: String, error: String },
Error { description: String },
}