Skip to content

Commit

Permalink
Test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson committed Jul 18, 2023
1 parent 065dcd4 commit a02a559
Show file tree
Hide file tree
Showing 2 changed files with 395 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sync3/handler/connstate_live.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,13 @@ func (s *connStateLive) processGlobalUpdates(ctx context.Context, builder *Rooms

metadata := rup.GlobalRoomMetadata().CopyHeroes()
metadata.RemoveHero(s.userID)
// TODO: if we change a room from being a DM to not being a DM, we should call
// SetRoom and recalculate avatars. To do that we'd need to
// - listen to m.direct global account data events
// - compute the symmetric difference between old and new
// - call SetRooms for each room in the difference.
// I'm assuming this happens so rarely that we can ignore this for now. PRs
// welcome if you a strong opinion to the contrary.
delta = s.lists.SetRoom(sync3.RoomConnMetadata{
RoomMetadata: *metadata,
UserRoomData: *rup.UserRoomMetadata(),
Expand Down
Loading

0 comments on commit a02a559

Please sign in to comment.