refactor: Make parameters more clear and remove unused methods
This commit is contained in:
parent
cf0e8200f0
commit
e170325cae
|
|
@ -82,15 +82,15 @@ abstract class DatabaseApi {
|
||||||
Future<List<Event>> getEventList(
|
Future<List<Event>> getEventList(
|
||||||
Room room, {
|
Room room, {
|
||||||
int start = 0,
|
int start = 0,
|
||||||
bool onlySending,
|
bool onlySending = false,
|
||||||
int limit,
|
int? limit,
|
||||||
});
|
});
|
||||||
|
|
||||||
Future<List<String>> getEventIdList(
|
Future<List<String>> getEventIdList(
|
||||||
Room room, {
|
Room room, {
|
||||||
int start = 0,
|
int start = 0,
|
||||||
bool includeSending = false,
|
bool includeSending = false,
|
||||||
int limit,
|
int? limit,
|
||||||
});
|
});
|
||||||
|
|
||||||
Future<Uint8List?> getFile(Uri mxcUri);
|
Future<Uint8List?> getFile(Uri mxcUri);
|
||||||
|
|
@ -232,20 +232,12 @@ abstract class DatabaseApi {
|
||||||
|
|
||||||
Future removeEvent(String eventId, String roomId);
|
Future removeEvent(String eventId, String roomId);
|
||||||
|
|
||||||
Future updateRoomSortOrder(
|
|
||||||
double oldestSortOrder,
|
|
||||||
double newestSortOrder,
|
|
||||||
String roomId,
|
|
||||||
);
|
|
||||||
|
|
||||||
Future setRoomPrevBatch(
|
Future setRoomPrevBatch(
|
||||||
String prevBatch,
|
String prevBatch,
|
||||||
String roomId,
|
String roomId,
|
||||||
Client client,
|
Client client,
|
||||||
);
|
);
|
||||||
|
|
||||||
Future resetNotificationCount(String roomId);
|
|
||||||
|
|
||||||
Future setVerifiedUserCrossSigningKey(
|
Future setVerifiedUserCrossSigningKey(
|
||||||
bool verified,
|
bool verified,
|
||||||
String userId,
|
String userId,
|
||||||
|
|
|
||||||
|
|
@ -893,15 +893,6 @@ class HiveCollectionsDatabase extends DatabaseApi {
|
||||||
return;
|
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
|
@override
|
||||||
Future<void> setBlockedUserCrossSigningKey(
|
Future<void> setBlockedUserCrossSigningKey(
|
||||||
bool blocked, String userId, String publicKey) async {
|
bool blocked, String userId, String publicKey) async {
|
||||||
|
|
@ -1430,17 +1421,6 @@ class HiveCollectionsDatabase extends DatabaseApi {
|
||||||
return;
|
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
|
@override
|
||||||
Future<List<StoredInboundGroupSession>> getAllInboundGroupSessions() async {
|
Future<List<StoredInboundGroupSession>> getAllInboundGroupSessions() async {
|
||||||
final rawSessions = await _inboundGroupSessionsBox.getAllValues();
|
final rawSessions = await _inboundGroupSessionsBox.getAllValues();
|
||||||
|
|
|
||||||
|
|
@ -829,15 +829,6 @@ class FamedlySdkHiveDatabase extends DatabaseApi {
|
||||||
return;
|
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
|
@override
|
||||||
Future<void> setBlockedUserCrossSigningKey(
|
Future<void> setBlockedUserCrossSigningKey(
|
||||||
bool blocked, String userId, String publicKey) async {
|
bool blocked, String userId, String publicKey) async {
|
||||||
|
|
@ -1390,16 +1381,6 @@ class FamedlySdkHiveDatabase extends DatabaseApi {
|
||||||
return;
|
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
|
@override
|
||||||
Future<List<StoredInboundGroupSession>> getAllInboundGroupSessions() async {
|
Future<List<StoredInboundGroupSession>> getAllInboundGroupSessions() async {
|
||||||
final rawSessions = await Future.wait(_inboundGroupSessionsBox.keys
|
final rawSessions = await Future.wait(_inboundGroupSessionsBox.keys
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue