mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-24 14:32:37 +01:00
Merge branch 'soru/fix-room-suggestions' into 'main'
fix: Suggest correct rooms See merge request ChristianPauly/fluffychat-flutter!283
This commit is contained in:
commit
9022da9394
@ -103,19 +103,24 @@ class InputBar extends StatelessWidget {
|
||||
if (roomMatch != null) {
|
||||
final roomSearch = roomMatch[1].toLowerCase();
|
||||
for (final r in room.client.rooms) {
|
||||
final state = r.getState('m.room.canonical_alias');
|
||||
if (state != null &&
|
||||
((state.content['alias'] is String &&
|
||||
state.content['alias']
|
||||
.split(':')[0]
|
||||
.toLowerCase()
|
||||
.contains(roomSearch)) ||
|
||||
(state.content['alt_aliases'] is List &&
|
||||
state.content['alt_aliases'].any((l) =>
|
||||
l is String &&
|
||||
l.split(':')[0].toLowerCase().contains(roomSearch))) ||
|
||||
(room.name != null &&
|
||||
room.name.toLowerCase().contains(roomSearch)))) {
|
||||
if (r.getState(EventTypes.RoomTombstone) != null) {
|
||||
continue; // we don't care about tombstoned rooms
|
||||
}
|
||||
final state = r.getState(EventTypes.RoomCanonicalAlias);
|
||||
if ((state != null &&
|
||||
((state.content['alias'] is String &&
|
||||
state.content['alias']
|
||||
.split(':')[0]
|
||||
.toLowerCase()
|
||||
.contains(roomSearch)) ||
|
||||
(state.content['alt_aliases'] is List &&
|
||||
state.content['alt_aliases'].any((l) =>
|
||||
l is String &&
|
||||
l
|
||||
.split(':')[0]
|
||||
.toLowerCase()
|
||||
.contains(roomSearch))))) ||
|
||||
(r.name != null && r.name.toLowerCase().contains(roomSearch))) {
|
||||
ret.add({
|
||||
'type': 'room',
|
||||
'mxid': (r.canonicalAlias != null && r.canonicalAlias.isNotEmpty)
|
||||
|
Loading…
Reference in New Issue
Block a user