mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Unbust user continue in group chats
This commit is contained in:
@@ -860,9 +860,31 @@ function activateImpersonate(members) {
|
|||||||
return memberIds;
|
return memberIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Activates a group member based on the last message.
|
||||||
|
* @param {string[]} members Array of group member avatar ids
|
||||||
|
* @returns {number[]} Array of character ids
|
||||||
|
*/
|
||||||
function activateSwipe(members) {
|
function activateSwipe(members) {
|
||||||
let activatedNames = [];
|
let activatedNames = [];
|
||||||
|
|
||||||
|
if (chat[chat.length - 1].is_user) {
|
||||||
|
for (const message of chat.slice().reverse()) {
|
||||||
|
if (message.is_system || message.is_user) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (message.original_avatar) {
|
||||||
|
activatedNames.push(message.original_avatar);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (activatedNames.length === 0) {
|
||||||
|
activatedNames.push(shuffle(members.slice())[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// pre-update group chat swipe
|
// pre-update group chat swipe
|
||||||
if (!chat[chat.length - 1].original_avatar) {
|
if (!chat[chat.length - 1].original_avatar) {
|
||||||
const matches = characters.filter(x => x.name == chat[chat.length - 1].name);
|
const matches = characters.filter(x => x.name == chat[chat.length - 1].name);
|
||||||
|
Reference in New Issue
Block a user