diff --git a/stylesheets/_modules.scss b/stylesheets/_modules.scss index a9003c1c6..31006e96c 100644 --- a/stylesheets/_modules.scss +++ b/stylesheets/_modules.scss @@ -2132,103 +2132,6 @@ button.ConversationDetails__action-button { color: $color-gray-45; } -// Module: Conversation Hero - -.module-conversation-hero { - padding: 32px 0 28px 0; - text-align: center; - - &__avatar { - margin-bottom: 12px; - } - - &__profile-name { - @include font-title-2; - margin-bottom: 2px; - - @include light-theme { - color: $color-gray-90; - } - - @include dark-theme { - color: $color-gray-05; - } - } - - &__with { - @include font-body-2; - margin: 0 auto; - margin-bottom: 16px; - max-width: 500px; - - @include light-theme { - color: $color-gray-60; - } - - @include dark-theme { - color: $color-gray-25; - } - } - - &__membership { - @include font-body-2; - - padding: 0 16px; - - @include light-theme { - color: $color-gray-60; - } - - @include dark-theme { - color: $color-gray-25; - } - - &__name { - @include font-body-2-bold; - } - } - - &__message-request-warning { - @include font-body-2; - - &__message { - display: flex; - margin-bottom: 12px; - align-items: center; - justify-content: center; - user-select: none; - - @include light-theme { - color: $color-gray-60; - } - @include dark-theme { - color: $color-gray-25; - } - - &::before { - content: ''; - display: block; - height: 14px; - margin-right: 8px; - width: 14px; - - @include light-theme { - @include color-svg( - '../images/icons/v2/info-outline-24.svg', - $color-gray-60 - ); - } - @include dark-theme { - @include color-svg( - '../images/icons/v2/info-solid-24.svg', - $color-gray-25 - ); - } - } - } - } -} - // Module: Message Request Actions .module-message-request-actions { diff --git a/stylesheets/components/ConversationHero.scss b/stylesheets/components/ConversationHero.scss new file mode 100644 index 000000000..9a038bc5f --- /dev/null +++ b/stylesheets/components/ConversationHero.scss @@ -0,0 +1,125 @@ +// Copyright 2022 Signal Messenger, LLC +// SPDX-License-Identifier: AGPL-3.0-only + +.module-conversation-hero { + padding: 32px 0 28px 0; + text-align: center; + + &__avatar { + margin-bottom: 12px; + } + + &__profile-name { + @include font-title-2; + margin-bottom: 2px; + + @include light-theme { + color: $color-gray-90; + } + + @include dark-theme { + color: $color-gray-05; + } + } + + &__with { + @include font-body-2; + margin: 0 auto; + margin-bottom: 16px; + max-width: 500px; + + @include light-theme { + color: $color-gray-60; + } + + @include dark-theme { + color: $color-gray-25; + } + } + + &__membership { + @include font-body-2; + + padding: 0 16px; + + @include light-theme { + color: $color-gray-60; + } + + @include dark-theme { + color: $color-gray-25; + } + + &__name { + @include font-body-2-bold; + } + } + + &__message-request-warning { + @include font-body-2; + + &__message { + display: flex; + margin-bottom: 12px; + align-items: center; + justify-content: center; + user-select: none; + + @include light-theme { + color: $color-gray-60; + } + @include dark-theme { + color: $color-gray-25; + } + + &::before { + content: ''; + display: block; + height: 14px; + margin-right: 8px; + width: 14px; + + @include light-theme { + @include color-svg( + '../images/icons/v2/info-outline-24.svg', + $color-gray-60 + ); + } + @include dark-theme { + @include color-svg( + '../images/icons/v2/info-solid-24.svg', + $color-gray-25 + ); + } + } + } + } + + &__linkNotification { + @include font-body-2; + text-align: center; + user-select: none; + + &::before { + content: ''; + display: inline-block; + height: 16px; + margin-right: 8px; + vertical-align: middle; + width: 16px; + + @include light-theme { + @include color-svg( + '../images/icons/v2/info-outline-24.svg', + $color-gray-60 + ); + } + @include dark-theme { + @include color-svg( + '../images/icons/v2/info-solid-24.svg', + $color-gray-25 + ); + } + } + } +} diff --git a/stylesheets/components/SystemMessage.scss b/stylesheets/components/SystemMessage.scss index cedc9beb8..231a8a273 100644 --- a/stylesheets/components/SystemMessage.scss +++ b/stylesheets/components/SystemMessage.scss @@ -219,13 +219,6 @@ ); } - &--icon-unsynced::before { - @include system-message-icon( - '../images/icons/v2/info-outline-24.svg', - '../images/icons/v2/info-solid-24.svg' - ); - } - &--icon-verified::before { @include system-message-icon( '../images/icons/v2/check-24.svg', diff --git a/stylesheets/manifest.scss b/stylesheets/manifest.scss index 9f04d2440..abc3e9854 100644 --- a/stylesheets/manifest.scss +++ b/stylesheets/manifest.scss @@ -57,6 +57,7 @@ @import './components/ContextMenu.scss'; @import './components/ConversationDetails.scss'; @import './components/ConversationHeader.scss'; +@import './components/ConversationHero.scss'; @import './components/ConversationView.scss'; @import './components/CustomColorEditor.scss'; @import './components/CustomizingPreferredReactionsModal.scss'; diff --git a/ts/background.ts b/ts/background.ts index c287c22d1..633edd1ac 100644 --- a/ts/background.ts +++ b/ts/background.ts @@ -2178,9 +2178,6 @@ export async function startApp(): Promise { ); } - log.info('firstRun: disabling post link experience'); - window.Signal.Util.postLinkExperience.stop(); - // Switch to inbox view even if contact sync is still running if ( window.reduxStore.getState().app.appView === AppViewType.Installer @@ -2647,13 +2644,6 @@ export async function startApp(): Promise { } ); } - - if (window.Signal.Util.postLinkExperience.isActive()) { - log.info( - 'onContactReceived: Adding the message history disclaimer on link' - ); - await conversation.addMessageHistoryDisclaimer(); - } } catch (error) { log.error('onContactReceived error:', Errors.toLogFormat(error)); } @@ -2722,12 +2712,6 @@ export async function startApp(): Promise { window.Signal.Data.updateConversation(conversation.attributes); - if (window.Signal.Util.postLinkExperience.isActive()) { - log.info( - 'onGroupReceived: Adding the message history disclaimer on link' - ); - await conversation.addMessageHistoryDisclaimer(); - } const { expireTimer } = details; const isValidExpireTimer = typeof expireTimer === 'number'; if (!isValidExpireTimer) { diff --git a/ts/components/conversation/ConversationHero.tsx b/ts/components/conversation/ConversationHero.tsx index 9459a35ea..afff7d68c 100644 --- a/ts/components/conversation/ConversationHero.tsx +++ b/ts/components/conversation/ConversationHero.tsx @@ -204,6 +204,9 @@ export const ConversationHero = ({ phoneNumber, sharedGroupNames, })} +
+ {i18n('messageHistoryUnsynced')} +
{isShowingMessageRequestWarning && ( ); diff --git a/ts/components/conversation/LinkNotification.tsx b/ts/components/conversation/LinkNotification.tsx deleted file mode 100644 index d5a667daf..000000000 --- a/ts/components/conversation/LinkNotification.tsx +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2021 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -import * as React from 'react'; - -import { SystemMessage } from './SystemMessage'; -import type { LocalizerType } from '../../types/Util'; - -export const LinkNotification = ({ - i18n, -}: Readonly<{ i18n: LocalizerType }>): JSX.Element => ( - -); diff --git a/ts/components/conversation/Timeline.stories.tsx b/ts/components/conversation/Timeline.stories.tsx index 8e600afc0..985f5771b 100644 --- a/ts/components/conversation/Timeline.stories.tsx +++ b/ts/components/conversation/Timeline.stories.tsx @@ -337,11 +337,6 @@ const items: Record = { }, timestamp: Date.now(), }, - 'id-15': { - type: 'linkNotification', - data: null, - timestamp: Date.now(), - }, }; const actions = () => ({ diff --git a/ts/components/conversation/TimelineItem.stories.tsx b/ts/components/conversation/TimelineItem.stories.tsx index 2fe8961bd..f1eb2444a 100644 --- a/ts/components/conversation/TimelineItem.stories.tsx +++ b/ts/components/conversation/TimelineItem.stories.tsx @@ -417,10 +417,6 @@ storiesOf('Components/Conversation/TimelineItem', module) startedTime: Date.now(), }, }, - { - type: 'linkNotification', - data: null, - }, { type: 'profileChange', data: { diff --git a/ts/components/conversation/TimelineItem.tsx b/ts/components/conversation/TimelineItem.tsx index 35dd1b512..7fbcedca4 100644 --- a/ts/components/conversation/TimelineItem.tsx +++ b/ts/components/conversation/TimelineItem.tsx @@ -23,7 +23,6 @@ import type { PropsDataType as DeliveryIssueProps, } from './DeliveryIssueNotification'; import { DeliveryIssueNotification } from './DeliveryIssueNotification'; -import { LinkNotification } from './LinkNotification'; import type { PropsData as ChangeNumberNotificationProps } from './ChangeNumberNotification'; import { ChangeNumberNotification } from './ChangeNumberNotification'; import type { CallingNotificationType } from '../../util/callingNotification'; @@ -69,10 +68,6 @@ type DeliveryIssueType = { type: 'deliveryIssue'; data: DeliveryIssueProps; }; -type LinkNotificationType = { - type: 'linkNotification'; - data: null; -}; type MessageType = { type: 'message'; data: Omit; @@ -129,7 +124,6 @@ export type TimelineItemType = ( | GroupNotificationType | GroupV1MigrationType | GroupV2ChangeType - | LinkNotificationType | MessageType | ProfileChangeNotificationType | ResetSessionNotificationType @@ -261,8 +255,6 @@ export class TimelineItem extends React.PureComponent { i18n={i18n} /> ); - } else if (item.type === 'linkNotification') { - notification = ; } else if (item.type === 'timerNotification') { notification = ( diff --git a/ts/model-types.d.ts b/ts/model-types.d.ts index ac8ccb964..0ae7bd988 100644 --- a/ts/model-types.d.ts +++ b/ts/model-types.d.ts @@ -171,7 +171,6 @@ export type MessageAttributesType = { | 'group-v2-change' | 'incoming' | 'keychange' - | 'message-history-unsynced' | 'outgoing' | 'profile-change' | 'story' diff --git a/ts/models/conversations.ts b/ts/models/conversations.ts index 20d6b8231..d11e9363e 100644 --- a/ts/models/conversations.ts +++ b/ts/models/conversations.ts @@ -219,8 +219,6 @@ export class ConversationModel extends window.Backbone private isFetchingUUID?: boolean; - private hasAddedHistoryDisclaimer?: boolean; - private lastIsTyping?: boolean; private muteTimer?: NodeJS.Timer; @@ -4578,38 +4576,6 @@ export class ConversationModel extends window.Backbone return message; } - async addMessageHistoryDisclaimer(): Promise { - const timestamp = Date.now(); - - if (this.hasAddedHistoryDisclaimer) { - log.warn( - `addMessageHistoryDisclaimer/${this.idForLogging()}: Refusing to add another this session` - ); - return; - } - this.hasAddedHistoryDisclaimer = true; - - const model = new window.Whisper.Message({ - type: 'message-history-unsynced', - readStatus: ReadStatus.Read, - seenStatus: SeenStatus.NotApplicable, - conversationId: this.id, - sent_at: timestamp, - received_at: window.Signal.Util.incrementMessageCounter(), - received_at_ms: timestamp, - // TODO: DESKTOP-722 - } as unknown as MessageAttributesType); - - const id = await window.Signal.Data.saveMessage(model.attributes, { - ourUuid: window.textsecure.storage.user.getCheckedUuid().toString(), - }); - - model.set({ id }); - - const message = window.MessageController.register(id, model); - this.addSingleMessage(message); - } - isSearchable(): boolean { return !this.get('left'); } diff --git a/ts/models/messages.ts b/ts/models/messages.ts index 81b3caaee..ddd13c0ef 100644 --- a/ts/models/messages.ts +++ b/ts/models/messages.ts @@ -91,7 +91,6 @@ import { isGroupV2Change, isIncoming, isKeyChange, - isMessageHistoryUnsynced, isOutgoing, isStory, isProfileChange, @@ -295,7 +294,6 @@ export class MessageModel extends window.Backbone.Model { !isGroupV2Change(attributes) && !isGroupV1Migration(attributes) && !isKeyChange(attributes) && - !isMessageHistoryUnsynced(attributes) && !isProfileChange(attributes) && !isUniversalTimerNotification(attributes) && !isUnsupportedMessage(attributes) && @@ -1056,7 +1054,6 @@ export class MessageModel extends window.Backbone.Model { // Locally-generated notifications const isKeyChangeValue = isKeyChange(attributes); - const isMessageHistoryUnsyncedValue = isMessageHistoryUnsynced(attributes); const isProfileChangeValue = isProfileChange(attributes); const isUniversalTimerNotificationValue = isUniversalTimerNotification(attributes); @@ -1085,7 +1082,6 @@ export class MessageModel extends window.Backbone.Model { hasErrorsValue || // Locally-generated notifications isKeyChangeValue || - isMessageHistoryUnsyncedValue || isProfileChangeValue || isUniversalTimerNotificationValue; diff --git a/ts/services/storageRecordOps.ts b/ts/services/storageRecordOps.ts index 813fae98a..0b50b3fac 100644 --- a/ts/services/storageRecordOps.ts +++ b/ts/services/storageRecordOps.ts @@ -1111,16 +1111,6 @@ export async function mergeAccountRecord( remotelyPinnedConversations.forEach(conversation => { conversation.set({ isPinned: true, isArchived: false }); - - if ( - window.Signal.Util.postLinkExperience.isActive() && - isGroupV2(conversation.attributes) - ) { - log.info( - 'mergeAccountRecord: Adding the message history disclaimer on link' - ); - conversation.addMessageHistoryDisclaimer(); - } updatedConversations.push(conversation); }); diff --git a/ts/sql/migrations/56-add-unseen-to-message.ts b/ts/sql/migrations/56-add-unseen-to-message.ts index 4a6927e38..1b7f7704a 100644 --- a/ts/sql/migrations/56-add-unseen-to-message.ts +++ b/ts/sql/migrations/56-add-unseen-to-message.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Signal Messenger, LLC +// Copyright 2021-2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from 'better-sqlite3'; diff --git a/ts/sql/migrations/57-rm-message-history-unsynced.ts b/ts/sql/migrations/57-rm-message-history-unsynced.ts new file mode 100644 index 000000000..a49c24708 --- /dev/null +++ b/ts/sql/migrations/57-rm-message-history-unsynced.ts @@ -0,0 +1,29 @@ +// Copyright 2022 Signal Messenger, LLC +// SPDX-License-Identifier: AGPL-3.0-only + +import type { Database } from 'better-sqlite3'; + +import type { LoggerType } from '../../types/Logging'; + +export default function updateToSchemaVersion57( + currentVersion: number, + db: Database, + logger: LoggerType +): void { + if (currentVersion >= 57) { + return; + } + + db.transaction(() => { + db.exec( + ` + DELETE FROM messages + WHERE type IS 'message-history-unsynced'; + ` + ); + + db.pragma('user_version = 57'); + })(); + + logger.info('updateToSchemaVersion57: success!'); +} diff --git a/ts/sql/migrations/index.ts b/ts/sql/migrations/index.ts index 4f9196299..2e3ab1bb4 100644 --- a/ts/sql/migrations/index.ts +++ b/ts/sql/migrations/index.ts @@ -32,6 +32,7 @@ import updateToSchemaVersion53 from './53-gv2-banned-members'; import updateToSchemaVersion54 from './54-unprocessed-received-at-counter'; import updateToSchemaVersion55 from './55-report-message-aci'; import updateToSchemaVersion56 from './56-add-unseen-to-message'; +import updateToSchemaVersion57 from './57-rm-message-history-unsynced'; function updateToSchemaVersion1( currentVersion: number, @@ -1927,6 +1928,7 @@ export const SCHEMA_VERSIONS = [ updateToSchemaVersion54, updateToSchemaVersion55, updateToSchemaVersion56, + updateToSchemaVersion57, ]; export function updateSchema(db: Database, logger: LoggerType): void { diff --git a/ts/state/selectors/message.ts b/ts/state/selectors/message.ts index 85a542275..ab08f0d35 100644 --- a/ts/state/selectors/message.ts +++ b/ts/state/selectors/message.ts @@ -785,13 +785,6 @@ export function getPropsForBubble( timestamp, }; } - if (isMessageHistoryUnsynced(message)) { - return { - type: 'linkNotification', - data: null, - timestamp, - }; - } if (isExpirationTimerUpdate(message)) { return { type: 'timerNotification', @@ -984,14 +977,6 @@ function getPropsForGroupV1Migration( }; } -// Message History Unsynced - -export function isMessageHistoryUnsynced( - message: MessageWithUIFieldsType -): boolean { - return message.type === 'message-history-unsynced'; -} - // Note: props are null! // Expiration Timer Update diff --git a/ts/state/smart/InstallScreen.tsx b/ts/state/smart/InstallScreen.tsx index 1a0fbb9c2..372288aee 100644 --- a/ts/state/smart/InstallScreen.tsx +++ b/ts/state/smart/InstallScreen.tsx @@ -1,4 +1,4 @@ -// Copyright 2021 Signal Messenger, LLC +// Copyright 2021-2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { ComponentProps, ReactElement } from 'react'; @@ -193,8 +193,6 @@ export function SmartInstallScreen(): ReactElement { throw new Error('Cannot confirm number; the component was unmounted'); } - window.Signal.Util.postLinkExperience.start(); - return result; }; diff --git a/ts/test-both/util/timelineUtil_test.ts b/ts/test-both/util/timelineUtil_test.ts index 4c1984abc..5dfdfbb9e 100644 --- a/ts/test-both/util/timelineUtil_test.ts +++ b/ts/test-both/util/timelineUtil_test.ts @@ -40,24 +40,6 @@ describe(' utilities', () => { assert.isFalse(areMessagesInSameGroup(undefined, false, defaultNewer)); }); - it('returns false if either item is not a message', () => { - const linkNotification = { - type: 'linkNotification' as const, - data: null, - timestamp: Date.now(), - }; - - assert.isFalse( - areMessagesInSameGroup(defaultNewer, false, linkNotification) - ); - assert.isFalse( - areMessagesInSameGroup(linkNotification, false, defaultNewer) - ); - assert.isFalse( - areMessagesInSameGroup(linkNotification, false, linkNotification) - ); - }); - it("returns false if authors don't match", () => { const older = { ...defaultOlder, @@ -155,18 +137,6 @@ describe(' utilities', () => { ); }); - it('returns false if newer item is not a message', () => { - const linkNotification = { - type: 'linkNotification' as const, - data: null, - timestamp: Date.now(), - }; - - assert.isFalse( - shouldCurrentMessageHideMetadata(true, defaultCurrent, linkNotification) - ); - }); - it('returns false if newer is deletedForEveryone', () => { const newer = { ...defaultNewer, diff --git a/ts/test-electron/sql/conversationSummary_test.ts b/ts/test-electron/sql/conversationSummary_test.ts index 4c4800dbe..784ed7660 100644 --- a/ts/test-electron/sql/conversationSummary_test.ts +++ b/ts/test-electron/sql/conversationSummary_test.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Signal Messenger, LLC +// Copyright 2021-2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; @@ -166,15 +166,6 @@ describe('sql/conversationSummary', () => { timestamp: now + 3, }; const message4: MessageAttributesType = { - id: getUuid(), - body: 'message 4', - type: 'message-history-unsynced', - conversationId, - sent_at: now + 4, - received_at: now + 4, - timestamp: now + 4, - }; - const message5: MessageAttributesType = { id: getUuid(), body: 'message 5', type: 'profile-change', @@ -183,7 +174,7 @@ describe('sql/conversationSummary', () => { received_at: now + 5, timestamp: now + 5, }; - const message6: MessageAttributesType = { + const message5: MessageAttributesType = { id: getUuid(), body: 'message 6', type: 'story', @@ -192,7 +183,7 @@ describe('sql/conversationSummary', () => { received_at: now + 6, timestamp: now + 6, }; - const message7: MessageAttributesType = { + const message6: MessageAttributesType = { id: getUuid(), body: 'message 7', type: 'universal-timer-notification', @@ -201,7 +192,7 @@ describe('sql/conversationSummary', () => { received_at: now + 7, timestamp: now + 7, }; - const message8: MessageAttributesType = { + const message7: MessageAttributesType = { id: getUuid(), body: 'message 8', type: 'verified-change', @@ -212,23 +203,14 @@ describe('sql/conversationSummary', () => { }; await saveMessages( - [ - message1, - message2, - message3, - message4, - message5, - message6, - message7, - message8, - ], + [message1, message2, message3, message4, message5, message6, message7], { forceSave: true, ourUuid, } ); - assert.lengthOf(await _getAllMessages(), 8); + assert.lengthOf(await _getAllMessages(), 7); const messages = await getConversationMessageStats({ conversationId, @@ -282,15 +264,6 @@ describe('sql/conversationSummary', () => { timestamp: now + 4, }; const message5: MessageAttributesType = { - id: getUuid(), - body: 'message 5', - type: 'message-history-unsynced', - conversationId, - sent_at: now + 5, - received_at: now + 5, - timestamp: now + 5, - }; - const message6: MessageAttributesType = { id: getUuid(), body: 'message 6', type: 'profile-change', @@ -299,7 +272,7 @@ describe('sql/conversationSummary', () => { received_at: now + 6, timestamp: now + 6, }; - const message7: MessageAttributesType = { + const message6: MessageAttributesType = { id: getUuid(), body: 'message 7', type: 'story', @@ -308,7 +281,7 @@ describe('sql/conversationSummary', () => { received_at: now + 7, timestamp: now + 7, }; - const message8: MessageAttributesType = { + const message7: MessageAttributesType = { id: getUuid(), body: 'message 8', type: 'universal-timer-notification', @@ -317,7 +290,7 @@ describe('sql/conversationSummary', () => { received_at: now + 8, timestamp: now + 8, }; - const message9: MessageAttributesType = { + const message8: MessageAttributesType = { id: getUuid(), body: 'message 9', type: 'verified-change', @@ -337,7 +310,6 @@ describe('sql/conversationSummary', () => { message6, message7, message8, - message9, ], { forceSave: true, @@ -345,7 +317,7 @@ describe('sql/conversationSummary', () => { } ); - assert.lengthOf(await _getAllMessages(), 9); + assert.lengthOf(await _getAllMessages(), 8); const messages = await getConversationMessageStats({ conversationId, diff --git a/ts/types/Message.ts b/ts/types/Message.ts index f92a37fc0..2a2f48a6f 100644 --- a/ts/types/Message.ts +++ b/ts/types/Message.ts @@ -1,4 +1,4 @@ -// Copyright 2018-2021 Signal Messenger, LLC +// Copyright 2018-2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only /* eslint-disable camelcase */ @@ -10,7 +10,6 @@ import type { IndexableBoolean, IndexablePresence } from './IndexedDB'; export type Message = ( | UserMessage | VerifiedChangeMessage - | MessageHistoryUnsyncedMessage | ProfileChangeNotificationMessage ) & { deletedForEveryone?: boolean }; export type UserMessage = IncomingMessage | OutgoingMessage; @@ -68,14 +67,6 @@ export type VerifiedChangeMessage = Readonly< ExpirationTimerUpdate >; -export type MessageHistoryUnsyncedMessage = Readonly< - { - type: 'message-history-unsynced'; - } & SharedMessageProperties & - MessageSchemaVersion5 & - ExpirationTimerUpdate ->; - export type ProfileChangeNotificationMessage = Readonly< { type: 'profile-change'; diff --git a/ts/types/message/initializeAttachmentMetadata.ts b/ts/types/message/initializeAttachmentMetadata.ts index 97b31e9d8..ac15b9d04 100644 --- a/ts/types/message/initializeAttachmentMetadata.ts +++ b/ts/types/message/initializeAttachmentMetadata.ts @@ -1,4 +1,4 @@ -// Copyright 2018-2020 Signal Messenger, LLC +// Copyright 2018-2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import * as Attachment from '../Attachment'; @@ -19,9 +19,6 @@ export const initializeAttachmentMetadata = async ( if (message.type === 'verified-change') { return message; } - if (message.type === 'message-history-unsynced') { - return message; - } if (message.type === 'profile-change') { return message; } diff --git a/ts/util/index.ts b/ts/util/index.ts index 213404268..a89c73f38 100644 --- a/ts/util/index.ts +++ b/ts/util/index.ts @@ -38,7 +38,6 @@ import { } from './sessionTranslation'; import * as zkgroup from './zkgroup'; import { StartupQueue } from './StartupQueue'; -import { postLinkExperience } from './postLinkExperience'; import { sendToGroup, sendContentMessageToGroup } from './sendToGroup'; import { RetryPlaceholders } from './retryPlaceholders'; import * as expirationTimer from './expirationTimer'; @@ -70,7 +69,6 @@ export { MessageController, missingCaseError, parseRemoteClientExpiration, - postLinkExperience, queueUpdateMessage, RetryPlaceholders, saveNewMessageBatcher, diff --git a/ts/util/postLinkExperience.ts b/ts/util/postLinkExperience.ts deleted file mode 100644 index 966bed7e0..000000000 --- a/ts/util/postLinkExperience.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2021 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -import { MINUTE } from './durations'; - -class PostLinkExperience { - private hasNotFinishedSync: boolean; - - constructor() { - this.hasNotFinishedSync = false; - } - - start() { - this.hasNotFinishedSync = true; - - // timeout "post link" after 10 minutes in case the syncs don't complete - // in time or are never called. - setTimeout(() => { - this.stop(); - }, 10 * MINUTE); - } - - stop() { - this.hasNotFinishedSync = false; - } - - isActive(): boolean { - return this.hasNotFinishedSync === true; - } -} - -export const postLinkExperience = new PostLinkExperience();