ChatCache

Move the functionality to cache the contents of a chat bar from the room directly and to a new ChatCache object. This works pretty much the same with a few extra check and balances, this also made it easy to put a test suite around the functionality so I did. The current functionality should be identical to what exists.

This is in prep for threads which will require managing even more caches if we create one per thread.
This commit is contained in:
James Graham
2023-10-15 12:55:56 +00:00
parent f5417a6227
commit a57744891a
22 changed files with 775 additions and 410 deletions

View File

@@ -93,8 +93,8 @@ Loader {
text: i18n("Edit")
icon.name: "document-edit"
onTriggered: {
currentRoom.chatBoxEditId = eventId;
currentRoom.chatBoxReplyId = "";
currentRoom.editCache.editId = eventId;
currentRoom.mainCache.replyId = "";
}
visible: author.isLocalUser && (root.delegateType === DelegateType.Emote || root.delegateType === DelegateType.Message)
},
@@ -102,8 +102,8 @@ Loader {
text: i18n("Reply")
icon.name: "mail-replied-symbolic"
onTriggered: {
currentRoom.chatBoxReplyId = eventId;
currentRoom.chatBoxEditId = "";
currentRoom.mainCache.replyId = eventId;
currentRoom.editCache.editId = "";
}
},
Kirigami.Action {