server notified of client profile updates

This commit is contained in:
2026-08-07 15:10:20 +08:00
parent 151ff9e5c6
commit a561a6fe94
4 changed files with 123 additions and 20 deletions
+9
View File
@@ -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()
}