Приведение chacha_key_plain к hex для транспортировки

This commit is contained in:
RoyceDa
2026-03-28 17:20:03 +02:00
parent 81f5e66c56
commit f5bfa153b6
2 changed files with 5 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ import { ReplyedMessage } from "../ReplyedMessage/ReplyedMessage";
import { IconX } from "@tabler/icons-react";
import { useSetting } from "@/app/providers/SettingsProvider/useSetting";
import { modals } from "@mantine/modals";
import { MessageReply } from "@/app/providers/DialogProvider/useReplyMessages";
export function MessageReplyMessages(props: AttachmentProps) {
const colors = useRosettaColors();
@@ -14,7 +15,7 @@ export function MessageReplyMessages(props: AttachmentProps) {
('bgInReplyMessages', '');
const reply = JSON.parse(props.attachment.blob);
//console.info("Mreply", reply);
console.info("Mreply", reply);
const closeAlert = () => {
modals.openConfirmModal({
@@ -40,8 +41,8 @@ export function MessageReplyMessages(props: AttachmentProps) {
{reply.length <= 0 &&
<Skeleton h={50} w={'100%'}></Skeleton>
}
{reply.map((msg, index) => (
<ReplyedMessage parent={props.parent} chacha_key_plain={msg.chacha_key_plain} key={index} messageReply={msg}></ReplyedMessage>
{reply.map((msg : MessageReply, index) => (
<ReplyedMessage parent={props.parent} chacha_key_plain={Buffer.from(msg.chacha_key_plain, 'hex').toString('utf-8')} key={index} messageReply={msg}></ReplyedMessage>
))}
{showAlertInReplyMessages && <Alert style={{
borderTopLeftRadius: 0,

View File

@@ -52,6 +52,7 @@ export function useReplyMessages() {
*/
return;
}
message.chacha_key_plain = Buffer.from(message.chacha_key_plain).toString('hex');
replyMessages.messages.push(message);
const sortedByTime = replyMessages.messages.sort((a, b) => a.timestamp - b.timestamp);