Skip to content

Replace hardcoded strings with MsgType constants #30179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

kenwuuu
Copy link

@kenwuuu kenwuuu commented Jun 20, 2025

Use constants where possible for maintainability and readability.

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.
  • I have licensed the changes to Element by completing the Contributor License Agreement (CLA)

@kenwuuu kenwuuu requested a review from a team as a code owner June 20, 2025 17:18
@kenwuuu kenwuuu requested review from dbkr and t3chguy June 20, 2025 17:18
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions bot added the Z-Community-PR Issue is solved by a community member's PR label Jun 20, 2025
@@ -302,7 +302,7 @@ export default abstract class Exporter {
}

protected isAttachment(mxEv: MatrixEvent): boolean {
const attachmentTypes = ["m.sticker", "m.image", "m.file", "m.video", "m.audio"];
const attachmentTypes = ["m.sticker", MsgType.Image, MsgType.File, MsgType.Video, MsgType.Audio];
Copy link
Author

@kenwuuu kenwuuu Jun 20, 2025

Choose a reason for hiding this comment

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

Didn't change "m.sticker" here because it makes getContext on the next line angry, and I want to keep my first PR small and light.

@t3chguy t3chguy added the T-Task Tasks for the team like planning label Jun 23, 2025
Copy link
Member

@t3chguy t3chguy left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

@t3chguy
Copy link
Member

t3chguy commented Jun 24, 2025

@kenwuuu seems like you have made tests unhappy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Task Tasks for the team like planning Z-Community-PR Issue is solved by a community member's PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants