Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

fix(app): include threads everywhere in the forward modal (#3550)

Jiralitede9c3efb0d98
diff --git a/fluxer_app/src/features/app/components/dialogs/shared/UseForwardDestinations.ts b/fluxer_app/src/features/app/components/dialogs/shared/UseForwardDestinations.ts
index a1157def1..56d37a45c 100644
--- a/fluxer_app/src/features/app/components/dialogs/shared/UseForwardDestinations.ts
+++ b/fluxer_app/src/features/app/components/dialogs/shared/UseForwardDestinations.ts
@@ -34,7 +34,7 @@ import SelectedChannel from '@app/features/navigation/state/SelectedChannel';
import Permission from '@app/features/permissions/state/Permission';
import {formatPermissionLabel} from '@app/features/permissions/utils/PermissionUtils';
import {Logger} from '@app/features/platform/utils/AppLogger';
-import {createForwardSearchCandidates} from '@app/features/search/utils/DestinationSearchSources';
+import {createForwardSearchCandidates, isForwardableThread} from '@app/features/search/utils/DestinationSearchSources';
import {getLoadedUnicodeConfusables, loadUnicodeConfusables} from '@app/features/search/utils/SearchTextMatching';
import Slowmode from '@app/features/slowmode/state/Slowmode';
import {useNow} from '@app/features/ui/state/Tick';
@@ -141,6 +141,9 @@ function findDirectMessageChannel(userId: string): Channel | null {
function resolveForwardChannelRow(channelId: string): ForwardRowIdentity | null {
const channel = Channels.getChannel(channelId);
if (channel == null) return null;
+ if (channel.isThread()) {
+ return isForwardableThread(channel) ? {id: channel.id, type: 'text_channel'} : null;
+ }
switch (channel.type) {
case ChannelTypes.DM: {
if (channel.recipientIds.length === 0) return null;
diff --git a/fluxer_app/src/features/search/utils/DestinationSearchSources.ts b/fluxer_app/src/features/search/utils/DestinationSearchSources.ts
index 9eb58dfbb..ee877d289 100644
--- a/fluxer_app/src/features/search/utils/DestinationSearchSources.ts
+++ b/fluxer_app/src/features/search/utils/DestinationSearchSources.ts
@@ -110,7 +110,7 @@ function buildForwardGroupDMCandidates(i18n: I18n): ReadonlyArray<ForwardGroupDM
return Object.freeze(candidates);
}
-function isForwardableThread(thread: Channel): boolean {
+export function isForwardableThread(thread: Channel): boolean {
if (!ThreadGuilds.isActive(thread.guildId) || ChannelThreads.getThread(thread.id) == null) return false;
if (thread.isArchived && thread.isLocked) return false;
return ThreadMemberships.isMember(thread.id) || canJoinThreadChannel(thread);