upd: add support in frontend

This commit is contained in:
Insert5StarName 2023-09-22 22:33:18 +02:00
parent feec3c302b
commit dc10579950
7 changed files with 47 additions and 3 deletions

View file

@ -39,6 +39,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</span>
<span v-if="note.localOnly" style="margin-left: 0.5em;" :title="i18n.ts._visibility['disableFederation']"><i class="ti ti-rocket-off"></i></span>
<span v-if="note.channel" style="margin-left: 0.5em;" :title="note.channel.name"><i class="ti ti-device-tv"></i></span>
<span v-if="note.updatedAt" style="margin-left: 0.5em;" :title="'edited'"><i class="ti ti-pencil"></i></span>
</div>
</div>
<div v-if="renoteCollapsed" :class="$style.collapsedRenoteTarget">

View file

@ -58,6 +58,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<i v-else-if="appearNote.visibility === 'followers'" class="ti ti-lock"></i>
<i v-else-if="appearNote.visibility === 'specified'" ref="specified" class="ti ti-mail"></i>
</span>
<span v-if="appearNote.updatedAt" style="margin-left: 0.5em;" :title="'Edited'"><i class="ti ti-pencil"></i></span>
<span v-if="appearNote.localOnly" style="margin-left: 0.5em;" :title="i18n.ts._visibility['disableFederation']"><i class="ti ti-rocket-off"></i></span>
</div>
</div>

View file

@ -22,6 +22,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<i v-else-if="note.visibility === 'followers'" class="ti ti-lock"></i>
<i v-else-if="note.visibility === 'specified'" ref="specified" class="ti ti-mail"></i>
</span>
<span v-if="note.updatedAt" style="margin-left: 0.5em;" :title="'Edited'"><i class="ti ti-pencil"></i></span>
<span v-if="note.localOnly" style="margin-left: 0.5em;" :title="i18n.ts._visibility['disableFederation']"><i class="ti ti-rocket-off"></i></span>
<span v-if="note.channel" style="margin-left: 0.5em;" :title="note.channel.name"><i class="ti ti-device-tv"></i></span>
</div>

View file

@ -143,6 +143,7 @@ const props = withDefaults(defineProps<{
fixed?: boolean;
autofocus?: boolean;
freezeAfterPosted?: boolean;
editId?: Misskey.entities.Note["id"];
}>(), {
initialVisibleUsers: () => [],
autofocus: true,
@ -709,6 +710,7 @@ async function post(ev?: MouseEvent) {
visibility: visibility,
visibleUserIds: visibility === 'specified' ? visibleUsers.map(u => u.id) : undefined,
reactionAcceptance,
editId: props.editId ? props.editId : undefined,
};
if (withHashtags && hashtags && hashtags.trim() !== '') {
@ -731,7 +733,7 @@ async function post(ev?: MouseEvent) {
}
posting = true;
os.api('notes/create', postData, token).then(() => {
os.api(postData.editId ? "notes/edit" : "notes/create", postData, token).then(() => {
if (props.freezeAfterPosted) {
posted = true;
} else {
@ -755,7 +757,7 @@ async function post(ev?: MouseEvent) {
const text = postData.text ?? '';
const lowerCase = text.toLowerCase();
if ((lowerCase.includes('love') || lowerCase.includes('❤')) && lowerCase.includes('misskey')) {
if ((lowerCase.includes('love') || lowerCase.includes('❤')) && lowerCase.includes('sharkey')) {
claimAchievement('iLoveMisskey');
}
if ([

View file

@ -30,6 +30,7 @@ const props = defineProps<{
instant?: boolean;
fixed?: boolean;
autofocus?: boolean;
editId?: Misskey.entities.Note["id"];
}>();
const emit = defineEmits<{