Skip to content

Commit

Permalink
Fix migration
Browse files Browse the repository at this point in the history
  • Loading branch information
MatMaul committed Dec 5, 2024
1 parent 5d56248 commit b69b595
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions crates/matrix-sdk-base/src/store/migration_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use ruma::{
},
EmptyStateKey, EventContent, RedactContent, StateEventContent, StateEventType,
},
OwnedRoomId, RoomId,
OwnedRoomId, OwnedUserId, RoomId,
};
use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -156,7 +156,7 @@ fn encryption_state_default() -> bool {
struct BaseRoomInfoV1 {
avatar: Option<MinimalStateEvent<RoomAvatarEventContent>>,
canonical_alias: Option<MinimalStateEvent<RoomCanonicalAliasEventContent>>,
dm_targets: HashSet<OwnedDirectUserIdentifier>,
dm_targets: HashSet<OwnedUserId>,
encryption: Option<RoomEncryptionEventContent>,
guest_access: Option<MinimalStateEvent<RoomGuestAccessEventContent>>,
history_visibility: Option<MinimalStateEvent<RoomHistoryVisibilityEventContent>>,
Expand Down Expand Up @@ -201,12 +201,17 @@ impl BaseRoomInfoV1 {
MinimalStateEvent::Redacted(ev) => MinimalStateEvent::Redacted(ev),
});

let mut dm_targets_converted = HashSet::new();
for dm_target in dm_targets {
dm_targets_converted.insert(OwnedDirectUserIdentifier::from(dm_target));
}

Box::new(BaseRoomInfo {
avatar,
beacons: BTreeMap::new(),
canonical_alias,
create,
dm_targets,
dm_targets: dm_targets_converted,
encryption,
guest_access,
history_visibility,
Expand Down

0 comments on commit b69b595

Please sign in to comment.