mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-23 22:12:34 +01:00
fix: Joining room aliases not published into the room directory
This commit is contained in:
parent
91b29f7b70
commit
dbadbc59e2
@ -23,7 +23,6 @@ class SearchController extends State<Search> {
|
||||
String lastServer;
|
||||
Timer _coolDown;
|
||||
String genericSearchTerm;
|
||||
String alias;
|
||||
|
||||
void search(String query) async {
|
||||
setState(() => null);
|
||||
|
@ -32,21 +32,21 @@ class SearchView extends StatelessWidget {
|
||||
genericSearchTerm: controller.genericSearchTerm,
|
||||
)
|
||||
.catchError((error) {
|
||||
if (controller.alias == null) {
|
||||
if (!(controller.genericSearchTerm?.isValidMatrixId ?? false)) {
|
||||
throw error;
|
||||
}
|
||||
return PublicRoomsResponse.fromJson({
|
||||
'chunk': [],
|
||||
});
|
||||
}).then((PublicRoomsResponse res) {
|
||||
if (controller.alias != null &&
|
||||
if (controller.genericSearchTerm != null &&
|
||||
!res.chunk.any((room) =>
|
||||
(room.aliases?.contains(controller.alias) ?? false) ||
|
||||
room.canonicalAlias == controller.alias)) {
|
||||
(room.aliases?.contains(controller.genericSearchTerm) ?? false) ||
|
||||
room.canonicalAlias == controller.genericSearchTerm)) {
|
||||
// we have to tack on the original alias
|
||||
res.chunk.add(PublicRoom.fromJson(<String, dynamic>{
|
||||
'aliases': [controller.alias],
|
||||
'name': controller.alias,
|
||||
'aliases': [controller.genericSearchTerm],
|
||||
'name': controller.genericSearchTerm,
|
||||
}));
|
||||
}
|
||||
return res;
|
||||
|
Loading…
Reference in New Issue
Block a user