[Event] sendAgain with return and mark all sending events as error on start

This commit is contained in:
Christian 2019-06-28 08:38:21 +00:00 committed by Marcel
parent 968b95e5c3
commit 9e096f31f8
2 changed files with 6 additions and 3 deletions

View file

@ -170,10 +170,11 @@ class Event {
}
/// Try to send this event again. Only works with events of status -1.
Future<dynamic> sendAgain({String txid}) async {
if (status != -1) return;
Future<String> sendAgain({String txid}) async {
if (status != -1) return null;
remove();
room.sendTextEvent(text, txid: txid);
final String eventID = await room.sendTextEvent(text, txid: txid);
return eventID;
}
@Deprecated("Use [client.store.getEventList(Room room)] instead!")

View file

@ -69,6 +69,8 @@ class Store {
}
});
await _db.rawUpdate("UPDATE Events SET status=-1 WHERE status=0");
List<Map> list = await _db
.rawQuery("SELECT * FROM Clients WHERE client=?", [client.clientName]);
if (list.length == 1) {