Fix Delete function
This commit is contained in:
parent
e73d33a5e8
commit
9b0b3c0ee5
|
@ -153,6 +153,9 @@ class Event {
|
|||
/// from the database and the timelines.
|
||||
Future<dynamic> remove() async {
|
||||
if (status < 1) {
|
||||
if (room.client.store != null)
|
||||
room.client.store.db.rawDelete("DELETE FROM Events WHERE id=?", [id]);
|
||||
|
||||
room.client.connection.onEvent.add(EventUpdate(
|
||||
roomID: room.id,
|
||||
type: "timeline",
|
||||
|
|
|
@ -220,11 +220,7 @@ class Store {
|
|||
}
|
||||
|
||||
// Save the event in the database
|
||||
if (status == -2) {
|
||||
txn.rawDelete(
|
||||
"DELETE FROM Events WHERE id=?", [eventContent["event_id"]]);
|
||||
} else if ((status == 1 || status == -1) &&
|
||||
eventContent["txid"] is String)
|
||||
if ((status == 1 || status == -1) && eventContent["txid"] is String)
|
||||
txn.rawUpdate("UPDATE Events SET status=?, id=?, WHERE id=?",
|
||||
[status, eventContent["event_id"], eventContent["txid"]]);
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue