A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.
fix: address 72 reported bugs across app, api and gateway (#3896)
Hampus32c9d9a8d0c3
diff --git a/fluxer_api/src/api/channel/services/message/MessageMentionService.ts b/fluxer_api/src/api/channel/services/message/MessageMentionService.tsindex 094f98489..f3692560d 100644--- a/fluxer_api/src/api/channel/services/message/MessageMentionService.ts+++ b/fluxer_api/src/api/channel/services/message/MessageMentionService.ts@@ -317,16 +317,11 @@ export class MessageMentionService {channelMentionPromise,]);const filteredRoles = canMentionRoles ? roles : roles.filter((role) => role.mentionable);- const blockFilteredMentions = await this.filterBlockedUserMentions({+ const validUserIds = await this.filterSuppressedSelfMentions({validUsers: users,validUserIds: users.map((u) => u.id),message,});- const validUserIds = await this.filterSuppressedSelfMentions({- validUsers: blockFilteredMentions.validUsers,- validUserIds: blockFilteredMentions.validUserIds,- message,- });return {validUserIds,validRoleIds: filteredRoles.map((r) => r.id),@@ -339,15 +334,10 @@ export class MessageMentionService {validUserIds.length > 0 ? this.userRepository.listUsers(validUserIds) : Promise.resolve([]),channelMentionPromise,]);- const blockFilteredMentions = await this.filterBlockedUserMentions({- validUsers,- validUserIds,- message,- });return {validUserIds: await this.filterSuppressedSelfMentions({- validUsers: blockFilteredMentions.validUsers,- validUserIds: blockFilteredMentions.validUserIds,+ validUsers,+ validUserIds,message,}),validRoleIds: [],@@ -380,33 +370,12 @@ export class MessageMentionService {return roles.map((role) => ({id: role.id, mentionable: role.isMentionable}));}- private async filterBlockedUserMentions({- validUsers,- validUserIds,- message,- }: {- validUsers: Array<MentionableUser>;- validUserIds: Array<UserID>;- message: Pick<Message, 'authorId' | 'webhookId'>;- }): Promise<{- validUsers: Array<MentionableUser>;- validUserIds: Array<UserID>;- }> {- if (validUserIds.length === 0 || message.webhookId != null || message.authorId == null) {- return {validUsers, validUserIds};- }- const authorId = message.authorId;- const blockedUserIds = await this.userRepository.listUserIdsBlockingTarget(- authorId,- validUserIds.filter((targetUserId) => targetUserId !== authorId),- );- if (blockedUserIds.size === 0) {- return {validUsers, validUserIds};- }- return {- validUsers: validUsers.filter((user) => !blockedUserIds.has(user.id)),- validUserIds: validUserIds.filter((userId) => !blockedUserIds.has(userId)),- };+ async withoutUsersBlockingAuthor(authorId: UserID, userIds: Array<UserID>): Promise<Array<UserID>> {+ const targets = userIds.filter((userId) => userId !== authorId);+ if (targets.length === 0) return userIds;+ const blockingUserIds = await this.userRepository.listUserIdsBlockingTarget(authorId, targets);+ if (blockingUserIds.size === 0) return userIds;+ return userIds.filter((userId) => !blockingUserIds.has(userId));}async validateChannelMentions({@@ -479,7 +448,7 @@ export class MessageMentionService {}): Promise<void> {const {guildId, message, authorId, mentionHere = false} = params;if (isPersonalNotesChannelId({userId: authorId, channelId: message.channelId})) return;- const mentionUserIds = Array.from(message.mentionedUserIds ?? []);+ const mentionUserIds = await this.withoutUsersBlockingAuthor(authorId, Array.from(message.mentionedUserIds ?? []));const mentionRoleIds = Array.from(message.mentionedRoleIds ?? []);const mentionEveryone = message.mentionEveryone && !mentionHere;const taskData = {diff --git a/fluxer_api/src/api/channel/services/message/MessageOperationsHelpers.ts b/fluxer_api/src/api/channel/services/message/MessageOperationsHelpers.tsindex 2e706018d..9d6ecbcb5 100644--- a/fluxer_api/src/api/channel/services/message/MessageOperationsHelpers.ts+++ b/fluxer_api/src/api/channel/services/message/MessageOperationsHelpers.ts@@ -55,10 +55,12 @@ export class MessageOperationsHelpers {userId,nonce,expectedChannelId,+ forumParentId,}: {userId: UserID;nonce?: string;expectedChannelId: ChannelID;+ forumParentId?: ChannelID;}): Promise<Message | null> {if (!nonce) return null;const existingNonce = await this.deps.cacheService.get<{@@ -67,7 +69,7 @@ export class MessageOperationsHelpers {}>(messageNonceKey(userId, nonce));if (!existingNonce) return null;const cachedChannelId = createChannelID(BigInt(existingNonce.channel_id));- if (cachedChannelId !== expectedChannelId) {+ if (cachedChannelId !== expectedChannelId && !(await this.isForumPost(cachedChannelId, forumParentId))) {throw new UnknownMessageError();}return this.deps.channelRepository.messages.getMessage(@@ -76,16 +78,24 @@ export class MessageOperationsHelpers {);}+ private async isForumPost(channelId: ChannelID, forumParentId: ChannelID | undefined): Promise<boolean> {+ if (forumParentId === undefined) return false;+ const channel = await this.deps.channelRepository.channelData.findUnique(channelId);+ return channel?.parentId === forumParentId;+ }+async sendOncePerNonce<T>({userId,nonce,expectedChannelId,+ forumParentId,existing,send,}: {userId: UserID;nonce?: string;expectedChannelId: ChannelID;+ forumParentId?: ChannelID;existing: (message: Message) => T;send: (recordNonce: RecordMessageNonce) => Promise<T>;}): Promise<T> {@@ -93,11 +103,20 @@ export class MessageOperationsHelpers {const claimKey = messageNonceClaimKey(userId, nonce);const deadline = Date.now() + MESSAGE_NONCE_WAIT_MS;while (true) {- const existingMessage = await this.findExistingMessage({userId, nonce, expectedChannelId});+ const existingMessage = await this.findExistingMessage({userId, nonce, expectedChannelId, forumParentId});if (existingMessage) return existing(existingMessage);const token = await this.deps.cacheService.acquireLock(claimKey, MESSAGE_NONCE_CLAIM_TTL_SECONDS);if (token) {- return this.sendWithNonceClaim({userId, nonce, expectedChannelId, claimKey, token, existing, send});+ return this.sendWithNonceClaim({+ userId,+ nonce,+ expectedChannelId,+ forumParentId,+ claimKey,+ token,+ existing,+ send,+ });}if (Date.now() >= deadline) {throw new ThrottledError({@@ -114,6 +133,7 @@ export class MessageOperationsHelpers {userId,nonce,expectedChannelId,+ forumParentId,claimKey,token,existing,@@ -122,6 +142,7 @@ export class MessageOperationsHelpers {userId: UserID;nonce: string;expectedChannelId: ChannelID;+ forumParentId?: ChannelID;claimKey: string;token: string;existing: (message: Message) => T;@@ -135,7 +156,7 @@ export class MessageOperationsHelpers {);let keepClaim = false;try {- const existingMessage = await this.findExistingMessage({userId, nonce, expectedChannelId});+ const existingMessage = await this.findExistingMessage({userId, nonce, expectedChannelId, forumParentId});if (existingMessage) return existing(existingMessage);return await send(async (messageId) => {try {diff --git a/fluxer_api/src/api/channel/services/message/MessageSendService.ts b/fluxer_api/src/api/channel/services/message/MessageSendService.tsindex ad8efeb7d..d23b268e5 100644--- a/fluxer_api/src/api/channel/services/message/MessageSendService.ts+++ b/fluxer_api/src/api/channel/services/message/MessageSendService.ts@@ -888,13 +888,17 @@ export class MessageSendService {? [{step: 'thread_mention_members',- promise: this.deps.threadActivity.addMentionedUsers({- channel,- parent: authChannel.thread.parent,- isModerator: authChannel.thread.isModerator,- authorId: user.id,- mentionUserIds: mentionData.mentionUserIds,- }),+ promise: this.deps.mentionService+ .withoutUsersBlockingAuthor(user.id, mentionData.mentionUserIds)+ .then((mentionUserIds) =>+ this.deps.threadActivity.addMentionedUsers({+ channel,+ parent: authChannel.thread!.parent,+ isModerator: authChannel.thread!.isModerator,+ authorId: user.id,+ mentionUserIds,+ }),+ ),},]: []),@@ -1025,6 +1029,7 @@ export class MessageSendService {userId: webhookActorId,nonce: data.nonce,expectedChannelId: channelId,+ forumParentId: forumStarter ? (thread?.parentId ?? undefined) : undefined,existing: (message) => message,send: async (recordNonce) => {const messageIdTask = startEarly(diff --git a/fluxer_api/src/api/channel/services/thread/ThreadCreationService.ts b/fluxer_api/src/api/channel/services/thread/ThreadCreationService.tsindex f97c4ffc2..02e3c0b1b 100644--- a/fluxer_api/src/api/channel/services/thread/ThreadCreationService.ts+++ b/fluxer_api/src/api/channel/services/thread/ThreadCreationService.ts@@ -319,12 +319,15 @@ export class ThreadCreationService {await dispatchThreadEvents(this.ctx.gatewayService, view.state.guildId, [threadCreateEvent(view, {members, newlyCreated: true}),]);+ let starter: Message;try {- return await params.sendStarter(view.channel);+ starter = await params.sendStarter(view.channel);} catch (error) {await this.discardThread(view, members, parent);throw error;}+ if (starter.channelId !== view.channel.id) await this.discardThread(view, members, parent);+ return starter;}private async discardThread(view: ThreadView, members: Array<ThreadMember>, parent: Channel): Promise<void> {diff --git a/fluxer_api/src/api/channel/tests/ForumChannels.test.ts b/fluxer_api/src/api/channel/tests/ForumChannels.test.tsindex 5d88a3f9c..0e2a59924 100644--- a/fluxer_api/src/api/channel/tests/ForumChannels.test.ts+++ b/fluxer_api/src/api/channel/tests/ForumChannels.test.ts@@ -114,6 +114,19 @@ describe('forum and media channels', () => {.execute();expect(forum.available_tags!.map((tag) => tag.name).sort()).toEqual(names);});++ it('creates invites for forum and media channels', async () => {+ const s = await setup();+ const media = await createForum(s.owner.token, s.guildId, {}, ChannelTypes.GUILD_MEDIA);+ for (const channelId of [s.forumId, media.id]) {+ const invite = await threadsRequest<{code: string; channel: {id: string}}>(harness, s.owner.token)+ .post(`/channels/${channelId}/invites`)+ .body({})+ .expect(200)+ .execute();+ expect(invite.channel.id).toBe(channelId);+ }+ });});describe('posts', () => {diff --git a/fluxer_api/src/api/channel/tests/MessageMentionBlockedUsers.test.ts b/fluxer_api/src/api/channel/tests/MessageMentionBlockedUsers.test.tsindex bc2af0399..02f02d4bd 100644--- a/fluxer_api/src/api/channel/tests/MessageMentionBlockedUsers.test.ts+++ b/fluxer_api/src/api/channel/tests/MessageMentionBlockedUsers.test.ts@@ -1,9 +1,14 @@// SPDX-License-Identifier: AGPL-3.0-or-laterimport assert from 'node:assert/strict';+import {createChannelID, createMessageID, createUserID} from '@app/api/BrandedTypes';+import {MessageMentionService} from '@app/api/channel/services/message/MessageMentionService';import {blockUser, setupTestGuildWithMembers} from '@app/api/channel/tests/ChannelTestUtils';import {type ApiTestHarness, createApiTestHarness} from '@app/api/test/ApiTestHarness';+import {RecordingWorkerService} from '@app/api/test/RecordingWorkerService';import {createBuilder} from '@app/api/test/TestRequestBuilder';+import {UserRepository} from '@app/api/user/repositories/UserRepository';+import {MessageTypes} from '@fluxer/constants/src/ChannelConstants';import type {MessageResponse} from '@fluxer/schema/src/domains/message/MessageResponseSchemas';import {afterAll, beforeAll, beforeEach, describe, expect, it} from 'vitest';@@ -22,18 +27,49 @@ describe('Message mentions of users who blocked the author', () => {await harness.shutdown();});- it('drops only the users who blocked the author', async () => {+ it('shows reply mentions the same way and leaves blockers out of the fanout', async () => {const {owner, members, systemChannel} = await setupTestGuildWithMembers(harness, 3);const [first, second, third] = members;assert(first && second && third, 'Expected three guild members');await blockUser(harness, second, owner.userId);await blockUser(harness, owner, third.userId);- const message = await createBuilder<MessageResponse>(harness, owner.token)+ const original = await createBuilder<MessageResponse>(harness, second.token).post(`/channels/${systemChannel.id}/messages`)- .body({content: `<@${first.userId}> <@${second.userId}> <@${third.userId}> <@${owner.userId}>`})+ .body({content: 'hello'}).execute();- expect(new Set(message.mentions.map((user) => user.id))).toEqual(- new Set([first.userId, third.userId, owner.userId]),+ const reply = await createBuilder<MessageResponse>(harness, owner.token)+ .post(`/channels/${systemChannel.id}/messages`)+ .body({+ content: `<@${first.userId}> <@${third.userId}>`,+ message_reference: {message_id: original.id},+ allowed_mentions: {replied_user: true},+ })+ .execute();+ expect(new Set(reply.mentions.map((user) => user.id))).toEqual(+ new Set([first.userId, second.userId, third.userId]),+ );+ const worker = new RecordingWorkerService();+ const mentionService = new MessageMentionService(+ new UserRepository(),+ null as never,+ null as never,+ worker,+ null as never,);+ await mentionService.handleMentionTasks({+ guildId: null,+ message: {+ id: createMessageID(BigInt(reply.id)),+ channelId: createChannelID(BigInt(reply.channel_id)),+ type: MessageTypes.REPLY,+ reference: null,+ mentionEveryone: false,+ mentionedUserIds: new Set(reply.mentions.map((user) => createUserID(BigInt(user.id)))),+ mentionedRoleIds: new Set(),+ } as never,+ authorId: createUserID(BigInt(owner.userId)),+ });+ const [job] = worker.byTask('handleMentions');+ expect(new Set(job?.payload.mentionUserIds as Array<string>)).toEqual(new Set([first.userId, third.userId]));});});diff --git a/fluxer_api/src/api/guild/GuildModel.ts b/fluxer_api/src/api/guild/GuildModel.tsindex 5ff47844b..dfcb9afac 100644--- a/fluxer_api/src/api/guild/GuildModel.ts+++ b/fluxer_api/src/api/guild/GuildModel.ts@@ -1,5 +1,6 @@// SPDX-License-Identifier: AGPL-3.0-or-later+import {Config} from '@app/api/Config';import {mapGuildFeatures} from '@app/api/guild/GuildFeatureUtils';import {stripGuildBannerForFeatures,@@ -15,6 +16,7 @@ import type {GuildMember} from '@app/api/models/GuildMember';import type {GuildRole} from '@app/api/models/GuildRole';import type {GuildSticker} from '@app/api/models/GuildSticker';import {hiddenGuildMember, isHiddenPartial} from '@app/api/user/ProfileVisibility';+import {getEffectiveGuildMfaLevel} from '@fluxer/constants/src/GuildConstants';import type {GuildEmojiResponse,GuildEmojiWithUserResponse,@@ -67,7 +69,7 @@ export function mapGuildToGuildResponse(afk_channel_id: guild.afkChannelId ? guild.afkChannelId.toString() : null,afk_timeout: guild.afkTimeout,verification_level: guild.verificationLevel,- mfa_level: guild.mfaLevel,+ mfa_level: getEffectiveGuildMfaLevel(guild.mfaLevel, guild.features, Config.instance.selfHosted),nsfw_level: guild.nsfwLevel,nsfw: guild.nsfw,content_warning_level: guild.contentWarningLevel as 0 | 1,diff --git a/fluxer_api/src/api/guild/services/GuildMfaEnforcement.ts b/fluxer_api/src/api/guild/services/GuildMfaEnforcement.tsindex 6bd454206..2cea7197e 100644--- a/fluxer_api/src/api/guild/services/GuildMfaEnforcement.ts+++ b/fluxer_api/src/api/guild/services/GuildMfaEnforcement.ts@@ -1,10 +1,11 @@// SPDX-License-Identifier: AGPL-3.0-or-laterimport type {ChannelID, GuildID, RoleID, UserID} from '@app/api/BrandedTypes';+import {Config} from '@app/api/Config';import type {IGatewayService} from '@app/api/infrastructure/IGatewayService';import type {UserRepository} from '@app/api/user/repositories/UserRepository';import {Permissions} from '@fluxer/constants/src/ChannelConstants';-import {GuildMFALevel} from '@fluxer/constants/src/GuildConstants';+import {GuildMFALevel, getEffectiveGuildMfaLevel} from '@fluxer/constants/src/GuildConstants';import {ThreadPermissionFlags} from '@fluxer/constants/src/ThreadPermissionUtils';import {MfaNotEnabledError} from '@fluxer/errors/src/domains/auth/MfaNotEnabledError';import {MissingAccessError} from '@fluxer/errors/src/domains/core/MissingAccessError';@@ -25,11 +26,13 @@ const ELEVATED_MFA_PERMISSIONS =export async function createGuildMfaEnforcer(params: {userRepository: UserRepository;- guildData: Pick<GuildResponse, 'mfa_level' | 'owner_id'>;+ guildData: Pick<GuildResponse, 'mfa_level' | 'owner_id' | 'features'>;userId: UserID;}): Promise<(permission: bigint) => void> {const {userRepository, guildData, userId} = params;- const requiresGuildMfa = guildData.mfa_level === GuildMFALevel.ELEVATED && guildData.owner_id !== userId.toString();+ const requiresGuildMfa =+ getEffectiveGuildMfaLevel(guildData.mfa_level, guildData.features, Config.instance.selfHosted) ===+ GuildMFALevel.ELEVATED && guildData.owner_id !== userId.toString();let actorLacksMfa = false;if (requiresGuildMfa) {const actor = await userRepository.findUnique(userId);diff --git a/fluxer_api/src/api/guild/tests/GuildMfaLevel.test.ts b/fluxer_api/src/api/guild/tests/GuildMfaLevel.test.tsindex dccc811cf..05f4d94f3 100644--- a/fluxer_api/src/api/guild/tests/GuildMfaLevel.test.ts+++ b/fluxer_api/src/api/guild/tests/GuildMfaLevel.test.ts@@ -1,6 +1,7 @@// SPDX-License-Identifier: AGPL-3.0-or-laterimport {createTestAccount, type TestAccount, totpCodeNow} from '@app/api/auth/tests/AuthTestUtils';+import {Config} from '@app/api/Config';import {addMemberRole,createGuild,@@ -12,7 +13,7 @@ import {type ApiTestHarness, createApiTestHarness} from '@app/api/test/ApiTestHaimport {HTTP_STATUS} from '@app/api/test/TestConstants';import {createBuilder, createBuilderWithoutAuth} from '@app/api/test/TestRequestBuilder';import {Permissions} from '@fluxer/constants/src/ChannelConstants';-import {GuildMFALevel} from '@fluxer/constants/src/GuildConstants';+import {GuildFeatures, GuildMFALevel} from '@fluxer/constants/src/GuildConstants';import type {GuildResponse} from '@fluxer/schema/src/domains/guild/GuildResponseSchemas';import {afterAll, beforeAll, beforeEach, describe, expect, it} from 'vitest';@@ -160,4 +161,62 @@ describe('Guild MFA level', () => {Permissions.SEND_MESSAGES.toString(),);});+ const setupModeratorInStatusCommunity = async (feature: string) => {+ const {owner, members, guild, channels} = await setupTestGuildWithMembers(harness, 1);+ const member = members[0]!;+ const channel = channels[0]!;+ const managerRole = await createRole(harness, owner.token, guild.id, {+ name: 'Managers',+ permissions: (Permissions.MANAGE_ROLES | Permissions.VIEW_CHANNEL | Permissions.SEND_MESSAGES).toString(),+ });+ const targetRole = await createRole(harness, owner.token, guild.id, {name: 'Target'});+ await addMemberRole(harness, owner.token, guild.id, member.userId, managerRole.id);+ await createBuilder(harness, '')+ .post(`/test/guilds/${guild.id}/features`)+ .body({add_features: [feature]})+ .expect(HTTP_STATUS.OK)+ .execute();+ return {owner, member, guild, channel, targetRole};+ };+ const withSelfHosted = async (selfHosted: boolean, run: () => Promise<void>) => {+ const previous = Config.instance.selfHosted;+ Config.instance.selfHosted = selfHosted;+ try {+ await run();+ } finally {+ Config.instance.selfHosted = previous;+ }+ };+ for (const feature of [GuildFeatures.VERIFIED, GuildFeatures.PARTNERED]) {+ it(`always requires 2FA for moderators in a ${feature} community`, async () => {+ const {owner, member, guild, channel, targetRole} = await setupModeratorInStatusCommunity(feature);+ await withSelfHosted(false, async () => {+ const fetched = await createBuilder<GuildResponse>(harness, owner.token)+ .get(`/guilds/${guild.id}`)+ .expect(HTTP_STATUS.OK)+ .execute();+ expect(fetched.mfa_level).toBe(GuildMFALevel.ELEVATED);+ await createBuilder(harness, member.token)+ .put(`/channels/${channel.id}/permissions/${targetRole.id}`)+ .body({type: 0, allow: Permissions.SEND_MESSAGES.toString(), deny: '0'})+ .expect(HTTP_STATUS.BAD_REQUEST, 'TWO_FACTOR_REQUIRED')+ .execute();+ });+ });+ }+ it('leaves moderator 2FA to the community on self-hosted instances', async () => {+ const {owner, member, guild, channel, targetRole} = await setupModeratorInStatusCommunity(GuildFeatures.VERIFIED);+ await withSelfHosted(true, async () => {+ const fetched = await createBuilder<GuildResponse>(harness, owner.token)+ .get(`/guilds/${guild.id}`)+ .expect(HTTP_STATUS.OK)+ .execute();+ expect(fetched.mfa_level).toBe(GuildMFALevel.NONE);+ await createBuilder(harness, member.token)+ .put(`/channels/${channel.id}/permissions/${targetRole.id}`)+ .body({type: 0, allow: Permissions.SEND_MESSAGES.toString(), deny: '0'})+ .expect(HTTP_STATUS.NO_CONTENT)+ .execute();+ });+ });});diff --git a/fluxer_api/src/api/invite/InviteService.ts b/fluxer_api/src/api/invite/InviteService.tsindex bda40a5b7..fac0d3272 100644--- a/fluxer_api/src/api/invite/InviteService.ts+++ b/fluxer_api/src/api/invite/InviteService.ts@@ -10,7 +10,7 @@ import {vanityCodeToInviteCode,} from '@app/api/BrandedTypes';import type {ChannelService} from '@app/api/channel/services/ChannelService';-import {THREAD_FEATURE_CHANNEL_TYPES, type ThreadViewer} from '@app/api/experiment/ChannelThreadsGate';+import {THREAD_CHANNEL_TYPES, type ThreadViewer} from '@app/api/experiment/ChannelThreadsGate';import type {GuildAuditLogService} from '@app/api/guild/GuildAuditLogService';import type {GuildService} from '@app/api/guild/services/GuildService';import {enqueueEndGuildVisitsForCode} from '@app/api/guild/visits/GuildVisitLifecycle';@@ -175,7 +175,7 @@ export class InviteService {viewer,channelId,});- if (THREAD_FEATURE_CHANNEL_TYPES.has(channel.type)) {+ if (THREAD_CHANNEL_TYPES.has(channel.type)) {throw new InvalidChannelTypeError();}if (!channel.guildId) {diff --git a/fluxer_api/src/api/openapi/openapi.json b/fluxer_api/src/api/openapi/openapi.jsonindex 7d778672c..e35515e33 100644--- a/fluxer_api/src/api/openapi/openapi.json+++ b/fluxer_api/src/api/openapi/openapi.json@@ -37855,7 +37855,7 @@"type": "object","properties": {"topic": {"description": "The channel topic (1-1024 characters)", "type": ["string", "null"]},- "url": {"description": "External URL for link channels", "type": ["string", "null"]},+ "url": {"description": "External URL for link channels", "type": "string"},"parent_id": {"description": "ID of the parent category for this channel","anyOf": [{"$ref": "#/components/schemas/SnowflakeType"}, {"type": "null"}]@@ -43336,7 +43336,7 @@"type": "object","properties": {"topic": {"description": "The channel topic (1-1024 characters)", "type": ["string", "null"]},- "url": {"description": "External URL for link channels", "type": ["string", "null"]},+ "url": {"description": "External URL for link channels", "type": "string"},"parent_id": {"description": "ID of the parent category for this channel","anyOf": [{"$ref": "#/components/schemas/SnowflakeType"}, {"type": "null"}]@@ -43407,7 +43407,7 @@},"name": {"description": "The name of the channel", "type": "string"}},- "required": ["type", "name"]+ "required": ["url", "type", "name"]},"GuildCategoryChannelCreateRequest": {"type": "object",diff --git a/fluxer_api/src/api/user/UniqueUsernames.ts b/fluxer_api/src/api/user/UniqueUsernames.tsindex 1894db9d8..596b60551 100644--- a/fluxer_api/src/api/user/UniqueUsernames.ts+++ b/fluxer_api/src/api/user/UniqueUsernames.ts@@ -1,6 +1,7 @@// SPDX-License-Identifier: AGPL-3.0-or-laterimport type {UserID} from '@app/api/BrandedTypes';+import {getInstanceProductName} from '@app/api/instance/ProductName';import type {User} from '@app/api/models/User';import type {UserRepository} from '@app/api/user/repositories/UserRepository';import {USERNAME_MODE_DISCRIMINATOR} from '@app/api/user/UserTag';@@ -88,7 +89,9 @@ export async function isUsernameTaken(username: string,exceptUserId?: UserID,): Promise<boolean> {- if (username.toLowerCase() === DELETED_USER_USERNAME.toLowerCase()) return true;+ const usernameLower = username.toLowerCase();+ if (usernameLower === DELETED_USER_USERNAME.toLowerCase()) return true;+ if (usernameLower === getInstanceProductName().toLowerCase()) return true;const holders = await findUsernameHolders(users, username);return holders.some((user) => user.id !== exceptUserId && (isPerson(user) || user.discriminator === USERNAME_MODE_DISCRIMINATOR),diff --git a/fluxer_api/src/api/user/tests/SystemUsernameTaken.test.ts b/fluxer_api/src/api/user/tests/SystemUsernameTaken.test.tsnew file mode 100644index 000000000..984b6c43d--- /dev/null+++ b/fluxer_api/src/api/user/tests/SystemUsernameTaken.test.ts@@ -0,0 +1,18 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++import {setCachedProductName} from '@app/api/instance/ProductName';+import {isUsernameTaken} from '@app/api/user/UniqueUsernames';+import {afterEach, describe, expect, it} from 'vitest';++const noUsers = {findUsersByUsername: async () => []};++describe('username-only mode', () => {+ afterEach(() => setCachedProductName(null));++ it('treats the system user name as taken', async () => {+ setCachedProductName('Tavern');+ expect(await isUsernameTaken(noUsers, 'tavern')).toBe(true);+ expect(await isUsernameTaken(noUsers, 'Tavern')).toBe(true);+ expect(await isUsernameTaken(noUsers, 'taverns')).toBe(false);+ });+});diff --git a/fluxer_api/src/api/webhook/tests/WebhookForumThreads.test.ts b/fluxer_api/src/api/webhook/tests/WebhookForumThreads.test.tsindex d44cb47f7..4bfce78cb 100644--- a/fluxer_api/src/api/webhook/tests/WebhookForumThreads.test.ts+++ b/fluxer_api/src/api/webhook/tests/WebhookForumThreads.test.ts@@ -82,6 +82,19 @@ describe('webhooks on forum and media channels', () => {});}+ it('returns the first post when a nonce repeats', async () => {+ const s = await setup();+ const body = {content: 'News', thread_name: 'News', nonce: 'probe-1'};+ const first = await execute(s, body).execute();+ const second = await execute(s, body).execute();+ expect(second.id).toBe(first.id);+ expect(second.channel_id).toBe(first.channel_id);+ const forum = await threadsRequest<ChannelResponse>(harness, s.owner.token)+ .get(`/channels/${s.forum.id}`)+ .execute();+ expect(forum.last_message_id).toBe(first.channel_id);+ });+it('rejects an invalid starter before creating the post', async () => {const s = await setup();await execute(s, {thread_name: 'empty'}).expect(400, APIErrorCodes.CANNOT_SEND_EMPTY_MESSAGE).execute();diff --git a/fluxer_api/src/api/worker/tests/PerMessageJobLedger.test.ts b/fluxer_api/src/api/worker/tests/PerMessageJobLedger.test.tsindex e5688d76f..899cf05ea 100644--- a/fluxer_api/src/api/worker/tests/PerMessageJobLedger.test.ts+++ b/fluxer_api/src/api/worker/tests/PerMessageJobLedger.test.ts@@ -30,7 +30,7 @@ function createOverflowingWorkerService(): RecordingWorkerService {describe('per-message worker jobs', () => {it('drops mention fanout instead of failing the send when the jobs stream is full', async () => {const mentionService = new MessageMentionService(- null as never,+ {listUserIdsBlockingTarget: async () => new Set()} as never,null as never,null as never,createOverflowingWorkerService(),diff --git a/fluxer_app/src/app/globals.css b/fluxer_app/src/app/globals.cssindex eed72a10c..a78bd2803 100644--- a/fluxer_app/src/app/globals.css+++ b/fluxer_app/src/app/globals.css@@ -768,7 +768,9 @@ html.reduced-motion *,html.reduced-motion *::before,html.reduced-motion *::after {animation-duration: 0.01ms !important;+ animation-delay: 0s !important;animation-iteration-count: 1 !important;- transition-duration: 0.01ms !important;+ transition-duration: 0s !important;+ transition-delay: 0s !important;scroll-behavior: auto !important;}diff --git a/fluxer_app/src/features/app/components/dialogs/Modal.module.css b/fluxer_app/src/features/app/components/dialogs/Modal.module.cssindex e99469b75..56c797156 100644--- a/fluxer_app/src/features/app/components/dialogs/Modal.module.css+++ b/fluxer_app/src/features/app/components/dialogs/Modal.module.css@@ -10,6 +10,8 @@.layer {position: fixed;inset: 0;+ left: var(--quick-css-dock-left, 0px);+ right: var(--quick-css-dock-right, 0px);display: flex;flex-direction: column;align-items: center;@@ -56,6 +58,8 @@.layer.layerFullscreen {position: absolute;inset: 0;+ left: var(--quick-css-dock-left, 0px);+ right: var(--quick-css-dock-right, 0px);--fullscreen-pad-y: clamp(0.5rem, 1.5vh, 1rem);--fullscreen-pad-x: clamp(0.75rem, 2vw, 1.5rem);--fullscreen-view-height: min(100dvh, 100svh, 100vh);diff --git a/fluxer_app/src/features/app/components/layout/ChannelListContent.tsx b/fluxer_app/src/features/app/components/layout/ChannelListContent.tsxindex bf0fbc9c3..24f3df891 100644--- a/fluxer_app/src/features/app/components/layout/ChannelListContent.tsx+++ b/fluxer_app/src/features/app/components/layout/ChannelListContent.tsx@@ -41,6 +41,7 @@ import {} from '@app/features/app/hooks/useSkeletonLayoutMemoryCapture';import type {Channel} from '@app/features/channel/models/Channel';import Channels from '@app/features/channel/state/Channels';+import {hasForumUnread} from '@app/features/forum/state/ForumReadState';import * as GuildCommands from '@app/features/guild/commands/GuildCommands';import type {Guild} from '@app/features/guild/models/Guild';import {MEMBERS_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';@@ -53,6 +54,7 @@ import ReadStates from '@app/features/read_state/state/ReadStates';import {remFromPx} from '@app/features/theme/layout/RemFromPx';import {SidebarThreadList} from '@app/features/threads/components/SidebarThreadList';import ThreadGuilds from '@app/features/threads/state/ThreadGuilds';+import {getSidebarThreadActivity} from '@app/features/threads/utils/SidebarThreadActivity';import {ChannelListContextMenu} from '@app/features/ui/action_menu/ChannelListContextMenu';import * as ContextMenuCommands from '@app/features/ui/commands/ContextMenuCommands';import * as DimensionCommands from '@app/features/ui/commands/DimensionCommands';@@ -347,11 +349,11 @@ export const ChannelListContent = observer(({guild, scrollY, banner}: ChannelLis[guild],);const getUnreadStateInChannel = (channelId: string): ChannelUnreadState => {+ const channel = Channels.getChannel(channelId);const unreadCount = ReadStates.getUnreadCount(channelId);- const hasUnread = ReadStates.hasUnread(channelId);+ const hasUnread = channel?.isThreadOnly() ? hasForumUnread(channel) : ReadStates.hasUnread(channelId);const mentionCount = ReadStates.getMentionCount(channelId);const isMuted = UserGuildSettings.isChannelDirectlyMuted(guild.id, channelId);- const channel = Channels.getChannel(channelId);const unreadBadgesLevel = channel? UserGuildSettings.resolvedUnreadBadgesLevel({id: channel.id,@@ -423,13 +425,14 @@ export const ChannelListContent = observer(({guild, scrollY, banner}: ChannelLisconst showSet = new Set<string>();for (const ch of filteredTextChannels) {const unreadState = getUnreadStateInChannel(ch.id);+ const threadActivity = threadsActive ? getSidebarThreadActivity(ch.id) : null;if (shouldShowChannelInCollapsedCategory({isCategoryMuted,isSelected: ch.id === showTextSelected,isConnected: false,- hasVisibleUnread: unreadState.hasVisibleUnread,- hasMentions: unreadState.hasMentions,+ hasVisibleUnread: unreadState.hasVisibleUnread || threadActivity?.hasActivity === true,+ hasMentions: unreadState.hasMentions || threadActivity?.hasMentions === true,})) {showSet.add(ch.id);@@ -659,7 +662,7 @@ export const ChannelListContent = observer(({guild, scrollY, banner}: ChannelLis<SidebarThreadListguildId={guild.id}parentId={ch.id}- onlySelected={group.isCollapsed}+ collapsed={group.isCollapsed}data-flx="app.channel-list-content.sidebar-thread-list"/></React.Fragment>diff --git a/fluxer_app/src/features/app/components/shared/ChannelPinsContent.tsx b/fluxer_app/src/features/app/components/shared/ChannelPinsContent.tsxindex 462db2999..460de263d 100644--- a/fluxer_app/src/features/app/components/shared/ChannelPinsContent.tsx+++ b/fluxer_app/src/features/app/components/shared/ChannelPinsContent.tsx@@ -77,7 +77,7 @@ export const ChannelPinsContent = observer(({channel, onJump}: ChannelPinsContenconst hasMore = ChannelPins.getHasMore(channel.id);const isLoading = ChannelPins.getIsLoading(channel.id);const isDMChannel = channel.type === ChannelTypes.DM || channel.type === ChannelTypes.GROUP_DM;- const canUnpin = isDMChannel || Permission.can(Permissions.MANAGE_MESSAGES, channel);+ const canUnpin = isDMChannel || Permission.can(Permissions.PIN_MESSAGES, channel);const mobileLayout = MobileLayout;const scrollerRef = useRef<ScrollerHandle | null>(null);const resolvePinnedScrollSurface = useMemo(() => () => scrollerRef.current?.getViewportElement() ?? null, []);diff --git a/fluxer_app/src/features/app/keybindings/KeybindEventUtils.ts b/fluxer_app/src/features/app/keybindings/KeybindEventUtils.tsindex b1fbf8422..09841b6f9 100644--- a/fluxer_app/src/features/app/keybindings/KeybindEventUtils.ts+++ b/fluxer_app/src/features/app/keybindings/KeybindEventUtils.ts@@ -14,6 +14,12 @@ export const normalizeKeyboardShortcutKey = (key: string): string => {};const isPrintableNonLetterShortcutKey = (key: string | undefined | null): boolean =>!!key && key.length === 1 && !/^[a-z]$/i.test(key);+const latinKeyCode = (key: string): string | null => {+ if (/^[a-z]$/i.test(key)) return `Key${key.toUpperCase()}`;+ if (/^[0-9]$/.test(key)) return `Digit${key}`;+ return null;+};+const isNonAsciiLayoutKey = (key: string): boolean => key.length === 1 && key.charCodeAt(0) > 0x7f;const hasTriggerKey = (combo: KeyCombo): boolean => (combo.key ?? '') !== '' || (combo.code ?? '') !== '';const keyboardEventIsModifierKey = (event: Pick<KeyboardShortcutEvent, 'key' | 'code'>,@@ -34,6 +40,10 @@ export const keyboardEventTriggerMatchesCombo = (combo: KeyCombo, event: Keyboarconst expectedLayoutKey = combo.key || combo.code;if (shouldPreferLayoutKey(combo) && expectedLayoutKey) {if (normalizeKeyboardShortcutKey(event.key) === normalizeKeyboardShortcutKey(expectedLayoutKey)) return true;+ const hasCommandModifier = Boolean(combo.ctrl || combo.ctrlOrMeta || combo.alt || combo.meta);+ if (hasCommandModifier && isNonAsciiLayoutKey(event.key) && event.code === latinKeyCode(expectedLayoutKey)) {+ return true;+ }return Boolean(combo.code && event.code === combo.code && combo.ctrlOrMeta && combo.alt);}const expectedCode = combo.code;diff --git a/fluxer_app/src/features/app/keybindings/KeybindManager.ts b/fluxer_app/src/features/app/keybindings/KeybindManager.tsindex adabeaf3a..4eed8846d 100644--- a/fluxer_app/src/features/app/keybindings/KeybindManager.ts+++ b/fluxer_app/src/features/app/keybindings/KeybindManager.ts@@ -82,6 +82,8 @@ import MacPermissions from '@app/features/permissions/system/state/MacPermissionimport {ensureMacPermission} from '@app/features/permissions/system/utils/MacPermissionGate';import {Logger} from '@app/features/platform/utils/AppLogger';import ReadStates from '@app/features/read_state/state/ReadStates';+import ChannelThreads from '@app/features/threads/state/ChannelThreads';+import ThreadGuilds from '@app/features/threads/state/ThreadGuilds';import KeyboardMode from '@app/features/ui/state/KeyboardMode';import {isWebReservedZoomShortcut} from '@app/features/ui/utils/AppZoomKeybindUtils';import {getElectronAPI, isNativeMacOS} from '@app/features/ui/utils/NativeUtils';@@ -357,15 +359,21 @@ class KeybindManager {private getNavigableChannelsInCurrentContext(): ReadonlyArray<Channel> {const guildId = this.currentGuildId;if (!guildId) return [];- return this.flattenGuildChannelsByDisplayOrder(Channels.getGuildChannels(guildId));+ return this.flattenGuildChannelsByDisplayOrder(guildId);}- private flattenGuildChannelsByDisplayOrder(channels: ReadonlyArray<Channel>): Array<Channel> {- const groups = organizeChannels(channels);+ private flattenGuildChannelsByDisplayOrder(guildId: string): Array<Channel> {+ const groups = organizeChannels(Channels.getGuildChannels(guildId));+ const threadsActive = ThreadGuilds.isActive(guildId);+ const currentChannelId = this.currentChannelId;+ const openThreadId =+ Navigation.threadId ?? (currentChannelId && ChannelThreads.hasThread(currentChannelId) ? currentChannelId : null);const flat: Array<Channel> = [];for (const group of groups) {for (const ch of group.textChannels) {- if (this.isNavigableChannel(ch)) flat.push(ch);+ if (!this.isNavigableChannel(ch)) continue;+ flat.push(ch);+ if (threadsActive) flat.push(...ChannelThreads.getSidebarThreads(ch.id, openThreadId));}for (const ch of group.voiceChannels) {if (this.isNavigableChannel(ch)) flat.push(ch);@@ -415,9 +423,7 @@ class KeybindManager {cycleFilteredChannelInCurrentGuild(predicate: (channel: Channel) => boolean, direction: 1 | -1): void {const guildId = this.currentGuildId;if (!guildId) return;- const channels = this.flattenGuildChannelsByDisplayOrder(Channels.getGuildChannels(guildId)).filter((c) =>- predicate(c),- );+ const channels = this.flattenGuildChannelsByDisplayOrder(guildId).filter((c) => predicate(c));if (!channels.length) return;const target = this.getNextChannel(channels, direction);this.navigateToChannel(guildId, target.id);@@ -463,7 +469,8 @@ class KeybindManager {return Boolean(channelId && ReadStates.hasUnread(channelId));}if (action === 'chat_focus_textarea') {- return this.currentChannelId != null && document.querySelector(CHANNEL_TEXTAREA_SELECTOR) != null;+ const composer = document.querySelector(CHANNEL_TEXTAREA_SELECTOR);+ return this.currentChannelId != null && composer != null && composer.getAttribute('aria-disabled') !== 'true';}return true;}diff --git a/fluxer_app/src/features/app/keybindings/keybind_manager/handlers/defaultHandlers.ts b/fluxer_app/src/features/app/keybindings/keybind_manager/handlers/defaultHandlers.tsindex edab292ca..671901ee2 100644--- a/fluxer_app/src/features/app/keybindings/keybind_manager/handlers/defaultHandlers.ts+++ b/fluxer_app/src/features/app/keybindings/keybind_manager/handlers/defaultHandlers.ts@@ -307,7 +307,7 @@ export function registerDefaultKeybindHandlers(host: HandlerHost, i18n: I18n): vif (type !== 'press') return;const channelId = host.currentChannelId;if (!channelId) return;- const targetId = ReadStates.getOldestUnreadMessageId(channelId);+ const targetId = ReadStates.getOldestUnreadJumpTargetId(channelId);if (!targetId) return;goToMessage(channelId, targetId, {jumpType: JumpTypes.ANIMATED});});diff --git a/fluxer_app/src/features/app/keybindings/keybind_manager/handlers/messageHandlers.ts b/fluxer_app/src/features/app/keybindings/keybind_manager/handlers/messageHandlers.tsindex e82237b63..b4595c678 100644--- a/fluxer_app/src/features/app/keybindings/keybind_manager/handlers/messageHandlers.ts+++ b/fluxer_app/src/features/app/keybindings/keybind_manager/handlers/messageHandlers.ts@@ -99,7 +99,7 @@ export function registerMessageHandlers(host: HandlerHost, i18n: I18n): void {if (type !== 'press') return;const message = context?.focusedMessage ?? MessageFocus.getFocusedMessage();if (!message) return;- requestToggleBookmark(message, i18n);+ void requestToggleBookmark(message, i18n);});host.register('message_toggle_embeds', ({type, context}) => {if (type !== 'press') return;diff --git a/fluxer_app/src/features/channel/components/Autocomplete.tsx b/fluxer_app/src/features/channel/components/Autocomplete.tsxindex 998a37ba1..83a6735a1 100644--- a/fluxer_app/src/features/channel/components/Autocomplete.tsx+++ b/fluxer_app/src/features/channel/components/Autocomplete.tsx@@ -30,6 +30,7 @@ import {import {isIMEComposing} from '@app/features/messaging/utils/IMECompositionUtils';import {Scroller, type ScrollerHandle} from '@app/features/ui/components/Scroller';import {usePortalHost} from '@app/features/ui/overlay/PortalHostContext';+import ModalState from '@app/features/ui/state/Modal';import {autoUpdate, FloatingPortal, flip, offset, size, useFloating} from '@floating-ui/react';import type {I18n} from '@lingui/core';import {msg} from '@lingui/core/macro';@@ -141,6 +142,14 @@ function resolvePortalRoot(portalHost: HTMLElement | null): HTMLElement | undefireturn portalHost;}+function isCoveredByModal(reference: HTMLElement): boolean {+ const ownerDocument = reference.ownerDocument;+ if (!ModalState.hasModalOpen(ownerDocument)) return false;+ const dialogs = ownerDocument.querySelectorAll('[role="dialog"][aria-modal="true"]');+ const topDialog = dialogs.item(dialogs.length - 1);+ return topDialog == null || !topDialog.contains(reference);+}+const ATTACHED_AUTOCOMPLETE_GAP = 4;export const Autocomplete = observer(@@ -324,6 +333,7 @@ export const Autocomplete = observer(rowRefs,getOptionId,};+ if (referenceState != null && isCoveredByModal(referenceState)) return null;return (<FloatingPortal root={resolvePortalRoot(portalHost)} data-flx="channel.autocomplete.floating-portal"><divdiff --git a/fluxer_app/src/features/channel/components/AutocompleteGif.tsx b/fluxer_app/src/features/channel/components/AutocompleteGif.tsxindex 0a0e2be82..a358bdd87 100644--- a/fluxer_app/src/features/channel/components/AutocompleteGif.tsx+++ b/fluxer_app/src/features/channel/components/AutocompleteGif.tsx@@ -117,6 +117,7 @@ export const AutocompleteGif = observer(className={styles.scroller}orientation="horizontal"fade={true}+ scrollbarTrackMode="reserve"key="autocomplete-gif-scroller"data-flx="channel.autocomplete-gif.scroller">diff --git a/fluxer_app/src/features/channel/components/ChannelSearchResults.module.css b/fluxer_app/src/features/channel/components/ChannelSearchResults.module.cssindex fff8c6baf..2707a2c57 100644--- a/fluxer_app/src/features/channel/components/ChannelSearchResults.module.css+++ b/fluxer_app/src/features/channel/components/ChannelSearchResults.module.css@@ -166,6 +166,13 @@flex-shrink: 0;}+.pageLimitNotice {+ margin: 0.5rem 0 0;+ text-align: center;+ font-size: 0.875rem;+ color: var(--text-primary-muted);+}+.sortButton {min-width: 0;}diff --git a/fluxer_app/src/features/channel/components/ChannelSearchResults.tsx b/fluxer_app/src/features/channel/components/ChannelSearchResults.tsxindex dca4b07c3..58953f1fb 100644--- a/fluxer_app/src/features/channel/components/ChannelSearchResults.tsx+++ b/fluxer_app/src/features/channel/components/ChannelSearchResults.tsx@@ -14,12 +14,14 @@ import {EMPTY_SEARCH_CHANNELS,EMPTY_SEARCH_MESSAGES,getAdaptiveVisiblePageCount,+ getSearchPageCount,getSearchResultChannelRenderData,getSortModeOptions,RESULTS_PER_PAGE,renderScopeIcon,renderSortIcon,runChannelSearch,+ SEARCH_PAGE_LIMIT_DESCRIPTOR,} from '@app/features/channel/components/channel_search_results/ChannelSearchResultsShared';import {shouldSearchResultRowJump} from '@app/features/channel/components/channel_search_results/SearchResultRowClick';import {SearchResultsHeader} from '@app/features/channel/components/channel_search_results/SearchResultsHeader';@@ -509,7 +511,7 @@ export const ChannelSearchResults = observer(if (results.length === 0) {return <SearchEmptyState data-flx="channel.channel-search-results.render-content.search-empty-state" />;}- const totalPages = Math.max(1, Math.ceil(total / hitsPerPage));+ const {totalPages, capped} = getSearchPageCount(total, hitsPerPage);return (<CollapsedMessageVisibilityProvidervalue={collapsedMessageVisibility}@@ -638,6 +640,14 @@ export const ChannelSearchResults = observer(onJumpToPage={handlePaginationJump}data-flx="channel.channel-search-results.render-content.search-results-pagination"/>+ {capped && currentPage === totalPages && (+ <p+ className={styles.pageLimitNotice}+ data-flx="channel.channel-search-results.render-content.page-limit-notice"+ >+ {i18n._(SEARCH_PAGE_LIMIT_DESCRIPTOR, {maxPages: totalPages})}+ </p>+ )}</Scroller></NearViewportSurfaceContext.Provider></CollapsedMessageVisibilityProvider>diff --git a/fluxer_app/src/features/channel/components/LexicalChannelTextareaContent.tsx b/fluxer_app/src/features/channel/components/LexicalChannelTextareaContent.tsxindex 2587729ef..98334f558 100644--- a/fluxer_app/src/features/channel/components/LexicalChannelTextareaContent.tsx+++ b/fluxer_app/src/features/channel/components/LexicalChannelTextareaContent.tsx@@ -49,7 +49,6 @@ import ChannelSearch from '@app/features/channel/state/ChannelSearch';import ChannelSticker from '@app/features/channel/state/ChannelSticker';import Channels from '@app/features/channel/state/Channels';import * as ChannelDisplayUtils from '@app/features/channel/utils/ChannelUtils';-import * as CommandUtils from '@app/features/devtools/utils/CommandUtils';import ExpressionPicker from '@app/features/emoji/state/ExpressionPicker';import type {FlatEmoji} from '@app/features/emoji/types/EmojiTypes';import {ExpressionPickerSheet} from '@app/features/expressions/components/modals/ExpressionPickerSheet';@@ -78,7 +77,7 @@ import {useTextareaEditing} from '@app/features/messaging/hooks/useTextareaEditiimport {useTextareaExpressionHandlers} from '@app/features/messaging/hooks/useTextareaExpressionHandlers';import {useTextareaExpressionPicker} from '@app/features/messaging/hooks/useTextareaExpressionPicker';import {useTextareaSegments} from '@app/features/messaging/hooks/useTextareaSegments';-import {useTextareaSubmit} from '@app/features/messaging/hooks/useTextareaSubmit';+import {shouldBlockSubmissionForSlowmode, useTextareaSubmit} from '@app/features/messaging/hooks/useTextareaSubmit';import {createMentionConfirmationSnapshot,type MentionConfirmationEvent,@@ -99,6 +98,7 @@ import {getComposerMessageContent,hasVisibleMessageContent,} from '@app/features/messaging/utils/MessageRequestUtils';+import * as ReplaceCommandUtils from '@app/features/messaging/utils/ReplaceCommandUtils';import type {MentionSegment} from '@app/features/messaging/utils/TextareaSegmentManager';import {resolveTypedEmojiShortcodes,@@ -579,22 +579,17 @@ export const LexicalChannelTextareaContent = observer([isEditingMessageOnMobile, trimmedMessageContent],);const hasMessageContent = useMemo(() => hasVisibleMessageContent(composerMessageContent), [composerMessageContent]);- const isSubmissionBlockedBySlowmode = useMemo(() => {- if (!isSlowmodeActive || isEditingMessageInComposer) {- return false;- }- if (!enableSlashCommands) {- return true;- }- const resolution = LexicalMessageCommandResolver.resolve(handleRef.current);- if (resolution.status === LexicalMessageCommandResolutionStatus.NO_COMMAND) {- return true;- }- if (resolution.status === LexicalMessageCommandResolutionStatus.INVALID_COMMAND) {- return false;- }- return CommandUtils.doesCommandSendCurrentChannelMessage(resolution.command);- }, [enableSlashCommands, handleRef, isEditingMessageInComposer, isSlowmodeActive, value]);+ const isSubmissionBlockedBySlowmode = useMemo(+ () =>+ shouldBlockSubmissionForSlowmode(+ isSlowmodeActive,+ isEditingMessageInComposer,+ null,+ enableSlashCommands ? LexicalMessageCommandResolver.resolve(handleRef.current) : null,+ enableSlashCommands && ReplaceCommandUtils.isReplaceCommand(wireValue),+ ),+ [enableSlashCommands, handleRef, isEditingMessageInComposer, isSlowmodeActive, value, wireValue],+ );useChannelComposerPaste({channel,attachmentKey: composerKey,diff --git a/fluxer_app/src/features/channel/components/MessageActionMenu.tsx b/fluxer_app/src/features/channel/components/MessageActionMenu.tsxindex e1d4fb4d1..4c6074c1c 100644--- a/fluxer_app/src/features/channel/components/MessageActionMenu.tsx+++ b/fluxer_app/src/features/channel/components/MessageActionMenu.tsx@@ -30,6 +30,7 @@ import {TRY_AGAIN_DESCRIPTOR,UNPIN_MESSAGE_DESCRIPTOR,} from '@app/features/i18n/utils/CommonMessageDescriptors';+import * as SavedMessageCommands from '@app/features/messaging/commands/SavedMessageCommands';import {useMessageReactions as useMessageReactionsSnapshot} from '@app/features/messaging/hooks/useMessageReactionStore';import type {Message} from '@app/features/messaging/models/MessagingMessage';import SavedMessages from '@app/features/messaging/state/SavedMessages';@@ -175,7 +176,10 @@ export const useMessageActionMenuData = (() => createMessageActionHandlers(message, {i18n, onClose, channel: permissions?.channel ?? sourceChannel}),[message, permissions?.channel, sourceChannel, onClose, i18n.locale],);- const isSaved = useMemo(() => SavedMessages.isSaved(message.id), [message.id]);+ const isSaved = SavedMessages.isSaved(message.id);+ useEffect(() => {+ void SavedMessageCommands.ensureAllLoaded();+ }, []);const channel = permissions?.channel ?? sourceChannel ?? null;const shouldBuildQuickReactions = permissions?.canAddReactions === true && message.state === MessageStates.SENT;const reactionEmojiLimit = Math.max(quickReactionCount, submenuReactionCount);diff --git a/fluxer_app/src/features/channel/components/MessageActionUtils.tsx b/fluxer_app/src/features/channel/components/MessageActionUtils.tsxindex 01c28991d..0a213d150 100644--- a/fluxer_app/src/features/channel/components/MessageActionUtils.tsx+++ b/fluxer_app/src/features/channel/components/MessageActionUtils.tsx@@ -688,10 +688,11 @@ export function requestCopyMessageId(message: Message, i18n: I18n): void {void TextCopyCommands.copy(i18n, message.id);}-export function requestToggleBookmark(message: Message, i18n: I18n): void {+export async function requestToggleBookmark(message: Message, i18n: I18n): Promise<void> {if (isClientSystemMessage(message)) {return;}+ await SavedMessageCommands.ensureAllLoaded();if (SavedMessages.isSaved(message.id)) {SavedMessageCommands.remove(i18n, message.id);return;@@ -722,5 +723,5 @@ export function requestToggleSuppressEmbeds(message: Message, i18n: I18n): void}export function requestSpeakMessage(message: Message): void {- TtsUtils.speakMessage(getEffectiveContent(message));+ TtsUtils.speakMessage(getEffectiveContent(message), Channels.getChannel(message.channelId)?.guildId ?? null);}diff --git a/fluxer_app/src/features/channel/components/bottomsheets/ChannelSearchBottomSheet.tsx b/fluxer_app/src/features/channel/components/bottomsheets/ChannelSearchBottomSheet.tsxindex f93120c6b..520f2cc66 100644--- a/fluxer_app/src/features/channel/components/bottomsheets/ChannelSearchBottomSheet.tsx+++ b/fluxer_app/src/features/channel/components/bottomsheets/ChannelSearchBottomSheet.tsx@@ -1,6 +1,9 @@// SPDX-License-Identifier: AGPL-3.0-or-later-import {getSortModeOptions} from '@app/features/channel/components/channel_search_results/ChannelSearchResultsShared';+import {+ getSearchPageCount,+ getSortModeOptions,+} from '@app/features/channel/components/channel_search_results/ChannelSearchResultsShared';import {useSearchResultCollapsedGroups} from '@app/features/channel/hooks/useSearchResultCollapsedGroups';import {msg} from '@lingui/core/macro';import '@app/features/channel/components/ChannelSearchHighlight.css';@@ -242,7 +245,7 @@ export const ChannelSearchBottomSheet: React.FC<ChannelSearchBottomSheetProps> =}, [reset]);const handleNextPage = useCallback(() => {if (machineState.status !== 'success') return;- const totalPages = Math.max(1, Math.ceil(machineState.total / machineState.hitsPerPage));+ const {totalPages} = getSearchPageCount(machineState.total, machineState.hitsPerPage);if (machineState.page < totalPages) {goToPage(machineState.page + 1);}@@ -550,7 +553,7 @@ export const ChannelSearchBottomSheet: React.FC<ChannelSearchBottomSheetProps> =</div>);}- const totalPages = Math.max(1, Math.ceil(total / hitsPerPage));+ const {totalPages} = getSearchPageCount(total, hitsPerPage);const hasMultipleChannels = countSearchResultChannels(resultGroups) > 1;return (<>diff --git a/fluxer_app/src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx b/fluxer_app/src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsxindex 7471fb1d7..1adffdd47 100644--- a/fluxer_app/src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+++ b/fluxer_app/src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx@@ -12,6 +12,7 @@ import type {Message} from '@app/features/messaging/models/MessagingMessage';import type {MessageSearchParams, MessageSearchScope} from '@app/features/search/utils/SearchUtils';import {isIndexing, type SearchContext, searchMessages} from '@app/features/search/utils/SearchUtils';import * as FormUtils from '@app/lib/forms';+import {MESSAGE_SEARCH_MAX_PAGE} from '@fluxer/constants/src/LimitConstants';import type {I18n, MessageDescriptor} from '@lingui/core';import {msg} from '@lingui/core/macro';import type {IconProps} from '@phosphor-icons/react';@@ -40,6 +41,15 @@ export const DETACHED_MESSAGE_BEHAVIOR: MessageBehaviorOverrides = {} as const;export const EMPTY_SEARCH_MESSAGES: Array<Message> = [];export const EMPTY_SEARCH_CHANNELS: Array<Channel> = [];+export const SEARCH_PAGE_LIMIT_DESCRIPTOR = msg({+ message: 'Only the first {maxPages} pages of results can be shown. Try a more specific search.',+ comment:+ 'Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.',+});+export function getSearchPageCount(total: number, hitsPerPage: number): {totalPages: number; capped: boolean} {+ const pages = Math.max(1, Math.ceil(total / hitsPerPage));+ return {totalPages: Math.min(pages, MESSAGE_SEARCH_MAX_PAGE), capped: pages > MESSAGE_SEARCH_MAX_PAGE};+}const OTHER_DESCRIPTOR = msg({message: '{total, plural, one {# result} other {# results}}',comment: 'Result count header in the channel search results panel. Plural cases describe the result count.',diff --git a/fluxer_app/src/features/channel/components/message_search_bar/useMessageSearchAutocomplete.ts b/fluxer_app/src/features/channel/components/message_search_bar/useMessageSearchAutocomplete.tsindex 527800d3f..87bc73b29 100644--- a/fluxer_app/src/features/channel/components/message_search_bar/useMessageSearchAutocomplete.ts+++ b/fluxer_app/src/features/channel/components/message_search_bar/useMessageSearchAutocomplete.ts@@ -44,7 +44,7 @@ import {buildSearchSegmentsFromHints,formatSearchHistoryEntryForStreamerMode,} from '@app/features/search/utils/SearchPrivacyUtils';-import {matchSearchDateWords} from '@app/features/search/utils/SearchQueryParser';+import {getSearchableGuildChannels, matchSearchDateWords} from '@app/features/search/utils/SearchQueryParser';import type {SearchSegment} from '@app/features/search/utils/SearchSegmentManager';import type {MessageSearchScope, SearchFilterOption} from '@app/features/search/utils/SearchUtils';import {getSearchFilterOptions} from '@app/features/search/utils/SearchUtils';@@ -55,7 +55,7 @@ import Users from '@app/features/user/state/Users';import {getCurrentLocale} from '@app/features/user/utils/LocaleUtils';import * as NicknameUtils from '@app/features/user/utils/NicknameUtils';import {ME} from '@fluxer/constants/src/AppConstants';-import {ChannelTypes, GUILD_TEXT_BASED_CHANNEL_TYPES, Permissions} from '@fluxer/constants/src/ChannelConstants';+import {ChannelTypes, Permissions} from '@fluxer/constants/src/ChannelConstants';import {msg} from '@lingui/core/macro';import {useLingui} from '@lingui/react/macro';import {DateTime} from 'luxon';@@ -70,12 +70,8 @@ function isDmSearchChannel(channel: Channel): boolean {return channel.type === ChannelTypes.DM || channel.type === ChannelTypes.GROUP_DM;}-function isGuildSearchChannel(channel: Channel): boolean {- return (- channel.guildId != null &&- GUILD_TEXT_BASED_CHANNEL_TYPES.has(channel.type) &&- Permission.can(Permissions.VIEW_CHANNEL | Permissions.READ_MESSAGE_HISTORY, channel)- );+function canSearchChannel(channel: Channel): boolean {+ return Permission.can(Permissions.VIEW_CHANNEL | Permissions.READ_MESSAGE_HISTORY, channel);}function isHistoryFilterRow(option: AutocompleteOption): option is HistoryFilterRow {@@ -457,16 +453,16 @@ export function useMessageSearchAutocomplete({if (!plan.currentGuildId) {throw new Error('Current guild channel suggestion mode requires a guild ID');}- for (const guildChannel of Channels.getGuildChannels(plan.currentGuildId)) {- if (isGuildSearchChannel(guildChannel)) {+ for (const guildChannel of getSearchableGuildChannels(plan.currentGuildId)) {+ if (canSearchChannel(guildChannel)) {addCandidate(guildChannel);}}break;case 'all_guilds':- for (const guildChannels of Channels.channelGroups.byGuild.values()) {- for (const guildChannel of guildChannels) {- if (isGuildSearchChannel(guildChannel)) {+ for (const guildId of Channels.channelGroups.byGuild.keys()) {+ for (const guildChannel of getSearchableGuildChannels(guildId)) {+ if (canSearchChannel(guildChannel)) {addCandidate(guildChannel);}}diff --git a/fluxer_app/src/features/channel/components/modals/ChannelCreateModal.tsx b/fluxer_app/src/features/channel/components/modals/ChannelCreateModal.tsxindex 85d3d25f0..f1d84e406 100644--- a/fluxer_app/src/features/channel/components/modals/ChannelCreateModal.tsx+++ b/fluxer_app/src/features/channel/components/modals/ChannelCreateModal.tsx@@ -33,7 +33,7 @@ import {msg} from '@lingui/core/macro';import {useLingui} from '@lingui/react/macro';import {LockSimpleIcon} from '@phosphor-icons/react';import {observer} from 'mobx-react-lite';-import {useState} from 'react';+import {useRef, useState} from 'react';import {Controller, useForm} from 'react-hook-form';const CHANNEL_TYPE_DESCRIPTOR = msg({@@ -82,22 +82,30 @@ export const ChannelCreateModal = observer(({guildId, parentId}: {guildId: strinconst channelType = Number(form.watch('type') || '0');const canBePrivate = channelType !== ChannelTypes.GUILD_LINK;const privateSelected = isPrivate && canBePrivate;+ const createStartedRef = useRef(false);const onSubmit = async (data: FormInputs) => {if (privateSelected && step === 'details') {setStep('access');return;}+ if (createStartedRef.current) return;+ createStartedRef.current = true;const currentUserId = Users.currentUser?.id;const members =currentUserId && !access.some((entry) => entry.type === 1 && entry.id === currentUserId)? [...access, {id: currentUserId, type: 1 as const}]: access;- await createChannel(- guildId,- data,- parentId,- privateSelected ? buildPrivateChannelOverwrites(guildId, Number(data.type), members) : undefined,- );+ try {+ await createChannel(+ guildId,+ data,+ parentId,+ privateSelected ? buildPrivateChannelOverwrites(guildId, Number(data.type), members) : undefined,+ );+ } catch (error) {+ createStartedRef.current = false;+ throw error;+ }};const {handleSubmit} = useFormSubmit({form,diff --git a/fluxer_app/src/features/channel/components/modals/useEditGroupForm.tsx b/fluxer_app/src/features/channel/components/modals/useEditGroupForm.tsxindex c576c3fe2..e1d51b780 100644--- a/fluxer_app/src/features/channel/components/modals/useEditGroupForm.tsx+++ b/fluxer_app/src/features/channel/components/modals/useEditGroupForm.tsx@@ -12,7 +12,11 @@ import {openAssetSourceModal} from '@app/features/expressions/components/modals/import {isAnimatedFile} from '@app/features/expressions/utils/AnimatedImageUtils';import {getAssetFormatErrorMessage} from '@app/features/expressions/utils/AssetFormatCopy';import {formatImageUploadRecommendedHint} from '@app/features/expressions/utils/AssetUploadHintCopy';-import {isSvgFile, readImageFileAsUploadDataUrl} from '@app/features/expressions/utils/ImageUploadFileUtils';+import {+ isAssetUploadFileAllowed,+ isSvgFile,+ readImageFileAsUploadDataUrl,+} from '@app/features/expressions/utils/ImageUploadFileUtils';import {FAILED_TO_PROCESS_CROPPED_IMAGE_DESCRIPTOR,INVALID_IMAGE_TRY_ANOTHER_DESCRIPTOR,@@ -95,7 +99,8 @@ export function useEditGroupForm({return;}const svg = isSvgFile(file);- if (!svg && !(await canCropFile(file))) {+ const croppable = svg || (await canCropFile(file));+ if (!croppable && !isAssetUploadFileAllowed('guild_icon', file)) {showChannelErrorModal({title: i18n._(messages.unsupportedIconFormatTitle),message: getAssetFormatErrorMessage(i18n, 'guild_icon', 'unsupported_mime'),@@ -113,6 +118,13 @@ export function useEditGroupForm({return;}const base64 = svg ? await readImageFileAsUploadDataUrl(file) : await readBlobAsDataUrl(file);+ if (!croppable) {+ form.setValue('icon', base64);+ setPreviewIconUrl(base64);+ setHasClearedIcon(false);+ form.clearErrors('icon');+ return;+ }ModalCommands.push(modal(() => (<AssetCropModaldiff --git a/fluxer_app/src/features/channel/components/useChannelComposerPaste.tsx b/fluxer_app/src/features/channel/components/useChannelComposerPaste.tsxindex 5f250858b..1bbeee746 100644--- a/fluxer_app/src/features/channel/components/useChannelComposerPaste.tsx+++ b/fluxer_app/src/features/channel/components/useChannelComposerPaste.tsx@@ -184,8 +184,8 @@ export function useChannelComposerPaste({void handlePasteFiles(pastedFiles);return true;}- const rawPastedText = clipboardData.getData('text/plain');- if (!rawPastedText) {+ const pastedText = clipboardData.getData('text/plain');+ if (!pastedText) {void readClipboardImageFiles().then((files) => {if (files.length > 0) {void handlePasteFiles(files);@@ -206,7 +206,6 @@ export function useChannelComposerPaste({return false;}}- const pastedText = rawPastedText.replace(/\t/g, ' ');if (pastedText.length > maxMessageLength) {event.preventDefault();void handlePasteExceedsLimit(pastedText);diff --git a/fluxer_app/src/features/channel/utils/ChannelSettingsModalUtils.ts b/fluxer_app/src/features/channel/utils/ChannelSettingsModalUtils.tsindex 97aeea8fa..7ed9a0ce6 100644--- a/fluxer_app/src/features/channel/utils/ChannelSettingsModalUtils.ts+++ b/fluxer_app/src/features/channel/utils/ChannelSettingsModalUtils.ts@@ -25,9 +25,6 @@ export function getAvailableTabs(i18n: I18n, channelId: string): Array<ChannelSeif (channel.type === ChannelTypes.GUILD_LINK) {filteredTabs = filteredTabs.filter((tab) => tab.type !== 'webhooks');}- if (channel.isThreadOnly()) {- filteredTabs = filteredTabs.filter((tab) => tab.type !== 'invites');- }const permissionContext = {channelId: channel.id, guildId: channel.guildId};const canUpdateRtcRegion =channel.type === ChannelTypes.GUILD_VOICE && Permission.can(Permissions.UPDATE_RTC_REGION, permissionContext);diff --git a/fluxer_app/src/features/discovery/state/Discovery.ts b/fluxer_app/src/features/discovery/state/Discovery.tsindex cf30ce7d1..2a1279b8d 100644--- a/fluxer_app/src/features/discovery/state/Discovery.ts+++ b/fluxer_app/src/features/discovery/state/Discovery.ts@@ -2,7 +2,7 @@import type {DiscoveryGuild} from '@app/features/discovery/commands/DiscoveryCommands';import * as DiscoveryCommands from '@app/features/discovery/commands/DiscoveryCommands';-import {AccountScopedWork} from '@app/features/platform/state/AccountScopedWork';+import {AccountScopedWork, AccountScopedWorkTransitionReason} from '@app/features/platform/state/AccountScopedWork';import {Logger} from '@app/features/platform/utils/AppLogger';import {isAbortError} from '@app/features/platform/utils/PlatformHelpers';import {makeAutoObservable, runInAction} from 'mobx';@@ -30,6 +30,8 @@ class Discovery {categoriesLoaded = false;categoriesError = false;private activeSearchToken = 0;+ private browsing = false;+ private reloadAfterTransition = false;constructor() {makeAutoObservable(this, {}, {autoBind: true});@@ -54,6 +56,7 @@ class Discovery {const searchToken = ++this.activeSearchToken;const searchModeChanged = query.length > 0 !== this.query.length > 0;runInAction(() => {+ this.browsing = true;this.loading = true;this.error = false;if (offset === 0 && searchModeChanged) {@@ -150,6 +153,8 @@ class Discovery {}reset(): void {+ this.browsing = false;+ this.reloadAfterTransition = false;this.activeSearchToken += 1;this.guilds = [];this.loadedCount = 0;@@ -163,10 +168,32 @@ class Discovery {this.tag = null;this.sortBy = 'member_count';}++ suspendForAccountTransition(reason: AccountScopedWorkTransitionReason): void {+ const reload = reason === AccountScopedWorkTransitionReason.ACCOUNT_SWITCH && this.browsing;+ this.reset();+ this.categories = [];+ this.categoriesLoaded = false;+ this.categoriesError = false;+ this.reloadAfterTransition = reload;+ }++ reloadAfterAccountTransition(): void {+ if (!this.reloadAfterTransition) {+ return;+ }+ this.reloadAfterTransition = false;+ void this.loadCategories();+ void this.search({offset: 0});+ }}const discovery = new Discovery();-AccountScopedWork.registerCancellation(() => discovery.reset());+AccountScopedWork.registerTransition({+ suspend: (reason) => discovery.suspendForAccountTransition(reason),+ resume: () => {},+ released: () => discovery.reloadAfterAccountTransition(),+});export default discovery;diff --git a/fluxer_app/src/features/emoji/components/emojis/EmojiListItem.tsx b/fluxer_app/src/features/emoji/components/emojis/EmojiListItem.tsxindex 1e4b442f1..fda2f07c2 100644--- a/fluxer_app/src/features/emoji/components/emojis/EmojiListItem.tsx+++ b/fluxer_app/src/features/emoji/components/emojis/EmojiListItem.tsx@@ -46,10 +46,6 @@ const EMOJI_NAME_MUST_BE_AT_MOST_32_CHARACTERS_DESCRIPTOR = msg({message: 'Emoji name must be at most 32 characters long',comment: 'Validation error for custom emoji names.',});-const INVALID_EMOJI_NAME_TITLE_DESCRIPTOR = msg({- message: 'Invalid emoji name',- comment: 'Title of the error modal shown when a custom emoji name fails validation.',-});const RENAME_FAILED_TITLE_DESCRIPTOR = msg({message: "Couldn't rename this emoji",comment: 'Title of the generic fallback error modal shown when renaming a custom emoji fails.',@@ -355,27 +351,14 @@ export const EmojiListItem: React.FC<{const {i18n} = useLingui();const avatarUrl = emoji.user ? AvatarUtils.getUserAvatarURL(emoji.user, false) : null;const gridNameButtonRef = useRef<HTMLButtonElement | null>(null);- const showEmojiNameValidationError = (message: string) => {- ModalCommands.push(- modal(() => (- <GenericErrorModal- title={i18n._(INVALID_EMOJI_NAME_TITLE_DESCRIPTOR)}- message={message}- data-flx="emoji.emojis.emoji-list-item.name-validation-error-modal"- />- )),- );+ const getEmojiNameError = (name: string): string | null => {+ const sanitizedName = name.replace(/[^a-zA-Z0-9_]/g, '');+ if (sanitizedName.length < 2) return i18n._(EMOJI_NAME_MUST_BE_AT_LEAST_2_CHARACTERS_DESCRIPTOR);+ if (sanitizedName.length > 32) return i18n._(EMOJI_NAME_MUST_BE_AT_MOST_32_CHARACTERS_DESCRIPTOR);+ return null;};const handleSave = async (newName: string) => {const sanitizedName = newName.replace(/[^a-zA-Z0-9_]/g, '');- if (sanitizedName.length < 2) {- showEmojiNameValidationError(i18n._(EMOJI_NAME_MUST_BE_AT_LEAST_2_CHARACTERS_DESCRIPTOR));- throw new Error('Name too short');- }- if (sanitizedName.length > 32) {- showEmojiNameValidationError(i18n._(EMOJI_NAME_MUST_BE_AT_MOST_32_CHARACTERS_DESCRIPTOR));- throw new Error('Name too long');- }if (sanitizedName === emoji.name) return;const prevName = emoji.name;onRename(emoji.id, sanitizedName);@@ -556,6 +539,7 @@ export const EmojiListItem: React.FC<{<InlineEditvalue={emoji.name}onSave={handleSave}+ getValidationError={getEmojiNameError}prefix=":"suffix=":"maxLength={32}diff --git a/fluxer_app/src/features/emoji/state/EmojiSearchIndex.ts b/fluxer_app/src/features/emoji/state/EmojiSearchIndex.tsindex 6b335c628..bd0a0ed61 100644--- a/fluxer_app/src/features/emoji/state/EmojiSearchIndex.ts+++ b/fluxer_app/src/features/emoji/state/EmojiSearchIndex.ts@@ -25,6 +25,7 @@ type EmojiSearchMeta<TEmoji extends FlatEmoji> = Readonly<{emoji: TEmoji;names: ReadonlyArray<string>;lowerNames: ReadonlyArray<string>;+ compactNames: ReadonlyArray<string>;lowerKeywords: ReadonlyArray<string>;primaryName: string;order: number;@@ -62,6 +63,10 @@ function normalizeQuery(query: string): NormalizedEmojiQuery {return query.toLowerCase() as NormalizedEmojiQuery;}+function compactName(value: string): string {+ return value.replace(/[_-]/g, '');+}+function getEmojiNames(emoji: FlatEmoji): ReadonlyArray<string> {if (emoji.names && emoji.names.length > 0) {return emoji.names;@@ -96,18 +101,21 @@ function hasBoundaryMatch(name: string, lowerName: string, lowerCasedQuery: strifunction getEmojiMatchTier<TEmoji extends FlatEmoji>(meta: EmojiSearchMeta<TEmoji>,lowerCasedQuery: NormalizedEmojiQuery,+ compactQuery: NormalizedEmojiQuery,): MatchTier | null {for (const lowerName of meta.lowerNames) {if (lowerName === lowerCasedQuery) return MATCH_TIER.exactName;}- for (const lowerName of meta.lowerNames) {- if (lowerName.startsWith(lowerCasedQuery)) return MATCH_TIER.nameStartsWith;+ for (let i = 0; i < meta.names.length; i++) {+ if (meta.lowerNames[i].startsWith(lowerCasedQuery)) return MATCH_TIER.nameStartsWith;+ if (compactQuery && meta.compactNames[i].startsWith(compactQuery)) return MATCH_TIER.nameStartsWith;}for (let i = 0; i < meta.names.length; i++) {if (hasBoundaryMatch(meta.names[i], meta.lowerNames[i], lowerCasedQuery)) return MATCH_TIER.nameBoundary;}- for (const lowerName of meta.lowerNames) {- if (lowerName.includes(lowerCasedQuery)) return MATCH_TIER.nameContains;+ for (let i = 0; i < meta.names.length; i++) {+ if (meta.lowerNames[i].includes(lowerCasedQuery)) return MATCH_TIER.nameContains;+ if (compactQuery && meta.compactNames[i].includes(compactQuery)) return MATCH_TIER.nameContains;}let hasKeywordContains = false;for (const lowerKeyword of meta.lowerKeywords) {@@ -195,10 +203,12 @@ export class EmojiSearchIndex<TEmoji extends FlatEmoji = FlatEmoji> {this.metas = Object.freeze(emojis.map((emoji, order) => {const names = getEmojiNames(emoji);+ const lowerNames = names.map((name) => name.toLowerCase());return {emoji,names,- lowerNames: names.map((name) => name.toLowerCase()),+ lowerNames,+ compactNames: lowerNames.map(compactName),lowerKeywords: emoji.keywords?.map((keyword) => keyword.toLowerCase()) ?? [],primaryName: emoji.uniqueName || names[0] || emoji.name,order,@@ -209,13 +219,11 @@ export class EmojiSearchIndex<TEmoji extends FlatEmoji = FlatEmoji> {for (const meta of this.metas) {const ordinal = asOrdinal(meta.order);const indexedGrams = new Set<NGram>();- for (const lowerName of meta.lowerNames) {- for (const gram of uniqueGramsForToken(lowerName)) {+ for (const token of [...meta.lowerNames, ...meta.lowerKeywords]) {+ for (const gram of uniqueGramsForToken(token)) {indexedGrams.add(gram);}- }- for (const lowerKeyword of meta.lowerKeywords) {- for (const gram of uniqueGramsForToken(lowerKeyword)) {+ for (const gram of uniqueGramsForToken(compactName(token))) {indexedGrams.add(gram);}}@@ -250,14 +258,15 @@ export class EmojiSearchIndex<TEmoji extends FlatEmoji = FlatEmoji> {search(query: string, options: EmojiSearchOptions<TEmoji> = {}): ReadonlyArray<TEmoji> {const normalizedQuery = normalizeQuery(query);if (!normalizedQuery) return this.metas.map((meta) => meta.emoji);- const candidateOrdinals = this.getCandidateOrdinals(normalizedQuery);+ const compactQuery = compactName(normalizedQuery) as NormalizedEmojiQuery;+ const candidateOrdinals = this.getCandidateOrdinals(compactQuery || normalizedQuery);if (candidateOrdinals.length === 0) return [];const results: Array<SearchResult<TEmoji>> = [];const limit = options.count ?? 0;for (const ordinal of candidateOrdinals) {const meta = this.metas[ordinal];if (!meta) continue;- const tier = getEmojiMatchTier(meta, normalizedQuery);+ const tier = getEmojiMatchTier(meta, normalizedQuery, compactQuery);if (tier === null) continue;if (options.canUse && !options.canUse(meta.emoji)) continue;insertBoundedResult(diff --git a/fluxer_app/src/features/expressions/utils/ImageUploadFileUtils.ts b/fluxer_app/src/features/expressions/utils/ImageUploadFileUtils.tsindex 3d0515a19..eee2f591a 100644--- a/fluxer_app/src/features/expressions/utils/ImageUploadFileUtils.ts+++ b/fluxer_app/src/features/expressions/utils/ImageUploadFileUtils.ts@@ -1,6 +1,7 @@// SPDX-License-Identifier: AGPL-3.0-or-laterimport {readBlobAsDataUrl} from '@app/features/platform/utils/BlobDataUrl';+import {type AssetKind, getPolicy, isExtensionAllowed} from '@fluxer/constants/src/AssetFormatPolicy';export interface ImageUploadFileLike {readonly type?: string | null;@@ -21,6 +22,14 @@ export function isSvgFile(file: ImageUploadFileLike): boolean {return (file.name ?? '').toLowerCase().endsWith('.svg');}+export function isAssetUploadFileAllowed(kind: AssetKind, file: ImageUploadFileLike): boolean {+ const name = (file.name ?? '').toLowerCase();+ const dot = name.lastIndexOf('.');+ if (dot !== -1 && isExtensionAllowed(kind, name.slice(dot + 1))) return true;+ const mime = normalizeImageMimeType(file.type);+ return mime !== '' && Object.values(getPolicy(kind).mimes).includes(mime);+}+export async function readImageFileAsUploadDataUrl(file: File): Promise<string> {const dataUrl = await readBlobAsDataUrl(file);if (!isSvgFile(file)) return dataUrl;diff --git a/fluxer_app/src/features/forum/components/ForumChannelView.tsx b/fluxer_app/src/features/forum/components/ForumChannelView.tsxindex 2b8d134aa..35fb4f0ec 100644--- a/fluxer_app/src/features/forum/components/ForumChannelView.tsx+++ b/fluxer_app/src/features/forum/components/ForumChannelView.tsx@@ -16,6 +16,7 @@ import {} from '@app/features/i18n/utils/CommonMessageDescriptors';import {SafeMarkdown} from '@app/features/messaging/components/markdown';import {MarkdownContext} from '@app/features/messaging/components/markdown/renderers/RendererTypes';+import markupStyles from '@app/features/theme/styles/Markup.module.css';import {Button} from '@app/features/ui/button/Button';import {Spinner} from '@app/features/ui/components/Spinner';import FocusRing from '@app/features/ui/focus_ring/FocusRing';@@ -61,11 +62,13 @@ const ForumGuidelines = observer(({forum}: {forum: Channel}) => {</FocusRing>{expanded && (<div className={styles.guidelinesBody} data-flx="forum.forum-channel-view.forum-guidelines.guidelines-body">- <SafeMarkdown- content={forum.topic}- options={{context: MarkdownContext.STANDARD_WITHOUT_JUMBO, channelId: forum.id}}- data-flx="forum.forum-channel-view.forum-guidelines.safe-markdown"- />+ <div className={markupStyles.markup} data-flx="forum.forum-channel-view.forum-guidelines.markup">+ <SafeMarkdown+ content={forum.topic}+ options={{context: MarkdownContext.STANDARD_WITHOUT_JUMBO, channelId: forum.id}}+ data-flx="forum.forum-channel-view.forum-guidelines.safe-markdown"+ />+ </div></div>)}</div>diff --git a/fluxer_app/src/features/forum/components/ForumPostComposer.tsx b/fluxer_app/src/features/forum/components/ForumPostComposer.tsxindex a8b6f233d..d94368211 100644--- a/fluxer_app/src/features/forum/components/ForumPostComposer.tsx+++ b/fluxer_app/src/features/forum/components/ForumPostComposer.tsx@@ -21,6 +21,7 @@ import Drafts from '@app/features/messaging/state/MessagingDrafts';import {CloudUpload} from '@app/features/messaging/upload/CloudUpload';import * as MessageSubmitUtils from '@app/features/messaging/utils/MessageSubmitUtils';import {remFromPx} from '@app/features/theme/layout/RemFromPx';+import markupStyles from '@app/features/theme/styles/Markup.module.css';import {openThread} from '@app/features/threads/commands/ThreadNavigation';import ThreadPanel from '@app/features/threads/state/ThreadPanel';import * as ThreadD from '@app/features/threads/utils/ThreadMessageDescriptors';@@ -185,11 +186,13 @@ export const ForumPostComposer = observer(({forum, initialTitle, onClose}: Forum{i18n._(D.PREVIEW_DESCRIPTOR)}</span>{hasVisibleMessageContent(body) ? (- <SafeMarkdown- content={body}- options={{context: MarkdownContext.STANDARD_WITHOUT_JUMBO, channelId: forum.id}}- data-flx="forum.forum-post-composer.safe-markdown"- />+ <div className={markupStyles.markup} data-flx="forum.forum-post-composer.preview-markup">+ <SafeMarkdown+ content={body}+ options={{context: MarkdownContext.STANDARD_WITHOUT_JUMBO, channelId: forum.id}}+ data-flx="forum.forum-post-composer.safe-markdown"+ />+ </div>) : (<span className={styles.hint} data-flx="forum.forum-post-composer.preview-empty">{i18n._(D.PREVIEW_EMPTY_DESCRIPTOR)}@@ -233,20 +236,19 @@ export const ForumPostComposer = observer(({forum, initialTitle, onClose}: Forumdata-flx="forum.forum-post-composer.emoji-picker-popout"/>)}+ tooltip={i18n._(D.ADD_EMOJI_DESCRIPTOR)}data-flx="forum.forum-post-composer.emoji-popout">- <Tooltip text={i18n._(D.ADD_EMOJI_DESCRIPTOR)} data-flx="forum.forum-post-composer.emoji-tooltip">- <FocusRing offset={-2} data-flx="forum.forum-post-composer.emoji.focus-ring">- <button- type="button"- className={styles.composerIconButton}- aria-label={i18n._(D.ADD_EMOJI_DESCRIPTOR)}- data-flx="forum.forum-post-composer.emoji-button"- >- <SmileyIcon size={remFromPx(20)} weight="bold" data-flx="forum.forum-post-composer.smiley-icon" />- </button>- </FocusRing>- </Tooltip>+ <FocusRing offset={-2} data-flx="forum.forum-post-composer.emoji.focus-ring">+ <button+ type="button"+ className={styles.composerIconButton}+ aria-label={i18n._(D.ADD_EMOJI_DESCRIPTOR)}+ data-flx="forum.forum-post-composer.emoji-button"+ >+ <SmileyIcon size={remFromPx(20)} weight="bold" data-flx="forum.forum-post-composer.smiley-icon" />+ </button>+ </FocusRing></Popout>)}{forum.availableTags.length > 0 && (diff --git a/fluxer_app/src/features/gateway/transport/BackgroundReadStateReducer.ts b/fluxer_app/src/features/gateway/transport/BackgroundReadStateReducer.tsindex 172b066be..865ba7c78 100644--- a/fluxer_app/src/features/gateway/transport/BackgroundReadStateReducer.ts+++ b/fluxer_app/src/features/gateway/transport/BackgroundReadStateReducer.ts@@ -178,13 +178,14 @@ function isMuted(config: MuteConfig, now: number): boolean {function readChannelOverrides(value: unknown): ReadonlyMap<string, ChannelNotificationOverride> {const overrides = new Map<string, ChannelNotificationOverride>();const record = asRecord(value);- const entries = record === null ? asArray(value) : Object.values(record);- for (const entry of entries) {+ const entries: ReadonlyArray<[string | null, unknown]> =+ record === null ? asArray(value).map((entry) => [null, entry]) : Object.entries(record);+ for (const [key, entry] of entries) {const override = asRecord(entry);if (override === null) {continue;}- const channelId = asString(override.channel_id);+ const channelId = asString(override.channel_id) ?? key;if (channelId === null) {continue;}diff --git a/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx b/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsxindex a64937bd1..d71abbfb6 100644--- a/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+++ b/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx@@ -27,6 +27,7 @@ import {GuildMFALevel,GuildVerificationLevel,getEffectiveGuildVerificationLevel,+ guildRequiresMfa,} from '@fluxer/constants/src/GuildConstants';import {msg} from '@lingui/core/macro';import {Trans, useLingui} from '@lingui/react/macro';@@ -40,6 +41,11 @@ const ONLY_OWNER_CAN_CHANGE_TOOLTIP_DESCRIPTOR = msg({comment:'Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the viewer is not the owner. Plain explanatory tone.',});+const MFA_REQUIRED_BY_STATUS_TOOLTIP_DESCRIPTOR = msg({+ message: 'Verified and partnered communities always require 2FA for moderators',+ comment:+ 'Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.',+});const ENABLE_2FA_TO_CHANGE_TOOLTIP_DESCRIPTOR = msg({message: 'Enable 2FA on your account to change this setting',comment:@@ -250,8 +256,12 @@ const GuildModerationTab: React.FC<{guildId: string}> = observer(({guildId}) =>) : (label);- const isMfaDisabled = !isGuildOwner || !currentUserHas2FA;+ const isMfaRequiredByStatus = !RuntimeConfig.isSelfHosted() && guildRequiresMfa(guild.features);+ const isMfaDisabled = !isGuildOwner || !currentUserHas2FA || isMfaRequiredByStatus;const getMfaTooltipText = (): string | undefined => {+ if (isMfaRequiredByStatus) {+ return i18n._(MFA_REQUIRED_BY_STATUS_TOOLTIP_DESCRIPTOR);+ }if (!isGuildOwner) {return i18n._(ONLY_OWNER_CAN_CHANGE_TOOLTIP_DESCRIPTOR);}diff --git a/fluxer_app/src/features/guild/events/PassiveUpdates.ts b/fluxer_app/src/features/guild/events/PassiveUpdates.tsindex 4891b6e27..e612f487d 100644--- a/fluxer_app/src/features/guild/events/PassiveUpdates.ts+++ b/fluxer_app/src/features/guild/events/PassiveUpdates.ts@@ -3,6 +3,7 @@import Channels from '@app/features/channel/state/Channels';import type {GatewayHandlerContext} from '@app/features/gateway/events/EventRouter';import type {VoiceState} from '@app/features/gateway/types/GatewayVoiceTypes';+import Messages from '@app/features/messaging/state/MessagingMessages';import ReadStates from '@app/features/read_state/state/ReadStates';import QuickSwitcher from '@app/features/search/state/QuickSwitcher';import MediaEngine from '@app/features/voice/engine/MediaEngineFacade';@@ -20,6 +21,7 @@ export function handlePassiveUpdates(data: PassiveUpdatesPayload, _context: Gatechannels,});ReadStates.handlePassiveLastMessageUpdates(channels, data.guild_id);+ Messages.handlePassiveLastMessageUpdates(channels);if (changedChannels) {QuickSwitcher.recomputeIfOpen();}diff --git a/fluxer_app/src/features/i18n/locales/ar/messages.po b/fluxer_app/src/features/i18n/locales/ar/messages.poindex a0c88b91b..8ebe54bcf 100644--- a/fluxer_app/src/features/i18n/locales/ar/messages.po+++ b/fluxer_app/src/features/i18n/locales/ar/messages.po@@ -20012,11 +20012,6 @@ msgstr "طلب تفويض غير صالح"msgid "Invalid bot permissions."msgstr "أذونات البوت غير صالحة."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "اسم الرمز التعبيري غير صالح"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "تتم مزامنة نص CSS فقط عبر الأجهزة. تبقى الmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "تتم مزامنة نص CSS فقط. تبقى الأصول التي تم تحميلها ومراجع الملفات المحلية على هذا الجهاز."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "يمكن عرض أول {maxPages} صفحة فقط من النتائج. جرّب بحثًا أكثر تحديدًا."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "تعذّر التحقق"msgid "Verified & partnered community"msgstr "مجتمع موثّق وشريك"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "تتطلب المجتمعات الموثّقة والشريكة دائمًا المصادقة الثنائية للمشرفين"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/bg/messages.po b/fluxer_app/src/features/i18n/locales/bg/messages.poindex a3c377dbb..35c3cd9ba 100644--- a/fluxer_app/src/features/i18n/locales/bg/messages.po+++ b/fluxer_app/src/features/i18n/locales/bg/messages.po@@ -20012,11 +20012,6 @@ msgstr "Невалидна заявка за оторизация"msgid "Invalid bot permissions."msgstr "Невалидни разрешения за бота."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Невалидно име на емоджи"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Само CSS текстът се синхронизира между уmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Синхронизира се само CSS текстът. Качените ресурси и препратките към локални файлове остават на това устройство."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Могат да се покажат само първите {maxPages} страници с резултати. Опитай по-конкретно търсене."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Неуспешно потвърждение"msgid "Verified & partnered community"msgstr "Верифицирана и партньорска общност"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Потвърдените и партньорските общности винаги изискват 2FA за модераторите"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/cs/messages.po b/fluxer_app/src/features/i18n/locales/cs/messages.poindex 44cc001f7..49e2a8571 100644--- a/fluxer_app/src/features/i18n/locales/cs/messages.po+++ b/fluxer_app/src/features/i18n/locales/cs/messages.po@@ -20012,11 +20012,6 @@ msgstr "Neplatný požadavek na autorizaci"msgid "Invalid bot permissions."msgstr "Neplatná oprávnění bota."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Neplatný název emoji"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Mezi zařízeními se synchronizuje pouze text CSS. Nahraná média, odkmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Synchronizuje se pouze text CSS. Nahraná média a odkazy na místní soubory zůstávají v tomto zařízení."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Lze zobrazit jen prvních {maxPages} stránek výsledků. Zkuste konkrétnější hledání."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Ověření se nezdařilo"msgid "Verified & partnered community"msgstr "Ověřená a partnerská komunita"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Ověřené a partnerské komunity vždy vyžadují 2FA pro moderátory"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/da/messages.po b/fluxer_app/src/features/i18n/locales/da/messages.poindex 337ee6632..394ed5afb 100644--- a/fluxer_app/src/features/i18n/locales/da/messages.po+++ b/fluxer_app/src/features/i18n/locales/da/messages.po@@ -20012,11 +20012,6 @@ msgstr "Ugyldig godkendelsesanmodning"msgid "Invalid bot permissions."msgstr "Ugyldige bot-tilladelser."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Ugyldigt emoji-navn"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Kun CSS-teksten synkroniseres på tværs af enheder. Uploadede ressourcemsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Kun CSS-teksten synkroniseres. Uploadede ressourcer og lokale filreferencer bliver på denne enhed."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Kun de første {maxPages} sider med resultater kan vises. Prøv en mere specifik søgning."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Bekræftelse mislykkedes"msgid "Verified & partnered community"msgstr "Verificeret partnerfællesskab"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Verificerede fællesskaber og partnerfællesskaber kræver altid 2FA for moderatorer"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/de/messages.po b/fluxer_app/src/features/i18n/locales/de/messages.poindex 6e4ed082f..7ddde6b9d 100644--- a/fluxer_app/src/features/i18n/locales/de/messages.po+++ b/fluxer_app/src/features/i18n/locales/de/messages.po@@ -20012,11 +20012,6 @@ msgstr "Ungültige Autorisierungsanfrage"msgid "Invalid bot permissions."msgstr "Ungültige Bot-Berechtigungen."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Ungültiger Emoji-Name"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Nur der CSS-Text wird geräteübergreifend synchronisiert. Hochgeladenemsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Nur der CSS-Text wird synchronisiert. Hochgeladene Assets und lokale Dateiverweise bleiben auf diesem Gerät."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Nur die ersten {maxPages} Ergebnisseiten können angezeigt werden. Versuche eine genauere Suche."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Verifizierung fehlgeschlagen"msgid "Verified & partnered community"msgstr "Verifizierte Partner-Community"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Verifizierte und Partner-Communitys verlangen für Moderatoren immer 2FA"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/el/messages.po b/fluxer_app/src/features/i18n/locales/el/messages.poindex 28357069d..45d6333ca 100644--- a/fluxer_app/src/features/i18n/locales/el/messages.po+++ b/fluxer_app/src/features/i18n/locales/el/messages.po@@ -20012,11 +20012,6 @@ msgstr "Μη έγκυρο αίτημα εξουσιοδότησης"msgid "Invalid bot permissions."msgstr "Μη έγκυρα δικαιώματα bot."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Μη έγκυρο όνομα emoji"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Μόνο το κείμενο CSS συγχρονίζεται σε όλεmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Μόνο το κείμενο CSS συγχρονίζεται. Τα στοιχεία που ανεβάσατε και οι αναφορές τοπικών αρχείων παραμένουν σε αυτήν τη συσκευή."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Μπορούν να εμφανιστούν μόνο οι πρώτες {maxPages} σελίδες αποτελεσμάτων. Δοκιμάστε πιο συγκεκριμένη αναζήτηση."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Η επαλήθευση απέτυχε"msgid "Verified & partnered community"msgstr "Επαληθευμένη και συνεργαζόμενη κοινότητα"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Οι επαληθευμένες και συνεργαζόμενες κοινότητες απαιτούν πάντα 2FA για τους συντονιστές"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/en-GB/messages.po b/fluxer_app/src/features/i18n/locales/en-GB/messages.poindex 020acf4b7..421ef1d22 100644--- a/fluxer_app/src/features/i18n/locales/en-GB/messages.po+++ b/fluxer_app/src/features/i18n/locales/en-GB/messages.po@@ -20012,11 +20012,6 @@ msgstr "Invalid authorisation request"msgid "Invalid bot permissions."msgstr "Invalid bot permissions."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Invalid emoji name"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Only the CSS text is synced across devices. Uploaded assets, desktop filmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Only the CSS text is synced. Uploaded assets and local file references stay on this device."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Only the first {maxPages} pages of results can be shown. Try a more specific search."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Verification failed"msgid "Verified & partnered community"msgstr "Verified & partnered community"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Verified and partnered communities always require 2FA for moderators"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/en-US/messages.po b/fluxer_app/src/features/i18n/locales/en-US/messages.poindex 2aa71dac0..0a2722ce9 100644--- a/fluxer_app/src/features/i18n/locales/en-US/messages.po+++ b/fluxer_app/src/features/i18n/locales/en-US/messages.po@@ -20012,11 +20012,6 @@ msgstr "Invalid authorization request"msgid "Invalid bot permissions."msgstr "Invalid bot permissions."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Invalid emoji name"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Only the CSS text is synced across devices. Uploaded assets, desktop filmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Only the CSS text is synced. Uploaded assets and local file references stay on this device."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Only the first {maxPages} pages of results can be shown. Try a more specific search."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Verification failed"msgid "Verified & partnered community"msgstr "Verified & partnered community"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Verified and partnered communities always require 2FA for moderators"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/es-419/messages.po b/fluxer_app/src/features/i18n/locales/es-419/messages.poindex 5b4238136..8dfeda481 100644--- a/fluxer_app/src/features/i18n/locales/es-419/messages.po+++ b/fluxer_app/src/features/i18n/locales/es-419/messages.po@@ -20012,11 +20012,6 @@ msgstr "Solicitud de autorización no válida"msgid "Invalid bot permissions."msgstr "Permisos de bot no válidos."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Nombre de emoji no válido"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Solo se sincroniza el texto CSS entre dispositivos. Los recursos subidosmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Solo se sincroniza el texto CSS. Los recursos cargados y las referencias de archivos locales permanecen en este dispositivo."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Solo se pueden mostrar las primeras {maxPages} páginas de resultados. Prueba una búsqueda más específica."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Falló la verificación"msgid "Verified & partnered community"msgstr "Comunidad verificada y asociada"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Las comunidades verificadas y asociadas siempre exigen 2FA a los moderadores"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/es-ES/messages.po b/fluxer_app/src/features/i18n/locales/es-ES/messages.poindex a36e49b02..2b0bbbb78 100644--- a/fluxer_app/src/features/i18n/locales/es-ES/messages.po+++ b/fluxer_app/src/features/i18n/locales/es-ES/messages.po@@ -20012,11 +20012,6 @@ msgstr "Solicitud de autorización no válida"msgid "Invalid bot permissions."msgstr "Permisos de bot no válidos."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Nombre de emoji no válido"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Solo se sincroniza el texto CSS entre dispositivos. Los recursos subidosmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Solo se sincroniza el texto CSS. Los recursos subidos y las referencias a archivos locales permanecen en este dispositivo."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Solo se pueden mostrar las primeras {maxPages} páginas de resultados. Prueba una búsqueda más específica."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Verificación fallida"msgid "Verified & partnered community"msgstr "Comunidad verificada y asociada"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Las comunidades verificadas y asociadas siempre exigen 2FA a los moderadores"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/fi/messages.po b/fluxer_app/src/features/i18n/locales/fi/messages.poindex 67b4b8475..b759afd0f 100644--- a/fluxer_app/src/features/i18n/locales/fi/messages.po+++ b/fluxer_app/src/features/i18n/locales/fi/messages.po@@ -20012,11 +20012,6 @@ msgstr "Virheellinen valtuutuspyyntö"msgid "Invalid bot permissions."msgstr "Virheelliset botin käyttöoikeudet."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Virheellinen emojin nimi"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Vain CSS-teksti synkronoidaan laitteiden välillä. Ladatut resurssit, tmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Vain CSS-teksti synkronoidaan. Ladatut resurssit ja paikalliset tiedostoviittaukset pysyvät tällä laitteella."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Vain ensimmäiset {maxPages} tulossivua voidaan näyttää. Kokeile tarkempaa hakua."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Vahvistus epäonnistui"msgid "Verified & partnered community"msgstr "Vahvistettu kumppanuusyhteisö"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Vahvistetut ja kumppaniyhteisöt vaativat moderaattoreilta aina 2FA:n"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/fr/messages.po b/fluxer_app/src/features/i18n/locales/fr/messages.poindex 2aba4b140..a1570659b 100644--- a/fluxer_app/src/features/i18n/locales/fr/messages.po+++ b/fluxer_app/src/features/i18n/locales/fr/messages.po@@ -20012,11 +20012,6 @@ msgstr "Requête d'autorisation non valide"msgid "Invalid bot permissions."msgstr "Permissions du bot non valides."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Nom d’emoji non valide"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Seul le texte CSS est synchronisé sur tous les appareils. Les élémentmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Seul le texte CSS est synchronisé. Les ressources importées et les références de fichiers locaux restent sur cet appareil."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Seules les {maxPages} premières pages de résultats peuvent être affichées. Essayez une recherche plus précise."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Échec de la vérification"msgid "Verified & partnered community"msgstr "Communauté vérifiée et partenaire"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Les communautés vérifiées et partenaires exigent toujours la 2FA pour les modérateurs"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/he/messages.po b/fluxer_app/src/features/i18n/locales/he/messages.poindex 8ecc8c195..b2d80037e 100644--- a/fluxer_app/src/features/i18n/locales/he/messages.po+++ b/fluxer_app/src/features/i18n/locales/he/messages.po@@ -20012,11 +20012,6 @@ msgstr "בקשת הרשאה לא תקינה"msgid "Invalid bot permissions."msgstr "הרשאות בוט לא תקינות."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "שם אימוג'י שגוי"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "רק טקסט ה-CSS מסונכרן בין מכשירים. נכסים שmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "רק טקסט ה-CSS מסונכרן. נכסים שהועלו והפניות לקבצים מקומיים נשארים במכשיר זה."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "אפשר להציג רק את {maxPages} עמודי התוצאות הראשונים. כדאי לנסות חיפוש מדויק יותר."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "האימות נכשל"msgid "Verified & partnered community"msgstr "קהילה מאומתת ושותפה"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "קהילות מאומתות ושותפות תמיד דורשות אימות דו-שלבי ממנחים"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/hi/messages.po b/fluxer_app/src/features/i18n/locales/hi/messages.poindex decd74a1f..99f40f625 100644--- a/fluxer_app/src/features/i18n/locales/hi/messages.po+++ b/fluxer_app/src/features/i18n/locales/hi/messages.po@@ -20012,11 +20012,6 @@ msgstr "अमान्य ऑथराइज़ेशन अनुरोध"msgid "Invalid bot permissions."msgstr "अमान्य बॉट अनुमतियाँ।"-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "अमान्य इमोजी नाम"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "केवल CSS टेक्स्ट डिवाइसों मेmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "केवल CSS टेक्स्ट सिंक होता है। अपलोड की गई एसेट और लोकल फ़ाइल रेफ़रेंस इसी डिवाइस पर रहते हैं।"+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "परिणामों के केवल पहले {maxPages} पेज ही दिखाए जा सकते हैं। ज़्यादा सटीक खोज आज़माएँ।"+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "वेरिफ़िकेशन नहीं हो पाया"msgid "Verified & partnered community"msgstr "वेरिफ़ाइड और पार्टनर कम्युनिटी"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "सत्यापित और पार्टनर समुदाय मॉडरेटर के लिए हमेशा 2FA ज़रूरी रखते हैं"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/hr/messages.po b/fluxer_app/src/features/i18n/locales/hr/messages.poindex 38bd31228..2fe1673be 100644--- a/fluxer_app/src/features/i18n/locales/hr/messages.po+++ b/fluxer_app/src/features/i18n/locales/hr/messages.po@@ -20012,11 +20012,6 @@ msgstr "Nevažeći zahtjev za autorizaciju"msgid "Invalid bot permissions."msgstr "Nevažeća dopuštenja bota."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Nevažeći naziv emojija"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Samo se CSS tekst sinkronizira među uređajima. Učitani resursi, refermsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Sinkronizira se samo CSS tekst. Učitani resursi i reference na lokalne datoteke ostaju na ovom uređaju."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Može se prikazati samo prvih {maxPages} stranica rezultata. Pokušajte s preciznijim pretraživanjem."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Provjera nije uspjela"msgid "Verified & partnered community"msgstr "Provjerena i partnerska zajednica"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Potvrđene i partnerske zajednice uvijek zahtijevaju 2FA za moderatore"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/hu/messages.po b/fluxer_app/src/features/i18n/locales/hu/messages.poindex bd15b5636..a0e943027 100644--- a/fluxer_app/src/features/i18n/locales/hu/messages.po+++ b/fluxer_app/src/features/i18n/locales/hu/messages.po@@ -20012,11 +20012,6 @@ msgstr "Érvénytelen engedélyezési kérelem"msgid "Invalid bot permissions."msgstr "Érvénytelen botjogosultságok."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Érvénytelen emojinév"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Csak a CSS-szöveg szinkronizálódik az eszközök között. A feltöltmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Csak a CSS-szöveg szinkronizálódik. A feltöltött erőforrások és a helyi fájlhivatkozások ezen az eszközön maradnak."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Csak a találatok első {maxPages} oldala jeleníthető meg. Próbálj pontosabb keresést."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Sikertelen ellenőrzés"msgid "Verified & partnered community"msgstr "Ellenőrzött és partnerközösség"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Az ellenőrzött és partnerközösségek mindig megkövetelik a 2FA-t a moderátoroktól"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/id/messages.po b/fluxer_app/src/features/i18n/locales/id/messages.poindex 57f1d71c8..5e57fb671 100644--- a/fluxer_app/src/features/i18n/locales/id/messages.po+++ b/fluxer_app/src/features/i18n/locales/id/messages.po@@ -20012,11 +20012,6 @@ msgstr "Permintaan otorisasi tidak valid"msgid "Invalid bot permissions."msgstr "Izin bot tidak valid."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Nama emoji tidak valid"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Hanya teks CSS yang disinkronkan di seluruh perangkat. Aset yang diunggamsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Hanya teks CSS yang disinkronkan. Aset yang diunggah dan referensi file lokal tetap ada di perangkat ini."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Hanya {maxPages} halaman pertama hasil yang dapat ditampilkan. Coba pencarian yang lebih spesifik."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Verifikasi gagal"msgid "Verified & partnered community"msgstr "Komunitas terverifikasi & bermitra"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Komunitas terverifikasi dan mitra selalu mewajibkan 2FA untuk moderator"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/it/messages.po b/fluxer_app/src/features/i18n/locales/it/messages.poindex e8203333c..2bf83de78 100644--- a/fluxer_app/src/features/i18n/locales/it/messages.po+++ b/fluxer_app/src/features/i18n/locales/it/messages.po@@ -20012,11 +20012,6 @@ msgstr "Richiesta di autorizzazione non valida"msgid "Invalid bot permissions."msgstr "Permessi bot non validi."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Nome emoji non valido"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Solo il testo CSS viene sincronizzato tra i dispositivi. Le risorse carimsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Solo il testo CSS viene sincronizzato. Le risorse caricate e i riferimenti a file locali rimangono su questo dispositivo."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "È possibile mostrare solo le prime {maxPages} pagine di risultati. Prova una ricerca più specifica."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Verifica non riuscita"msgid "Verified & partnered community"msgstr "Community verificata e partner"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Le community verificate e partner richiedono sempre la 2FA ai moderatori"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/ja/messages.po b/fluxer_app/src/features/i18n/locales/ja/messages.poindex 410bd8ca1..936556b32 100644--- a/fluxer_app/src/features/i18n/locales/ja/messages.po+++ b/fluxer_app/src/features/i18n/locales/ja/messages.po@@ -20012,11 +20012,6 @@ msgstr "無効な認証リクエスト"msgid "Invalid bot permissions."msgstr "ボットの権限が無効です。"-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "無効な絵文字名"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "CSSテキストのみがデバイス間で同期されます。アップmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "CSSテキストのみが同期されます。アップロードされたアセットとローカルファイルの参照はこのデバイスに残ります。"+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "表示できるのは検索結果の最初の {maxPages} ページまでです。検索条件を絞り込んでください。"+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "認証に失敗しました"msgid "Verified & partnered community"msgstr "認証済みパートナーコミュニティ"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "認証済みおよびパートナーのコミュニティでは、モデレーターに常に2段階認証が必要です"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/ko/messages.po b/fluxer_app/src/features/i18n/locales/ko/messages.poindex 6c4b0bcbc..4474e0b6a 100644--- a/fluxer_app/src/features/i18n/locales/ko/messages.po+++ b/fluxer_app/src/features/i18n/locales/ko/messages.po@@ -20012,11 +20012,6 @@ msgstr "유효하지 않은 승인 요청입니다"msgid "Invalid bot permissions."msgstr "봇 권한이 유효하지 않습니다."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "이모티콘 이름이 유효하지 않습니다"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "CSS 텍스트만 기기 간에 동기화됩니다. 업로드된 에셋,msgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "CSS 텍스트만 동기화됩니다. 업로드된 에셋과 로컬 파일 참조는 이 기기에 유지됩니다."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "검색 결과는 처음 {maxPages}페이지까지만 표시할 수 있어요. 더 구체적으로 검색해 보세요."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "인증 실패"msgid "Verified & partnered community"msgstr "인증된 파트너 커뮤니티"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "인증된 커뮤니티와 파트너 커뮤니티는 항상 모더레이터에게 2단계 인증을 요구합니다"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/lt/messages.po b/fluxer_app/src/features/i18n/locales/lt/messages.poindex 489c2e911..bc50101ab 100644--- a/fluxer_app/src/features/i18n/locales/lt/messages.po+++ b/fluxer_app/src/features/i18n/locales/lt/messages.po@@ -20013,11 +20013,6 @@ msgstr "Netinkama autorizacijos užklausa"msgid "Invalid bot permissions."msgstr "Netinkami boto leidimai."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Neteisingas jaustuko pavadinimas"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25699,6 +25694,11 @@ msgstr "Tik CSS tekstas sinchronizuojamas visuose įrenginiuose. Įkelti išteklmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Sinchronizuojamas tik CSS tekstas. Įkelti ištekliai ir vietinių failų nuorodos lieka šiame įrenginyje."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Galima rodyti tik pirmuosius {maxPages} rezultatų puslapius. Pabandykite tikslesnę paiešką."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41218,6 +41218,11 @@ msgstr "Patvirtinimas nepavyko"msgid "Verified & partnered community"msgstr "Patvirtinta ir partnerių bendruomenė"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Patvirtintos ir partnerių bendruomenės visada reikalauja moderatorių 2FA"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/nl/messages.po b/fluxer_app/src/features/i18n/locales/nl/messages.poindex bfe7cf4ee..0468c4cbf 100644--- a/fluxer_app/src/features/i18n/locales/nl/messages.po+++ b/fluxer_app/src/features/i18n/locales/nl/messages.po@@ -20012,11 +20012,6 @@ msgstr "Ongeldig autorisatieverzoek"msgid "Invalid bot permissions."msgstr "Ongeldige botmachtigingen."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Ongeldige emojinaam"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Alleen de CSS-tekst wordt gesynchroniseerd tussen apparaten. Geüploademsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Alleen de CSS-tekst wordt gesynchroniseerd. Geüploade bestanden en lokale bestandsverwijzingen blijven op dit apparaat."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Alleen de eerste {maxPages} pagina's met resultaten kunnen worden getoond. Probeer een specifiekere zoekopdracht."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Verificatie mislukt"msgid "Verified & partnered community"msgstr "Geverifieerde en partnercommunity"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Geverifieerde en partnercommunity's vereisen altijd 2FA voor moderators"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/no/messages.po b/fluxer_app/src/features/i18n/locales/no/messages.poindex c4b71fdb1..3ee1f8861 100644--- a/fluxer_app/src/features/i18n/locales/no/messages.po+++ b/fluxer_app/src/features/i18n/locales/no/messages.po@@ -20012,11 +20012,6 @@ msgstr "Ugyldig autoriseringsforespørsel"msgid "Invalid bot permissions."msgstr "Ugyldige bot-tillatelser."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Ugyldig emojinavn"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Kun CSS-teksten synkroniseres på tvers av enheter. Opplastede filer, skmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Bare CSS-teksten synkroniseres. Opplastede ressurser og lokale filreferanser forblir på denne enheten."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Bare de første {maxPages} sidene med resultater kan vises. Prøv et mer spesifikt søk."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Bekreftelsen mislyktes"msgid "Verified & partnered community"msgstr "Verifisert partnerfellesskap"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Verifiserte fellesskap og partnerfellesskap krever alltid 2FA for moderatorer"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/pl/messages.po b/fluxer_app/src/features/i18n/locales/pl/messages.poindex c173aeaa2..6c582b135 100644--- a/fluxer_app/src/features/i18n/locales/pl/messages.po+++ b/fluxer_app/src/features/i18n/locales/pl/messages.po@@ -20012,11 +20012,6 @@ msgstr "Nieprawidłowe żądanie autoryzacji"msgid "Invalid bot permissions."msgstr "Nieprawidłowe uprawnienia bota."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Nieprawidłowa nazwa emoji"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Tylko tekst CSS jest synchronizowany między urządzeniami. Przesłane zmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Synchronizowany jest tylko tekst CSS. Przesłane zasoby i odwołania do plików lokalnych pozostają na tym urządzeniu."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Można wyświetlić tylko pierwsze {maxPages} stron wyników. Spróbuj bardziej szczegółowego wyszukiwania."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Weryfikacja nieudana"msgid "Verified & partnered community"msgstr "Zweryfikowana społeczność partnerska"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Zweryfikowane i partnerskie społeczności zawsze wymagają 2FA od moderatorów"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/pt-BR/messages.po b/fluxer_app/src/features/i18n/locales/pt-BR/messages.poindex 0d8d8cfe2..b18d11ea2 100644--- a/fluxer_app/src/features/i18n/locales/pt-BR/messages.po+++ b/fluxer_app/src/features/i18n/locales/pt-BR/messages.po@@ -20012,11 +20012,6 @@ msgstr "Solicitação de autorização inválida"msgid "Invalid bot permissions."msgstr "Permissões de bot inválidas."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Nome de emoji inválido"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Apenas o texto CSS é sincronizado entre dispositivos. Os recursos enviamsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Apenas o texto CSS é sincronizado. Os recursos enviados e as referências de arquivos locais permanecem neste dispositivo."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Só é possível mostrar as primeiras {maxPages} páginas de resultados. Tente uma busca mais específica."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Falha na verificação"msgid "Verified & partnered community"msgstr "Comunidade verificada e parceira"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Comunidades verificadas e parceiras sempre exigem 2FA dos moderadores"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/ro/messages.po b/fluxer_app/src/features/i18n/locales/ro/messages.poindex 272da4313..9ab8038e8 100644--- a/fluxer_app/src/features/i18n/locales/ro/messages.po+++ b/fluxer_app/src/features/i18n/locales/ro/messages.po@@ -20012,11 +20012,6 @@ msgstr "Solicitare de autorizare nevalidă"msgid "Invalid bot permissions."msgstr "Permisiuni bot nevalide."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Nume emoji nevalid"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Doar textul CSS este sincronizat pe toate dispozitivele. Elementele încmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Doar textul CSS este sincronizat. Elementele încărcate și referințele fișierelor locale rămân pe acest dispozitiv."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Pot fi afișate doar primele {maxPages} pagini de rezultate. Încearcă o căutare mai specifică."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Verificarea nu a reușit"msgid "Verified & partnered community"msgstr "Comunitate verificată și parteneră"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Comunitățile verificate și partenere cer întotdeauna 2FA pentru moderatori"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/ru/messages.po b/fluxer_app/src/features/i18n/locales/ru/messages.poindex 0ffa23d63..222c862d6 100644--- a/fluxer_app/src/features/i18n/locales/ru/messages.po+++ b/fluxer_app/src/features/i18n/locales/ru/messages.po@@ -20012,11 +20012,6 @@ msgstr "Недействительный запрос авторизации"msgid "Invalid bot permissions."msgstr "Недействительные разрешения для бота."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Недопустимое имя эмодзи"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Между устройствами синхронизируется тmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Синхронизируется только текст CSS. Загруженные ресурсы и ссылки на локальные файлы остаются на этом устройстве."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Можно показать только первые {maxPages} страниц результатов. Попробуйте уточнить поиск."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Подтверждение не удалось"msgid "Verified & partnered community"msgstr "Подтвержденное сообщество-партнёр"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "В подтверждённых и партнёрских сообществах модераторам всегда нужна двухфакторная аутентификация"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/sv-SE/messages.po b/fluxer_app/src/features/i18n/locales/sv-SE/messages.poindex 3e7c871a9..71a606bf5 100644--- a/fluxer_app/src/features/i18n/locales/sv-SE/messages.po+++ b/fluxer_app/src/features/i18n/locales/sv-SE/messages.po@@ -20012,11 +20012,6 @@ msgstr "Ogiltig auktoriseringsförfrågan"msgid "Invalid bot permissions."msgstr "Ogiltiga bot-behörigheter."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Ogiltigt emojinamn"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Bara CSS-texten synkroniseras mellan enheter. Uppladdade resurser, filremsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Bara CSS-texten synkroniseras. Uppladdade resurser och lokala filreferenser stannar på den här enheten."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Bara de första {maxPages} sidorna med resultat kan visas. Prova en mer specifik sökning."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Verifiering misslyckades"msgid "Verified & partnered community"msgstr "Verifierad partnercommunity"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Verifierade communityn och partnercommunityn kräver alltid 2FA för moderatorer"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/th/messages.po b/fluxer_app/src/features/i18n/locales/th/messages.poindex c45967014..af17ef8da 100644--- a/fluxer_app/src/features/i18n/locales/th/messages.po+++ b/fluxer_app/src/features/i18n/locales/th/messages.po@@ -20012,11 +20012,6 @@ msgstr "คำขออนุญาตไม่ถูกต้อง"msgid "Invalid bot permissions."msgstr "สิทธิ์ของบอทไม่ถูกต้อง"-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "ชื่ออิโมจิไม่ถูกต้อง"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "เฉพาะข้อความ CSS เท่านั้นทีmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "เฉพาะข้อความ CSS เท่านั้นที่ซิงค์ ส่วนไฟล์ที่อัปโหลดและการอ้างอิงไฟล์ในเครื่องจะอยู่เฉพาะในอุปกรณ์นี้"+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "แสดงผลลัพธ์ได้เพียง {maxPages} หน้าแรกเท่านั้น ลองค้นหาให้เจาะจงมากขึ้น"+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "ยืนยันตัวตนไม่สำเร็จ"msgid "Verified & partnered community"msgstr "คอมมูนิตี้ที่ยืนยันแล้วและเป็นพาร์ทเนอร์"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "ชุมชนที่ยืนยันแล้วและชุมชนพาร์ทเนอร์กำหนดให้ผู้ดูแลต้องใช้ 2FA เสมอ"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/tr/messages.po b/fluxer_app/src/features/i18n/locales/tr/messages.poindex bee891447..17555da68 100644--- a/fluxer_app/src/features/i18n/locales/tr/messages.po+++ b/fluxer_app/src/features/i18n/locales/tr/messages.po@@ -20012,11 +20012,6 @@ msgstr "Geçersiz yetkilendirme isteği"msgid "Invalid bot permissions."msgstr "Geçersiz bot izinleri."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Geçersiz emoji adı"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Cihazlar arasında yalnızca CSS metni senkronize edilir. Yüklenen öğmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Yalnızca CSS metni senkronize edilir. Yüklenen öğeler ve yerel dosya referansları bu cihazda kalır."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Sonuçların yalnızca ilk {maxPages} sayfası gösterilebilir. Daha belirli bir arama dene."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Doğrulama başarısız oldu"msgid "Verified & partnered community"msgstr "Onaylı ve iş ortağı topluluğu"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Doğrulanmış ve partner topluluklar moderatörler için her zaman 2FA ister"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/uk/messages.po b/fluxer_app/src/features/i18n/locales/uk/messages.poindex c37a28687..fff4a89d9 100644--- a/fluxer_app/src/features/i18n/locales/uk/messages.po+++ b/fluxer_app/src/features/i18n/locales/uk/messages.po@@ -20012,11 +20012,6 @@ msgstr "Недійсний запит авторизації"msgid "Invalid bot permissions."msgstr "Недійсні дозволи бота."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Недійсна назва емоджі"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Синхронізується між пристроями лише теmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Синхронізується лише текст CSS. Завантажені ресурси та посилання на локальні файли залишаються на цьому пристрої."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Можна показати лише перші {maxPages} сторінок результатів. Спробуйте точніший пошук."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Не вдалося підтвердити"msgid "Verified & partnered community"msgstr "Верифікована спільнота-партнер"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Підтверджені та партнерські спільноти завжди вимагають від модераторів двофакторну автентифікацію"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/vi/messages.po b/fluxer_app/src/features/i18n/locales/vi/messages.poindex 4c4e7bad7..073964d78 100644--- a/fluxer_app/src/features/i18n/locales/vi/messages.po+++ b/fluxer_app/src/features/i18n/locales/vi/messages.po@@ -20012,11 +20012,6 @@ msgstr "Yêu cầu ủy quyền không hợp lệ"msgid "Invalid bot permissions."msgstr "Quyền của bot không hợp lệ."-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "Tên biểu tượng cảm xúc không hợp lệ"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "Chỉ văn bản CSS được đồng bộ giữa các thiết bị. Tàmsgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "Chỉ văn bản CSS được đồng bộ. Tài nguyên đã tải lên và tham chiếu tệp cục bộ vẫn nằm trên thiết bị này."+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "Chỉ có thể hiển thị {maxPages} trang kết quả đầu tiên. Hãy thử tìm kiếm cụ thể hơn."+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "Xác minh không thành công"msgid "Verified & partnered community"msgstr "Cộng đồng đối tác đã xác minh"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "Cộng đồng đã xác minh và cộng đồng đối tác luôn yêu cầu người điều hành bật 2FA"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/zh-CN/messages.po b/fluxer_app/src/features/i18n/locales/zh-CN/messages.poindex 2b1170b63..bb6c29ab7 100644--- a/fluxer_app/src/features/i18n/locales/zh-CN/messages.po+++ b/fluxer_app/src/features/i18n/locales/zh-CN/messages.po@@ -20012,11 +20012,6 @@ msgstr "授权请求无效"msgid "Invalid bot permissions."msgstr "机器人权限无效。"-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "表情名称无效"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "只有 CSS 文本会在设备间同步。上传的资源、桌面端文msgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "仅同步 CSS 文本。上传的资源和本地文件引用将保留在此设备上。"+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "只能显示前 {maxPages} 页结果。请尝试更具体的搜索。"+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "验证失败"msgid "Verified & partnered community"msgstr "已认证的合作社区"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "已验证和合作伙伴社区始终要求版主启用双重认证"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/i18n/locales/zh-TW/messages.po b/fluxer_app/src/features/i18n/locales/zh-TW/messages.poindex 70243b0f9..50b14919a 100644--- a/fluxer_app/src/features/i18n/locales/zh-TW/messages.po+++ b/fluxer_app/src/features/i18n/locales/zh-TW/messages.po@@ -20012,11 +20012,6 @@ msgstr "無效的授權請求"msgid "Invalid bot permissions."msgstr "無效的機器人權限。"-#. Title of the error modal shown when a custom emoji name fails validation.-#: src/features/emoji/components/emojis/EmojiListItem.tsx-msgid "Invalid emoji name"-msgstr "無效的表情符號名稱"-#. Gift redemption error modal title for an invalid or already used code.#: src/features/gift/commands/GiftCommands.tsxmsgid "Invalid gift code"@@ -25698,6 +25693,11 @@ msgstr "只有 CSS 文字會在裝置間同步。上傳的素材、桌面檔案msgid "Only the CSS text is synced. Uploaded assets and local file references stay on this device."msgstr "只會同步 CSS 文字。上傳的素材和本機檔案參考會保留在此裝置上。"+#. Notice under the search results pagination when a search has more pages than can be shown. maxPages is a number.+#: src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx+msgid "Only the first {maxPages} pages of results can be shown. Try a more specific search."+msgstr "只能顯示前 {maxPages} 頁結果。請嘗試更具體的搜尋。"+#. Shown for a watched theme folder in Settings > Themes when it has more than 200 CSS files.#: src/features/theme_settings/components/YourThemesSection.tsxmsgid "Only the first 200 CSS files in this folder are loaded."@@ -41217,6 +41217,11 @@ msgstr "驗證失敗"msgid "Verified & partnered community"msgstr "已驗證與合作社群"+#. Tooltip on the 2FA-for-moderation switch in the community moderation settings tab when the community is verified or partnered, so the switch stays on and cannot be changed.+#: src/features/guild/components/modals/guild_tabs/GuildModerationTab.tsx+msgid "Verified and partnered communities always require 2FA for moderators"+msgstr "已驗證和合作夥伴社群一律要求版主啟用雙重驗證"+#. Short label in the community badge. Keep it concise.#: src/features/guild/components/GuildBadge.tsxmsgid "Verified community"diff --git a/fluxer_app/src/features/invite/state/Invites.ts b/fluxer_app/src/features/invite/state/Invites.tsindex 1b7281229..ac612b2fc 100644--- a/fluxer_app/src/features/invite/state/Invites.ts+++ b/fluxer_app/src/features/invite/state/Invites.ts@@ -175,6 +175,14 @@ class Invites {this.guildFetchStatus = new Map();}+ dropFailedInviteSlots(): void {+ const next = new Map(this.inviteSlots);+ for (const [resourceKey, slot] of this.inviteSlots) {+ if (slot.error != null) next.delete(resourceKey);+ }+ if (next.size !== this.inviteSlots.size) this.inviteSlots = next;+ }+fetchInvite = action(async (code: string, target: InstanceHTTPTarget): Promise<Invite> => {const resourceKey = inviteResourceKey(code, target);const inflight = this.pendingRequests.get(resourceKey);@@ -304,6 +312,10 @@ class Invites {const invites = new Invites();-AccountScopedWork.registerCancellation(() => invites.reset());+AccountScopedWork.registerTransition({+ suspend: () => invites.reset(),+ resume: () => {},+ released: () => invites.dropFailedInviteSlots(),+});export default invites;diff --git a/fluxer_app/src/features/lexical/composer/ComposerEmojiShortcode.ts b/fluxer_app/src/features/lexical/composer/ComposerEmojiShortcode.tsindex 3639dc89c..b12dffd18 100644--- a/fluxer_app/src/features/lexical/composer/ComposerEmojiShortcode.ts+++ b/fluxer_app/src/features/lexical/composer/ComposerEmojiShortcode.ts@@ -148,6 +148,8 @@ function $convertEmojiShortcode(node: TextNode, resolve: ComposerEmojiResolver):const resolved = resolve(match.name);if (resolved != null) {edits.push({start: match.start, end: match.end, replacement: resolved});+ } else if (!match.surrogate) {+ searchFrom = match.end - 1;}}if (edits.length === 0) {diff --git a/fluxer_app/src/features/lexical/composer/ComposerLineBoundary.ts b/fluxer_app/src/features/lexical/composer/ComposerLineBoundary.tsnew file mode 100644index 000000000..97db4bfc5--- /dev/null+++ b/fluxer_app/src/features/lexical/composer/ComposerLineBoundary.ts@@ -0,0 +1,154 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++import {+ $captureSelectionOffsets,+ $selectComposerNodeBoundary,+ $selectComposerRange,+} from '@app/features/lexical/composer/composerOffsets';+import {+ $getNearestNodeFromDOMNode,+ $getSelection,+ $isDecoratorNode,+ $isElementNode,+ $isLineBreakNode,+ $isRangeSelection,+ type LexicalEditor,+} from 'lexical';+import type React from 'react';++export function moveSelectionToLineBoundary(event: React.KeyboardEvent<HTMLElement>, editor: LexicalEditor): boolean {+ if (event.key !== 'Home' && event.key !== 'End') {+ return false;+ }+ if (event.ctrlKey || event.metaKey || event.altKey) {+ return false;+ }+ const root = event.currentTarget;+ const selection = root.ownerDocument.defaultView?.getSelection();+ if (selection == null || selection.rangeCount === 0 || selection.focusNode == null) {+ return false;+ }+ event.preventDefault();+ const edge = event.key === 'Home' ? 'start' : 'end';+ const caret = caretRectAt(selection.focusNode, selection.focusOffset);+ const target = caret == null ? null : lineBoundaryPoint(root, caret.top + caret.height / 2, edge);+ if (target == null) {+ selection.modify(event.shiftKey ? 'extend' : 'move', edge === 'start' ? 'backward' : 'forward', 'lineboundary');+ return true;+ }+ const island = islandAtBoundary(root, target.node, target.offset, edge);+ if (island == null) {+ if (event.shiftKey) {+ selection.extend(target.node, target.offset);+ } else {+ selection.collapse(target.node, target.offset);+ }+ return true;+ }+ const extend = event.shiftKey;+ editor.update(() => {+ const node = $getNearestNodeFromDOMNode(island);+ if (node == null) {+ return;+ }+ const anchor = extend ? $captureSelectionOffsets() : null;+ $selectComposerNodeBoundary(node, edge === 'start' ? 'before' : 'after');+ const focus = $captureSelectionOffsets();+ if (anchor != null && focus != null) {+ $selectComposerRange(anchor.anchor, focus.focus);+ }+ });+ return true;+}++function caretRectAt(node: Node, offset: number): DOMRect | null {+ const document = node.ownerDocument;+ if (document == null) {+ return null;+ }+ const range = document.createRange();+ range.setStart(node, offset);+ range.collapse(true);+ const rects = range.getClientRects();+ if (rects.length > 0) {+ return rects[rects.length - 1]!;+ }+ const neighbour = node.childNodes[offset] ?? node.childNodes[offset - 1] ?? node;+ if (neighbour instanceof Element) {+ return neighbour.getBoundingClientRect();+ }+ range.selectNodeContents(neighbour);+ const textRects = range.getClientRects();+ return textRects.length > 0 ? textRects[0]! : null;+}++function lineBoundaryPoint(root: HTMLElement, y: number, edge: 'start' | 'end'): {node: Node; offset: number} | null {+ const bounds = root.getBoundingClientRect();+ const rtl = root.ownerDocument.defaultView?.getComputedStyle(root).direction === 'rtl';+ const x = (edge === 'start') !== rtl ? bounds.left + 1 : bounds.right - 1;+ const point = caretPointFromPoint(root.ownerDocument, x, y);+ return point != null && root.contains(point.node) ? point : null;+}++function caretPointFromPoint(document: Document, x: number, y: number): {node: Node; offset: number} | null {+ if (typeof document.caretPositionFromPoint === 'function') {+ const position = document.caretPositionFromPoint(x, y);+ return position == null ? null : {node: position.offsetNode, offset: position.offset};+ }+ if (typeof document.caretRangeFromPoint === 'function') {+ const range = document.caretRangeFromPoint(x, y);+ return range == null ? null : {node: range.startContainer, offset: range.startOffset};+ }+ return null;+}++function islandAtBoundary(root: HTMLElement, node: Node, offset: number, edge: 'start' | 'end'): HTMLElement | null {+ const element = node instanceof Element ? node : node.parentElement;+ const enclosing = element == null ? null : element.closest<HTMLElement>('[contenteditable="false"]');+ if (enclosing != null && root.contains(enclosing)) {+ return enclosing;+ }+ const neighbour = node.childNodes[edge === 'start' ? offset : offset - 1];+ return neighbour instanceof HTMLElement && neighbour.contentEditable === 'false' ? neighbour : null;+}++export function registerComposerLineStartInsertion(editor: LexicalEditor): () => void {+ const handleBeforeInput = (event: InputEvent) => {+ if (event.inputType !== 'insertText' || event.data == null || editor.isComposing()) {+ return;+ }+ const text = event.data;+ let handled = false;+ editor.update(+ () => {+ const selection = $getSelection();+ if (!$isRangeSelection(selection) || !selection.isCollapsed() || selection.anchor.type !== 'element') {+ return;+ }+ const parent = selection.anchor.getNode();+ if (!$isElementNode(parent)) {+ return;+ }+ const previous = parent.getChildAtIndex(selection.anchor.offset - 1);+ const next = parent.getChildAtIndex(selection.anchor.offset);+ if (+ !($isLineBreakNode(previous) && $isDecoratorNode(next)) &&+ !($isDecoratorNode(previous) && $isLineBreakNode(next))+ ) {+ return;+ }+ selection.insertText(text);+ handled = true;+ },+ {discrete: true},+ );+ if (handled) {+ event.preventDefault();+ event.stopImmediatePropagation();+ }+ };+ return editor.registerRootListener((root, previousRoot) => {+ previousRoot?.removeEventListener('beforeinput', handleBeforeInput, true);+ root?.addEventListener('beforeinput', handleBeforeInput, true);+ });+}diff --git a/fluxer_app/src/features/lexical/composer/LexicalComposerInput.tsx b/fluxer_app/src/features/lexical/composer/LexicalComposerInput.tsxindex 96dbd434d..994c7aaeb 100644--- a/fluxer_app/src/features/lexical/composer/LexicalComposerInput.tsx+++ b/fluxer_app/src/features/lexical/composer/LexicalComposerInput.tsx@@ -12,6 +12,10 @@ import {registerComposerEnter} from '@app/features/lexical/composer/ComposerEnteimport type {ComposerHandle, ComposerSelectionRange} from '@app/features/lexical/composer/ComposerHandle';import {resetComposerHistory} from '@app/features/lexical/composer/ComposerHistory';import {registerComposerIMECommandGuard} from '@app/features/lexical/composer/ComposerIME';+import {+ moveSelectionToLineBoundary,+ registerComposerLineStartInsertion,+} from '@app/features/lexical/composer/ComposerLineBoundary';import {registerComposerMarkdownHighlight} from '@app/features/lexical/composer/ComposerMarkdownHighlight';import {registerComposerMarkdownShortcuts} from '@app/features/lexical/composer/ComposerMarkdownShortcuts';import {ComposerMentionContext} from '@app/features/lexical/composer/ComposerMentionContext';@@ -168,22 +172,6 @@ export interface LexicalComposerInputProps {onSlashCommandStateChange?: (state: SlashCommandComposerState) => void;}-function moveSelectionToLineBoundary(event: React.KeyboardEvent<HTMLElement>): boolean {- if (event.key !== 'Home' && event.key !== 'End') {- return false;- }- if (event.ctrlKey || event.metaKey || event.altKey) {- return false;- }- const selection = event.currentTarget.ownerDocument.defaultView?.getSelection();- if (selection == null || selection.rangeCount === 0) {- return false;- }- selection.modify(event.shiftKey ? 'extend' : 'move', event.key === 'Home' ? 'backward' : 'forward', 'lineboundary');- event.preventDefault();- return true;-}-export const LexicalComposerInput = observer((props: LexicalComposerInputProps) => {const plainText = ChatInputSettings.renderComposerAsPlainText;const selectionToolbar = (props.selectionToolbar == null ? true : props.selectionToolbar) && !MobileLayout.enabled;@@ -575,6 +563,7 @@ const ComposerInner = ({registerContextMenuUndoRedo(editor),registerComposerIMECommandGuard(editor),registerComposerSoftWrapDeletion(editor),+ registerComposerLineStartInsertion(editor),registerComposerTypeaheadModifierGuard(editor, typeaheadActiveState),registerComposerMarkdownShortcuts(editor),registerComposerCodeIndent(editor, typeaheadActiveState),@@ -651,7 +640,7 @@ const ComposerInner = ({const handleEditableKeyDown = useCallback((event: React.KeyboardEvent<HTMLElement>) => {if (!event.defaultPrevented && !isIMEComposing(event)) {- if (moveSelectionToLineBoundary(event)) {+ if (moveSelectionToLineBoundary(event, editor)) {return;}if (onKeyDown != null) {@@ -659,7 +648,7 @@ const ComposerInner = ({}}},- [onKeyDown],+ [editor, onKeyDown],);const handleEditablePointerDown = useCallback((event: React.PointerEvent<HTMLElement>) => {diff --git a/fluxer_app/src/features/lexical/composer/markdownSpans.ts b/fluxer_app/src/features/lexical/composer/markdownSpans.tsindex a8087a3a7..e8effad66 100644--- a/fluxer_app/src/features/lexical/composer/markdownSpans.ts+++ b/fluxer_app/src/features/lexical/composer/markdownSpans.ts@@ -408,6 +408,10 @@ function alignNode(node: Node, format: MarkdownHlFormat, ctx: AlignContext): voireturn;}case 'Emoji': {+ if (node.kind.kind === 'Standard' && ctx.source.startsWith(`:${node.kind.name}:`, ctx.pos)) {+ pushContent(ctx, ctx.pos + node.kind.name.length + 2, format);+ return;+ }alignOpaque(EMOJI_TOKEN_RE, node.kind.kind === 'Standard' ? node.kind.raw : null, format, ctx);return;}@@ -1150,6 +1154,12 @@ const DROPPED_WHITESPACE_RE = /^[ \t\r]+\n/;const LINE_WHITESPACE_RE = /^[ \t\r]+/;const REPLACEMENT_CHARACTER = '\uFFFD';+const TEXT_PRESENTATION_SELECTOR = '\uFE0F';+const PLAINTEXT_SYMBOL_SHORTCODES: Readonly<Record<string, string>> = {+ '\u2122': ':tm:',+ '\u00A9': ':copyright:',+ '\u00AE': ':registered:',+};const UNPAIRED_SURROGATE_RE = /[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g;function isUnpairedSurrogateAt(text: string, index: number): boolean {@@ -1210,6 +1220,15 @@ function advancePastText(if (source[pos] === content[ci]) {pos += 1;ci += 1;+ if (source[pos] === TEXT_PRESENTATION_SELECTOR && PLAINTEXT_SYMBOL_SHORTCODES[source[pos - 1]!] != null) {+ pos += 1;+ }+ continue;+ }+ const symbolShortcode = PLAINTEXT_SYMBOL_SHORTCODES[content[ci]!];+ if (symbolShortcode != null && source.startsWith(symbolShortcode, pos)) {+ pos += symbolShortcode.length;+ ci += 1;continue;}if (content[ci] === REPLACEMENT_CHARACTER && isUnpairedSurrogateAt(source, pos)) {diff --git a/fluxer_app/src/features/messaging/commands/SavedMessageCommands.tsx b/fluxer_app/src/features/messaging/commands/SavedMessageCommands.tsxindex 47513edc6..6d4c82479 100644--- a/fluxer_app/src/features/messaging/commands/SavedMessageCommands.tsx+++ b/fluxer_app/src/features/messaging/commands/SavedMessageCommands.tsx@@ -116,6 +116,22 @@ export async function loadMore(): Promise<Array<SavedMessageEntry>> {return runSavedMessagesFetch(`Loading more saved messages before ${before}`, true, {before});}+let loadingAll: Promise<void> | null = null;++export function ensureAllLoaded(): Promise<void> {+ if (SavedMessages.fetched && !SavedMessages.getHasMore()) return Promise.resolve();+ loadingAll ??= (async () => {+ try {+ if (!SavedMessages.fetched) await fetch();+ while (SavedMessages.getHasMore() && (await loadMore()).length > 0) {}+ } catch {+ } finally {+ loadingAll = null;+ }+ })();+ return loadingAll;+}+export async function create(i18n: I18n, channelId: string, messageId: string): Promise<void> {try {logger.debug(`Saving message ${messageId} from channel ${channelId}`);diff --git a/fluxer_app/src/features/messaging/components/markdown/renderers/LinkRenderer.tsx b/fluxer_app/src/features/messaging/components/markdown/renderers/LinkRenderer.tsxindex b6ef880ac..ad52f202b 100644--- a/fluxer_app/src/features/messaging/components/markdown/renderers/LinkRenderer.tsx+++ b/fluxer_app/src/features/messaging/components/markdown/renderers/LinkRenderer.tsx@@ -18,9 +18,12 @@ import {GuildAcronym} from '@app/features/guild/components/GuildAcronym';import type {Guild} from '@app/features/guild/models/Guild';import Guilds from '@app/features/guild/state/Guilds';import {COPY_LINK_DESCRIPTOR, OPEN_LINK_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';+import {isKeyboardActivationKey} from '@app/features/input/utils/KeyboardUtils';import * as InviteCommands from '@app/features/invite/commands/InviteCommands';import * as InviteUtils from '@app/features/invite/utils/InviteUtils';import {LinkDestinationTooltip} from '@app/features/messaging/components/LinkDestinationTooltip';+import {MentionLabel} from '@app/features/messaging/components/markdown/renderers/MentionLabel';+import {MentionRenderer} from '@app/features/messaging/components/markdown/renderers/MentionRenderer';import jumpLinkStyles from '@app/features/messaging/components/markdown/renderers/MessageJumpLink.module.css';import {isRestrictedInlineContext,@@ -44,7 +47,6 @@ import {import {handleDeepLinkUrl,isInternalChannelHost,- navigateToLinkedUserProfile,parseChannelJumpLink,parseChannelUrl,parseMessageJumpLink,@@ -57,6 +59,7 @@ import StreamerMode from '@app/features/streamer_mode/state/StreamerMode';import * as ThemeCommands from '@app/features/theme/commands/ThemeCommands';import markupStyles from '@app/features/theme/styles/Markup.module.css';import * as ThemeUtils from '@app/features/theme/utils/ThemeUtils';+import {loadThreadsForMessages} from '@app/features/threads/commands/ThreadCommands';import TrustedDomain from '@app/features/trusted_domain/state/TrustedDomain';import {CopyLinkIcon, OpenLinkIcon} from '@app/features/ui/action_menu/ContextMenuIcons';import {MenuGroup} from '@app/features/ui/action_menu/MenuGroup';@@ -69,12 +72,14 @@ import FocusRing from '@app/features/ui/focus_ring/FocusRing';import {CaretRightIcon} from '@app/features/ui/icons/DirectionalIcons';import {APP_PROTOCOL_PREFIX, APP_PROTOCOL_SCHEME, isAppProtocolUrl} from '@app/features/ui/utils/AppProtocol';import {openExternalUrl} from '@app/features/ui/utils/NativeUtils';+import * as UserProfileCommands from '@app/features/user/commands/UserProfileCommands';import {getUserSettingsSectionLabel,getUserSettingsTabIconDescriptor,getUserSettingsTabLabel,} from '@app/features/user/components/settings_utils/SettingsConstants';import type {UserSettingsDeepLinkTarget} from '@app/features/user/components/settings_utils/UserSettingsDeepLinks';+import Users from '@app/features/user/state/Users';import * as AvatarUtils from '@app/features/user/utils/AvatarUtils';import {ME} from '@fluxer/constants/src/AppConstants';import {isProbablyAValidSnowflake} from '@fluxer/snowflake/src/SnowflakeUtils';@@ -783,6 +788,50 @@ function AppPageJumpLinkMention({page, url, i18n, interactive = true}: AppPageJu);}+interface UnknownUserLinkMentionProps {+ userId: string;+ guildId?: string;+ interactive: boolean;+}++function UnknownUserLinkMention({userId, guildId, interactive}: UnknownUserLinkMentionProps) {+ const label = (+ <MentionLabel data-flx="messaging.markdown.renderers.link-renderer.unknown-user-link-mention.mention-label">{`@${userId}`}</MentionLabel>+ );+ if (!interactive) {+ return (+ <span+ className={markupStyles.mention}+ data-flx="messaging.markdown.renderers.link-renderer.unknown-user-link-mention.span"+ >+ {label}+ </span>+ );+ }+ const open = () => void UserProfileCommands.openLinkedUserProfile(userId, guildId);+ return (+ <span+ role="button"+ tabIndex={0}+ className={clsx(markupStyles.mention, markupStyles.interactive)}+ onClick={(event) => {+ event.preventDefault();+ event.stopPropagation();+ open();+ }}+ onKeyDown={(event) => {+ if (!isKeyboardActivationKey(event.key)) return;+ event.preventDefault();+ event.stopPropagation();+ open();+ }}+ data-flx="messaging.markdown.renderers.link-renderer.unknown-user-link-mention.button"+ >+ {label}+ </span>+ );+}+export const LinkRenderer = observer(function LinkRenderer({node,id,@@ -809,6 +858,12 @@ export const LinkRenderer = observer(function LinkRenderer({!Guilds.getGuild(jumpTarget.scope)? jumpTarget.scope: null;+ const uncachedGuildId = jumpTarget && !jumpChannel && jumpTarget.scope !== ME ? jumpTarget.scope : null;+ const uncachedChannelId = uncachedGuildId ? (jumpTarget?.channelId ?? null) : null;+ useEffect(() => {+ if (!uncachedGuildId || !uncachedChannelId) return;+ void loadThreadsForMessages([{channel_id: uncachedChannelId, guild_id: uncachedGuildId}]);+ }, [uncachedGuildId, uncachedChannelId]);const settingsTarget = isAppProtocolUrl(url) ? parseUserSettingsDeepLink(url) : null;const appPage = settingsTarget ? null : parseAppPageLink(url);const isInlineReplyContext = isRestrictedInlineContext(options.context);@@ -856,6 +911,34 @@ export const LinkRenderer = observer(function LinkRenderer({</FocusRing>);}+ if (userProfileId && !text) {+ if (Users.getUser(userProfileId)) {+ return (+ <MentionRenderer+ node={{type: 'Mention', kind: {kind: 'User', id: userProfileId}}}+ id={id}+ renderChildren={renderChildren}+ options={options}+ data-flx="messaging.markdown.renderers.link-renderer.user-link-mention"+ />+ );+ }+ const mention = (+ <UnknownUserLinkMention+ userId={userProfileId}+ guildId={options.guildId}+ interactive={!isInlineReplyContext && !shouldDisableInteractions}+ data-flx="messaging.markdown.renderers.link-renderer.unknown-user-link-mention"+ />+ );+ return shouldDisableInteractions || isInlineReplyContext ? (+ mention+ ) : (+ <FocusRing key={id} offset={-2} data-flx="messaging.markdown.renderers.link-renderer.focus-ring--user">+ {mention}+ </FocusRing>+ );+ }if (jumpTarget && jumpChannel && !text) {const mention = (<JumpLinkMention@@ -921,7 +1004,7 @@ export const LinkRenderer = observer(function LinkRenderer({handleClick = (event) => {event.preventDefault();event.stopPropagation();- navigateToLinkedUserProfile(userProfileId);+ void UserProfileCommands.openLinkedUserProfile(userProfileId, options.guildId);};isInternal = true;} else if (shouldShowAccessDeniedModal) {diff --git a/fluxer_app/src/features/messaging/components/modals/MediaModal.module.css b/fluxer_app/src/features/messaging/components/modals/MediaModal.module.cssindex a8ef7c3b1..aa041fd43 100644--- a/fluxer_app/src/features/messaging/components/modals/MediaModal.module.css+++ b/fluxer_app/src/features/messaging/components/modals/MediaModal.module.css@@ -135,8 +135,9 @@}.modalOverlay {+ --media-titlebar-offset: 0px;position: fixed;- inset: var(--native-titlebar-height, 0px) 0 0;+ inset: var(--media-titlebar-offset) 0 0;z-index: var(--z-index-modal);display: flex;align-items: center;@@ -144,6 +145,10 @@pointer-events: auto;}+:global(html.platform-native:not(.platform-macos)) .modalOverlay {+ --media-titlebar-offset: var(--native-titlebar-height);+}+.modalBackdrop {position: absolute;inset: 0;@@ -191,7 +196,7 @@--media-fit-max-width: max(0px, calc(100dvw - (2 * var(--media-fit-safe-inset-inline))));--media-fit-max-height: max(0px,- calc(100dvh - var(--native-titlebar-height, 0px) - (2 * var(--media-fit-safe-inset-block)))+ calc(100dvh - var(--media-titlebar-offset, 0px) - (2 * var(--media-fit-safe-inset-block))));--media-content-inner-gap: 0.75rem;--media-content-inner-padding: 0px;diff --git a/fluxer_app/src/features/messaging/components/modals/UploadDropModal.module.css b/fluxer_app/src/features/messaging/components/modals/UploadDropModal.module.cssindex e43adb3fa..51ee333db 100644--- a/fluxer_app/src/features/messaging/components/modals/UploadDropModal.module.css+++ b/fluxer_app/src/features/messaging/components/modals/UploadDropModal.module.css@@ -52,9 +52,12 @@flex-direction: column;justify-content: center;gap: 0.35rem;+ max-width: 100%;+ min-width: 0;}.dialogTitle {+ overflow-wrap: anywhere;font-weight: 600;font-size: 1.05rem;color: var(--text-primary);diff --git a/fluxer_app/src/features/messaging/hooks/useTextareaSubmit.ts b/fluxer_app/src/features/messaging/hooks/useTextareaSubmit.tsindex 70024acec..42fd69f2d 100644--- a/fluxer_app/src/features/messaging/hooks/useTextareaSubmit.ts+++ b/fluxer_app/src/features/messaging/hooks/useTextareaSubmit.ts@@ -212,14 +212,14 @@ function getResolvedMentionCount({return fallbackCount;}-function shouldBlockSubmissionForSlowmode(+export function shouldBlockSubmissionForSlowmode(isSlowmodeActive: boolean,- editingMessage: Message | null,+ isEditing: boolean,parsedCommand: CommandUtils.ParsedCommand | null,lexicalCommand: LexicalMessageCommandResolution | null,hasReplaceCommand: boolean,): boolean {- if (!isSlowmodeActive || editingMessage !== null) {+ if (!isSlowmodeActive || isEditing) {return false;}if (hasReplaceCommand) {@@ -458,13 +458,14 @@ export const useTextareaSubmit = ({composerHandle = composerHandleRef.current;}let lexicalCommand: LexicalMessageCommandResolution | null = null;- let actualContent = displayToActual(value).trim();+ let untrimmedContent = displayToActual(value);if (composerHandle !== null) {if (commandsEnabled) {lexicalCommand = LexicalMessageCommandResolver.resolve(composerHandle);}- actualContent = dropTrailingEmptyBlockquoteLines(composerHandle.getWireValue()).trim();+ untrimmedContent = dropTrailingEmptyBlockquoteLines(composerHandle.getWireValue());}+ const actualContent = untrimmedContent.trim();const resolvedContent = resolveTypedEmojiContent(actualContent);let parsedCommand: CommandUtils.ParsedCommand | null = null;if (lexicalCommand === null) {@@ -473,7 +474,7 @@ export const useTextareaSubmit = ({} else if (lexicalCommand.status === LexicalMessageCommandResolutionStatus.VALID_COMMAND) {parsedCommand = lexicalCommand.command;}- const replaceCommand = commandsEnabled ? ReplaceCommandUtils.parseReplaceCommand(actualContent) : null;+ const replaceCommand = commandsEnabled ? ReplaceCommandUtils.parseReplaceCommand(untrimmedContent) : null;const reactionShorthand =commandsEnabled && editingMessage === null && uploadAttachmentsLength === 0 && !hasPendingSticker? parseReactionShorthand(actualContent, Channels.getChannel(channelId) ?? null, guildId, i18n)@@ -491,7 +492,7 @@ export const useTextareaSubmit = ({if (shouldBlockSubmissionForSlowmode(isSlowmodeActive,- editingMessage,+ editingMessage !== null,parsedCommand,lexicalCommand,replaceCommand !== null,diff --git a/fluxer_app/src/features/messaging/models/MessagingMessage.ts b/fluxer_app/src/features/messaging/models/MessagingMessage.tsindex cb42c67fa..a3cbde378 100644--- a/fluxer_app/src/features/messaging/models/MessagingMessage.ts+++ b/fluxer_app/src/features/messaging/models/MessagingMessage.ts@@ -342,6 +342,13 @@ export class Message {);}+ withoutReferencedMessage(): Message {+ return new Message(+ {...this.toJSON(), referenced_message: null},+ {skipUserCache: true, instanceId: this.instanceId, skipReactionHydration: true},+ );+ }+withoutReactionEmoji(emoji: ReactionEmoji): Message {return this.withUpdates({reactions: this.reactions.filter((reaction) => !emojiEquals(reaction.emoji, emoji)),diff --git a/fluxer_app/src/features/messaging/state/MessageReferences.ts b/fluxer_app/src/features/messaging/state/MessageReferences.tsindex 578bf33e6..6b80258c1 100644--- a/fluxer_app/src/features/messaging/state/MessageReferences.ts+++ b/fluxer_app/src/features/messaging/state/MessageReferences.ts@@ -40,7 +40,7 @@ class MessageReferences {deletedMessageIds = new Set<string>();cachedMessages = new Map<string, MessageRecord>();private referenceVersions = new Map<string, number>();- private referenceCount = new Map<string, Set<string>>();+ private referenceCount = new Map<string, Map<string, string>>();private referencingMessages = new Map<string,{@@ -127,14 +127,19 @@ class MessageReferences {this.bumpReferenceVersion(message.channel_id, message.id);}- private addReference(refChannelId: string, refMessageId: string, referencingMessageId: string): void {+ private addReference(+ refChannelId: string,+ refMessageId: string,+ referencingChannelId: string,+ referencingMessageId: string,+ ): void {const key = this.getKey(refChannelId, refMessageId);- let refs = this.referenceCount.get(key);- if (!refs) {- refs = new Set<string>();- this.referenceCount.set(key, refs);+ const refs = this.referenceCount.get(key);+ if (refs) {+ refs.set(referencingMessageId, referencingChannelId);+ } else {+ this.referenceCount.set(key, new Map([[referencingMessageId, referencingChannelId]]));}- refs.add(referencingMessageId);this.referencingMessages.set(referencingMessageId, {channelId: refChannelId, messageId: refMessageId});}@@ -169,7 +174,7 @@ class MessageReferences {return false;}const refChannelId = message.message_reference?.channel_id ?? fallbackChannelId;- this.addReference(refChannelId, refMessageId, message.id);+ this.addReference(refChannelId, refMessageId, message.channel_id, message.id);if (!('referenced_message' in message)) {return false;}@@ -189,7 +194,13 @@ class MessageReferences {this.recordDeletedMessage(key);this.cachedMessages.delete(key);this.referenceVersions.delete(key);+ const referencing = this.referenceCount.get(key);this.referenceCount.delete(key);+ if (referencing) {+ for (const [referencingMessageId, referencingChannelId] of referencing) {+ Messages.clearReferencedMessage(referencingChannelId, referencingMessageId);+ }+ }const referencedBy = this.referencingMessages.get(messageId);if (referencedBy) {this.removeReference(referencedBy.channelId, referencedBy.messageId, messageId);diff --git a/fluxer_app/src/features/messaging/state/MessagingMessages.ts b/fluxer_app/src/features/messaging/state/MessagingMessages.tsindex e859735aa..eec485fe7 100644--- a/fluxer_app/src/features/messaging/state/MessagingMessages.ts+++ b/fluxer_app/src/features/messaging/state/MessagingMessages.ts@@ -22,6 +22,7 @@ import {MAX_MESSAGES_PER_CHANNEL} from '@fluxer/constants/src/LimitConstants';import type {ChannelId} from '@fluxer/schema/src/branded/WireIds';import type {GuildMemberData} from '@fluxer/schema/src/domains/guild/GuildMemberSchemas';import type {Message as WireMessage} from '@fluxer/schema/src/domains/message/MessageResponseSchemas';+import * as SnowflakeUtils from '@fluxer/snowflake/src/SnowflakeUtils';import {makeAutoObservable, reaction} from 'mobx';const STALE_WINDOW_REFETCH_INTERVAL_MS = 10_000;@@ -203,6 +204,19 @@ class Messages {return messages.ready && messages.length > 0 && !messages.cached;}+ handlePassiveLastMessageUpdates(channels: Record<string, string>): void {+ let changed = false;+ for (const [channelId, lastMessageId] of Object.entries(channels)) {+ const messages = ChannelMessages.get(channelId);+ const newestLoadedId = messages?.last()?.id;+ if (!messages || messages.cached || !newestLoadedId || !messages.hasNewestMessages()) continue;+ if (SnowflakeUtils.compare(lastMessageId, newestLoadedId) <= 0) continue;+ this.commitMessages(messages.withPatch({cached: true}));+ changed = true;+ }+ if (changed) this.notifyChange();+ }+shouldPreloadLatestPage(channelId: string): boolean {if (!GatewaySessions.foregroundConnection.isConnected || !Channels.getChannel(channelId)) {return false;@@ -419,7 +433,13 @@ class Messages {channelId: selectedChannelId,messageId: undefined,});- if (!didChannelSelect && currentMessages && currentMessages.length === 0 && !currentMessages.ready) {+ if (+ !didChannelSelect &&+ currentMessages &&+ currentMessages.length === 0 &&+ !currentMessages.ready &&+ !currentMessages.loadingMore+ ) {this.commitMessages(currentMessages.withPatch({loadingMore: true}));MessageCommands.fetchMessages(selectedChannelId, null, null, MAX_MESSAGES_PER_CHANNEL);this.notifyChange();@@ -564,6 +584,13 @@ class Messages {return true;}+ clearReferencedMessage(channelId: string, messageId: string): void {+ const existing = ChannelMessages.get(channelId);+ if (!existing?.get(messageId)?.referencedMessage) return;+ this.commitMessages(existing.update(messageId, (message) => message.withoutReferencedMessage()));+ this.notifyChange();+ }+handleMessageDeleteBulk(action: {ids: Array<string>; channelId: string}): boolean {const existing = ChannelMessages.get(action.channelId);if (!existing) return false;diff --git a/fluxer_app/src/features/messaging/utils/ReplaceCommandUtils.ts b/fluxer_app/src/features/messaging/utils/ReplaceCommandUtils.tsindex f82dcedf1..066aa8b39 100644--- a/fluxer_app/src/features/messaging/utils/ReplaceCommandUtils.ts+++ b/fluxer_app/src/features/messaging/utils/ReplaceCommandUtils.ts@@ -3,6 +3,7 @@import {escapeRegex} from '@app/features/messaging/utils/RegexUtils';const REPLACE_REGEX = /^s\/(.+?)\/(.*?)(?:\/(g)?)?$/;+const TRAILING_LINE_BREAKS_REGEX = /[\r\n]+$/;interface ReplaceCommand {source: string;@@ -11,7 +12,7 @@ interface ReplaceCommand {}export function parseReplaceCommand(content: string): ReplaceCommand | null {- const match = content.match(REPLACE_REGEX);+ const match = content.trimStart().replace(TRAILING_LINE_BREAKS_REGEX, '').match(REPLACE_REGEX);if (!match) {return null;}@@ -46,5 +47,5 @@ export function executeReplaceCommand(text: string, command: ReplaceCommand): st}export function isReplaceCommand(content: string): boolean {- return REPLACE_REGEX.test(content);+ return parseReplaceCommand(content) !== null;}diff --git a/fluxer_app/src/features/messaging/utils/markdown/TypedEmojiMatch.ts b/fluxer_app/src/features/messaging/utils/markdown/TypedEmojiMatch.tsindex b49cb3beb..d6b8e3abb 100644--- a/fluxer_app/src/features/messaging/utils/markdown/TypedEmojiMatch.ts+++ b/fluxer_app/src/features/messaging/utils/markdown/TypedEmojiMatch.ts@@ -10,14 +10,6 @@ export interface TypedEmojiMatch {name: string;}-const SHORTCODE_WORD_BOUNDARY_CHAR = /[\p{L}\p{N}_]/u;--function isTypedEmojiShortcodeBoundary(text: string, start: number, end: number): boolean {- const previous = start > 0 ? text.charAt(start - 1) : '';- const next = end < text.length ? text.charAt(end) : '';- return !SHORTCODE_WORD_BOUNDARY_CHAR.test(previous) && !SHORTCODE_WORD_BOUNDARY_CHAR.test(next);-}-export function isExistingCustomEmojiMarkdown(content: string, matchIndex: number): boolean {return content[matchIndex - 1] === '<' || (content[matchIndex - 2] === '<' && content[matchIndex - 1] === 'a');}@@ -33,7 +25,7 @@ export function findTypedEmojiShortcode(text: string, startIndex = 0): TypedEmojwhile (match != null) {const matchIndex = match.index;const matchEnd = matchIndex + match[0].length;- if (!isExistingCustomEmojiMarkdown(text, matchIndex) && isTypedEmojiShortcodeBoundary(text, matchIndex, matchEnd)) {+ if (!isExistingCustomEmojiMarkdown(text, matchIndex)) {if (urlSpans === null) {urlSpans = findUrlSpans(text);}diff --git a/fluxer_app/src/features/navigation/utils/DeepLinkUtils.ts b/fluxer_app/src/features/navigation/utils/DeepLinkUtils.tsindex 53ad96e34..15ec268c1 100644--- a/fluxer_app/src/features/navigation/utils/DeepLinkUtils.ts+++ b/fluxer_app/src/features/navigation/utils/DeepLinkUtils.ts@@ -297,23 +297,25 @@ export function parseChannelUrl(url: string): string | null {return null;}-export function parseUserProfileUrl(url: string): string | null {+function userProfilePath(url: string): string | null {+ if (isAppProtocolUrl(url)) return normalizeAppRoutePath(url)?.split(/[?#]/, 1)[0] ?? null;try {const parsed = new URL(url);- if (!isInternalChannelHost(parsed.host) || !parsed.pathname.startsWith('/users/')) {- return null;- }- const segments = parsed.pathname.split('/').filter(Boolean);- if (segments.length !== 2 || segments[0] !== 'users') {- return null;- }- const userId = segments[1];- return isProbablyAValidSnowflake(userId) ? userId : null;+ return isInternalChannelHost(parsed.host) ? parsed.pathname : null;} catch {return null;}}+export function parseUserProfileUrl(url: string): string | null {+ const path = userProfilePath(url);+ if (!path?.startsWith('/users/')) return null;+ const segments = path.split('/').filter(Boolean);+ if (segments.length !== 2) return null;+ const userId = segments[1];+ return isProbablyAValidSnowflake(userId) ? userId : null;+}+export function navigateToLinkedUserProfile(userId: string,{diff --git a/fluxer_app/src/features/notification/utils/SoundUtils.ts b/fluxer_app/src/features/notification/utils/SoundUtils.tsindex b02afc39a..36d369f7b 100644--- a/fluxer_app/src/features/notification/utils/SoundUtils.ts+++ b/fluxer_app/src/features/notification/utils/SoundUtils.ts@@ -87,7 +87,7 @@ const CALL_RELATED_SOUND_TYPES = new Set<SoundType>([SoundType.ScreenShareStart,SoundType.ScreenShareStop,]);-const shouldRouteSoundToCaptureBus = (type: SoundType): boolean => !CALL_RELATED_SOUND_TYPES.has(type);+const isCallRelatedSound = (type: SoundType): boolean => CALL_RELATED_SOUND_TYPES.has(type);interface AudioInstance {audio: HTMLAudioElement;@@ -108,6 +108,7 @@ const activeOneShotSounds: Set<OneShotAudioInstance> = new Set();const customSoundCache: Map<SoundType, string> = new Map();let audioContext: AudioContext | null = null;+let callAudioContext: AudioContext | null = null;let masterGainNode: GainNode | null = null;let soundOutputDeviceIdResolver: (() => string | null) | null = null;let lastAppliedContextSinkId: string | null = null;@@ -211,6 +212,12 @@ const getAudioContext = (): AudioContext => {}return audioContext;};+const getCallAudioContext = (): AudioContext => {+ if (!callAudioContext) {+ callAudioContext = new AudioContext();+ }+ return callAudioContext;+};const getMasterGainNode = (): GainNode => {const ctx = getAudioContext();if (!masterGainNode || masterGainNode.context.state === 'closed') {@@ -278,24 +285,30 @@ export function removeSoundCaptureDestination(node: AudioNode): void {} catch {}}-const resumeAudioContextIfNeeded = async (): Promise<AudioContext> => {- const ctx = getAudioContext();+const resumeIfSuspended = async (ctx: AudioContext): Promise<AudioContext> => {if (ctx.state === 'suspended') {try {await ctx.resume();} catch {}}+ return ctx;+};+const resumeCallAudioContextIfNeeded = async (): Promise<AudioContext> => {+ const ctx = await resumeIfSuspended(getCallAudioContext());applyOutputDeviceToSoundContext(ctx);return ctx;};+const resumeAudioContextForSound = (type: SoundType): Promise<AudioContext> =>+ isCallRelatedSound(type) ? resumeCallAudioContextIfNeeded() : resumeIfSuspended(getAudioContext());+const soundOutputNode = (type: SoundType, ctx: AudioContext): AudioNode =>+ isCallRelatedSound(type) ? ctx.destination : getMasterGainNode();export async function acquireOutputAudioContext(): Promise<AudioContext> {- return resumeAudioContextIfNeeded();+ return resumeCallAudioContextIfNeeded();}const fadeIn = (gainNode: GainNode, targetVolume: number, duration = DEFAULT_FADE_DURATION): void => {- const ctx = getAudioContext();- const now = ctx.currentTime;+ const now = gainNode.context.currentTime;targetVolume = clamp(targetVolume, 0, MAX_EFFECTIVE_VOLUME);gainNode.gain.cancelScheduledValues(now);gainNode.gain.setValueAtTime(MIN_GAIN, now);@@ -303,8 +316,7 @@ const fadeIn = (gainNode: GainNode, targetVolume: number, duration = DEFAULT_FAD};const fadeOut = (gainNode: GainNode, duration = DEFAULT_FADE_DURATION): Promise<void> => {return new Promise((resolve) => {- const ctx = getAudioContext();- const now = ctx.currentTime;+ const now = gainNode.context.currentTime;const currentVolume = gainNode.gain.value;if (currentVolume <= MIN_GAIN) {gainNode.gain.setValueAtTime(MIN_GAIN, now);@@ -361,25 +373,28 @@ const playOneShotSound = async (const effectiveVolume = clamp(volume, 0, MAX_EFFECTIVE_VOLUME);let sourceNode: MediaElementAudioSourceNode | undefined;let gainNode: GainNode | undefined;- const routeToCaptureBus = shouldRouteSoundToCaptureBus(type);+ const applyElementOutput = (): void => {+ audio.volume = effectiveVolume;+ if (isCallRelatedSound(type)) {+ applyOutputDeviceToAudioElement(audio);+ }+ };try {- const ctx = await resumeAudioContextIfNeeded();+ const ctx = await resumeAudioContextForSound(type);if (signal?.aborted) return null;if (ctx.state !== 'suspended') {sourceNode = ctx.createMediaElementSource(audio);gainNode = ctx.createGain();gainNode.gain.value = effectiveVolume;sourceNode.connect(gainNode);- gainNode.connect(routeToCaptureBus ? getMasterGainNode() : ctx.destination);+ gainNode.connect(soundOutputNode(type, ctx));audio.volume = 1;} else {- audio.volume = effectiveVolume;- applyOutputDeviceToAudioElement(audio);+ applyElementOutput();}} catch (error) {logger.debug('Falling back to direct element playback for one-shot sound', {type, error});- audio.volume = effectiveVolume;- applyOutputDeviceToAudioElement(audio);+ applyElementOutput();}let cleanedUp = false;let abortPlayback: (() => void) | null = null;@@ -449,7 +464,7 @@ export async function playSound(if (!loop) {return await playOneShotSound(type, volume, onAutoplayBlocked, signal);}- const ctx = await resumeAudioContextIfNeeded();+ const ctx = await resumeAudioContextForSound(type);if (ctx.state === 'suspended') {logger.debug('Audio context still suspended; skipping sound', {type});onAutoplayBlocked?.();@@ -462,7 +477,7 @@ export async function playSound(const sourceNode = ctx.createMediaElementSource(audio);const gainNode = ctx.createGain();sourceNode.connect(gainNode);- gainNode.connect(shouldRouteSoundToCaptureBus(type) ? getMasterGainNode() : ctx.destination);+ gainNode.connect(soundOutputNode(type, ctx));const effectiveVolume = clamp(volume, 0, MAX_EFFECTIVE_VOLUME);fadeIn(gainNode, effectiveVolume);const instance: AudioInstance = {diff --git a/fluxer_app/src/features/permissions/utils/PermissionUtils.ts b/fluxer_app/src/features/permissions/utils/PermissionUtils.tsindex a4ea95f7f..28cd8da53 100644--- a/fluxer_app/src/features/permissions/utils/PermissionUtils.ts+++ b/fluxer_app/src/features/permissions/utils/PermissionUtils.ts@@ -446,6 +446,7 @@ function generateForumPermissionSpec(i18n: I18n): PermissionSpec {description: ForumDescriptors.MANAGE_POSTS_PERMISSION_DESCRIPTION_DESCRIPTOR,}),makePermissionEntry(i18n, Permissions.MANAGE_MESSAGES, {scope: 'channel'}),+ makePermissionEntry(i18n, Permissions.PIN_MESSAGES, {scope: 'channel'}),makePermissionEntry(i18n, Permissions.EMBED_LINKS, {scope: 'channel'}),makePermissionEntry(i18n, Permissions.ATTACH_FILES, {scope: 'channel'}),makePermissionEntry(i18n, Permissions.READ_MESSAGE_HISTORY, {scope: 'channel'}),diff --git a/fluxer_app/src/features/platform/utils/DesktopTrayBridge.ts b/fluxer_app/src/features/platform/utils/DesktopTrayBridge.tsindex 2a32d3c15..5bf548515 100644--- a/fluxer_app/src/features/platform/utils/DesktopTrayBridge.ts+++ b/fluxer_app/src/features/platform/utils/DesktopTrayBridge.ts@@ -13,6 +13,7 @@ import StreamerMode from '@app/features/streamer_mode/state/StreamerMode';import * as ThemeSettingsCommands from '@app/features/theme_settings/commands/ThemeSettingsCommands';import ThemeSettingsState from '@app/features/theme_settings/state/ThemeSettingsState';import {getElectronAPI, isDesktop} from '@app/features/ui/utils/NativeUtils';+import StatusExpiry from '@app/features/user/state/StatusExpiry';import UserSettings from '@app/features/user/state/UserSettings';import MediaEngine from '@app/features/voice/engine/MediaEngineFacade';import {selectVoiceEngineV2AppConnectionWithFallback} from '@app/features/voice/engine/v2/VoiceEngineV2AppSelectors';@@ -105,7 +106,7 @@ export function initializeDesktopTrayBridge(): (() => void) | null {const disposeTrayAction = electronApi.onTrayAction((payload) => {switch (payload.action) {case 'set-status': {- void UserSettings.setStatus(payload.status);+ StatusExpiry.setActiveStatusExpiry({status: payload.status, durationMs: null});break;}case 'toggle-mute': {diff --git a/fluxer_app/src/features/platform/utils/InputFocusManager.ts b/fluxer_app/src/features/platform/utils/InputFocusManager.tsindex 7ae31d95e..7383a3ef8 100644--- a/fluxer_app/src/features/platform/utils/InputFocusManager.ts+++ b/fluxer_app/src/features/platform/utils/InputFocusManager.ts@@ -1,5 +1,6 @@// SPDX-License-Identifier: AGPL-3.0-or-later+import MediaViewer from '@app/features/ui/state/MediaViewer';import MobileLayout from '@app/features/ui/state/MobileLayout';import Modal from '@app/features/ui/state/Modal';import Popout from '@app/features/ui/state/Popout';@@ -56,7 +57,7 @@ class InputFocusManager {const hasPopoutsOpen = (Popout?.getPopouts?.() ?? []).length > 0;const isMobileLayout = !!MobileLayout?.enabled;const inputFocused = this.isInputFocused(textareaElement);- return !(isMobileLayout || hasModalOpen || hasPopoutsOpen || inputFocused);+ return !(isMobileLayout || hasModalOpen || MediaViewer.isOpen || hasPopoutsOpen || inputFocused);}safeFocus(element: FocusableElementType, force: boolean = false): boolean {diff --git a/fluxer_app/src/features/read_state/state/ReadStates.ts b/fluxer_app/src/features/read_state/state/ReadStates.tsindex 2ab482e1c..f55cbd242 100644--- a/fluxer_app/src/features/read_state/state/ReadStates.ts+++ b/fluxer_app/src/features/read_state/state/ReadStates.ts@@ -334,6 +334,19 @@ class ReadStates {return state?.supportsUnreadTracking() ? state.oldestUnreadMessageId : null;}+ getOldestUnreadJumpTargetId(channelId: string): string | null {+ const state = this.getIfExists(channelId);+ if (!state?.supportsUnreadTracking() || !state.hasUnread()) return null;+ const ackMessageId = state.ackMessageId;+ if (ackMessageId == null) return state.oldestUnreadMessageId;+ const messages = Messages.getMessages(channelId);+ let boundaryLoaded = !messages.hasMoreBefore;+ messages.forEachBuffered((message) => {+ if (!isNewerMessageId(message.id, ackMessageId)) boundaryLoaded = true;+ });+ return boundaryLoaded ? (state.oldestUnreadMessageId ?? ackMessageId) : ackMessageId;+ }+getVisualUnreadMessageId(channelId: string): string | null {const state = this.getIfExists(channelId);return state?.supportsUnreadTracking() ? state.visualUnreadMessageId : null;diff --git a/fluxer_app/src/features/search/utils/SearchQueryParser.ts b/fluxer_app/src/features/search/utils/SearchQueryParser.tsindex 1fba0dbc7..27daf3b6a 100644--- a/fluxer_app/src/features/search/utils/SearchQueryParser.ts+++ b/fluxer_app/src/features/search/utils/SearchQueryParser.ts@@ -1,10 +1,14 @@// SPDX-License-Identifier: AGPL-3.0-or-laterimport RuntimeConfig from '@app/features/app/state/RuntimeConfig';+import type {Channel} from '@app/features/channel/models/Channel';import Channels from '@app/features/channel/state/Channels';import {fuzzySearch} from '@app/features/search/utils/SearchTextMatching';import type {MessageSearchParams} from '@app/features/search/utils/SearchUtils';+import ChannelThreads from '@app/features/threads/state/ChannelThreads';import Users from '@app/features/user/state/Users';+import {GUILD_TEXT_BASED_CHANNEL_TYPES} from '@fluxer/constants/src/ChannelConstants';+import {THREAD_ONLY_CHANNEL_TYPES} from '@fluxer/constants/src/ThreadConstants';import {MS_PER_DAY, MS_PER_HOUR, MS_PER_MINUTE, MS_PER_SECOND} from '@fluxer/date_utils/src/DateConstants';import {fromTimestamp, isProbablyAValidSnowflake} from '@fluxer/snowflake/src/SnowflakeUtils';import {DateTime} from 'luxon';@@ -367,6 +371,13 @@ export function resolveSearchChannelDisplayName(channel: {return channel.name?.trim() ?? '';}+export function getSearchableGuildChannels(guildId: string): Array<Channel> {+ const channels = Channels.getGuildChannels(guildId).filter(+ (channel) => GUILD_TEXT_BASED_CHANNEL_TYPES.has(channel.type) || THREAD_ONLY_CHANNEL_TYPES.has(channel.type),+ );+ return [...channels, ...ChannelThreads.getGuildThreads(guildId)];+}+const tryResolveChannel = (name: string, guildId?: string | null, hints?: SearchHints): string | null => {if (hints?.channelsByName?.[name]) return hints.channelsByName[name];const target = name.toLowerCase();@@ -377,7 +388,7 @@ const tryResolveChannel = (name: string, guildId?: string | null, hints?: Searchconst partial = privateChannels.find((c) => resolveSearchChannelDisplayName(c).toLowerCase().includes(target));return partial?.id ?? null;}- const channels = Channels.getGuildChannels(guildId);+ const channels = getSearchableGuildChannels(guildId);const matches = channels.filter((c) => (c.name || '').toLowerCase() === target);if (matches.length > 0) return matches[0].id;const partial = channels.find((c) => (c.name || '').toLowerCase().includes(target));diff --git a/fluxer_app/src/features/threads/commands/ThreadCommands.ts b/fluxer_app/src/features/threads/commands/ThreadCommands.tsindex 4ce22a2b7..43bb91110 100644--- a/fluxer_app/src/features/threads/commands/ThreadCommands.ts+++ b/fluxer_app/src/features/threads/commands/ThreadCommands.ts@@ -186,7 +186,17 @@ export async function loadThreadsForMessages(if (nonThreadChannelIds.has(message.channel_id)) continue;pending.add(message.channel_id);}- await Promise.all(Array.from(pending, loadUnknownThread));+ await Promise.all(Array.from(pending, loadUnknownThreadOnce));+}++const unknownThreadLookups = new Map<string, Promise<void>>();++function loadUnknownThreadOnce(channelId: string): Promise<void> {+ const existing = unknownThreadLookups.get(channelId);+ if (existing) return existing;+ const lookup = loadUnknownThread(channelId).finally(() => unknownThreadLookups.delete(channelId));+ unknownThreadLookups.set(channelId, lookup);+ return lookup;}async function loadUnknownThread(channelId: string): Promise<void> {diff --git a/fluxer_app/src/features/threads/components/SidebarThreadList.tsx b/fluxer_app/src/features/threads/components/SidebarThreadList.tsxindex 94ac05ad3..72b619d1f 100644--- a/fluxer_app/src/features/threads/components/SidebarThreadList.tsx+++ b/fluxer_app/src/features/threads/components/SidebarThreadList.tsx@@ -13,7 +13,7 @@ import {ThreadContextMenu} from '@app/features/threads/components/ThreadContextMimport {useThreadMenuData} from '@app/features/threads/hooks/useThreadMenuData';import ChannelThreads from '@app/features/threads/state/ChannelThreads';import ThreadGuilds from '@app/features/threads/state/ThreadGuilds';-import ThreadMemberships from '@app/features/threads/state/ThreadMemberships';+import {hasSidebarThreadActivity, isSidebarThreadUnread} from '@app/features/threads/utils/SidebarThreadActivity';import {isThreadMutedInSidebar} from '@app/features/threads/utils/ThreadNotificationUtils';import * as ContextMenuCommands from '@app/features/ui/commands/ContextMenuCommands';import {MentionBadge} from '@app/features/ui/components/MentionBadge';@@ -45,10 +45,9 @@ const ThreadMenuSheet = observer(({thread, onClose}: {thread: Channel; onClose:const SidebarThreadRow = observer(({thread, isLast, isSelected}: SidebarThreadRowProps) => {const [menuOpen, setMenuOpen] = useState(false);- const joined = ThreadMemberships.isMember(thread.id);const muted = isThreadMutedInSidebar(thread);const mentionCount = ReadStates.getMentionCount(thread.id);- const isUnread = joined && !muted && ReadStates.hasUnread(thread.id);+ const isUnread = isSidebarThreadUnread(thread);const handleClick = useCallback(() => openThreadFullView(thread), [thread]);const handleContextMenu = useCallback((event: React.MouseEvent) => {@@ -130,16 +129,18 @@ const SidebarThreadRow = observer(({thread, isLast, isSelected}: SidebarThreadRointerface SidebarThreadListProps {guildId: string;parentId: string;- onlySelected?: boolean;+ collapsed?: boolean;}-export const SidebarThreadList = observer(({guildId, parentId, onlySelected = false}: SidebarThreadListProps) => {+export const SidebarThreadList = observer(({guildId, parentId, collapsed = false}: SidebarThreadListProps) => {if (!ThreadGuilds.isActive(guildId)) return null;const selectedThreadId =Navigation.threadId ??(Navigation.channelId && ChannelThreads.hasThread(Navigation.channelId) ? Navigation.channelId : null);const sidebarThreads = ChannelThreads.getSidebarThreads(parentId, selectedThreadId);- const threads = onlySelected ? sidebarThreads.filter((thread) => thread.id === selectedThreadId) : sidebarThreads;+ const threads = collapsed+ ? sidebarThreads.filter((thread) => thread.id === selectedThreadId || hasSidebarThreadActivity(thread))+ : sidebarThreads;if (threads.length === 0) return null;return (<div className={styles.threadList} role="group" data-flx="threads.sidebar-thread-list.thread-list">diff --git a/fluxer_app/src/features/threads/components/ThreadCreatePane.module.css b/fluxer_app/src/features/threads/components/ThreadCreatePane.module.cssindex 1a5452435..fc6907fd5 100644--- a/fluxer_app/src/features/threads/components/ThreadCreatePane.module.css+++ b/fluxer_app/src/features/threads/components/ThreadCreatePane.module.css@@ -14,11 +14,18 @@overflow-y: auto;display: flex;flex-direction: column;- justify-content: flex-end;gap: 1rem;padding: 1rem;}+.body > * {+ flex-shrink: 0;+}++.body > :first-child {+ margin-top: auto;+}+.icon {display: flex;align-items: center;diff --git a/fluxer_app/src/features/threads/state/ThreadRoster.ts b/fluxer_app/src/features/threads/state/ThreadRoster.tsindex 9a414c1a0..081f9d5fe 100644--- a/fluxer_app/src/features/threads/state/ThreadRoster.ts+++ b/fluxer_app/src/features/threads/state/ThreadRoster.ts@@ -73,12 +73,16 @@ class ThreadRoster {if (!entry) return;if (entry.count <= 1) {this.subscriptionCounts.delete(threadId);- this.rosters.delete(threadId);+ queueMicrotask(() => this.dropUnsubscribedRoster(threadId));return;}this.subscriptionCounts.set(threadId, {...entry, count: entry.count - 1});}+ private dropUnsubscribedRoster(threadId: string): void {+ if (!this.subscriptionCounts.has(threadId)) this.rosters.delete(threadId);+ }+handleListUpdate(payload: ThreadMemberListPayload): void {if (!this.subscriptionCounts.has(payload.thread_id)) return;const members: Array<ThreadRosterMember> = [];diff --git a/fluxer_app/src/features/threads/utils/SidebarThreadActivity.ts b/fluxer_app/src/features/threads/utils/SidebarThreadActivity.tsnew file mode 100644index 000000000..fb1c35df6--- /dev/null+++ b/fluxer_app/src/features/threads/utils/SidebarThreadActivity.ts@@ -0,0 +1,29 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++import type {Channel} from '@app/features/channel/models/Channel';+import ReadStates from '@app/features/read_state/state/ReadStates';+import ChannelThreads from '@app/features/threads/state/ChannelThreads';+import ThreadMemberships from '@app/features/threads/state/ThreadMemberships';+import {isThreadMutedInSidebar} from '@app/features/threads/utils/ThreadNotificationUtils';++export interface SidebarThreadActivity {+ readonly hasActivity: boolean;+ readonly hasMentions: boolean;+}++export function isSidebarThreadUnread(thread: Channel): boolean {+ return ThreadMemberships.isMember(thread.id) && !isThreadMutedInSidebar(thread) && ReadStates.hasUnread(thread.id);+}++export function hasSidebarThreadActivity(thread: Channel): boolean {+ return ReadStates.getMentionCount(thread.id) > 0 || isSidebarThreadUnread(thread);+}++export function getSidebarThreadActivity(parentId: string): SidebarThreadActivity {+ let hasActivity = false;+ for (const thread of ChannelThreads.getSidebarThreads(parentId, null)) {+ if (ReadStates.getMentionCount(thread.id) > 0) return {hasActivity: true, hasMentions: true};+ if (isSidebarThreadUnread(thread)) hasActivity = true;+ }+ return {hasActivity, hasMentions: false};+}diff --git a/fluxer_app/src/features/ui/action_menu/MenuItemSlider.tsx b/fluxer_app/src/features/ui/action_menu/MenuItemSlider.tsxindex 0dd902292..b823d1b74 100644--- a/fluxer_app/src/features/ui/action_menu/MenuItemSlider.tsx+++ b/fluxer_app/src/features/ui/action_menu/MenuItemSlider.tsx@@ -6,7 +6,7 @@ import {formatRoundedPercentage} from '@app/features/ui/utils/PercentageFormattiimport {ContextMenu as BaseContextMenu} from '@base-ui/react/context-menu';import {useLingui} from '@lingui/react/macro';import {clsx} from 'clsx';-import React, {useCallback, useEffect, useState} from 'react';+import React, {useCallback, useEffect, useRef, useState} from 'react';interface MenuItemSliderProps {label: string;@@ -23,12 +23,15 @@ export const MenuItemSlider = React.forwardRef<HTMLDivElement, MenuItemSliderPro({label, value, minValue = 0, maxValue = 100, disabled = false, onChange, onFormat, step = 1}, forwardedRef) => {const {i18n} = useLingui();const [localValue, setLocalValue] = useState(value);+ const localValueRef = useRef(value);+ localValueRef.current = localValue;useEffect(() => {setLocalValue(value);}, [value]);const formattedValue = onFormat ? onFormat(localValue) : formatRoundedPercentage(i18n.locale, localValue);const handleValueChange = useCallback((newValue: number) => {+ localValueRef.current = newValue;setLocalValue(newValue);onChange?.(newValue);},@@ -43,6 +46,39 @@ export const MenuItemSlider = React.forwardRef<HTMLDivElement, MenuItemSliderProconst stopPropagation = useCallback((e: React.SyntheticEvent) => {e.stopPropagation();}, []);+ const handleKeyDown = useCallback(+ (event: React.KeyboardEvent<HTMLDivElement>) => {+ if (disabled) return;+ const current = localValueRef.current;+ let next: number;+ switch (event.key) {+ case 'ArrowRight':+ next = current + step;+ break;+ case 'ArrowLeft':+ next = current - step;+ break;+ case 'PageUp':+ next = current + step * 10;+ break;+ case 'PageDown':+ next = current - step * 10;+ break;+ case 'Home':+ next = minValue;+ break;+ case 'End':+ next = maxValue;+ break;+ default:+ return;+ }+ event.preventDefault();+ event.stopPropagation();+ handleValueChange(Math.min(maxValue, Math.max(minValue, next)));+ },+ [disabled, step, minValue, maxValue, handleValueChange],+ );return (<BaseContextMenu.Itemref={forwardedRef}@@ -52,6 +88,14 @@ export const MenuItemSlider = React.forwardRef<HTMLDivElement, MenuItemSliderProdisabled={disabled}closeOnClick={false}label={label}+ role="slider"+ aria-label={label}+ aria-valuemin={minValue}+ aria-valuemax={maxValue}+ aria-valuenow={localValue}+ aria-valuetext={formattedValue}+ aria-orientation="horizontal"+ onKeyDown={handleKeyDown}data-flx="ui.action-menu.menu-item-slider.slider-item">{/* biome-ignore lint/a11y/noStaticElementInteractions: presentational wrapper that only stops propagation of focus-stealing events. */}diff --git a/fluxer_app/src/features/ui/action_menu/items/ChannelMenuData.tsx b/fluxer_app/src/features/ui/action_menu/items/ChannelMenuData.tsxindex 9493007a0..3541b14a4 100644--- a/fluxer_app/src/features/ui/action_menu/items/ChannelMenuData.tsx+++ b/fluxer_app/src/features/ui/action_menu/items/ChannelMenuData.tsx@@ -476,7 +476,7 @@ export function useChannelMenuData(menuGroups.push({items: metaItems});}const inviteItems: Array<MenuItemType> = [];- if (state.canInvite && !channel.isThreadOnly()) {+ if (state.canInvite) {inviteItems.push({icon: <InviteIcon size={20} data-flx="ui.action-menu.items.channel-menu-data.groups.invite-icon" />,label: i18n._(INVITE_PEOPLE_DESCRIPTOR),diff --git a/fluxer_app/src/features/ui/components/InlineEdit.tsx b/fluxer_app/src/features/ui/components/InlineEdit.tsxindex be6712630..219fd1e32 100644--- a/fluxer_app/src/features/ui/components/InlineEdit.tsx+++ b/fluxer_app/src/features/ui/components/InlineEdit.tsx@@ -15,7 +15,7 @@ interface InlineEditProps {suffix?: string;placeholder?: string;maxLength?: number;- validate?: (value: string) => boolean;+ getValidationError?: (value: string) => string | null;className?: string;inputClassName?: string;buttonClassName?: string;@@ -41,7 +41,7 @@ export const InlineEdit: React.FC<InlineEditProps> = observer((props) => {prefix = '',suffix = '',maxLength,- validate,+ getValidationError,allowEmpty = false,} = props;const [mode, setMode] = useState<Mode>('idle');@@ -62,9 +62,9 @@ export const InlineEdit: React.FC<InlineEditProps> = observer((props) => {const canSave = (raw: string): boolean => {const trimmed = raw.trim();if (trimmed === value.trim()) return true;- if (!trimmed.length) return !!allowEmpty;- if (validate && !validate(trimmed)) return false;- return true;+ if (!trimmed.length && allowEmpty) return true;+ if (getValidationError?.(trimmed) != null) return false;+ return trimmed.length > 0;};const startEdit = () => {setError(null);@@ -96,7 +96,7 @@ export const InlineEdit: React.FC<InlineEditProps> = observer((props) => {const doSave = async () => {const next = draft.trim();if (!canSave(next)) {- setError('VALIDATION_FAILED');+ setError(getValidationError?.(next) ?? null);return;}if (next === value.trim()) {@@ -107,11 +107,8 @@ export const InlineEdit: React.FC<InlineEditProps> = observer((props) => {setError(null);try {await Promise.resolve(onSave(next));- setMode('idle');- } catch (e: unknown) {- setError(e instanceof Error ? e.message : 'SAVE_FAILED');- setMode('editing');- }+ } catch {}+ setMode('idle');};const handleEditableInput: React.InputEventHandler<HTMLDivElement> = (e) => {const el = e.currentTarget;@@ -196,11 +193,6 @@ export const InlineEdit: React.FC<InlineEditProps> = observer((props) => {</span></button></FocusRing>- {error && (- <span className={styles.error} data-flx="ui.inline-edit.error">- {error}- </span>- )}</div>);}@@ -215,7 +207,7 @@ export const InlineEdit: React.FC<InlineEditProps> = observer((props) => {<divref={editableRef}className={clsx(styles.inlineTextBase, styles.text, styles.editable, inputClassName)}- contentEditable+ contentEditable="plaintext-only"suppressContentEditableWarningonInput={handleEditableInput}onKeyDown={handleEditableKeyDown}diff --git a/fluxer_app/src/features/ui/components/Scroller.tsx b/fluxer_app/src/features/ui/components/Scroller.tsxindex 2bca2365d..0b7812cba 100644--- a/fluxer_app/src/features/ui/components/Scroller.tsx+++ b/fluxer_app/src/features/ui/components/Scroller.tsx@@ -127,10 +127,14 @@ function getTrackWheelDelta(viewportSize: number,): number {const raw = orientation === 'vertical' ? event.deltaY : event.deltaX || event.deltaY;- if (event.deltaMode === WheelEvent.DOM_DELTA_LINE) {+ return wheelDeltaInPixels(raw, event.deltaMode, viewportSize);+}++function wheelDeltaInPixels(raw: number, deltaMode: number, viewportSize: number): number {+ if (deltaMode === WheelEvent.DOM_DELTA_LINE) {return raw * LINE_DELTA_PX;}- if (event.deltaMode === WheelEvent.DOM_DELTA_PAGE) {+ if (deltaMode === WheelEvent.DOM_DELTA_PAGE) {return raw * viewportSize;}return raw;@@ -637,6 +641,27 @@ export const Scroller = forwardRef<ScrollerHandle, ScrollerProps>(function Scrol},[cancelProgrammaticScrollForUserIntent, onWheel],);+ useEffect(() => {+ const scrollElement = scrollRef.current;+ if (orientation !== 'horizontal' || scrollElement == null) {+ return undefined;+ }+ const handleVerticalWheel = (event: WheelEvent) => {+ if (event.ctrlKey || event.shiftKey || Math.abs(event.deltaY) <= Math.abs(event.deltaX)) {+ return;+ }+ const maxScrollLeft = scrollElement.scrollWidth - scrollElement.clientWidth;+ const delta = wheelDeltaInPixels(event.deltaY, event.deltaMode, scrollElement.clientWidth);+ const nextScrollLeft = Math.min(maxScrollLeft, Math.max(0, scrollElement.scrollLeft + delta));+ if (maxScrollLeft <= 0 || nextScrollLeft === scrollElement.scrollLeft) {+ return;+ }+ event.preventDefault();+ scrollElement.scrollLeft = nextScrollLeft;+ };+ scrollElement.addEventListener('wheel', handleVerticalWheel, {passive: false});+ return () => scrollElement.removeEventListener('wheel', handleVerticalWheel);+ }, [orientation]);const handleScrollerTouchStart = useCallback((event: ReactTouchEvent<HTMLDivElement>) => {cancelProgrammaticScrollForUserIntent();diff --git a/fluxer_app/src/features/ui/components/form/FormCombobox.tsx b/fluxer_app/src/features/ui/components/form/FormCombobox.tsxindex 64332bd6f..06f168ca4 100644--- a/fluxer_app/src/features/ui/components/form/FormCombobox.tsx+++ b/fluxer_app/src/features/ui/components/form/FormCombobox.tsx@@ -5,6 +5,7 @@ import styles from '@app/features/ui/components/form/FormCombobox.module.css';import {Scroller} from '@app/features/ui/components/Scroller';import FocusRing from '@app/features/ui/focus_ring/FocusRing';import {usePortalHost} from '@app/features/ui/overlay/PortalHostContext';+import LayerManager from '@app/features/ui/state/LayerManager';import {Combobox as BaseCombobox} from '@base-ui/react/combobox';import {msg} from '@lingui/core/macro';import {useLingui} from '@lingui/react/macro';@@ -12,7 +13,7 @@ import {CaretDownIcon, CheckIcon, CircleNotchIcon, XIcon} from '@phosphor-icons/import {clsx} from 'clsx';import {observer} from 'mobx-react-lite';import type React from 'react';-import {useCallback, useId, useMemo, useRef, useState} from 'react';+import {useCallback, useEffect, useId, useMemo, useRef, useState} from 'react';type Primitive = string | number | null;export interface ComboboxOption<V extends Primitive = string> {@@ -173,6 +174,20 @@ export const Combobox = observer(function Combobox<const controlRef = useRef<HTMLDivElement | null>(null);const [open, setOpen] = useState(false);const [isTyping, setIsTyping] = useState(false);+ useEffect(() => {+ if (!open) return;+ const layerKey = `form-combobox-${inputId}`;+ LayerManager.addLayer(+ 'popout',+ layerKey,+ () => {+ setIsTyping(false);+ setOpen(false);+ },+ inputRef.current?.ownerDocument ?? document,+ );+ return () => LayerManager.removeLayer('popout', layerKey);+ }, [open, inputId]);const selectedOptions = useMemo(() => {return options.find((option) => Object.is(option.value, value as V)) ?? null;}, [options, value]);diff --git a/fluxer_app/src/features/user/components/modals/tabs/my_profile_tab/AvatarUploader.tsx b/fluxer_app/src/features/user/components/modals/tabs/my_profile_tab/AvatarUploader.tsxindex a9392b91c..6609fc790 100644--- a/fluxer_app/src/features/user/components/modals/tabs/my_profile_tab/AvatarUploader.tsx+++ b/fluxer_app/src/features/user/components/modals/tabs/my_profile_tab/AvatarUploader.tsx@@ -24,7 +24,11 @@ import {formatImageUploadRecommendedHintWithNote,} from '@app/features/expressions/utils/AssetUploadHintCopy';import {downloadGifAsImageFile} from '@app/features/expressions/utils/GifFileDownload';-import {isSvgFile, readImageFileAsUploadDataUrl} from '@app/features/expressions/utils/ImageUploadFileUtils';+import {+ isAssetUploadFileAllowed,+ isSvgFile,+ readImageFileAsUploadDataUrl,+} from '@app/features/expressions/utils/ImageUploadFileUtils';import {CANCEL_DESCRIPTOR,FAILED_TO_PROCESS_CROPPED_IMAGE_DESCRIPTOR,@@ -145,7 +149,8 @@ export function useChangeAvatarAction({return;}const svg = isSvgFile(file);- if (!svg && !(await canCropFile(file))) {+ const croppable = svg || (await canCropFile(file));+ if (!croppable && !isAssetUploadFileAllowed('avatar', file)) {showGenericErrorModal({title: i18n._(COULDN_T_UPLOAD_AVATAR_DESCRIPTOR),message: getAssetFormatErrorMessage(i18n, 'avatar', 'unsupported_mime'),@@ -222,6 +227,10 @@ export function useChangeAvatarAction({return;}const base64 = svg ? await readImageFileAsUploadDataUrl(file) : await readBlobAsDataUrl(file);+ if (!croppable) {+ onAvatarChange(base64);+ return;+ }ModalCommands.push(modal(() => (<AssetCropModaldiff --git a/fluxer_app/src/features/user/state/UserSettings.ts b/fluxer_app/src/features/user/state/UserSettings.tsindex 2184c71cf..938d7bae2 100644--- a/fluxer_app/src/features/user/state/UserSettings.ts+++ b/fluxer_app/src/features/user/state/UserSettings.ts@@ -664,11 +664,6 @@ class UserSettingsState {}}- setStatus(status: StatusType): void {- this.status = status;- LocalPresence.updatePresence();- }-handleGatewayReady(userSettings: unknown): void {this.updateUserSettings(userSettings);}diff --git a/fluxer_app/src/features/voice/components/popout/usePoppedOutTransition.ts b/fluxer_app/src/features/voice/components/popout/usePoppedOutTransition.tsindex f8cdd1816..f1edfbc85 100644--- a/fluxer_app/src/features/voice/components/popout/usePoppedOutTransition.ts+++ b/fluxer_app/src/features/voice/components/popout/usePoppedOutTransition.ts@@ -1,5 +1,6 @@// SPDX-License-Identifier: AGPL-3.0-or-later+import Accessibility from '@app/features/accessibility/state/Accessibility';import {createPoppedOutSurfaceSnapshot,isPoppedOutSurfaceTransitioning,@@ -24,7 +25,8 @@ export function usePoppedOutTransition(isPoppedOut: boolean): PoppedOutTransitio}, []);useEffect(() => {if (!isPoppedOutSurfaceTransitioning(snapshot)) return;- const timeout = window.setTimeout(handleTransitionEnd, POPPED_OUT_TRANSITION_FALLBACK_MS);+ const delay = Accessibility.useReducedMotion ? 0 : POPPED_OUT_TRANSITION_FALLBACK_MS;+ const timeout = window.setTimeout(handleTransitionEnd, delay);return () => window.clearTimeout(timeout);}, [snapshot, handleTransitionEnd]);return {snapshot, handleTransitionEnd};diff --git a/fluxer_app/src/features/voice/engine/VoiceSpeakingDetection.ts b/fluxer_app/src/features/voice/engine/VoiceSpeakingDetection.tsindex 3cc77ea7d..b40635ce8 100644--- a/fluxer_app/src/features/voice/engine/VoiceSpeakingDetection.ts+++ b/fluxer_app/src/features/voice/engine/VoiceSpeakingDetection.ts@@ -40,6 +40,11 @@ export function createSpeakingSamples(): Float32Array<ArrayBuffer> {return new Float32Array(new ArrayBuffer(SPEAKING_ANALYSER_FFT_SIZE * Float32Array.BYTES_PER_ELEMENT));}+export interface LocalTransmitGate {+ suppressed: boolean;+ open: boolean | null;+}+interface SpeakingMeterTap {context: BaseAudioContext;source: MediaStreamAudioSourceNode;@@ -56,6 +61,7 @@ export class VoiceSpeakingMeter {constructor(private readonly readTrack: () => MediaStreamTrack | null,private readonly onChange: () => void,+ private readonly readGate: () => LocalTransmitGate,) {this.timer = setInterval(() => this.tick(performance.now()), SPEAKING_ANALYSER_INTERVAL_MS);}@@ -66,6 +72,15 @@ export class VoiceSpeakingMeter {tick(nowMs: number): void {const tap = this.syncTap();+ const gate = this.readGate();+ if (gate.suppressed) {+ this.update(SILENT_SPEAKING_HYSTERESIS);+ return;+ }+ if (gate.open !== null) {+ this.update({...SILENT_SPEAKING_HYSTERESIS, speaking: gate.open});+ return;+ }if (!tap) {this.update(SILENT_SPEAKING_HYSTERESIS);return;diff --git a/fluxer_app/src/features/voice/engine/v2/VoiceEngineV2AppMediaExecutionAdapter.tsx b/fluxer_app/src/features/voice/engine/v2/VoiceEngineV2AppMediaExecutionAdapter.tsxindex 2f4fa05fc..42bb8961c 100644--- a/fluxer_app/src/features/voice/engine/v2/VoiceEngineV2AppMediaExecutionAdapter.tsx+++ b/fluxer_app/src/features/voice/engine/v2/VoiceEngineV2AppMediaExecutionAdapter.tsx@@ -1735,6 +1735,10 @@ class VoiceEngineV2AppMediaExecutionAdapter extends Store {this.syncLocalSpeaking(room);if (meter.speaking) noteLocalVoiceActivity(room.localParticipant, {force: true, speaking: true});},+ () => ({+ suppressed: this.shouldSuppressLocalSpeaking(room),+ open: isPushToTalkActiveFromAppState() ? true : (readVoiceInputProcessor(track)?.readGateOpen() ?? null),+ }),);const reportRuntime = (): void => {const processor = readVoiceInputProcessor(track);diff --git a/fluxer_app/src/features/voice/state/ActiveScreenShareSource.ts b/fluxer_app/src/features/voice/state/ActiveScreenShareSource.tsindex 815ead789..45346580e 100644--- a/fluxer_app/src/features/voice/state/ActiveScreenShareSource.ts+++ b/fluxer_app/src/features/voice/state/ActiveScreenShareSource.ts@@ -10,6 +10,7 @@ import {makeAutoObservable} from 'mobx';interface ActiveScreenShareSourceOptions {readonly isOwnWindow?: boolean;+ readonly portalSurface?: 'window' | 'monitor';}export type PublishedScreenShareSource = 'web' | 'wayland' | 'device' | 'app' | 'display';@@ -17,6 +18,7 @@ export type PublishedScreenShareSource = 'web' | 'wayland' | 'device' | 'app' |class ActiveScreenShareSource {sourceId: string | null = null;ownWindow = false;+ portalWindowShare = false;publishedSource: PublishedScreenShareSource | null = null;windowAudioScope: WindowShareAudioScope = 'window';pendingWindowAudioScope: WindowShareAudioScope | null = null;@@ -39,6 +41,7 @@ class ActiveScreenShareSource {this.publishedSource = publishedSource;this.sourceId = sourceId;this.ownWindow = sourceId !== null && options.isOwnWindow === true;+ this.portalWindowShare = publishedSource === 'wayland' && options.portalSurface === 'window';}getSourceId(): string | null {@@ -118,7 +121,7 @@ class ActiveScreenShareSource {}getShareContext(): StreamSettingsShareContext | null {- if (this.publishedSource === 'app') return 'app';+ if (this.publishedSource === 'app' || this.portalWindowShare) return 'app';if (this.publishedSource === 'device') return 'device';if (this.publishedSource === null) return null;return 'display';@@ -127,6 +130,7 @@ class ActiveScreenShareSource {clear(): void {this.sourceId = null;this.ownWindow = false;+ this.portalWindowShare = false;this.publishedSource = null;this.windowAudioScope = 'window';this.pendingWindowAudioScope = null;diff --git a/fluxer_app/src/features/voice/state/ScreenSharePiPController.ts b/fluxer_app/src/features/voice/state/ScreenSharePiPController.tsindex 5d3e8d040..d0367f820 100644--- a/fluxer_app/src/features/voice/state/ScreenSharePiPController.ts+++ b/fluxer_app/src/features/voice/state/ScreenSharePiPController.ts@@ -64,8 +64,7 @@ function pickLiveKitScreenShare(channelId: string,guildId: string | null,): ScreenSharePiPScreenShare | null {- const participants = [room.localParticipant, ...Array.from(room.remoteParticipants.values())];- for (const participant of participants) {+ for (const participant of room.remoteParticipants.values()) {for (const publication of participant.trackPublications.values()) {if (publication.source !== Track.Source.ScreenShare) continue;if (publication.isMuted) continue;@@ -97,6 +96,7 @@ function pickRemoteScreenShareFromSnapshots(if (!snapshot.isScreenShareEnabled) continue;const parsed = parseVoiceParticipantIdentity(snapshot.identity);if (!parsed.userId || !parsed.connectionId) continue;+ if (parsed.connectionId === MediaEngine.connectionId) continue;const voiceState = connectionVoiceStates[parsed.connectionId];if (voiceState && voiceState.channel_id !== channelId) continue;if (!isWatchedScreenShare(guildId, channelId, parsed.connectionId)) continue;@@ -129,18 +129,10 @@ function pickLocalSelfShare(channelId: string): ScreenSharePiPScreenShare | null);}-function detectActiveScreenShare(channelId: string | null, guildId: string | null): ScreenSharePiPScreenShare | null {- if (!channelId) return null;- const local = pickLocalSelfShare(channelId);- if (local) return local;+function pickRemoteScreenShare(channelId: string, guildId: string | null): ScreenSharePiPScreenShare | null {const room = MediaEngine.room;- if (room) {- const fromRoom = pickLiveKitScreenShare(room, channelId, guildId);- if (fromRoom) return fromRoom;- }- const fromSnapshots = pickRemoteScreenShareFromSnapshots(channelId, guildId);- if (fromSnapshots) return fromSnapshots;- return null;+ const fromRoom = room ? pickLiveKitScreenShare(room, channelId, guildId) : null;+ return fromRoom ?? pickRemoteScreenShareFromSnapshots(channelId, guildId);}function pickWatchedScreenShareFromOpenPiP(@@ -167,7 +159,12 @@ function detectScreenSharePiPContent(channelId: string | null,guildId: string | null,): ScreenSharePiPScreenShare | null {- return detectActiveScreenShare(channelId, guildId) ?? pickWatchedScreenShareFromOpenPiP(channelId, guildId);+ if (!channelId) return null;+ return (+ pickWatchedScreenShareFromOpenPiP(channelId, guildId) ??+ pickRemoteScreenShare(channelId, guildId) ??+ pickLocalSelfShare(channelId)+ );}function getClosedReason(conditions: ScreenSharePiPConditions): string | null {diff --git a/fluxer_app/src/features/voice/state/StreamAudioPrefs.ts b/fluxer_app/src/features/voice/state/StreamAudioPrefs.tsindex 8260daac5..6cb462487 100644--- a/fluxer_app/src/features/voice/state/StreamAudioPrefs.ts+++ b/fluxer_app/src/features/voice/state/StreamAudioPrefs.ts@@ -79,7 +79,8 @@ class StreamAudioPrefs {setVolume(streamKey: string, volume: number): void {const clamped = clampVoiceVolumePercent(volume);const existing = this.entries[streamKey];- if (existing && existing.volume === clamped) {+ const muted = (existing?.muted ?? false) && clamped === 0;+ if (existing && existing.volume === clamped && existing.muted === muted) {this.touchStream(streamKey);return;}@@ -87,14 +88,14 @@ class StreamAudioPrefs {...this.entries,[streamKey]: {volume: clamped,- muted: existing?.muted ?? false,+ muted,lastAccessed: Date.now(),},};this.audioPrefsRevision += 1;this.startPruneInterval();this.notifyListeners();- logger.debug('Set stream volume', {streamKey, volume: clamped});+ logger.debug('Set stream volume', {streamKey, volume: clamped, muted});}setMuted(streamKey: string, muted: boolean): void {diff --git a/fluxer_app/src/features/voice/utils/ScreenShareStartFlow.ts b/fluxer_app/src/features/voice/utils/ScreenShareStartFlow.tsindex 2c29f6132..17c68c820 100644--- a/fluxer_app/src/features/voice/utils/ScreenShareStartFlow.ts+++ b/fluxer_app/src/features/voice/utils/ScreenShareStartFlow.ts@@ -635,7 +635,9 @@ async function runConfiguredDisplayScreenShare(ActiveScreenShareSource.setWindowAudioScope(appShareAudioScope ?? 'window');}if (captured && useWaylandPortal) {- ActiveScreenShareSource.setPublishedSource('wayland', null);+ ActiveScreenShareSource.setPublishedSource('wayland', null, {+ portalSurface: options?.preferredDisplaySurface,+ });ActiveScreenShareSource.setSourceDimensions(null);}if (!captured && useWaylandPortal && mode !== 'switch') {diff --git a/fluxer_app/src/features/voice/utils/TtsTextFormatter.ts b/fluxer_app/src/features/voice/utils/TtsTextFormatter.tsindex c617d34f7..594191a8f 100644--- a/fluxer_app/src/features/voice/utils/TtsTextFormatter.ts+++ b/fluxer_app/src/features/voice/utils/TtsTextFormatter.ts@@ -1,14 +1,12 @@// SPDX-License-Identifier: AGPL-3.0-or-laterimport Channels from '@app/features/channel/state/Channels';+import UnicodeEmojis from '@app/features/expressions/utils/UnicodeEmojis';import Guilds from '@app/features/guild/state/Guilds';+import {formatTimestamp} from '@app/features/messaging/utils/markdown/DateFormatter';import {TimestampStyle} from '@app/features/messaging/utils/markdown/parser/Enums';-import {getDateFromUnixTimestampSeconds} from '@app/features/messaging/utils/markdown/TimestampValidation';import Users from '@app/features/user/state/Users';-import {shouldUse12HourFormat} from '@app/features/user/utils/DateFormatting';-import {getCurrentLocale} from '@app/features/user/utils/LocaleUtils';import * as NicknameUtils from '@app/features/user/utils/NicknameUtils';-import {formatTimestampWithStyle} from '@fluxer/date_utils/src/DateTimestampStyle';import type {I18n} from '@lingui/core';import {msg} from '@lingui/core/macro';@@ -62,6 +60,7 @@ const TTS_STYLE_MAP: Record<string, TimestampStyle> = {D: TimestampStyle.LongDate,f: TimestampStyle.ShortDateTime,F: TimestampStyle.LongDateTime,+ R: TimestampStyle.RelativeTime,};const USER_MENTION_PATTERN = /<@!?(\d+)>/g;const ROLE_MENTION_PATTERN = /<@&(\d+)>/g;@@ -106,23 +105,26 @@ function formatChannelMention(channelId: string, i18n: I18n): string {return channel?.name ?? i18n._(UNKNOWN_CHANNEL_DESCRIPTOR);}-function formatTimestampForTts(timestamp: number, style: string | undefined): string {- if (getDateFromUnixTimestampSeconds(timestamp) == null) {- return String(timestamp);- }- const locale = getCurrentLocale();- const hour12 = shouldUse12HourFormat(locale);+function formatTimestampForTts(timestamp: number, style: string | undefined, i18n: I18n): string {const resolvedStyle = (style ? TTS_STYLE_MAP[style] : undefined) ?? TimestampStyle.ShortDateTime;- return formatTimestampWithStyle(timestamp, resolvedStyle, locale, hour12);+ return formatTimestamp(timestamp, resolvedStyle, i18n);}-export function formatMessageForTts(- content: string,- authorName: string,- guildId: string | null,- i18n: I18n,- replyAuthorName?: string | null,-): string {+function replaceUnicodeEmojiWithNames(text: string): string {+ let result = '';+ let cursor = 0;+ for (const match of UnicodeEmojis.matchEmojiSurrogates(text)) {+ if (match.name == null) {+ continue;+ }+ const [baseName] = match.name.split('::');+ result += `${text.slice(cursor, match.start)} ${baseName.replace(/_/g, ' ')} `;+ cursor = match.end;+ }+ return result + text.slice(cursor);+}++export function formatContentForTts(content: string, guildId: string | null, i18n: I18n): string {let formatted = content;formatted = formatted.replace(CODE_BLOCK_PATTERN, ` ${i18n._(CODE_BLOCK_DESCRIPTOR)} `);formatted = formatted.replace(SPOILER_PATTERN, i18n._(SPOILER_DESCRIPTOR));@@ -130,11 +132,12 @@ export function formatMessageForTts(formatted = formatted.replace(ROLE_MENTION_PATTERN, (_match, roleId) => formatRoleMention(roleId, guildId, i18n));formatted = formatted.replace(CHANNEL_MENTION_PATTERN, (_match, channelId) => formatChannelMention(channelId, i18n));formatted = formatted.replace(CUSTOM_EMOJI_PATTERN, (_match, emojiName) => i18n._(EMOJI_DESCRIPTOR, {emojiName}));+ formatted = replaceUnicodeEmojiWithNames(formatted);formatted = formatted.replace(SLASH_COMMAND_PATTERN, (_match, commandName) =>i18n._(SLASH_DESCRIPTOR, {commandName}),);formatted = formatted.replace(TIMESTAMP_PATTERN, (_match, timestamp, style) =>- formatTimestampForTts(Number.parseInt(timestamp, 10), style),+ formatTimestampForTts(Number.parseInt(timestamp, 10), style, i18n),);formatted = formatted.replace(INLINE_CODE_PATTERN, '$1');formatted = formatted.replace(MASKED_LINK_PATTERN, '$1');@@ -145,7 +148,17 @@ export function formatMessageForTts(formatted = formatted.replace(ITALIC_PATTERN, '$1');formatted = formatted.replace(BLOCKQUOTE_PATTERN, '');formatted = formatted.replace(HEADER_PATTERN, '');- formatted = formatted.replace(/\s+/g, ' ').trim();+ return formatted.replace(/\s+/g, ' ').trim();+}++export function formatMessageForTts(+ content: string,+ authorName: string,+ guildId: string | null,+ i18n: I18n,+ replyAuthorName?: string | null,+): string {+ const formatted = formatContentForTts(content, guildId, i18n);if (replyAuthorName) {return i18n._(REPLYING_TO_SAID_DESCRIPTOR, {replyAuthorName, authorName, formatted});}diff --git a/fluxer_app/src/features/voice/utils/VoiceActivityGate.ts b/fluxer_app/src/features/voice/utils/VoiceActivityGate.tsindex acb5eb4fa..95c01e9ae 100644--- a/fluxer_app/src/features/voice/utils/VoiceActivityGate.ts+++ b/fluxer_app/src/features/voice/utils/VoiceActivityGate.ts@@ -17,6 +17,8 @@ export interface VoiceInputLevel {rms: number;floorRms: number;thresholdRms: number;+ gated: boolean;+ open: boolean;nonFinite: boolean;frame: number;contextTime: number;diff --git a/fluxer_app/src/features/voice/utils/VoiceInputProcessor.ts b/fluxer_app/src/features/voice/utils/VoiceInputProcessor.tsindex cfe2f1d4c..467b8c32f 100644--- a/fluxer_app/src/features/voice/utils/VoiceInputProcessor.ts+++ b/fluxer_app/src/features/voice/utils/VoiceInputProcessor.ts@@ -192,6 +192,11 @@ export class VoiceInputGraph {return this.level?.rms ?? 0;}+ readGateOpen(): boolean | null {+ if (!this.gateNode || !this.level?.gated) return null;+ return this.level.open;+ }+configure(): Promise<void> {if (this.disposed) return Promise.resolve();this.configureDirty = true;@@ -526,6 +531,11 @@ export class VoiceInputTrackProcessor implements TrackProcessor<Track.Kind.Audioif (this.state === 'live') this.graph?.reportRuntime(this);}+ readGateOpen(): boolean | null {+ if (this.state !== 'live') return null;+ return this.graph?.readGateOpen() ?? null;+ }+private noteLevel(): void {if (this.state !== 'live' || this.hasRunningLevel || this.lease?.context.state !== 'running') return;this.hasRunningLevel = true;diff --git a/fluxer_app/src/features/voice/utils/VoiceTtsUtils.tsx b/fluxer_app/src/features/voice/utils/VoiceTtsUtils.tsxindex 5afe676f6..36513500c 100644--- a/fluxer_app/src/features/voice/utils/VoiceTtsUtils.tsx+++ b/fluxer_app/src/features/voice/utils/VoiceTtsUtils.tsx@@ -15,7 +15,7 @@ import Users from '@app/features/user/state/Users';import * as NicknameUtils from '@app/features/user/utils/NicknameUtils';import LocalVoiceState from '@app/features/voice/state/LocalVoiceState';import * as TtsSpeechUtils from '@app/features/voice/utils/TtsSpeechUtils';-import {formatMessageForTts} from '@app/features/voice/utils/TtsTextFormatter';+import {formatContentForTts, formatMessageForTts} from '@app/features/voice/utils/TtsTextFormatter';import {MessageTypes} from '@fluxer/constants/src/ChannelConstants';import type {Message} from '@fluxer/schema/src/domains/message/MessageResponseSchemas';import {type I18n, i18n as linguiI18n} from '@lingui/core';@@ -332,7 +332,7 @@ async function speakWithFallback(void speakNextChunk();}-function speakMessage(content: string): void {+function speakMessage(content: string, guildId: string | null): void {ensureInitialized();if (!isSupported()) {void showUnsupportedModal();@@ -342,7 +342,7 @@ function speakMessage(content: string): void {stopSpeaking();return;}- speakText({text: content});+ speakText({text: formatContentForTts(content, guildId, getI18n())});}function isUserMessageType(type: number): boolean {diff --git a/fluxer_app/src/features/voice/utils/voiceGateProcessor.worklet.js b/fluxer_app/src/features/voice/utils/voiceGateProcessor.worklet.jsindex ec284d609..5364f1439 100644--- a/fluxer_app/src/features/voice/utils/voiceGateProcessor.worklet.js+++ b/fluxer_app/src/features/voice/utils/voiceGateProcessor.worklet.js@@ -36,6 +36,7 @@ class VoiceGateProcessor extends AudioWorkletProcessor {this.attackStep = 1 / (ATTACK_SECONDS * sampleRate);this.releaseFactor = Math.exp(-1 / (RELEASE_SECONDS * sampleRate));this.speaking = false;+ this.open = true;this.nonFinite = false;this.disposed = false;this.port.onmessage = ({data}) => {@@ -128,12 +129,16 @@ class VoiceGateProcessor extends AudioWorkletProcessor {if (this.delayFrames > 0) this.delayIndex = (this.delayIndex + 1) % this.delayFrames;}this.frame += length;- if (this.frame >= this.reportFrame) {+ const openChanged = open !== this.open;+ this.open = open;+ if (openChanged || this.frame >= this.reportFrame) {this.port.postMessage({type: 'level',rms,floorRms,thresholdRms,+ gated: this.apply,+ open,nonFinite: this.nonFinite,frame: this.frame,contextTime: currentTime,diff --git a/fluxer_desktop/src/main/IpcHandlers.ts b/fluxer_desktop/src/main/IpcHandlers.tsindex 964bf1738..3c66d356b 100644--- a/fluxer_desktop/src/main/IpcHandlers.ts+++ b/fluxer_desktop/src/main/IpcHandlers.ts@@ -62,6 +62,7 @@ import {isPrivilegedRendererDocumentSender,requirePrivilegedRendererDocumentSender,} from '@electron/main/PrivilegedRendererDocuments';+import {saveDialogFilters, withDefaultExtension} from '@electron/main/SaveDialogFileType';import {getDesktopSelectedInstanceClient} from '@electron/main/SelectedInstanceFetch';import {getStreamerModeCaptureAppStatus} from '@electron/main/StreamerModeProcessDetection';import {@@ -444,12 +445,14 @@ export function registerIpcHandlers(): void {try {const result = await dialog.showSaveDialog(win, {defaultPath: options.defaultPath,+ filters: saveDialogFilters(options.defaultPath),});if (result.canceled || !result.filePath) {return {success: false, canceled: true};}- await downloadFile(options.url, result.filePath, {sha256: options.sha256});- return {success: true, path: result.filePath};+ const filePath = withDefaultExtension(result.filePath, options.defaultPath);+ await downloadFile(options.url, filePath, {sha256: options.sha256});+ return {success: true, path: filePath};} catch (error) {if (error instanceof DownloadChecksumError) {return {success: false, checksumMismatch: true, error: error.message};diff --git a/fluxer_desktop/src/main/MainWindowClose.ts b/fluxer_desktop/src/main/MainWindowClose.tsnew file mode 100644index 000000000..90dd9f299--- /dev/null+++ b/fluxer_desktop/src/main/MainWindowClose.ts@@ -0,0 +1,20 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++export interface MainWindowCloseContext {+ platform: NodeJS.Platform;+ isQuitting: boolean;+ closingForUpdate: boolean;+ keepInTray: boolean;+}++export type MainWindowCloseAction = 'hide' | 'close' | 'quit';++export function getMainWindowCloseAction(context: MainWindowCloseContext): MainWindowCloseAction {+ if (context.isQuitting || context.closingForUpdate) {+ return 'close';+ }+ if (context.platform === 'darwin' || context.keepInTray) {+ return 'hide';+ }+ return 'quit';+}diff --git a/fluxer_desktop/src/main/SaveDialogFileType.ts b/fluxer_desktop/src/main/SaveDialogFileType.tsnew file mode 100644index 000000000..928eecbaf--- /dev/null+++ b/fluxer_desktop/src/main/SaveDialogFileType.ts@@ -0,0 +1,25 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++import path from 'node:path';+import type {FileFilter} from 'electron';++function fileExtension(filePath: string): string {+ return path.extname(filePath).slice(1);+}++export function saveDialogFilters(defaultPath: string): Array<FileFilter> {+ const extension = fileExtension(defaultPath);+ const allFiles: FileFilter = {name: 'All files', extensions: ['*']};+ if (!extension) {+ return [allFiles];+ }+ return [{name: `${extension.toUpperCase()} file`, extensions: [extension]}, allFiles];+}++export function withDefaultExtension(filePath: string, defaultPath: string): string {+ const extension = fileExtension(defaultPath);+ if (!extension || fileExtension(filePath)) {+ return filePath;+ }+ return `${filePath}.${extension}`;+}diff --git a/fluxer_desktop/src/main/Window.ts b/fluxer_desktop/src/main/Window.tsindex 726a84ef7..08135953b 100644--- a/fluxer_desktop/src/main/Window.ts+++ b/fluxer_desktop/src/main/Window.ts@@ -31,6 +31,7 @@ import {getDesktopLocalAppAuthorization} from '@electron/main/LocalAppProtocolAuimport {isLocalAppRendererDocumentURL, isLocalAppURL} from '@electron/main/LocalAppURL';import {cancelPendingFullScreenHide, hideWindowLeavingFullScreen} from '@electron/main/MacFullScreenHide';import {t} from '@electron/main/MainI18n';+import {getMainWindowCloseAction} from '@electron/main/MainWindowClose';import {MainWindowRevealGate, MainWindowRevealReason} from '@electron/main/MainWindowReveal';import {signalMainWindowCreated, signalMainWindowReady} from '@electron/main/ModuleBootHandoff';import {openExternalDeduped} from '@electron/main/OpenExternal';@@ -148,6 +149,7 @@ let quickCssEditorWindow: BrowserWindow | null = null;let lastRestorableMainWindowMaximized = false;let mainWindowRendererGone = false;let closingMainWindowForUpdate = false;+let quitAfterMainWindowCloses = false;const SHELL_PAGE_URL_PREFIX = 'file:';let mainWindowTakeover: (() => void) | null = null;const takeoverEndedListeners = new Set<() => void>();@@ -318,14 +320,15 @@ export function clearSavedWindowBounds(): void {}}-function shouldHideMainWindowOnClose(): boolean {- if (process.platform === 'darwin') {- return true;- }+function shouldKeepMainWindowInTrayOnClose(): boolean {const settings = getDesktopWindowBehaviorSettings();return hasActiveDesktopTray() && settings.showTrayIcon && settings.closeToTray;}+function shouldHideMainWindowOnClose(): boolean {+ return process.platform === 'darwin' || shouldKeepMainWindowInTrayOnClose();+}+function shouldHideMainWindowOnMinimize(): boolean {const settings = getDesktopWindowBehaviorSettings();return hasActiveDesktopTray() && settings.showTrayIcon && settings.minimizeToTray;@@ -854,7 +857,14 @@ export function createWindow(options: CreateWindowOptions = {}): BrowserWindow {if (saveTimeout) clearTimeout(saveTimeout);endLiveResize();saveWindowBounds();- if (!isQuitting && !closingMainWindowForUpdate && shouldHideMainWindowOnClose()) {+ const closeAction = getMainWindowCloseAction({+ platform: process.platform,+ isQuitting,+ closingForUpdate: closingMainWindowForUpdate,+ keepInTray: shouldKeepMainWindowInTrayOnClose(),+ });+ quitAfterMainWindowCloses = closeAction === 'quit';+ if (closeAction === 'hide') {event.preventDefault();logger.info(process.platform === 'darwin'@@ -867,6 +877,10 @@ export function createWindow(options: CreateWindowOptions = {}): BrowserWindow {});mainWindow.on('closed', () => {mainWindow = null;+ if (quitAfterMainWindowCloses && !isQuitting) {+ logger.info('The main window closed and close to tray is off, quitting');+ app.quit();+ }});mainWindow.setMenuBarVisibility(false);if (process.platform === 'win32') {diff --git a/fluxer_docs/src/content/docs/gateway/opcodes-and-close-codes.md b/fluxer_docs/src/content/docs/gateway/opcodes-and-close-codes.mdindex 3c981f92a..9fc9ef70f 100644--- a/fluxer_docs/src/content/docs/gateway/opcodes-and-close-codes.md+++ b/fluxer_docs/src/content/docs/gateway/opcodes-and-close-codes.md@@ -79,7 +79,7 @@ Other refused voice joins get no opcode 12.<sup>2</sup> The Gateway counts guilds after the shard filter. Raise `shard_count` until each shard has at most 2,500.-If the connection had a session, you can [Resume](/gateway/commands/#resume) it for 60,000 ms after any close, including a network failure or a normal `1000` or `1001` close. When a Resume closes with `4004` or `4007`, the session stays and you can try again. Resume only replays events still in the [replay buffer](/gateway/limits-and-rate-limits/#replay-and-backpressure).+If the connection had a session, you can [Resume](/gateway/commands/#resume) it for 60,000 ms after a network failure or any close except `1000` and `1001`. A `1000` or `1001` close from the client ends the session right away, so close with another code, such as `4000`, when you plan to resume. When a Resume closes with `4004` or `4007`, the session stays and you can try again. Resume only replays events still in the [replay buffer](/gateway/limits-and-rate-limits/#replay-and-backpressure).Change the token, shard pair or version before you reconnect after `4004`, `4010` or `4012`.diff --git a/fluxer_docs/src/content/docs/gateway/overview.md b/fluxer_docs/src/content/docs/gateway/overview.mdindex b7f4ef54b..8f78ae8c9 100644--- a/fluxer_docs/src/content/docs/gateway/overview.md+++ b/fluxer_docs/src/content/docs/gateway/overview.md@@ -112,7 +112,7 @@ The Gateway drops replayable Dispatches up to the sequence in your heartbeat. On## Resuming a session-Opcode 6 resumes a session on a new socket within 60,000 ms after the old one closes. Send the original token, the Ready `session_id` and the last sequence you processed. A payload missing any of them closes with `4002`.+Opcode 6 resumes a session on a new socket within 60,000 ms after the old one closes, unless the client closed it with `1000` or `1001`. Send the original token, the Ready `session_id` and the last sequence you processed. A payload missing any of them closes with `4002`.```json{diff --git a/fluxer_gateway/src/gateway/gateway_handler_identify.erl b/fluxer_gateway/src/gateway/gateway_handler_identify.erlindex 6d0e83125..25732d3e5 100644--- a/fluxer_gateway/src/gateway/gateway_handler_identify.erl+++ b/fluxer_gateway/src/gateway/gateway_handler_identify.erl@@ -19,6 +19,7 @@-define(PENDING_IDENTIFY_RETRY_BASE_MS, 1000).-define(PENDING_IDENTIFY_RETRY_JITTER_MS, 1000).-define(MAX_IGNORED_EVENTS, 256).+-define(MAX_TOKEN_BYTES, 256).-spec handle_identify(map(), binary(), state()) -> ws_result().handle_identify(Data, PeerIP, State) ->@@ -66,6 +67,12 @@ handle_identify_validated(Data, PeerIP, State) -><<"Invalid shard">>,State);+ {error, invalid_token} ->+ gateway_handler_encode:close_with_reason(+ authentication_failed,+ <<"Invalid token">>,+ State+ );{error, _Reason} ->gateway_handler_encode:close_with_reason(decode_error,@@ -198,15 +205,34 @@ validate_identify_data(Data) when is_map(Data) ->IgnoredEventsRaw = maps:get(<<"ignored_events">>, Data, []),InitialGuildIdRaw = maps:get(<<"initial_guild_id">>, Data, undefined),ShardRaw = maps:get(<<"shard">>, Data, undefined),- validate_properties(- Token, Properties, IgnoredEventsRaw, InitialGuildIdRaw, ShardRaw, Data- )+ case is_valid_token(Token) of+ true ->+ validate_properties(+ Token, Properties, IgnoredEventsRaw, InitialGuildIdRaw, ShardRaw, Data+ );+ false ->+ {error, invalid_token}+ endcatcherror:{badkey, _} -> {error, missing_required_field}end;validate_identify_data(_Data) ->{error, invalid_data}.+-spec is_valid_token(term()) -> boolean().+is_valid_token(Token) when is_binary(Token), byte_size(Token) =< ?MAX_TOKEN_BYTES ->+ has_visible_byte(Token);+is_valid_token(_) ->+ false.++-spec has_visible_byte(binary()) -> boolean().+has_visible_byte(<<Byte, Rest/binary>>) when Byte =< 32 ->+ has_visible_byte(Rest);+has_visible_byte(<<_, _/binary>>) ->+ true;+has_visible_byte(<<>>) ->+ false.+-spec validate_properties(binary(), term(), term(), term(), term(), map()) ->{ok, binary(), map(), term(), [binary()], non_neg_integer(), integer() | undefined,gateway_sharding:shard() | undefined}diff --git a/fluxer_gateway/src/presence/presence_session.erl b/fluxer_gateway/src/presence/presence_session.erlindex 5460816dd..a4c871dee 100644--- a/fluxer_gateway/src/presence/presence_session.erl+++ b/fluxer_gateway/src/presence/presence_session.erl@@ -34,8 +34,9 @@-spec handle_session_connect(connect_request(), pid(), state()) ->{reply, {ok, [map()]}, state()}.-handle_session_connect(Request, Pid, State) ->+handle_session_connect(Request, Pid, State0) ->#{session_id := SessionId0} = Request,+ State = merge_guild_ids(maps:get(guild_ids, Request, []), State0),SessionId = normalize_session_id(SessionId0),Status = normalize_status(maps:get(status, Request, offline)),Afk = normalize_boolean(maps:get(afk, Request, false)),@@ -59,6 +60,9 @@ handle_session_connect(Request, Pid, State) ->SessionsData = presence_status:collect_sessions_for_replace(presence_status:effective_sessions(NewState)),+ dispatch_sessions_replace_to(+ [P || #{pid := P} <- maps:values(Sessions), P =/= Pid], SessionsData+ ),{reply, {ok, SessionsData}, NewState};Existing ->{UpdatedSession, NewState0} = refresh_existing_session(@@ -72,6 +76,12 @@ handle_session_connect(Request, Pid, State) ->{reply, {ok, SessionsData}, NewState}end.+-spec merge_guild_ids(term(), state()) -> state().+merge_guild_ids([_ | _] = GuildIds, #{guild_ids := Known} = State) ->+ State#{guild_ids := maps:merge(Known, presence_targets:map_from_ids(GuildIds))};+merge_guild_ids(_GuildIds, State) ->+ State.+-spec refresh_existing_session(session_entry(), pid(), status(), boolean(), boolean(), pid() | undefined, state()) -> {session_entry(), state()}.@@ -151,7 +161,12 @@ dispatch_sessions_replace(State) ->SessionsData = presence_status:collect_sessions_for_replace(presence_status:effective_sessions(State)),- SessionPids = [maps:get(pid, S) || S <- maps:values(Sessions)],+ dispatch_sessions_replace_to(+ [maps:get(pid, S) || S <- maps:values(Sessions)], SessionsData+ ).++-spec dispatch_sessions_replace_to([term()], [map()]) -> ok.+dispatch_sessions_replace_to(SessionPids, SessionsData) ->gateway_dispatch_relay:dispatch_many([Pid || Pid <- SessionPids, is_pid(Pid)], sessions_replace, SessionsData, 0),diff --git a/fluxer_gateway/src/session/session.erl b/fluxer_gateway/src/session/session.erlindex 7f26d108b..c7102c7dd 100644--- a/fluxer_gateway/src/session/session.erl+++ b/fluxer_gateway/src/session/session.erl@@ -178,11 +178,7 @@ handle_cast_guild_or_lifecycle({reconnect_drain, SocketPid}, State) when->session_lifecycle:handle_reconnect_drain(SocketPid, State);handle_cast_guild_or_lifecycle({guild_join, GuildId}, State) when is_integer(GuildId) ->- self() ! {guild_connect, GuildId, 0},- {noreply,- session_bot_guilds:track_join(- GuildId, session_visits:handle_guild_join(GuildId, State)- )};+ handle_guild_join(GuildId, maps:get(shard, State, undefined), State);handle_cast_guild_or_lifecycle({visit_start, GuildId, Operator}, State) whenis_integer(GuildId), is_boolean(Operator)->@@ -221,6 +217,20 @@ handle_cast_guild_or_lifecycle(reconnect_drain, State) ->handle_cast_guild_or_lifecycle(Msg, State) ->do_handle_cast_call(Msg, State).+-spec handle_guild_join(guild_id(), gateway_sharding:shard() | undefined, session_state()) ->+ {noreply, session_state()}.+handle_guild_join(GuildId, Shard, State) ->+ case gateway_sharding:retain_guild_ids_for_shard([GuildId], Shard) of+ [] ->+ {noreply, State};+ _ ->+ self() ! {guild_connect, GuildId, 0},+ {noreply,+ session_bot_guilds:track_join(+ GuildId, session_visits:handle_guild_join(GuildId, State)+ )}+ end.+-spec do_handle_cast_call(term(), session_state()) ->{noreply, session_state()}.do_handle_cast_call({call_monitor, ChannelId, CallPid}, State) whendiff --git a/fluxer_gateway/src/session/session_connection_presence.erl b/fluxer_gateway/src/session/session_connection_presence.erlindex 82a6b7295..7b9190ef6 100644--- a/fluxer_gateway/src/session/session_connection_presence.erl+++ b/fluxer_gateway/src/session/session_connection_presence.erl@@ -84,7 +84,8 @@ do_session_connect(Pid, Attempt, State) when is_map(State) ->status => Status,afk => Afk,mobile => Mobile,- socket_pid => SocketPid+ socket_pid => SocketPid,+ guild_ids => session_visits:member_guild_ids(State)},ConnectStartedAt = gateway_timings:start(),Result = safe_call(fun() ->diff --git a/fluxer_media_proxy/src/http_client/mod.rs b/fluxer_media_proxy/src/http_client/mod.rsindex 26f58d4ea..8c57fb0b4 100644--- a/fluxer_media_proxy/src/http_client/mod.rs+++ b/fluxer_media_proxy/src/http_client/mod.rs@@ -21,7 +21,7 @@ const EXTERNAL_RETRY_WINDOW_MS: u64 = 15_000;#[derive(Clone, Copy, Debug, Eq, PartialEq)]pub struct HTTPClientOptions {connect_timeout_ms: NonZeroU64,- request_timeout_ms: NonZeroU64,+ request_timeout_ms: Option<NonZeroU64>,read_timeout_ms: Option<NonZeroU64>,retries: HTTPRetryPolicy,address_policy: HTTPAddressPolicy,@@ -45,7 +45,16 @@ impl HTTPClientOptions {pub fn new(connect_timeout_ms: NonZeroU64, timeout_ms: NonZeroU64) -> Self {Self {connect_timeout_ms,- request_timeout_ms: timeout_ms,+ request_timeout_ms: Some(timeout_ms),+ ..Self::default()+ }+ }++ pub fn streaming(connect_timeout_ms: NonZeroU64, read_timeout_ms: NonZeroU64) -> Self {+ Self {+ connect_timeout_ms,+ request_timeout_ms: None,+ read_timeout_ms: Some(read_timeout_ms),..Self::default()}}@@ -73,8 +82,7 @@ impl Default for HTTPClientOptions {Self {connect_timeout_ms: NonZeroU64::new(1_500).expect("default connection timeout must be nonzero"),- request_timeout_ms: NonZeroU64::new(30_000)- .expect("default request timeout must be nonzero"),+ request_timeout_ms: NonZeroU64::new(30_000),read_timeout_ms: None,retries: HTTPRetryPolicy {max_retries: NonZeroU32::new(2)@@ -97,9 +105,11 @@ pub fn build_raw(options: HTTPClientOptions) -> Result<reqwest::Client, reqwest:// is the one client that opts out, because it only ever dials this process on loopback.let mut builder = reqwest::Client::builder().connect_timeout(Duration::from_millis(options.connect_timeout_ms.get()))- .timeout(Duration::from_millis(options.request_timeout_ms.get())).redirect(reqwest::redirect::Policy::none()).user_agent(crate::constants::OUTBOUND_USER_AGENT);+ if let Some(request_timeout_ms) = options.request_timeout_ms {+ builder = builder.timeout(Duration::from_millis(request_timeout_ms.get()));+ }if let Some(read_timeout_ms) = options.read_timeout_ms {builder = builder.read_timeout(Duration::from_millis(read_timeout_ms.get()));}diff --git a/fluxer_media_proxy/src/media_process/transform.rs b/fluxer_media_proxy/src/media_process/transform.rsindex c1cadcc56..ab8e8ba47 100644--- a/fluxer_media_proxy/src/media_process/transform.rs+++ b/fluxer_media_proxy/src/media_process/transform.rs@@ -40,7 +40,13 @@ use std::ptr;pub(super) fn source_supports_pages(mime: &str) -> bool {matches!(mime,- "image/webp" | "image/gif" | "image/apng" | "image/heic" | "image/heif" | "image/avif"+ "image/webp"+ | "image/gif"+ | "image/apng"+ | "image/heic"+ | "image/heif"+ | "image/avif"+ | "image/jxl")}diff --git a/fluxer_media_proxy/src/storage/mod.rs b/fluxer_media_proxy/src/storage/mod.rsindex 30344dd7c..2340f7575 100644--- a/fluxer_media_proxy/src/storage/mod.rs+++ b/fluxer_media_proxy/src/storage/mod.rs@@ -155,7 +155,7 @@ impl Store {) -> Result<Self, reqwest::Error> {let socket_io_timeout =NonZeroU64::new(cfg.socket_io_timeout_ms).unwrap_or(NonZeroU64::MIN);- let options = HTTPClientOptions::new(socket_io_timeout, socket_io_timeout);+ let options = HTTPClientOptions::streaming(socket_io_timeout, socket_io_timeout);let client = http_client::build(options, http_client_metrics)?;let raw_client = http_client::build_raw(options)?;Ok(Self {diff --git a/fluxer_media_proxy/src/storage/tests/mod.rs b/fluxer_media_proxy/src/storage/tests/mod.rsindex 3c56b09eb..ce323ce54 100644--- a/fluxer_media_proxy/src/storage/tests/mod.rs+++ b/fluxer_media_proxy/src/storage/tests/mod.rs@@ -1,6 +1,7 @@// SPDX-License-Identifier: AGPL-3.0-or-latermod keys;+mod slow_stream;use crate::{config::{diff --git a/fluxer_media_proxy/src/storage/tests/slow_stream.rs b/fluxer_media_proxy/src/storage/tests/slow_stream.rsnew file mode 100644index 000000000..8a56202a3--- /dev/null+++ b/fluxer_media_proxy/src/storage/tests/slow_stream.rs@@ -0,0 +1,71 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++use super::fake_s3;+use crate::{+ metrics::{http_client::HTTPClientMetrics, storage::StorageMetrics},+ storage::Store,+};+use std::{sync::Arc, time::Duration};++async fn slow_s3(chunks: usize, gap: Duration) -> String {+ let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap();+ let addr = listener.local_addr().unwrap();+ let app = axum::Router::new().fallback(axum::routing::any(move || async move {+ let stream = futures_util::stream::unfold(0usize, move |sent| async move {+ if sent == chunks {+ return None;+ }+ tokio::time::sleep(gap).await;+ Some((+ Ok::<_, std::io::Error>(bytes::Bytes::from_static(b"x")),+ sent + 1,+ ))+ });+ axum::response::Response::builder()+ .header(http::header::CONTENT_LENGTH, chunks.to_string())+ .header(http::header::CONTENT_TYPE, "video/mp4")+ .body(axum::body::Body::from_stream(stream))+ .unwrap()+ }));+ tokio::spawn(async move {+ axum::serve(listener, app).await.unwrap();+ });+ format!("http://{addr}")+}++async fn read_slow_object(+ socket_io_timeout_ms: u64,+ chunks: usize,+ gap: Duration,+) -> Result<usize, String> {+ let dir = tempfile::tempdir().unwrap();+ let mut cfg = fake_s3().await.config(dir.path());+ cfg.storage.s3_endpoint = slow_s3(chunks, gap).await;+ cfg.socket_io_timeout_ms = socket_io_timeout_ms;+ let store = Store::try_new(+ cfg,+ Arc::new(StorageMetrics::default()),+ Arc::new(HTTPClientMetrics::default()),+ )+ .unwrap();+ let object = store+ .stream_object("fluxer", "attachments/1/2/big.mp4", None)+ .await+ .map_err(|error| error.to_string())?;+ axum::body::to_bytes(object.body, usize::MAX)+ .await+ .map(|bytes| bytes.len())+ .map_err(|error| error.to_string())+}++#[tokio::test]+async fn stored_download_outlives_the_socket_timeout_while_bytes_keep_flowing() {+ let read = read_slow_object(300, 12, Duration::from_millis(100)).await;+ assert_eq!(read, Ok(12));+}++#[tokio::test]+async fn stored_download_still_stops_when_the_store_stalls() {+ let read = read_slow_object(300, 2, Duration::from_millis(900)).await;+ assert!(read.is_err(), "a stalled read must fail, got {read:?}");+}diff --git a/fluxer_unfurl/src/resolvers/klipy.rs b/fluxer_unfurl/src/resolvers/klipy.rsindex bc98c26d6..67cb36154 100644--- a/fluxer_unfurl/src/resolvers/klipy.rs+++ b/fluxer_unfurl/src/resolvers/klipy.rs@@ -5,12 +5,14 @@ use crate::http_fetch;use crate::types::{EmbedMedia, EmbedProvider, MessageEmbed};use std::future::Future;use std::pin::Pin;-use std::time::Duration;+use std::time::{Duration, Instant};use url::Url;const CURATED_PROVIDER_NSFW_MODE: &str = "allow";const KLIPY_API_MAX_BYTES: usize = 512 * 1024;const KLIPY_API_TIMEOUT: Duration = Duration::from_secs(10);+const KLIPY_API_RETRY_DELAYS: [Duration; 2] = [Duration::from_secs(1), Duration::from_secs(3)];+const KLIPY_API_RETRY_BUDGET: Duration = Duration::from_secs(6);const KLIPY_SIZE_PREFERENCE: &[&str] = &["hd", "md", "sm", "xs"];const KLIPY_THUMBNAIL_FORMATS: &[&str] = &["webp", "gif"];const KLIPY_VIDEO_FORMATS: &[&str] = &["webm", "mp4"];@@ -115,11 +117,17 @@ async fn resolve_media_via_api(return Ok(None);};let url = fluxer_common::klipy::direct_items_url(api_key, path.kind, &path.slug)?;- let response = http_fetch::fetch_url(- &ctx.http_client,- url.as_str(),- KLIPY_API_MAX_BYTES,- KLIPY_API_TIMEOUT,+ let response = fetch_items_with_retry(+ || {+ http_fetch::fetch_url(+ &ctx.http_client,+ url.as_str(),+ KLIPY_API_MAX_BYTES,+ KLIPY_API_TIMEOUT,+ )+ },+ &KLIPY_API_RETRY_DELAYS,+ Instant::now() + KLIPY_API_RETRY_BUDGET,).await?;@@ -137,6 +145,34 @@ async fn resolve_media_via_api(.and_then(extract_klipy_api_media))}+async fn fetch_items_with_retry<F, Fut>(+ mut fetch: F,+ retry_delays: &[Duration],+ deadline: Instant,+) -> anyhow::Result<http_fetch::FetchResult>+where+ F: FnMut() -> Fut,+ Fut: Future<Output = anyhow::Result<http_fetch::FetchResult>>,+{+ let mut response = fetch().await?;+ for delay in retry_delays {+ if !is_transient_status(response.status) || Instant::now() + *delay > deadline {+ break;+ }+ tracing::warn!(+ status = response.status,+ "KLIPY direct API lookup returned a transient status, retrying"+ );+ tokio::time::sleep(*delay).await;+ response = fetch().await?;+ }+ Ok(response)+}++fn is_transient_status(status: u16) -> bool {+ status == 429 || (500..600).contains(&status)+}+fn extract_klipy_api_media(item: &serde_json::Value) -> Option<KlipyMediaFormats> {let file = item.get("file")?;let file_meta = item.get("file_meta");@@ -217,3 +253,44 @@ fn extract_media_format(value: Option<&serde_json::Value>) -> Option<KlipyMediaF}use super::default_helpers::resolve_http_url;++#[cfg(test)]+mod tests {+ use super::*;+ use std::sync::Mutex;++ async fn run(statuses: &[u16]) -> (u16, usize) {+ let calls = Mutex::new(0usize);+ let response = fetch_items_with_retry(+ || {+ let mut count = calls.lock().unwrap();+ let status = statuses[(*count).min(statuses.len() - 1)];+ *count += 1;+ async move {+ Ok(http_fetch::FetchResult {+ bytes: Vec::new(),+ headers: reqwest::header::HeaderMap::new(),+ status,+ })+ }+ },+ &[Duration::ZERO, Duration::ZERO],+ Instant::now() + Duration::from_secs(60),+ )+ .await+ .unwrap();+ (response.status, *calls.lock().unwrap())+ }++ #[tokio::test]+ async fn retries_a_rate_limited_lookup() {+ assert_eq!(run(&[429, 200]).await, (200, 2));+ assert_eq!(run(&[503, 429, 200]).await, (200, 3));+ }++ #[tokio::test]+ async fn does_not_retry_a_final_answer() {+ assert_eq!(run(&[404]).await, (404, 1));+ assert_eq!(run(&[429, 429, 429, 200]).await, (429, 3));+ }+}diff --git a/packages/constants/src/GuildConstants.ts b/packages/constants/src/GuildConstants.tsindex 6a9a8d6cf..6ff2d8048 100644--- a/packages/constants/src/GuildConstants.ts+++ b/packages/constants/src/GuildConstants.ts@@ -34,6 +34,22 @@ export const GuildMFALevel = {export type GuildMFALevelValue = ValueOf<typeof GuildMFALevel>;+export function guildRequiresMfa(features: Iterable<string>): boolean {+ for (const feature of features) {+ if (feature === GuildFeatures.VERIFIED || feature === GuildFeatures.PARTNERED) return true;+ }+ return false;+}++export function getEffectiveGuildMfaLevel(+ mfaLevel: number,+ features: Iterable<string>,+ selfHosted: boolean,+): GuildMFALevelValue {+ if (!selfHosted && guildRequiresMfa(features)) return GuildMFALevel.ELEVATED;+ return mfaLevel === GuildMFALevel.ELEVATED ? GuildMFALevel.ELEVATED : GuildMFALevel.NONE;+}+export const GuildSplashCardAlignment = {CENTER: 0,LEFT: 1,diff --git a/packages/constants/src/LimitConstants.ts b/packages/constants/src/LimitConstants.tsindex ae2826ac9..89cf4579e 100644--- a/packages/constants/src/LimitConstants.ts+++ b/packages/constants/src/LimitConstants.ts@@ -28,6 +28,7 @@ export const CHANNEL_TOPIC_MAX_LENGTH = 1024;export const RTC_REGION_ID_MIN_LENGTH = 1;export const RTC_REGION_ID_MAX_LENGTH = 64;export const MAX_GUILD_EMOJIS = 500;+export const MESSAGE_SEARCH_MAX_PAGE = 400;export const MAX_GUILD_EMOJIS_ANIMATED = MAX_GUILD_EMOJIS;export const MAX_GUILD_EMOJIS_STATIC = MAX_GUILD_EMOJIS;export const MAX_GUILD_EMOJIS_ANIMATED_MORE_EMOJI = MAX_GUILD_EMOJIS;diff --git a/packages/markdown_parser/rust/src/block.rs b/packages/markdown_parser/rust/src/block.rsindex f2d96292d..6227c6c47 100644--- a/packages/markdown_parser/rust/src/block.rs+++ b/packages/markdown_parser/rust/src/block.rs@@ -1054,14 +1054,6 @@ impl ListContext<'_> {} else {break;}- } else if is_bullet_point_text(current_line) {- if let Some(last) = items.last_mut() {- last.children.push(Node::Text {- content: trim(current_line).to_owned(),- });- }- index += 1;- new_count += 1;} else if is_list_continuation(current_line, indent_level) {if let Some(last) = items.last_mut() {let trimmed = trim_start(current_line);@@ -1140,9 +1132,6 @@ pub(crate) fn match_list_item(line: &str) -> Option<ListMatch<'_>> {while indent < line.len() && byte_at(line, indent) == b' ' {indent += 1;}- if indent > 0 && indent < 2 {- return None;- }let indent_level = indent / 2;if indent >= line.len() {return None;@@ -1463,14 +1452,6 @@ fn normalise_ordinal(items: &[ListItem], ordinal: Option<usize>, ordered: bool)Some(start + items.len())}-fn is_bullet_point_text(text: &str) -> bool {- if match_list_item(text).is_some() {- return false;- }- let trimmed_text = trim_start(text);- starts_with(trimmed_text, "- ") && !starts_with(text, " ")-}-fn is_list_continuation(line: &str, indent_level: usize) -> bool {let mut spaces = 0usize;while spaces < line.len() && byte_at(line, spaces) == b' ' {diff --git a/packages/markdown_parser/rust/src/links.rs b/packages/markdown_parser/rust/src/links.rsindex 80001a918..bfced53e6 100644--- a/packages/markdown_parser/rust/src/links.rs+++ b/packages/markdown_parser/rust/src/links.rs@@ -343,7 +343,7 @@ pub(crate) fn parse_masked_link(};if !has_visible_content(link_text)|| is_slash_command_masked_link_text(trimmed_link_text)- || is_email_like(trimmed_link_text)+ || (is_email_like(trimmed_link_text) && !is_mailto_of(trimmed_link_text, url_info.url))|| url_info.url.len() > MAX_LINK_URL_LENGTH|| !is_valid_masked_link_url(scan, position + url_info.start, url_info.url.len())|| (starts_with_url(trimmed_link_text)@@ -925,6 +925,10 @@ fn is_email_like(text: &str) -> bool {text[at + 1..].contains('.')}+fn is_mailto_of(email: &str, url: &str) -> bool {+ starts_with(url, "mailto:") && url["mailto:".len()..].eq_ignore_ascii_case(email)+}+pub fn is_valid_email(text: &str) -> bool {let Some(at) = text.bytes()diff --git a/packages/markdown_parser/rust/tests/masked_mailto.rs b/packages/markdown_parser/rust/tests/masked_mailto.rsnew file mode 100644index 000000000..a03e2ff94--- /dev/null+++ b/packages/markdown_parser/rust/tests/masked_mailto.rs@@ -0,0 +1,25 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++use fluxer_markdown_parser::{EmojiContext, MarkdownParser, ParserFlags};+use serde_json::{Value, json};++fn parse(input: &str) -> Value {+ let mut parser = MarkdownParser::new(ParserFlags::ALL, EmojiContext::parse(""));+ json!(parser.parse(input).expect("parse succeeds"))+}++#[test]+fn email_text_masks_only_its_own_mailto_address() {+ assert_eq!(+ parse("[[email protected]](mailto:[email protected])")[0]["type"],+ "Link"+ );+ assert_eq!(+ parse("[[email protected]](mailto:[email protected])")[0]["type"],+ "Text"+ );+ assert_eq!(+ parse("[[email protected]](https://example.com)")[0]["type"],+ "Text"+ );+}diff --git a/packages/schema/src/domains/channel/ChannelRequestSchemas.ts b/packages/schema/src/domains/channel/ChannelRequestSchemas.tsindex 96018b3d1..6f737798c 100644--- a/packages/schema/src/domains/channel/ChannelRequestSchemas.ts+++ b/packages/schema/src/domains/channel/ChannelRequestSchemas.ts@@ -175,6 +175,7 @@ const ChannelCreateCategoryRequest = ChannelCreateCommon.extend({const ChannelCreateLinkRequest = ChannelCreateCommon.extend({type: createNamedLiteral(ChannelTypes.GUILD_LINK, 'GUILD_LINK', 'Channel type (link channel)'),name: GeneralChannelNameType.describe('The name of the channel'),+ url: URLType.describe('External URL for link channels'),});const EXPERIMENT = {experiment: 'channel_threads'} as const;@@ -251,6 +252,7 @@ const ChannelUpdateCategoryRequest = ChannelUpdateCommon.extend({const ChannelUpdateLinkRequest = ChannelUpdateCommon.extend({type: createNamedLiteral(ChannelTypes.GUILD_LINK, 'GUILD_LINK', 'Channel type (link channel)'),name: GeneralChannelNameType.nullish().describe('The name of the channel'),+ url: URLType.optional().describe('External URL for link channels'),});const ChannelUpdateGroupDmRequest = z.object({diff --git a/packages/schema/src/domains/message/MessageRequestSchemas.ts b/packages/schema/src/domains/message/MessageRequestSchemas.tsindex 2421c1307..5f01c6722 100644--- a/packages/schema/src/domains/message/MessageRequestSchemas.ts+++ b/packages/schema/src/domains/message/MessageRequestSchemas.ts@@ -1,7 +1,11 @@// SPDX-License-Identifier: AGPL-3.0-or-laterimport {MessageFlags, MessageFlagsDescriptions} from '@fluxer/constants/src/ChannelConstants';-import {MAX_MESSAGE_LENGTH_NON_PREMIUM, MAX_MESSAGE_LENGTH_PREMIUM} from '@fluxer/constants/src/LimitConstants';+import {+ MAX_MESSAGE_LENGTH_NON_PREMIUM,+ MAX_MESSAGE_LENGTH_PREMIUM,+ MESSAGE_SEARCH_MAX_PAGE,+} from '@fluxer/constants/src/LimitConstants';import {ClientAttachmentReferenceRequest,ClientAttachmentRequest,@@ -37,7 +41,7 @@ function omitEmbedObjectWithoutRequiredField(value: unknown, requiredField: strireturn value;}const record = value as Record<string, unknown>;- if (record[requiredField] === undefined || record[requiredField] === null) {+ if (record[requiredField] === undefined || record[requiredField] === null || record[requiredField] === '') {return undefined;}return value;@@ -222,7 +226,7 @@ export const MessageSearchRequest = z.object({.number().int().min(1)- .max(400)+ .max(MESSAGE_SEARCH_MAX_PAGE).default(1).describe('Page number for pagination (ignored when cursor is provided). Use cursor to page beyond this.'),cursor: zdiff --git a/packages/schema/src/domains/tests/MessageRequestSchemas.test.ts b/packages/schema/src/domains/tests/MessageRequestSchemas.test.tsindex a3835b242..2b86c9638 100644--- a/packages/schema/src/domains/tests/MessageRequestSchemas.test.ts+++ b/packages/schema/src/domains/tests/MessageRequestSchemas.test.ts@@ -127,3 +127,11 @@ describe('RichEmbedRequest', () => {expect(result.data.title).toBe('');});});++describe('RichEmbedRequest author', () => {+ it('drops an author whose name is empty', () => {+ const result = RichEmbedRequest.safeParse({author: {name: ''}, description: 'text'});+ expect(result.success).toBe(true);+ expect(result.data?.author).toBeUndefined();+ });+});diff --git a/packages/schema/src/primitives/ChannelValidators.ts b/packages/schema/src/primitives/ChannelValidators.tsindex 7d82a839b..9f109a948 100644--- a/packages/schema/src/primitives/ChannelValidators.ts+++ b/packages/schema/src/primitives/ChannelValidators.ts@@ -61,7 +61,7 @@ function sanitizeChannelName(value: string): string {throw new Error(ValidationErrorCodes.STRING_LENGTH_INVALID);}let s = normalizeString(value);- s = stripInvisibles(s);+ s = stripInvisibles(s, {keepInnerJoinControls: true});s = normalizeWhitespace(s);return s;}diff --git a/packages/schema/src/primitives/SchemaPrimitives.ts b/packages/schema/src/primitives/SchemaPrimitives.tsindex 5c24f6a31..ce89528a8 100644--- a/packages/schema/src/primitives/SchemaPrimitives.ts+++ b/packages/schema/src/primitives/SchemaPrimitives.ts@@ -192,6 +192,7 @@ export function createUnboundedStringType() {// biome-ignore lint/complexity/useRegexLiterals: The literal form trips noControlCharactersInRegex for C0/C1 controls.const C0_C1_CTRL_REGEX = new RegExp('[\\u0000-\\u0008\\u000B\\u000C\\u000E-\\u001F\\u007F\\u0080-\\u009F]', 'g');const JOIN_CONTROLS_REGEX = /(?:\u200C|\u200D)/g;+const STRAY_JOIN_CONTROLS_REGEX = /(?<![^\s\u200C\u200D])[\u200C\u200D]|[\u200C\u200D](?![^\s\u200C\u200D])/gu;const WJ_BOM_REGEX = /(?:\u2060|\uFEFF)/g;const BIDI_CTRL_REGEX = /[\u200E\u200F\u202A-\u202E\u2066-\u2069]/g;const MISC_INVISIBLES_REGEX = /[\u00AD\u180E\uFFFE\uFFFF]/g;@@ -222,17 +223,17 @@ export function normalizeWhitespace(s: string): string {return s.replace(UNICODE_SPACES_REGEX, ' ').replace(/\s+/g, ' ').trim();}-export function stripInvisibles(s: string): string {+export function stripInvisibles(s: string, {keepInnerJoinControls = false} = {}): string {if (s.length > MAX_STRING_PROCESSING_LENGTH) {throw new Error(ValidationErrorCodes.STRING_LENGTH_INVALID);}return s.replace(C0_C1_CTRL_REGEX, '')- .replace(JOIN_CONTROLS_REGEX, '').replace(WJ_BOM_REGEX, '').replace(BIDI_CTRL_REGEX, '').replace(MISC_INVISIBLES_REGEX, '')- .replace(TAG_CHARS_REGEX, '');+ .replace(TAG_CHARS_REGEX, '')+ .replace(keepInnerJoinControls ? STRAY_JOIN_CONTROLS_REGEX : JOIN_CONTROLS_REGEX, '');}export function stripVariationSelectors(s: string): string {diff --git a/packages/schema/src/primitives/tests/ChannelValidators.test.ts b/packages/schema/src/primitives/tests/ChannelValidators.test.tsnew file mode 100644index 000000000..8a3e2a661--- /dev/null+++ b/packages/schema/src/primitives/tests/ChannelValidators.test.ts@@ -0,0 +1,19 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++import {ChannelNameType, GeneralChannelNameType} from '@fluxer/schema/src/primitives/ChannelValidators';+import {describe, expect, it} from 'vitest';++describe('channel names', () => {+ it('keeps joiners inside emoji sequences', () => {+ for (const name of ['🧑💻', '🧝🏿', 'میخواهم']) {+ const general = GeneralChannelNameType.parse(name);+ expect(general).toBe(name);+ expect(ChannelNameType.parse(general)).toBe(name);+ }+ });++ it('drops stray joiners', () => {+ expect(GeneralChannelNameType.parse('general')).toBe('general');+ expect(GeneralChannelNameType.parse('a b')).toBe('a b');+ });+});