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
F105589: D32.1730717972.diff
Sun, Nov 3, 2:59 AM
F104314: D32.1730664313.diff
Sat, Nov 2, 1:05 PM
F104313: D32.1730664308.diff
Sat, Nov 2, 1:05 PM
F104312: D32.1730664304.diff
Sat, Nov 2, 1:05 PM
F104311: D32.1730664300.diff
Sat, Nov 2, 1:05 PM
F104310: D32.1730664296.diff
Sat, Nov 2, 1:04 PM
F104288: D32.1730664128.diff
Sat, Nov 2, 1:02 PM
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 53
Build 95: GitLab CI for kazv
Build 94: 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
135–157

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