server notified of client profile updates
This commit is contained in:
@@ -13,6 +13,7 @@ pub struct Profile {
|
||||
#[serde(tag = "type", rename_all = "camelCase")]
|
||||
pub enum ClientMessage {
|
||||
Register { profile: Profile, signature: String },
|
||||
ProfileUpdated { profile: Profile, signature: String },
|
||||
Signed { payload: String, signature: String },
|
||||
}
|
||||
|
||||
@@ -34,3 +35,11 @@ pub fn register_bytes(challenge: &str, profile: &Profile) -> Vec<u8> {
|
||||
pub fn message_bytes(payload: &str) -> Vec<u8> {
|
||||
format!("wyd-message-v{VERSION}\n{payload}").into_bytes()
|
||||
}
|
||||
|
||||
pub fn profile_bytes(profile: &Profile) -> Vec<u8> {
|
||||
format!(
|
||||
"wyd-profile-v{VERSION}\n{}\n{}",
|
||||
profile.id, profile.display_name
|
||||
)
|
||||
.into_bytes()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user