[Event] Refactoring
This commit is contained in:
parent
f7e74436f4
commit
e73d33a5e8
|
@ -224,9 +224,9 @@ class Store {
|
|||
txn.rawDelete(
|
||||
"DELETE FROM Events WHERE id=?", [eventContent["event_id"]]);
|
||||
} else if ((status == 1 || status == -1) &&
|
||||
eventUpdate.content["txid"] is String)
|
||||
eventContent["txid"] is String)
|
||||
txn.rawUpdate("UPDATE Events SET status=?, id=?, WHERE id=?",
|
||||
[status, eventContent["event_id"], eventUpdate.content["txid"]]);
|
||||
[status, eventContent["event_id"], eventContent["txid"]]);
|
||||
else
|
||||
txn.rawInsert(
|
||||
"INSERT OR REPLACE INTO Events VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)", [
|
||||
|
|
|
@ -47,9 +47,10 @@ class Timeline {
|
|||
int i;
|
||||
for (i = 0; i < events.length; i++) {
|
||||
if (events[i].content.containsKey("txid") &&
|
||||
events[i].content["txid"] == txid ||
|
||||
(txid != null && events[i].content["txid"] == txid) ||
|
||||
events[i].id == event_id ||
|
||||
(events[i].content["txid"] == unsigned_txid)) break;
|
||||
(unsigned_txid != null && events[i].content["txid"] == unsigned_txid))
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue