This repository has been archived on 2022-08-19. You can view files and clone it, but cannot push or open issues or pull requests.
hydrogen-web/src/session.js

34 lines
553 B
JavaScript
Raw Normal View History

2018-12-21 19:05:24 +05:30
class Session {
// sessionData has device_id and access_token
constructor(sessionData) {
this._sessionData = sessionData;
}
loadFromStorage() {
// what is the PK for a session [user_id, device_id], a uuid?
}
start() {
if (!this._syncToken) {
do initial sync
}
do incremental sync
}
stop() {
if (this._initialSync) {
this._initialSync.abort();
}
if (this._incrementalSync) {
this._incrementalSync.stop();
}
}
getRoom(roomId) {
return this._rooms[roomId];
}
applySync(newRooms, syncToken, accountData) {
}
}