From cc411c530b9c7c798ca38abe6888cefcc42bfbc1 Mon Sep 17 00:00:00 2001 From: gnieto Date: Wed, 29 Jul 2020 07:48:34 +0200 Subject: [PATCH] Fix custom account data serialization (#165) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stylistic change Fix custom data serialization Build a custom event before storing global account data Co-authored-by: Guillem Nieto Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/165 Reviewed-by: Timo Kösters --- src/client_server.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/client_server.rs b/src/client_server.rs index d1addc89..c5bba03d 100644 --- a/src/client_server.rs +++ b/src/client_server.rs @@ -67,11 +67,12 @@ use ruma::{ unversioned::get_supported_versions, }, events::{ + custom::CustomEventContent, room::{ canonical_alias, guest_access, history_visibility, join_rules, member, name, redaction, topic, }, - AnyEphemeralRoomEvent, AnyEvent, AnySyncEphemeralRoomEvent, EventType, + AnyEphemeralRoomEvent, AnyEvent, AnySyncEphemeralRoomEvent, BasicEvent, EventType, }, Raw, RoomAliasId, RoomId, RoomVersionId, UserId, }; @@ -601,8 +602,13 @@ pub fn set_global_account_data_route( db.account_data.update( None, user_id, - EventType::Custom(event_type), - &content, + event_type.clone().into(), + &BasicEvent { + content: CustomEventContent { + event_type, + json: content, + }, + }, &db.globals, )?;