Skip to content

Commit e1f73db

Browse files
formatring
1 parent 5b3d3b5 commit e1f73db

23 files changed

Lines changed: 134 additions & 115 deletions

commet/lib/client/client_manager.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ class ClientManager {
1717

1818
final NotifyingMap<String, Client> _clients = NotifyingMap();
1919

20-
late final NotifyingMap<String, Room> _rooms = NotifyingSubMap(_all_rooms, null);
20+
late final NotifyingMap<String, Room> _rooms =
21+
NotifyingSubMap(_all_rooms, null);
2122

22-
late final NotifyingMap<String, Space> _spaces = NotifyingSubMap(_all_rooms, null);
23+
late final NotifyingMap<String, Space> _spaces =
24+
NotifyingSubMap(_all_rooms, null);
2325

2426
NotifyingMap<String, Room> get motifyingMapRoom => _rooms;
2527
NotifyingMap<String, Space> get motifyingMapSpace => _spaces;

commet/lib/client/components/calendar_room/calendar_sync.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class CalendarSync {
2626
]);
2727

2828
Timer(Duration(minutes: 30), () => syncAllClients());
29-
}
29+
}
3030

3131
Future<void> syncClient(Client client) async {
3232
// Wait for client to come online

commet/lib/client/components/user_presence/user_presence_lifecycle_watcher.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class UserPresenceLifecycleWatcher {
5252
component.setStatus(state);
5353
}
5454
}
55-
55+
5656
lastUpdatedStatus = now;
5757
}
5858
}

commet/lib/client/matrix/components/direct_messages/matrix_direct_messages_component.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ class MatrixDirectMessagesComponent
113113

114114
void updateNotificationsList() {
115115
highlightedRoomsList = directMessageRooms
116-
.where((e) =>
117-
e.displayNotificationCount > 0 && e.roomId != currentRoomId)
116+
.where(
117+
(e) => e.displayNotificationCount > 0 && e.roomId != currentRoomId)
118118
.toList();
119119

120120
highlightedListUpdated.add(null);

commet/lib/client/matrix/extensions/matrix_client_extensions.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ extension MatrixExtensions on Client {
6262
avatar: image,
6363
numMembers: numMembers,
6464
visibility: visibility,
65-
topic: topic, clientId: this.clientName);
65+
topic: topic,
66+
clientId: this.clientName);
6667
}
6768

6869
return null;

commet/lib/client/matrix/matrix_client.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ class MatrixClient extends Client {
5353

5454
late String _id;
5555

56-
late final NotifyingMap<String, Room> _rooms = NotifyingSubMap(clientManager.motifyingMapRoom, (e) => e?.clientId == _id);
56+
late final NotifyingMap<String, Room> _rooms = NotifyingSubMap(
57+
clientManager.motifyingMapRoom, (e) => e?.clientId == _id);
5758

58-
late final NotifyingMap<String, Space> _spaces = NotifyingSubMap(clientManager.motifyingMapSpace, (e) => e?.clientId == _id);
59+
late final NotifyingMap<String, Space> _spaces = NotifyingSubMap(
60+
clientManager.motifyingMapSpace, (e) => e?.clientId == _id);
5961

6062
late final NotifyingMap<String, Peer> _peers = NotifyingMap();
6163

@@ -602,12 +604,14 @@ class MatrixClient extends Client {
602604

603605
@override
604606
bool hasRoom(String identifier) {
605-
return _rooms.containsKey(BaseRoom.get_localId(identifier, this.identifier));
607+
return _rooms
608+
.containsKey(BaseRoom.get_localId(identifier, this.identifier));
606609
}
607610

608611
@override
609612
bool hasSpace(String identifier) {
610-
return _spaces.containsKey(BaseRoom.get_localId(identifier, this.identifier));
613+
return _spaces
614+
.containsKey(BaseRoom.get_localId(identifier, this.identifier));
611615
}
612616

613617
(String, List<String>?)? parseAddressToIdAndVia(String address) {

commet/lib/client/matrix/matrix_room.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ class MatrixRoom extends Room {
847847

848848
await tl.setReadMarker();
849849
}
850-
850+
851851
@override
852852
String get clientId => client.identifier;
853853
}

commet/lib/client/matrix/matrix_room_preview.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ class MatrixSpaceRoomChunkPreview extends RoomPreview {
4848

4949
@override
5050
RoomVisibility? get visibility => null;
51-
51+
5252
@override
5353
String get clientId => matrixClient.clientName;
54-
5554
}

commet/lib/client/matrix/matrix_space.dart

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,9 @@ class MatrixSpace extends Space {
289289
}
290290

291291
if (room != null) {
292-
if (!containsRoom(room.roomId) &&
293-
!client.hasSpace(room.roomId)) {
292+
if (!containsRoom(room.roomId) && !client.hasSpace(room.roomId)) {
294293
_rooms.add(room);
295-
_previews
296-
.removeWhere((element) => element.roomId == room.roomId);
294+
_previews.removeWhere((element) => element.roomId == room.roomId);
297295
}
298296
}
299297
}
@@ -329,8 +327,7 @@ class MatrixSpace extends Space {
329327

330328
@override
331329
Future<List<RoomPreview>> fetchChildren() async {
332-
var response =
333-
await _matrixClient.getSpaceHierarchy(roomId, maxDepth: 5);
330+
var response = await _matrixClient.getSpaceHierarchy(roomId, maxDepth: 5);
334331

335332
return response.rooms
336333
.where((element) => element.roomId != roomId)
@@ -354,8 +351,7 @@ class MatrixSpace extends Space {
354351

355352
@override
356353
Future<void> loadExtra() async {
357-
var response =
358-
await _matrixClient.getSpaceHierarchy(roomId, maxDepth: 1);
354+
var response = await _matrixClient.getSpaceHierarchy(roomId, maxDepth: 1);
359355

360356
// read child rooms
361357
response.rooms
@@ -499,7 +495,7 @@ class MatrixSpace extends Space {
499495
Future<void> removeChild(SpaceChild<dynamic> child) async {
500496
await matrixRoom.removeSpaceChild(child.id);
501497
}
502-
498+
503499
@override
504500
String get clientId => client.identifier;
505501
}

commet/lib/client/matrix_background/matrix_background_room.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ class MatrixBackgroundRoom implements Room {
128128
Future<Member> fetchMember(String id) async {
129129
var db = backgroundClient.database.db;
130130
var data = await (db.select(db.roomMembers)
131-
..where(
132-
(tbl) => tbl.roomId.equals(roomId) & tbl.userId.equals(id)))
131+
..where((tbl) => tbl.roomId.equals(roomId) & tbl.userId.equals(id)))
133132
.getSingleOrNull();
134133

135134
MatrixBackgroundMember result = MatrixBackgroundMember(id);
@@ -163,8 +162,7 @@ class MatrixBackgroundRoom implements Room {
163162

164163
@override
165164
Future<TimelineEvent<Client>?> getEvent(String eventId) async {
166-
var result =
167-
await backgroundClient.api.getOneRoomEvent(roomId, eventId);
165+
var result = await backgroundClient.api.getOneRoomEvent(roomId, eventId);
168166
Log.i("Received event: ${result}");
169167

170168
if ([
@@ -346,7 +344,7 @@ class MatrixBackgroundRoom implements Room {
346344
// TODO: implement markAsRead
347345
throw UnimplementedError();
348346
}
349-
347+
350348
@override
351349
// TODO: implement clientId
352350
String get clientId => client.identifier;

0 commit comments

Comments
 (0)