Page MenuHomePhorge

Display invited room at the top of RoomListView
ClosedPublic

Authored by nannanko on May 20 2024, 5:17 AM.
Tags
None
Referenced Files
F112615: D32.1732338841.diff
Thu, Nov 21, 9:14 PM
F112607: D32.1732338323.diff
Thu, Nov 21, 9:05 PM
F112595: D32.1732337839.diff
Thu, Nov 21, 8:57 PM
F112586: D32.1732337677.diff
Thu, Nov 21, 8:54 PM
F112452: D32.1732314769.diff
Thu, Nov 21, 2:32 PM
F112156: D32.1732272273.diff
Thu, Nov 21, 2:44 AM
F112155: D32.1732272271.diff
Thu, Nov 21, 2:44 AM
F112154: D32.1732272267.diff
Thu, Nov 21, 2:44 AM
Subscribers
None

Details

Summary

This displays invited room at the top of room list, sorted by time.

Type: add

Test Plan
  • Verify unit tests pass.
  • Invite user to a room
  • Open kazv and verify this room at the top of room list
  • Send some message in other room
  • Verify the invited room is still at the top

Diff Detail

Repository
rK kazv
Branch
servant
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 48
Build 85: GitLab CI for kazv
Build 84: arc lint + arc unit

Event Timeline

Please add a changelog type to the summary, using the following format:

Type: (add|remove|skip|security|fix)

nannanko edited the test plan for this revision. (Show Details)
nannanko added a reviewer: tusooa.
src/matrix-room-list.cpp
116–138

Why don't we just sort by membership first and timestamp second?

The comparison function of the sort can be:

auto aIsInvite = a.membership == Invite;
auto bIsInvite = b.membership == Invite;
if (aIsInvite != bIsInvite) {
  return aIsInvite; // if my membership in A is invite, then the membership in B is not invite, so A should come first; otherwise B should come first
}

// otherwise compare by timestamp
tusooa requested changes to this revision.May 20 2024, 10:37 AM

Add a unit test (src/tests/matrix-room-list-test.cpp) to verify that invited rooms are indeed displayed before joined rooms.

This revision now requires changes to proceed.May 20 2024, 10:37 AM
  • Simplify the process by modifying existing sorting condition
nannanko marked an inline comment as done.
  • Add test for display invite room at top

Why does it cause testFilter to fail?

In D32#587, @nannanko wrote:

Why does it cause testFilter to fail?

Maybe the sort is unstable.

tusooa requested changes to this revision.May 25 2024, 4:05 PM
This revision now requires changes to proceed.May 25 2024, 4:05 PM
In D32#534, @tusooa wrote:

Add a unit test (src/tests/matrix-room-list-test.cpp) to verify that invited rooms are indeed displayed before joined rooms.

Done

In D32#589, @tusooa wrote:
In D32#587, @nannanko wrote:

Why does it cause testFilter to fail?

Maybe the sort is unstable.

Fixed

This revision is now accepted and ready to land.May 28 2024, 5:43 AM