Skip to content

Commit 62fc2d0

Browse files
formatring
1 parent ddea2bd commit 62fc2d0

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
@@ -56,9 +56,11 @@ class MatrixClient extends Client {
5656

5757
late String _id;
5858

59-
late final NotifyingMap<String, Room> _rooms = NotifyingSubMap(clientManager.motifyingMapRoom, (e) => e?.clientId == _id);
59+
late final NotifyingMap<String, Room> _rooms = NotifyingSubMap(
60+
clientManager.motifyingMapRoom, (e) => e?.clientId == _id);
6061

61-
late final NotifyingMap<String, Space> _spaces = NotifyingSubMap(clientManager.motifyingMapSpace, (e) => e?.clientId == _id);
62+
late final NotifyingMap<String, Space> _spaces = NotifyingSubMap(
63+
clientManager.motifyingMapSpace, (e) => e?.clientId == _id);
6264

6365
late final NotifyingMap<String, Peer> _peers = NotifyingMap();
6466

@@ -623,12 +625,14 @@ class MatrixClient extends Client {
623625

624626
@override
625627
bool hasRoom(String identifier) {
626-
return _rooms.containsKey(BaseRoom.get_localId(identifier, this.identifier));
628+
return _rooms
629+
.containsKey(BaseRoom.get_localId(identifier, this.identifier));
627630
}
628631

629632
@override
630633
bool hasSpace(String identifier) {
631-
return _spaces.containsKey(BaseRoom.get_localId(identifier, this.identifier));
634+
return _spaces
635+
.containsKey(BaseRoom.get_localId(identifier, this.identifier));
632636
}
633637

634638
(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
@@ -830,7 +830,7 @@ class MatrixRoom extends Room {
830830

831831
await tl.setReadMarker();
832832
}
833-
833+
834834
@override
835835
String get clientId => client.identifier;
836836
}

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
@@ -244,11 +244,9 @@ class MatrixSpace extends Space {
244244
}
245245

246246
if (room != null) {
247-
if (!containsRoom(room.roomId) &&
248-
!client.hasSpace(room.roomId)) {
247+
if (!containsRoom(room.roomId) && !client.hasSpace(room.roomId)) {
249248
_rooms.add(room);
250-
_previews
251-
.removeWhere((element) => element.roomId == room.roomId);
249+
_previews.removeWhere((element) => element.roomId == room.roomId);
252250
}
253251
}
254252
}
@@ -284,8 +282,7 @@ class MatrixSpace extends Space {
284282

285283
@override
286284
Future<List<RoomPreview>> fetchChildren() async {
287-
var response =
288-
await _matrixClient.getSpaceHierarchy(roomId, maxDepth: 5);
285+
var response = await _matrixClient.getSpaceHierarchy(roomId, maxDepth: 5);
289286

290287
return response.rooms
291288
.where((element) => element.roomId != roomId)
@@ -328,8 +325,7 @@ class MatrixSpace extends Space {
328325

329326
@override
330327
Future<void> loadExtra() async {
331-
var response =
332-
await _matrixClient.getSpaceHierarchy(roomId, maxDepth: 1);
328+
var response = await _matrixClient.getSpaceHierarchy(roomId, maxDepth: 1);
333329

334330
// read child rooms
335331
response.rooms
@@ -465,7 +461,7 @@ class MatrixSpace extends Space {
465461
Future<void> setTopic(String topic) {
466462
return matrixRoom.setDescription(topic);
467463
}
468-
464+
469465
@override
470466
String get clientId => client.identifier;
471467
}

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)