From 11b3162aa422b07b4870824699228f6e37888d7a Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Wed, 27 Mar 2024 22:11:19 +0100 Subject: [PATCH 1/2] Include swipeid to all messages in chat --- public/script.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/script.js b/public/script.js index 38ed270cd..77b5728f6 100644 --- a/public/script.js +++ b/public/script.js @@ -1855,6 +1855,7 @@ function insertSVGIcon(mes, extra) { function getMessageFromTemplate({ mesId, + swipeId, characterName, isUser, avatarImg, @@ -1872,6 +1873,7 @@ function getMessageFromTemplate({ const mes = messageTemplate.clone(); mes.attr({ 'mesid': mesId, + 'swipeid': swipeId, 'ch_name': characterName, 'is_user': isUser, 'is_system': !!isSystem, @@ -2018,6 +2020,7 @@ function addOneMessage(mes, { type = 'normal', insertAfter = null, scroll = true let params = { mesId: forceId ?? chat.length - 1, + swipeId: mes.swipes?.indexOf(mes.mes) ?? mes.swipe_id ?? 0, characterName: mes.name, isUser: mes.is_user, avatarImg: avatarImg, From b8c6e6c85c92b6a0487c8b88f7dfe2b180d877a6 Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Wed, 27 Mar 2024 23:12:40 +0100 Subject: [PATCH 2/2] Remove unnecessary swipe id check --- public/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/script.js b/public/script.js index 77b5728f6..c86106b8f 100644 --- a/public/script.js +++ b/public/script.js @@ -2020,7 +2020,7 @@ function addOneMessage(mes, { type = 'normal', insertAfter = null, scroll = true let params = { mesId: forceId ?? chat.length - 1, - swipeId: mes.swipes?.indexOf(mes.mes) ?? mes.swipe_id ?? 0, + swipeId: mes.swipe_id ?? 0, characterName: mes.name, isUser: mes.is_user, avatarImg: avatarImg,