Remove custom code for renaming groups

Was something for my local matrix
environment, committed
accidentally.
This commit is contained in:
Brandon Presley 2023-12-30 15:54:30 +13:00
parent 1aa73bbd7e
commit 2039b4e90d

View File

@ -28,22 +28,6 @@ class _RoomsPageState extends State<RoomsPage> {
context, MaterialPageRoute(builder: (context) => RoomPage(room: room)));
}
void fixNames(Client client) async {
final rooms = client.rooms
.where((element) =>
element.getLocalizedDisplayname().contains("Group with"))
.toList();
for (final room in rooms) {
print("Setting power level to 100...");
final result = await room.setPower(client.userID!, 100);
print("Result=$result");
print("Fixing ${room.getLocalizedDisplayname()}...");
await room.setName(
room.getLocalizedDisplayname().replaceAll(RegExp("Group with"), ""));
}
print("Fixed all.");
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -108,10 +92,6 @@ class _RoomsPageState extends State<RoomsPage> {
});
});
return ElevatedButton(
onPressed: () => fixNames(provider.client),
child: const Text("Fix names"));
if (provider.client.rooms.isEmpty)
return const CircularProgressIndicator();
else