feat(webapi): impl identity description retrieval

This commit is contained in:
oxalica 2024-10-18 11:12:29 -04:00
parent d5cc097e7a
commit c3842a6d3b
6 changed files with 126 additions and 6 deletions

View file

@ -5,6 +5,7 @@ use std::fmt;
use serde::{Deserialize, Serialize};
use url::Url;
use crate::identity::UserIdentityDesc;
use crate::msg::{Id, MemberPermission, RoomAttrs, SignedChatMsgWithId};
use crate::PubKey;
@ -172,6 +173,15 @@ pub struct RoomMember {
pub last_seen_cid: Option<Id>,
}
/// Server cached user identity description.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
pub struct UserIdentityDescResponse<I = UserIdentityDesc> {
/// The identity description of the requested user.
#[cfg_attr(feature = "schemars", schemars(with = "UserIdentityDesc"))]
pub identity: I,
}
/// A server-to-client event.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]