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,
pub restorable: bool,
}
#[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 },
FileOffered {
room_id: String,
file_id: String,
name: String,
size_bytes: u64,
sender_fingerprint: String,
},
FileProgress {
file_id: String,
bytes_received: u64,
total_bytes: u64,
},
FileReady { file_id: String },
FileSaved { file_id: String, path: String },
FileFailed { file_id: String, reason: String },
RotationRequested {
room_id: String,
rotator_fingerprint: String,
new_salt: Vec<u8>,
},
TypingChanged { room_id: String },
MentionReceived { room_id: String, body: String },
}