🚧 Add Avatar management and refresh the Matrix client part
This commit is contained in:
@@ -1,34 +1,43 @@
|
||||
use std::fmt::{Debug, Formatter};
|
||||
|
||||
use matrix_sdk::ruma::{OwnedRoomId, OwnedUserId};
|
||||
use matrix_sdk::ruma::{OwnedMxcUri, OwnedRoomId, OwnedUserId};
|
||||
use tokio::sync::broadcast::Receiver;
|
||||
|
||||
use crate::domain::model::common::Avatar;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub enum RoomEvent {
|
||||
Invitation(),
|
||||
|
||||
#[allow(dead_code)]
|
||||
Membership(OwnedUserId, bool),
|
||||
Invitation(OwnedUserId, OwnedUserId, bool),
|
||||
Join(OwnedUserId, Option<String>, Option<OwnedMxcUri>, bool),
|
||||
|
||||
NewTopic(Option<String>),
|
||||
NewName(Option<String>),
|
||||
NewAvatar(Option<Avatar>),
|
||||
NewChild(OwnedRoomId),
|
||||
}
|
||||
|
||||
impl Debug for RoomEvent {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), std::fmt::Error> {
|
||||
match self {
|
||||
Self::Invitation() => f
|
||||
Self::Invitation(invitee_id, sender_id, is_account_user) => f
|
||||
.debug_tuple("RoomEvent::Invitation")
|
||||
.field(&format_args!("_"))
|
||||
.field(invitee_id)
|
||||
.field(sender_id)
|
||||
.field(is_account_user)
|
||||
.finish(),
|
||||
Self::Membership(user_id, is_account_user) => f
|
||||
.debug_tuple("RoomEvent::Membership")
|
||||
Self::Join(user_id, user_name, avatar_url, is_account_user) => f
|
||||
.debug_tuple("RoomEvent::Join")
|
||||
.field(user_id)
|
||||
.field(user_name)
|
||||
.field(avatar_url)
|
||||
.field(is_account_user)
|
||||
.finish(),
|
||||
Self::NewTopic(topic) => f.debug_tuple("RoomEvent::NewTopic").field(topic).finish(),
|
||||
Self::NewName(name) => f.debug_tuple("RoomEvent::NewName").field(name).finish(),
|
||||
Self::NewAvatar(avatar) => f
|
||||
.debug_tuple("RoomEvent::NewAvatar")
|
||||
.field(&format!("is_some: {}", &avatar.is_some()))
|
||||
.finish(),
|
||||
Self::NewChild(room_id) => f
|
||||
.debug_tuple("SpaceEvent::NewChild")
|
||||
.field(room_id)
|
||||
|
Reference in New Issue
Block a user