feat: Add notifications
This commit is contained in:
@@ -75,6 +75,17 @@ export class BrowserDatabaseService {
|
||||
.map((message) => this.normaliseMessage(message));
|
||||
}
|
||||
|
||||
async getMessagesSince(roomId: string, sinceTimestamp: number): Promise<Message[]> {
|
||||
const allRoomMessages = await this.getAllFromIndex<Message>(
|
||||
STORE_MESSAGES, 'roomId', roomId
|
||||
);
|
||||
|
||||
return allRoomMessages
|
||||
.filter((message) => message.timestamp > sinceTimestamp)
|
||||
.sort((first, second) => first.timestamp - second.timestamp)
|
||||
.map((message) => this.normaliseMessage(message));
|
||||
}
|
||||
|
||||
/** Delete a message by its ID. */
|
||||
async deleteMessage(messageId: string): Promise<void> {
|
||||
await this.deleteRecord(STORE_MESSAGES, messageId);
|
||||
|
||||
Reference in New Issue
Block a user