fix: hidden post federation

This commit is contained in:
trollo 2023-05-06 18:27:17 +02:00
parent 3b45cd8f40
commit 8a51c73fe7
4 changed files with 7 additions and 6 deletions

View file

@ -16,6 +16,7 @@ export default async function renderNote(
dive = true, dive = true,
isTalk = false, isTalk = false,
): Promise<Record<string, unknown>> { ): Promise<Record<string, unknown>> {
note.visibility = note.visibility === "hidden" ? "home" : note.visibility;
const getPromisedFiles = async (ids: string[]) => { const getPromisedFiles = async (ids: string[]) => {
if (!ids || ids.length === 0) return []; if (!ids || ids.length === 0) return [];
const items = await DriveFiles.findBy({ id: In(ids) }); const items = await DriveFiles.findBy({ id: In(ids) });

View file

@ -606,7 +606,8 @@ export default async (
}); });
async function renderNoteOrRenoteActivity(data: Option, note: Note) { async function renderNoteOrRenoteActivity(data: Option, note: Note) {
if (data.localOnly) return null; if (data.localOnly ||
note.visibility !== "hidden") return null;
const content = const content =
data.renote && data.renote &&

View file

@ -146,8 +146,7 @@ export default async (
//#region deliver //#region deliver
if ( if (
Users.isLocalUser(user) && Users.isLocalUser(user) &&
!note.localOnly && !note.localOnly
note.visibility !== "hidden"
) { ) {
const content = renderActivity(await renderLike(record, note)); const content = renderActivity(await renderLike(record, note));
const dm = new DeliverManager(user, content); const dm = new DeliverManager(user, content);

View file

@ -35,7 +35,7 @@ const buttonRef = ref<HTMLElement>();
const canRenote = computed( const canRenote = computed(
() => () =>
["public", "home"].includes(props.note.visibility) || ["public", "home","hidden"].includes(props.note.visibility) ||
props.note.userId === $i.id props.note.userId === $i.id
); );
@ -75,7 +75,7 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => {
let buttonActions = []; let buttonActions = [];
if (props.note.visibility === "public") { if (props.note.visibility === "public" || props.note.visibility === "hidden") {
buttonActions.push({ buttonActions.push({
text: i18n.ts.renote, text: i18n.ts.renote,
textStyle: "font-weight: bold", textStyle: "font-weight: bold",
@ -102,7 +102,7 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => {
}); });
} }
if (["public", "home"].includes(props.note.visibility)) { if (["public", "home","hidden"].includes(props.note.visibility)) {
buttonActions.push({ buttonActions.push({
text: `${i18n.ts.renote} (${i18n.ts._visibility.home})`, text: `${i18n.ts.renote} (${i18n.ts._visibility.home})`,
icon: "ph-house ph-bold ph-lg", icon: "ph-house ph-bold ph-lg",