✨ Add events shared by Matrix client and Requester
This commit is contained in:
51
src/infrastructure/messaging/matrix/account_event.rs
Normal file
51
src/infrastructure/messaging/matrix/account_event.rs
Normal file
@@ -0,0 +1,51 @@
|
||||
use std::fmt::{Debug, Formatter};
|
||||
|
||||
use matrix_sdk::{ruma::OwnedRoomId, RoomState};
|
||||
|
||||
use super::room_event::RoomEventsReceiver;
|
||||
use crate::{domain::model::space::SpaceId, utils::Sender};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub enum AccountEvent {
|
||||
NewRoom(
|
||||
OwnedRoomId,
|
||||
Vec<SpaceId>,
|
||||
Option<String>,
|
||||
Option<String>,
|
||||
Option<bool>,
|
||||
RoomState,
|
||||
RoomEventsReceiver,
|
||||
Sender<bool>,
|
||||
),
|
||||
|
||||
NewSpace(
|
||||
OwnedRoomId,
|
||||
Option<String>,
|
||||
Option<String>,
|
||||
RoomEventsReceiver,
|
||||
Sender<bool>,
|
||||
),
|
||||
}
|
||||
|
||||
impl Debug for AccountEvent {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::NewRoom(id, spaces, name, topic, is_direct, state, _events_receiver, _sender) => {
|
||||
f.debug_tuple("AccountEvent::NewRoom")
|
||||
.field(id)
|
||||
.field(spaces)
|
||||
.field(name)
|
||||
.field(topic)
|
||||
.field(is_direct)
|
||||
.field(state)
|
||||
.finish()
|
||||
}
|
||||
Self::NewSpace(id, name, topic, _events_receiver, _sender) => f
|
||||
.debug_tuple("AccountEvent::NewSpace")
|
||||
.field(id)
|
||||
.field(name)
|
||||
.field(topic)
|
||||
.finish(),
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user