This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
components/views/dialogs/spotlight Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -180,16 +180,20 @@ const toPublicRoomResult = (publicRoom: IPublicRoomsChunkRoom): IPublicRoomResul
180
180
} ) ;
181
181
182
182
const toRoomResult = ( room : Room ) : IRoomResult => {
183
+ const myUserId = MatrixClientPeg . get ( ) . getUserId ( ) ;
183
184
const otherUserId = DMRoomMap . shared ( ) . getUserIdForRoomId ( room . roomId ) ;
185
+
184
186
if ( otherUserId ) {
187
+ const otherMembers = room . getMembers ( ) . filter ( it => it . userId !== myUserId ) ;
188
+ const query = [
189
+ ...otherMembers . map ( it => it . name . toLowerCase ( ) ) ,
190
+ ...otherMembers . map ( it => it . userId . toLowerCase ( ) ) ,
191
+ ] . filter ( Boolean ) ;
185
192
return {
186
193
room,
187
194
section : Section . People ,
188
195
filter : [ Filter . People ] ,
189
- query : [
190
- otherUserId . toLowerCase ( ) ,
191
- room . getMember ( otherUserId ) ?. name . toLowerCase ( ) ,
192
- ] . filter ( Boolean ) ,
196
+ query,
193
197
} ;
194
198
} else if ( room . isSpaceRoom ( ) ) {
195
199
return {
Original file line number Diff line number Diff line change @@ -44,7 +44,9 @@ export function roomContextDetailsText(room: Room): string {
44
44
if ( room . isSpaceRoom ( ) ) return undefined ;
45
45
46
46
const dmPartner = DMRoomMap . shared ( ) . getUserIdForRoomId ( room . roomId ) ;
47
- if ( dmPartner ) {
47
+ // if we’ve got more than 2 users, don’t treat it like a regular DM
48
+ const isGroupDm = room . getMembers ( ) . length > 2 ;
49
+ if ( dmPartner && ! isGroupDm ) {
48
50
return dmPartner ;
49
51
}
50
52
You can’t perform that action at this time.
0 commit comments