refactor: Make parameters more clear and remove unused methods

This commit is contained in:
Krille 2023-05-05 13:38:56 +02:00
parent cf0e8200f0
commit e170325cae
No known key found for this signature in database
3 changed files with 3 additions and 50 deletions

View File

@ -82,15 +82,15 @@ abstract class DatabaseApi {
Future<List<Event>> getEventList(
Room room, {
int start = 0,
bool onlySending,
int limit,
bool onlySending = false,
int? limit,
});
Future<List<String>> getEventIdList(
Room room, {
int start = 0,
bool includeSending = false,
int limit,
int? limit,
});
Future<Uint8List?> getFile(Uri mxcUri);
@ -232,20 +232,12 @@ abstract class DatabaseApi {
Future removeEvent(String eventId, String roomId);
Future updateRoomSortOrder(
double oldestSortOrder,
double newestSortOrder,
String roomId,
);
Future setRoomPrevBatch(
String prevBatch,
String roomId,
Client client,
);
Future resetNotificationCount(String roomId);
Future setVerifiedUserCrossSigningKey(
bool verified,
String userId,

View File

@ -893,15 +893,6 @@ class HiveCollectionsDatabase extends DatabaseApi {
return;
}
@override
Future<void> resetNotificationCount(String roomId) async {
final raw = await _roomsBox.get(roomId);
if (raw == null) return;
raw['notification_count'] = raw['highlight_count'] = 0;
await _roomsBox.put(roomId, raw);
return;
}
@override
Future<void> setBlockedUserCrossSigningKey(
bool blocked, String userId, String publicKey) async {
@ -1430,17 +1421,6 @@ class HiveCollectionsDatabase extends DatabaseApi {
return;
}
@override
Future<void> updateRoomSortOrder(
double oldestSortOrder, double newestSortOrder, String roomId) async {
final raw = await _roomsBox.get(roomId);
if (raw == null) throw ('Room not found');
raw['oldest_sort_order'] = oldestSortOrder;
raw['newest_sort_order'] = newestSortOrder;
await _roomsBox.put(roomId, raw);
return;
}
@override
Future<List<StoredInboundGroupSession>> getAllInboundGroupSessions() async {
final rawSessions = await _inboundGroupSessionsBox.getAllValues();

View File

@ -829,15 +829,6 @@ class FamedlySdkHiveDatabase extends DatabaseApi {
return;
}
@override
Future<void> resetNotificationCount(String roomId) async {
final raw = await _roomsBox.get(roomId.toHiveKey);
if (raw == null) return;
raw['notification_count'] = raw['highlight_count'] = 0;
await _roomsBox.put(roomId.toHiveKey, raw);
return;
}
@override
Future<void> setBlockedUserCrossSigningKey(
bool blocked, String userId, String publicKey) async {
@ -1390,16 +1381,6 @@ class FamedlySdkHiveDatabase extends DatabaseApi {
return;
}
@override
Future<void> updateRoomSortOrder(
double oldestSortOrder, double newestSortOrder, String roomId) async {
final raw = await _roomsBox.get(roomId.toHiveKey);
raw['oldest_sort_order'] = oldestSortOrder;
raw['newest_sort_order'] = newestSortOrder;
await _roomsBox.put(roomId.toHiveKey, raw);
return;
}
@override
Future<List<StoredInboundGroupSession>> getAllInboundGroupSessions() async {
final rawSessions = await Future.wait(_inboundGroupSessionsBox.keys