From 8335f44bfe80f9be71928eb5000f84d16344dfb1 Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Tue, 10 Aug 2021 05:43:44 +0000 Subject: [PATCH] Set nicer displayname --- src/client_server/account.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client_server/account.rs b/src/client_server/account.rs index 87e3731f..d11a2e08 100644 --- a/src/client_server/account.rs +++ b/src/client_server/account.rs @@ -192,6 +192,11 @@ pub async fn register_route( // Create user db.users.create(&user_id, password)?; + let displayname = format!("{} ⚡️", user_id.localpart()); + + db.users + .set_displayname(&user_id, Some(displayname.clone()))?; + // Initial data db.account_data.update( None, @@ -465,7 +470,7 @@ pub async fn register_route( event_type: EventType::RoomMember, content: serde_json::to_value(member::MemberEventContent { membership: member::MembershipState::Join, - displayname: None, + displayname: Some(displayname), avatar_url: None, is_direct: None, third_party_invite: None,