Skip to content
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

Add support for Akkoma's move notification #885

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
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
1 change: 1 addition & 0 deletions src/components/ICONS.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,5 @@ export const ICONS = {
'user-x': () => import('@iconify-icons/mingcute/user-x-line'),
minimize: () => import('@iconify-icons/mingcute/arrows-down-line'),
celebrate: () => import('@iconify-icons/mingcute/celebrate-line'),
suitcase: () => import('@iconify-icons/mingcute/suitcase-line'),
};
2 changes: 1 addition & 1 deletion src/components/name-text.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function NameText({
)}
{showAcct && (
<>
<br />
{' '}
Copy link
Owner

Choose a reason for hiding this comment

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

This change seems like could cause some layout issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems to me that it's necessary to prevent them, actually!

With <br>:

With {' '}:

image

Copy link
Owner

Choose a reason for hiding this comment

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

The <br> is used for the large-size post. Maybe need to rename or add another prop to allow both cases.

<i class="bidi-isolate">
{acct2 ? '' : '@'}
{acct1}
Expand Down
14 changes: 14 additions & 0 deletions src/components/notification.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const NOTIFICATION_ICONS = {
emoji_reaction: 'emoji2',
'pleroma:emoji_reaction': 'emoji2',
annual_report: 'celebrate',
move: 'suitcase',
};

/*
Expand Down Expand Up @@ -263,6 +264,13 @@ const contentText = {
emoji_reaction: emojiText,
'pleroma:emoji_reaction': emojiText,
annual_report: ({ year }) => <Trans>Your {year} #Wrapstodon is here!</Trans>,
move: ({ account, targetAccount }) => {
return (
<Trans>
{account} moved to {targetAccount}.
</Trans>
);
},
};

// account_suspension, domain_block, user_domain_block
Expand Down Expand Up @@ -311,6 +319,7 @@ function Notification({
id,
status,
account,
target, // Pleroma move event
report,
event,
moderation_warning,
Expand Down Expand Up @@ -416,6 +425,11 @@ function Notification({
text = text({
...notification.annualReport,
});
} else if (type === 'move') {
text = text({
account: <NameText account={account} showAvatar showAcct />,
targetAccount: <NameText account={target} showAvatar showAcct />,
});
} else {
text = text({
account: account ? (
Expand Down
76 changes: 40 additions & 36 deletions src/locales/en.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading