summaryrefslogtreecommitdiff
path: root/packages/frontend/src/utility/get-user-menu.ts
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-03-24 21:32:46 +0900
committerGitHub <noreply@github.com>2025-03-24 21:32:46 +0900
commitf1f24e39d2df3135493e2c2087230b428e2d02b7 (patch)
treea5ae0e9d2cf810649b2f4e08ef4d00ce7ea91dc9 /packages/frontend/src/utility/get-user-menu.ts
parentfix(frontend): fix broken styles (diff)
downloadmisskey-f1f24e39d2df3135493e2c2087230b428e2d02b7.tar.gz
misskey-f1f24e39d2df3135493e2c2087230b428e2d02b7.tar.bz2
misskey-f1f24e39d2df3135493e2c2087230b428e2d02b7.zip
Feat: Chat (#15686)
* wip * wip * wip * wip * wip * wip * Update types.ts * Create 1742203321812-chat.js * wip * wip * Update room.vue * Update home.vue * Update home.vue * Update ja-JP.yml * Update index.d.ts * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * Update CHANGELOG.md * wip * Update home.vue * clean up * Update misskey-js.api.md * wip * wip * wip * wip * wip * wip * wip * wip * wip * lint fixes * lint * Update UserEntityService.ts * search * wip * 🎨 * wip * Update home.ownedRooms.vue * wip * Update CHANGELOG.md * Update style.scss * wip * improve performance * improve performance * Update timeline.test.ts
Diffstat (limited to 'packages/frontend/src/utility/get-user-menu.ts')
-rw-r--r--packages/frontend/src/utility/get-user-menu.ts73
1 files changed, 39 insertions, 34 deletions
diff --git a/packages/frontend/src/utility/get-user-menu.ts b/packages/frontend/src/utility/get-user-menu.ts
index de20f2678e..37c88c9665 100644
--- a/packages/frontend/src/utility/get-user-menu.ts
+++ b/packages/frontend/src/utility/get-user-menu.ts
@@ -151,24 +151,6 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: Router
const menuItems: MenuItem[] = [];
- menuItems.push({
- icon: 'ti ti-at',
- text: i18n.ts.copyUsername,
- action: () => {
- copyToClipboard(`@${user.username}@${user.host ?? host}`);
- },
- });
-
- if (notesSearchAvailable && (user.host == null || canSearchNonLocalNotes)) {
- menuItems.push({
- icon: 'ti ti-search',
- text: i18n.ts.searchThisUsersNotes,
- action: () => {
- router.push(`/search?username=${encodeURIComponent(user.username)}${user.host != null ? '&host=' + encodeURIComponent(user.host) : ''}`);
- },
- });
- }
-
if (iAmModerator) {
menuItems.push({
icon: 'ti ti-user-exclamation',
@@ -176,10 +158,27 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: Router
action: () => {
router.push(`/admin/user/${user.id}`);
},
- });
+ }, { type: 'divider' });
}
menuItems.push({
+ icon: 'ti ti-at',
+ text: i18n.ts.copyUsername,
+ action: () => {
+ copyToClipboard(`@${user.username}@${user.host ?? host}`);
+ },
+ });
+
+ menuItems.push({
+ icon: 'ti ti-share',
+ text: i18n.ts.copyProfileUrl,
+ action: () => {
+ const canonical = user.host === null ? `@${user.username}` : `@${user.username}@${toUnicode(user.host)}`;
+ copyToClipboard(`${url}/${canonical}`);
+ },
+ });
+
+ menuItems.push({
icon: 'ti ti-rss',
text: i18n.ts.copyRSS,
action: () => {
@@ -210,24 +209,18 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: Router
});
}
- menuItems.push({
- icon: 'ti ti-share',
- text: i18n.ts.copyProfileUrl,
- action: () => {
- const canonical = user.host === null ? `@${user.username}` : `@${user.username}@${toUnicode(user.host)}`;
- copyToClipboard(`${url}/${canonical}`);
- },
- });
-
- if ($i) {
+ if (notesSearchAvailable && (user.host == null || canSearchNonLocalNotes)) {
menuItems.push({
- icon: 'ti ti-mail',
- text: i18n.ts.sendMessage,
+ icon: 'ti ti-search',
+ text: i18n.ts.searchThisUsersNotes,
action: () => {
- const canonical = user.host === null ? `@${user.username}` : `@${user.username}@${user.host}`;
- os.post({ specified: user, initialText: `${canonical} ` });
+ router.push(`/search?username=${encodeURIComponent(user.username)}${user.host != null ? '&host=' + encodeURIComponent(user.host) : ''}`);
},
- }, { type: 'divider' }, {
+ });
+ }
+
+ if ($i) {
+ menuItems.push({ type: 'divider' }, {
icon: 'ti ti-pencil',
text: i18n.ts.editMemo,
action: editMemo,
@@ -363,6 +356,18 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: Router
//}
menuItems.push({ type: 'divider' }, {
+ icon: 'ti ti-mail',
+ text: i18n.ts.sendMessage,
+ action: () => {
+ const canonical = user.host === null ? `@${user.username}` : `@${user.username}@${user.host}`;
+ os.post({ specified: user, initialText: `${canonical} ` });
+ },
+ }, {
+ type: 'link',
+ icon: 'ti ti-messages',
+ text: i18n.ts._chat.chatWithThisUser,
+ to: `/chat/user/${user.id}`,
+ }, { type: 'divider' }, {
icon: user.isMuted ? 'ti ti-eye' : 'ti ti-eye-off',
text: user.isMuted ? i18n.ts.unmute : i18n.ts.mute,
action: toggleMute,