diff --git a/src/main.js b/src/main.js index 82a67efc..0b9ef4b8 100644 --- a/src/main.js +++ b/src/main.js @@ -76,6 +76,7 @@ export default async function main(container) { if (needsInitialSync) { showSession(container, session, sync); } + session.notifyNetworkAvailable(); } catch(err) { console.error(`${err.message}:\n${err.stack}`); } diff --git a/src/matrix/room/room.js b/src/matrix/room/room.js index 42d3eef1..cb47eb27 100644 --- a/src/matrix/room/room.js +++ b/src/matrix/room/room.js @@ -42,6 +42,10 @@ export default class Room extends EventEmitter { } } + resumeSending() { + this._sendQueue.resumeSending(); + } + load(summary, txn) { this._summary.load(summary); return this._syncWriter.load(txn); diff --git a/src/matrix/session.js b/src/matrix/session.js index 15b45181..251debb9 100644 --- a/src/matrix/session.js +++ b/src/matrix/session.js @@ -38,6 +38,12 @@ export default class Session { })); } + notifyNetworkAvailable() { + for (const room of this._rooms) { + room.resumeSending(); + } + } + async _getPendingEventsByRoom(txn) { const pendingEvents = await txn.pendingEvents.getAll(); return pendingEvents.reduce((groups, pe) => {