diff --git a/components/account/AccountHeader.vue b/components/account/AccountHeader.vue
index 0aadff04..65fd38bf 100644
--- a/components/account/AccountHeader.vue
+++ b/components/account/AccountHeader.vue
@@ -64,16 +64,12 @@ function getFieldNameIcon(fieldName: string) {
diff --git a/components/account/AccountMoreButton.vue b/components/account/AccountMoreButton.vue
new file mode 100644
index 00000000..b2537416
--- /dev/null
+++ b/components/account/AccountMoreButton.vue
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+ Open in original site
+
+
+
+
+ Mention @{{ account.acct }}
+
+
+ Direct message @{{ account.acct }}
+
+
+
+ Mute @{{ account.acct }}
+
+
+ Unmute @{{ account.acct }}
+
+
+
+ Block @{{ account.acct }}
+
+
+ Unblock @{{ account.acct }}
+
+
+
+
diff --git a/components/publish/PublishWidget.vue b/components/publish/PublishWidget.vue
index c78e3fcf..ffb41269 100644
--- a/components/publish/PublishWidget.vue
+++ b/components/publish/PublishWidget.vue
@@ -89,7 +89,7 @@ async function publish() {
await masto.statuses.create(status)
else await masto.statuses.update(draft.editingStatus.id, status)
- draft = getDefaultDraft(inReplyToId)
+ draft = getDefaultDraft({ inReplyToId })
isPublishDialogOpen.value = false
}
finally {
diff --git a/components/status/StatusActions.vue b/components/status/StatusActions.vue
index 352e27a0..18e891df 100644
--- a/components/status/StatusActions.vue
+++ b/components/status/StatusActions.vue
@@ -77,9 +77,6 @@ const toggleTranslation = async () => {
const copyLink = async () => {
await clipboard.copy(`${location.origin}${getStatusPath(status)}`)
}
-const openInOriginal = () => {
- window.open(status.url!, '_blank')
-}
const deleteStatus = async () => {
// TODO confirm to delete
@@ -115,16 +112,6 @@ function editStatus() {
attachments: [],
})
}
-
-function mention() {
- openPublishDialog({
- params: {
- ...getParamsFromStatus(status),
- status: `@${status.account.acct} `,
- },
- attachments: [],
- })
-}
@@ -189,9 +176,11 @@ function mention() {
Copy link to this post
-
- Open in original site
-
+
+
+ Open in original site
+
+
@@ -232,7 +221,7 @@ function mention() {
Mention @{{ status.account.acct }}
diff --git a/composables/statusDrafts.ts b/composables/statusDrafts.ts
index d93bfb29..a7119dca 100644
--- a/composables/statusDrafts.ts
+++ b/composables/statusDrafts.ts
@@ -1,4 +1,4 @@
-import type { Attachment, CreateStatusParams, Status } from 'masto'
+import type { Account, Attachment, CreateStatusParams, Status } from 'masto'
import { STORAGE_KEY_DRAFTS } from '~/constants'
import type { Mutable } from '~/types/utils'
@@ -22,12 +22,16 @@ export const currentUserDrafts = computed(() => {
return allDrafts.value[id]
})
-export function getDefaultDraft(inReplyToId?: string): Draft {
+export function getDefaultDraft({
+ status = '',
+ inReplyToId,
+ visibility = 'public',
+}: Partial = {}): Draft {
return {
params: {
- status: '',
+ status,
inReplyToId,
- visibility: 'public',
+ visibility,
},
attachments: [],
}
@@ -45,7 +49,7 @@ export function useDraft(draftKey: string, inReplyToId?: string) {
const draft = computed({
get() {
if (!currentUserDrafts.value[draftKey])
- currentUserDrafts.value[draftKey] = getDefaultDraft(inReplyToId)
+ currentUserDrafts.value[draftKey] = getDefaultDraft({ inReplyToId })
return currentUserDrafts.value[draftKey]
},
@@ -63,3 +67,14 @@ export function useDraft(draftKey: string, inReplyToId?: string) {
}
export const dialogDraft = useDraft('dialog')
+
+export function mentionUser(account: Account) {
+ openPublishDialog(getDefaultDraft({ status: `@${account.acct} ` }))
+}
+
+export function directMessageUser(account: Account) {
+ openPublishDialog(getDefaultDraft({
+ status: `@${account.acct} `,
+ visibility: 'direct',
+ }))
+}