diff --git a/lib/shared/threads/protocols/dm-thread-protocol.js b/lib/shared/threads/protocols/dm-thread-protocol.js --- a/lib/shared/threads/protocols/dm-thread-protocol.js +++ b/lib/shared/threads/protocols/dm-thread-protocol.js @@ -572,6 +572,8 @@ sidebarThreadType: thickThreadTypes.THICK_SIDEBAR, pendingSidebarURLPrefix: pendingThickSidebarURLPrefix, }, + + shouldPerformSideEffectsBeforeSendingMessage: false, }); export { dmThreadProtocol }; diff --git a/lib/shared/threads/protocols/keyserver-thread-protocol.js b/lib/shared/threads/protocols/keyserver-thread-protocol.js --- a/lib/shared/threads/protocols/keyserver-thread-protocol.js +++ b/lib/shared/threads/protocols/keyserver-thread-protocol.js @@ -368,6 +368,8 @@ sidebarThreadType: thinThreadTypes.SIDEBAR, pendingSidebarURLPrefix: pendingSidebarURLPrefix, }, + + shouldPerformSideEffectsBeforeSendingMessage: true, }); function mediaIDIsKeyserverID(mediaID: string): boolean { diff --git a/lib/shared/threads/thread-spec.js b/lib/shared/threads/thread-spec.js --- a/lib/shared/threads/thread-spec.js +++ b/lib/shared/threads/thread-spec.js @@ -274,6 +274,7 @@ +sidebarThreadType: ThreadType, +pendingSidebarURLPrefix: string, }, + +shouldPerformSideEffectsBeforeSendingMessage: boolean, }; export type ThreadSpec = { diff --git a/native/input/input-state-container.react.js b/native/input/input-state-container.react.js --- a/native/input/input-state-container.react.js +++ b/native/input/input-state-container.react.js @@ -78,10 +78,7 @@ type ClientMediaMissionReportCreationRequest, reportTypes, } from 'lib/types/report-types.js'; -import { - threadTypeIsThick, - type ThreadType, -} from 'lib/types/thread-types-enum.js'; +import { type ThreadType } from 'lib/types/thread-types-enum.js'; import { type ClientNewThinThreadRequest, type NewThreadResult, @@ -588,7 +585,10 @@ parentThreadInfo: ?ThreadInfo, ): Promise { try { - if (!threadTypeIsThick(threadInfo.type)) { + if ( + threadSpecs[threadInfo.type].protocol + .shouldPerformSideEffectsBeforeSendingMessage + ) { await this.props.textMessageCreationSideEffectsFunc( messageInfo, threadInfo, @@ -608,7 +608,10 @@ parentThreadInfo, sidebarCreation, ); - if (threadTypeIsThick(threadInfo.type)) { + if ( + !threadSpecs[threadInfo.type].protocol + .shouldPerformSideEffectsBeforeSendingMessage + ) { await this.props.textMessageCreationSideEffectsFunc( messageInfo, threadInfo, diff --git a/web/input/input-state-container.react.js b/web/input/input-state-container.react.js --- a/web/input/input-state-container.react.js +++ b/web/input/input-state-container.react.js @@ -76,7 +76,6 @@ import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { Dispatch } from 'lib/types/redux-types.js'; import { reportTypes } from 'lib/types/report-types.js'; -import { threadTypeIsThick } from 'lib/types/thread-types-enum.js'; import type { ThreadType } from 'lib/types/thread-types-enum.js'; import { type ClientNewThinThreadRequest, @@ -1365,7 +1364,10 @@ parentThreadInfo: ?ThreadInfo, ): Promise { try { - if (!threadTypeIsThick(threadInfo.type)) { + if ( + threadSpecs[threadInfo.type].protocol + .shouldPerformSideEffectsBeforeSendingMessage + ) { await this.props.textMessageCreationSideEffectsFunc( messageInfo, threadInfo, @@ -1385,7 +1387,10 @@ parentThreadInfo, sidebarCreation, ); - if (threadTypeIsThick(threadInfo.type)) { + if ( + !threadSpecs[threadInfo.type].protocol + .shouldPerformSideEffectsBeforeSendingMessage + ) { await this.props.textMessageCreationSideEffectsFunc( messageInfo, threadInfo,