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 4 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 @@ -174,4 +174,5 @@ export const ICONS = {
'heart-break': () => import('@iconify-icons/mingcute/heart-crack-line'),
'user-x': () => import('@iconify-icons/mingcute/user-x-line'),
minimize: () => import('@iconify-icons/mingcute/arrows-down-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 />
{' '}
<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 @@ -33,6 +33,7 @@ const NOTIFICATION_ICONS = {
moderation_warning: 'alert',
emoji_reaction: 'emoji2',
'pleroma:emoji_reaction': 'emoji2',
move: 'suitcase',
};

/*
Expand Down Expand Up @@ -261,6 +262,13 @@ const contentText = {
),
emoji_reaction: emojiText,
'pleroma:emoji_reaction': emojiText,
move: ({ account, targetAccount }) => {
return (
<Trans>
{account} moved to {targetAccount}.
</Trans>
);
},
};

// account_suspension, domain_block, user_domain_block
Expand Down Expand Up @@ -309,6 +317,7 @@ function Notification({
id,
status,
account,
target, // Pleroma move event
report,
event,
moderation_warning,
Expand Down Expand Up @@ -409,6 +418,11 @@ function Notification({
emoji: notification.emoji,
emojiURL,
});
} 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
112 changes: 58 additions & 54 deletions src/locales/en.po

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