mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-11 01:20:12 +01:00
Merge pull request #2823 from SillyTavern/fix-sendas-forced-avatar
Fix `/sendas` to not always enforce avatar, if not needed in solo chats
This commit is contained in:
commit
c4cc33cad9
@ -24,6 +24,7 @@ import {
|
||||
main_api,
|
||||
name1,
|
||||
name2,
|
||||
neutralCharacterName,
|
||||
reloadCurrentChat,
|
||||
removeMacros,
|
||||
renameCharacter,
|
||||
@ -3129,7 +3130,13 @@ export async function sendMessageAs(args, text) {
|
||||
const character = characters.find(x => x.avatar === name) ?? characters.find(x => x.name === name);
|
||||
let force_avatar, original_avatar;
|
||||
|
||||
if (character && character.avatar !== 'none') {
|
||||
const chatCharacter = this_chid !== undefined ? characters[this_chid] : null;
|
||||
const isNeutralCharacter = !chatCharacter && name2 === neutralCharacterName && name === neutralCharacterName;
|
||||
|
||||
if (chatCharacter === character || isNeutralCharacter) {
|
||||
// If the targeted character is the currently selected one in a solo chat, we don't need to force any avatars
|
||||
}
|
||||
else if (character && character.avatar !== 'none') {
|
||||
force_avatar = getThumbnailUrl('avatar', character.avatar);
|
||||
original_avatar = character.avatar;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user