feat: remove QUOTED_TEXT_MAX_LENGTH and sliceQuoteText

pull/2757/head
William Grant 2 years ago
parent a204464723
commit 5111a141c8

@ -91,7 +91,6 @@ import {
getUsBlindedInThatServer, getUsBlindedInThatServer,
isUsAnySogsFromCache, isUsAnySogsFromCache,
} from '../session/apis/open_group_api/sogsv3/knownBlindedkeys'; } from '../session/apis/open_group_api/sogsv3/knownBlindedkeys';
import { QUOTED_TEXT_MAX_LENGTH } from '../session/constants';
import { ReactionList } from '../types/Reaction'; import { ReactionList } from '../types/Reaction';
import { getAttachmentMetadata } from '../types/message/initializeAttachmentMetadata'; import { getAttachmentMetadata } from '../types/message/initializeAttachmentMetadata';
// tslint:disable: cyclomatic-complexity // tslint:disable: cyclomatic-complexity
@ -1275,14 +1274,6 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
} }
} }
// this is to avoid saving 2k chars for just the quote object inside a message
export function sliceQuoteText(quotedText: string | undefined | null) {
if (!quotedText || isEmpty(quotedText)) {
return '';
}
return quotedText.slice(0, QUOTED_TEXT_MAX_LENGTH);
}
const throttledAllMessagesDispatch = debounce( const throttledAllMessagesDispatch = debounce(
() => { () => {
if (updatesToDispatch.size === 0) { if (updatesToDispatch.size === 0) {

@ -60,9 +60,6 @@ export const UI = {
}, },
}; };
// we keep 150 chars, because quoting someone with 66 hex chars need to be kept in full so we can render it in the quote with its name
export const QUOTED_TEXT_MAX_LENGTH = 150;
export const DEFAULT_RECENT_REACTS = ['😂', '🥰', '😢', '😡', '😮', '😈']; export const DEFAULT_RECENT_REACTS = ['😂', '🥰', '😢', '😡', '😮', '😈'];
export const MAX_USERNAME_BYTES = 64; export const MAX_USERNAME_BYTES = 64;

Loading…
Cancel
Save