1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-11 00:20:54 +00:00
* Changed: Make the badge visibility settings page a bit nicer.
* Changed: Display add-on's maintainers field in the add-ons list.
* API Fixed: When iterating chat messages, include tokenized messages that have not been pushed out of the buffer yet.
This commit is contained in:
SirStendec 2023-11-03 16:04:35 -04:00
parent 71f347ab70
commit a5e5082d63
10 changed files with 81 additions and 11 deletions

View file

@ -1122,6 +1122,42 @@ export default class ChatHook extends Module {
this.updateLineBorders();
//this.updateMentionCSS();
this.on('chat:get-messages-late', (include_chat, include_whisper, include_video, messages) => {
if ( ! include_chat )
return;
const msg_ids = new Set(messages.map(x => x.message?.id));
for(const inst of this.ChatBuffer.instances) {
for(const msg of inst.buffer) {
const msg_id = msg?.id;
if ( ! msg_id || msg_ids.has(msg_id) || ! msg.ffz_standardized )
continue;
msg_ids.add(msg_id);
messages.push({
message: msg,
_instance: null,
update: () => null
});
}
for(const raw of inst.delayedMessageBuffer) {
const msg = raw?.event,
msg_id = msg?.id;
if ( ! msg_id || msg_ids.has(msg_id) || ! msg.ffz_standardized )
continue;
msg_ids.add(msg_id);
messages.push({
message: msg,
_instance: null,
update: () => null
});
}
}
});
this.on('chat:get-tab-commands', e => {
e.commands.push({
name: 'reconnect',