Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/chat-api/Bitwise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,12 @@ export const ROLE_PERMISSIONS = {
bit: 256,
description: () => "Allow users to mention roles",
icon: "alternate_email"
},
MASQUERADE: {
name: () => "Masquerade",
bit: 512,
description: () => "Allow members to change name and avatar per-message",
//icon: "alternate_email" // We dont need curently a icon for that because a "normal" user cant use it
}
};

Expand Down
1 change: 1 addition & 0 deletions src/chat-api/RawData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export interface RawMessage {

buttons: RawMessageButton[];
roleMentions: RawServerRole[];
creatorOverrideId?: string | null;
webhookId?: string;
}

Expand Down
3 changes: 3 additions & 0 deletions src/components/message-pane/message-item/MessageItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ const Details = (props: DetailsProps) => {
: t("message.badge.bot")}
</div>
</Show>
<Show when={!props.message.webhookId && props.message.creatorOverrideId}>
<div class={styles.ownerBadge}>masq</div>
</Show>
Comment on lines +339 to +341

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use the i18n translation function for the masq badge text.

All other badges in this component (owner, bot, webhook) use t("message.badge.*") for localization. The hardcoded "masq" string breaks this pattern and won't be translatable.

🌐 Proposed fix to use i18n
       <Show when={!props.message.webhookId && props.message.creatorOverrideId}>
-        <div class={styles.ownerBadge}>masq</div>
+        <div class={styles.ownerBadge}>{t("message.badge.masq")}</div>
       </Show>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Show when={!props.message.webhookId && props.message.creatorOverrideId}>
<div class={styles.ownerBadge}>masq</div>
</Show>
<Show when={!props.message.webhookId && props.message.creatorOverrideId}>
<div class={styles.ownerBadge}>{t("message.badge.masq")}</div>
</Show>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/message-pane/message-item/MessageItem.tsx` around lines 339 -
341, Update the ownerBadge content in MessageItem to use the component’s
existing i18n translation function with the appropriate message.badge
translation key instead of the hardcoded “masq” text, matching the localization
pattern used by the owner, bot, and webhook badges.

<div class={styles.date}>{formatTimestamp(props.message.createdAt)}</div>
<Show when={props.message.silent}>
<Tooltip tooltip="Silent" anchor="left">
Expand Down