Add removing of forgotten rooms
This commit is contained in:
parent
9bd377c4be
commit
b3bb4e6531
|
@ -233,6 +233,7 @@ class Room {
|
|||
|
||||
/// Call the Matrix API to forget this room if you already left it.
|
||||
Future<dynamic> forget() async {
|
||||
client.store.forgetRoom(id);
|
||||
dynamic res = await client.connection
|
||||
.jsonRequest(type: "POST", action: "/client/r0/rooms/${id}/forget");
|
||||
if (res is ErrorResponse) client.connection.onError.add(res);
|
||||
|
|
|
@ -576,6 +576,11 @@ class Store {
|
|||
return directChats;
|
||||
}
|
||||
|
||||
Future<void> forgetRoom(String roomID) async {
|
||||
await db.rawDelete("DELETE FROM Rooms WHERE id=?", [roomID]);
|
||||
return;
|
||||
}
|
||||
|
||||
/// The database sheme for the Client class.
|
||||
static final String ClientsScheme = 'CREATE TABLE IF NOT EXISTS Clients(' +
|
||||
'client TEXT PRIMARY KEY, ' +
|
||||
|
|
Loading…
Reference in a new issue