diff --git a/ts/components/conversation/MessageBody.tsx b/ts/components/conversation/MessageBody.tsx index e4af45af1..b81acd62d 100644 --- a/ts/components/conversation/MessageBody.tsx +++ b/ts/components/conversation/MessageBody.tsx @@ -82,9 +82,7 @@ export class MessageBody extends React.Component { isGroup: false, }; - public addDownloading(jsx: JSX.Element): JSX.Element { - const { i18n } = this.props; - + public renderJsxSelectable(jsx: JSX.Element): JSX.Element { return {jsx}; } @@ -100,7 +98,7 @@ export class MessageBody extends React.Component { const sizeClass = disableJumbomoji ? undefined : getSizeClass(text); if (disableLinks) { - return this.addDownloading( + return this.renderJsxSelectable( renderEmoji({ i18n, text, @@ -113,24 +111,7 @@ export class MessageBody extends React.Component { ); } - const bodyContents = this.addDownloading( - { - return renderEmoji({ - i18n, - text: nonLinkText, - sizeClass, - key, - renderNonEmoji: renderNewLines, - isGroup, - convoId, - }); - }} - /> - ); - - return this.addDownloading( + return this.renderJsxSelectable( { diff --git a/ts/components/conversation/message/MessageMetadata.tsx b/ts/components/conversation/message/MessageMetadata.tsx index 5991c9423..ea1f62e7a 100644 --- a/ts/components/conversation/message/MessageMetadata.tsx +++ b/ts/components/conversation/message/MessageMetadata.tsx @@ -96,14 +96,14 @@ export const MessageMetadata = (props: Props) => { theme={theme} /> ) : ( - - )} + + )} { /> ) : null} - {showStatus ? ( { spellCheck={true} inputRef={this.textarea} disabled={!typingEnabled} - maxLength={Constants.CONVERSATION.MAX_MESSAGE_BODY_LENGTH} + // maxLength={Constants.CONVERSATION.MAX_MESSAGE_BODY_LENGTH} rows={1} style={sendMessageStyle} suggestionsPortalHost={this.container} @@ -751,25 +751,8 @@ export class SessionCompositionBox extends React.Component { // tslint:disable-next-line: cyclomatic-complexity private async onSendMessage() { - const toUnicode = (str: string) => { - return str - .split('') - .map(value => { - const temp = value - .charCodeAt(0) - .toString(16) - .toUpperCase(); - if (temp.length > 2) { - return `\\u${temp}`; - } - return value; - }) - .join(''); - }; - // this is dirty but we have to replace all @(xxx) by @xxx manually here const cleanMentions = (text: string): string => { - const textUnicode = toUnicode(text); const matches = text.match(this.mentionsRegex); let replacedMentions = text; (matches || []).forEach(match => { @@ -808,10 +791,10 @@ export class SessionCompositionBox extends React.Component { } // Verify message length const msgLen = messagePlaintext?.length || 0; - if (msgLen > Constants.CONVERSATION.MAX_MESSAGE_BODY_LENGTH) { - ToastUtils.pushMessageBodyTooLong(); - return; - } + // if (msgLen > Constants.CONVERSATION.MAX_MESSAGE_BODY_LENGTH) { + // ToastUtils.pushMessageBodyTooLong(); + // return; + // } if (msgLen === 0 && this.props.stagedAttachments?.length === 0) { ToastUtils.pushMessageBodyMissing(); return; diff --git a/ts/session/constants.ts b/ts/session/constants.ts index 85c0b0dfe..06c57392b 100644 --- a/ts/session/constants.ts +++ b/ts/session/constants.ts @@ -9,7 +9,7 @@ export const TTL_DEFAULT = { // User Interface export const CONVERSATION = { - MAX_MESSAGE_BODY_LENGTH: 2000, + // MAX_MESSAGE_BODY_LENGTH: 2000, DEFAULT_MEDIA_FETCH_COUNT: 50, DEFAULT_DOCUMENTS_FETCH_COUNT: 150, DEFAULT_MESSAGE_FETCH_COUNT: 30,