Merge branch 'event-enhance-sending-stability' into 'master'

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

See merge request famedly/famedlysdk!22
This commit is contained in:
Marcel 2019-06-28 08:38:21 +00:00
commit 0e8bfa2889
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) {