0fd52be710
that's why numeric parts of the keys have to be encoded as a fixed length, "big-endian" ordered strings, so string sorting will also sort the numeric keys correctly. this also assumes room ids don't contain the "|" character, we should probably escape the separator at some point.
19 lines
373 B
JavaScript
19 lines
373 B
JavaScript
export default class RoomStateStore {
|
|
constructor(idbStore) {
|
|
this._roomStateStore = idbStore;
|
|
}
|
|
|
|
async getEvents(type) {
|
|
|
|
}
|
|
|
|
async getEventsForKey(type, stateKey) {
|
|
|
|
}
|
|
|
|
async setStateEvent(roomId, event) {
|
|
const key = `${roomId}|${event.type}|${event.state_key}`;
|
|
const entry = {roomId, event, key};
|
|
return this._roomStateStore.put(entry);
|
|
}
|
|
}
|