Matrix messages are broadcasted
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
use crate::matrix_connection::sync_thread::MatrixSyncTaskID;
|
||||
use crate::users::{APIToken, UserEmail};
|
||||
use matrix_sdk::Room;
|
||||
use matrix_sdk::ruma::events::room::message::OriginalSyncRoomMessageEvent;
|
||||
use matrix_sdk::sync::SyncResponse;
|
||||
|
||||
pub type BroadcastSender = tokio::sync::broadcast::Sender<BroadcastMessage>;
|
||||
|
||||
@@ -14,4 +17,12 @@ pub enum BroadcastMessage {
|
||||
StopSyncThread(MatrixSyncTaskID),
|
||||
/// Matrix sync thread has been interrupted
|
||||
SyncThreadStopped(MatrixSyncTaskID),
|
||||
/// New room message
|
||||
RoomMessageEvent {
|
||||
user: UserEmail,
|
||||
event: Box<OriginalSyncRoomMessageEvent>,
|
||||
room: Room,
|
||||
},
|
||||
/// Raw Matrix sync response
|
||||
MatrixSyncResponse { user: UserEmail, sync: SyncResponse },
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user