Remove custom code for renaming groups
Was something for my local matrix environment, committed accidentally.
This commit is contained in:
parent
1aa73bbd7e
commit
2039b4e90d
|
@ -28,22 +28,6 @@ class _RoomsPageState extends State<RoomsPage> {
|
||||||
context, MaterialPageRoute(builder: (context) => RoomPage(room: room)));
|
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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
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)
|
if (provider.client.rooms.isEmpty)
|
||||||
return const CircularProgressIndicator();
|
return const CircularProgressIndicator();
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user