Add the agent scaffold, mobile web UI, voice auto-leave, and text notifications
This commit is contained in:
@@ -61,6 +61,27 @@ export class MessageCache {
|
||||
return merged;
|
||||
}
|
||||
|
||||
/** Update cached content after an edit. */
|
||||
edit(channelId: string, messageId: string, content: string): boolean {
|
||||
const messages = this.get(channelId);
|
||||
const message = messages.find(item => item.id === messageId);
|
||||
if (!message) return false;
|
||||
|
||||
message.content = content;
|
||||
this.write(channelId, messages);
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Drop a deleted message from the cache. */
|
||||
remove(channelId: string, messageId: string): boolean {
|
||||
const messages = this.get(channelId);
|
||||
const next = messages.filter(item => item.id !== messageId);
|
||||
if (next.length === messages.length) return false;
|
||||
|
||||
this.write(channelId, next);
|
||||
return true;
|
||||
}
|
||||
|
||||
private file(channelId: string): string {
|
||||
return join(this.dir, `${channelId}.json`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user