Новая система пересылки сообщений без трансляции и транскодирования вложений

This commit is contained in:
RoyceDa
2026-03-28 17:07:43 +02:00
parent c9cff515e5
commit aaa4b4283a
4 changed files with 8 additions and 5 deletions

View File

@@ -41,7 +41,7 @@ export function MessageReplyMessages(props: AttachmentProps) {
<Skeleton h={50} w={'100%'}></Skeleton> <Skeleton h={50} w={'100%'}></Skeleton>
} }
{reply.map((msg, index) => ( {reply.map((msg, index) => (
<ReplyedMessage parent={props.parent} chacha_key_plain={props.chacha_key_plain} key={index} messageReply={msg}></ReplyedMessage> <ReplyedMessage parent={props.parent} chacha_key_plain={msg.chacha_key_plain} key={index} messageReply={msg}></ReplyedMessage>
))} ))}
{showAlertInReplyMessages && <Alert style={{ {showAlertInReplyMessages && <Alert style={{
borderTopLeftRadius: 0, borderTopLeftRadius: 0,

View File

@@ -104,7 +104,7 @@ export function Message(props: MessageProps) {
message: props.message, message: props.message,
attachments: props.attachments.filter(a => a.type != AttachmentType.MESSAGES), attachments: props.attachments.filter(a => a.type != AttachmentType.MESSAGES),
message_id: props.message_id, message_id: props.message_id,
chacha_key_plain: props.chacha_key_plain
}; };
const avatars = useAvatars(user.publicKey); const avatars = useAvatars(user.publicKey);
@@ -126,6 +126,9 @@ export function Message(props: MessageProps) {
if (props.replyed) { if (props.replyed) {
return false; return false;
} }
if(props.chacha_key_plain == ""){
return false;
}
if (messageReply.attachments.find((v) => ATTACHMENTS_NOT_ALLOWED_TO_REPLY.includes(v.type))) { if (messageReply.attachments.find((v) => ATTACHMENTS_NOT_ALLOWED_TO_REPLY.includes(v.type))) {
return false; return false;
} }
@@ -215,7 +218,7 @@ export function Message(props: MessageProps) {
fontSize: '13px', fontSize: '13px',
color: messageStyle == MessageStyle.BUBBLES ? (computedTheme == 'light' ? (props.parent?.from_me ? 'white' : 'black') : 'white') : (computedTheme == 'light' ? 'black' : 'white') color: messageStyle == MessageStyle.BUBBLES ? (computedTheme == 'light' ? (props.parent?.from_me ? 'white' : 'black') : 'white') : (computedTheme == 'light' ? 'black' : 'white')
}} ml={props.avatar_no_render ? 50 : undefined} onDoubleClick={(e) => e.stopPropagation()}> }} ml={props.avatar_no_render ? 50 : undefined} onDoubleClick={(e) => e.stopPropagation()}>
<TextParser performanceEntityLimit={ENTITY_LIMITS_TO_PARSE_IN_MESSAGE} oversizeIfTextSmallerThan={1} text={props.message.trim() + props.chacha_key_plain}></TextParser> <TextParser performanceEntityLimit={ENTITY_LIMITS_TO_PARSE_IN_MESSAGE} oversizeIfTextSmallerThan={1} text={props.message.trim()}></TextParser>
</Box> </Box>
</Flex> </Flex>
</Flex> </Flex>

View File

@@ -103,7 +103,7 @@ export function useDialog() : {
content: content, content: content,
timestamp: Date.now(), timestamp: Date.now(),
readed: publicKey == dialog ? 1 : 0, readed: publicKey == dialog ? 1 : 0,
chacha_key: aesChachaKey, chacha_key: key.toString('utf-8'),
from_me: 1, from_me: 1,
plain_message: message, plain_message: message,
delivered: publicKey == dialog ? DeliveredMessageState.DELIVERED : DeliveredMessageState.WAITING, delivered: publicKey == dialog ? DeliveredMessageState.DELIVERED : DeliveredMessageState.WAITING,

View File

@@ -19,7 +19,7 @@ export interface MessageReply {
message: string; message: string;
attachments: Attachment[]; attachments: Attachment[];
message_id: string; message_id: string;
chacha_key_plain: string;
} }
export function useReplyMessages() { export function useReplyMessages() {