Новая система пересылки сообщений без трансляции и транскодирования вложений
This commit is contained in:
@@ -41,7 +41,7 @@ export function MessageReplyMessages(props: AttachmentProps) {
|
||||
<Skeleton h={50} w={'100%'}></Skeleton>
|
||||
}
|
||||
{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={{
|
||||
borderTopLeftRadius: 0,
|
||||
|
||||
@@ -104,7 +104,7 @@ export function Message(props: MessageProps) {
|
||||
message: props.message,
|
||||
attachments: props.attachments.filter(a => a.type != AttachmentType.MESSAGES),
|
||||
message_id: props.message_id,
|
||||
|
||||
chacha_key_plain: props.chacha_key_plain
|
||||
};
|
||||
|
||||
const avatars = useAvatars(user.publicKey);
|
||||
@@ -126,6 +126,9 @@ export function Message(props: MessageProps) {
|
||||
if (props.replyed) {
|
||||
return false;
|
||||
}
|
||||
if(props.chacha_key_plain == ""){
|
||||
return false;
|
||||
}
|
||||
if (messageReply.attachments.find((v) => ATTACHMENTS_NOT_ALLOWED_TO_REPLY.includes(v.type))) {
|
||||
return false;
|
||||
}
|
||||
@@ -215,7 +218,7 @@ export function Message(props: MessageProps) {
|
||||
fontSize: '13px',
|
||||
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()}>
|
||||
<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>
|
||||
</Flex>
|
||||
</Flex>
|
||||
|
||||
@@ -103,7 +103,7 @@ export function useDialog() : {
|
||||
content: content,
|
||||
timestamp: Date.now(),
|
||||
readed: publicKey == dialog ? 1 : 0,
|
||||
chacha_key: aesChachaKey,
|
||||
chacha_key: key.toString('utf-8'),
|
||||
from_me: 1,
|
||||
plain_message: message,
|
||||
delivered: publicKey == dialog ? DeliveredMessageState.DELIVERED : DeliveredMessageState.WAITING,
|
||||
|
||||
@@ -19,7 +19,7 @@ export interface MessageReply {
|
||||
message: string;
|
||||
attachments: Attachment[];
|
||||
message_id: string;
|
||||
|
||||
chacha_key_plain: string;
|
||||
}
|
||||
|
||||
export function useReplyMessages() {
|
||||
|
||||
Reference in New Issue
Block a user