From 5a2ca61f2606274f85a068974960ff65849857a0 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Wed, 26 Jul 2023 23:02:37 +0200 Subject: [PATCH] Remove support for ads --- CHANGES_FROM_UPSTREAM.md | 2 +- .../backend/native-utils/migration/src/lib.rs | 2 + .../src/m20230726_213530_drop_ads.rs | 69 ++++++ .../backend/native-utils/src/model/entity.rs | 1 - .../native-utils/src/model/entity/ad.rs | 26 -- .../native-utils/src/model/entity/prelude.rs | 1 - packages/backend/src/db/postgre.ts | 2 - packages/backend/src/models/entities/ad.ts | 65 ----- packages/backend/src/models/index.ts | 2 - packages/backend/src/server/api/endpoints.ts | 8 - .../server/api/endpoints/admin/ad/create.ts | 46 ---- .../server/api/endpoints/admin/ad/delete.ts | 34 --- .../src/server/api/endpoints/admin/ad/list.ts | 32 --- .../server/api/endpoints/admin/ad/update.ts | 58 ----- .../src/server/api/endpoints/admin/meta.ts | 29 --- .../backend/src/server/api/endpoints/meta.ts | 48 +--- .../src/components/MkDateSeparatedList.vue | 21 +- packages/client/src/components/MkNotes.vue | 1 - .../client/src/components/global/MkAd.vue | 222 ------------------ packages/client/src/components/index.ts | 3 - packages/client/src/pages/admin/index.vue | 6 - .../client/src/pages/admin/promotions.vue | 158 ------------- packages/client/src/pages/favorites.vue | 1 - packages/client/src/pages/gallery/post.vue | 1 - packages/client/src/pages/page.vue | 1 - .../client/src/pages/settings/general.vue | 5 - .../pages/settings/preferences-backups.vue | 1 - packages/client/src/router.ts | 5 - packages/client/src/store.ts | 8 - .../client/src/ui/deck/widgets-column.vue | 1 - packages/client/src/ui/universal.widgets.vue | 1 - packages/iceshrimp-js/src/api.types.ts | 1 - packages/iceshrimp-js/src/entities.ts | 9 - 33 files changed, 76 insertions(+), 794 deletions(-) create mode 100644 packages/backend/native-utils/migration/src/m20230726_213530_drop_ads.rs delete mode 100644 packages/backend/native-utils/src/model/entity/ad.rs delete mode 100644 packages/backend/src/models/entities/ad.ts delete mode 100644 packages/backend/src/server/api/endpoints/admin/ad/create.ts delete mode 100644 packages/backend/src/server/api/endpoints/admin/ad/delete.ts delete mode 100644 packages/backend/src/server/api/endpoints/admin/ad/list.ts delete mode 100644 packages/backend/src/server/api/endpoints/admin/ad/update.ts delete mode 100644 packages/client/src/components/global/MkAd.vue delete mode 100644 packages/client/src/pages/admin/promotions.vue diff --git a/CHANGES_FROM_UPSTREAM.md b/CHANGES_FROM_UPSTREAM.md index ef10e9931..26bdcf760 100644 --- a/CHANGES_FROM_UPSTREAM.md +++ b/CHANGES_FROM_UPSTREAM.md @@ -119,11 +119,11 @@ - [DragonflyDB](https://dragonflydb.io/) support as a Redis alternative - Link verification - Importing posts from other Misskey/Mastodon/Pleroma/Akkoma instances +- Removed ability to serve ads ## Implemented (remote) - MissV: [fix Misskey Forkbomb](https://code.vtopia.live/Vtopia/MissV/commit/40b23c070bd4adbb3188c73546c6c625138fb3c1) -- [Make showing ads optional](https://github.com/misskey-dev/misskey/pull/8996) - [Tapping avatar in mobile opens account modal](https://github.com/misskey-dev/misskey/pull/9056) - [OAuth bearer token authentication](https://github.com/misskey-dev/misskey/pull/9021) - [Styled Repair Tools](https://github.com/misskey-dev/misskey/pull/8956) diff --git a/packages/backend/native-utils/migration/src/lib.rs b/packages/backend/native-utils/migration/src/lib.rs index 5ad23f162..a6f2fd5c9 100644 --- a/packages/backend/native-utils/migration/src/lib.rs +++ b/packages/backend/native-utils/migration/src/lib.rs @@ -3,6 +3,7 @@ pub use sea_orm_migration::prelude::*; mod m20230531_180824_drop_reversi; mod m20230627_185451_index_note_url; mod m20230709_000510_move_antenna_to_cache; +mod m20230726_213530_drop_ads; pub struct Migrator; @@ -13,6 +14,7 @@ impl MigratorTrait for Migrator { Box::new(m20230531_180824_drop_reversi::Migration), Box::new(m20230627_185451_index_note_url::Migration), Box::new(m20230709_000510_move_antenna_to_cache::Migration), + Box::new(m20230726_213530_drop_ads::Migration), ] } } diff --git a/packages/backend/native-utils/migration/src/m20230726_213530_drop_ads.rs b/packages/backend/native-utils/migration/src/m20230726_213530_drop_ads.rs new file mode 100644 index 000000000..1a6aa1143 --- /dev/null +++ b/packages/backend/native-utils/migration/src/m20230726_213530_drop_ads.rs @@ -0,0 +1,69 @@ +use sea_orm::entity::prelude::*; +use sea_orm::Schema; + +use sea_orm_migration::{ + prelude::*, + sea_orm::{DbBackend, Statement}, +}; + +#[derive(DeriveMigrationName)] +pub struct Migration; + +#[async_trait::async_trait] +impl MigrationTrait for Migration { + async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { + if manager.get_database_backend() == DbBackend::Sqlite { + return Ok(()); + } + + let db = manager.get_connection(); + db.query_one(Statement::from_string( + DbBackend::Postgres, + Table::drop() + .table(Entity) + .if_exists() + .to_string(PostgresQueryBuilder), + )) + .await?; + + Ok(()) + } + + async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { + if manager.get_database_backend() == DbBackend::Sqlite { + return Ok(()); + } + + let db = manager.get_connection(); + let builder = db.get_database_backend(); + let schema = Schema::new(builder); + + db.execute(builder.build(&schema.create_table_from_entity(Entity))) + .await?; + + Ok(()) + } +} + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Default)] +#[sea_orm(table_name = "ad")] +pub struct Model { + #[sea_orm(primary_key, auto_increment = false)] + pub id: String, + #[sea_orm(column_name = "createdAt")] + pub created_at: DateTimeWithTimeZone, + #[sea_orm(column_name = "expiresAt")] + pub expires_at: DateTimeWithTimeZone, + pub place: String, + pub priority: String, + pub url: String, + #[sea_orm(column_name = "imageUrl")] + pub image_url: String, + pub memo: String, + pub ratio: i32, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation {} + +impl ActiveModelBehavior for ActiveModel {} diff --git a/packages/backend/native-utils/src/model/entity.rs b/packages/backend/native-utils/src/model/entity.rs index ccf3f0060..617133be3 100644 --- a/packages/backend/native-utils/src/model/entity.rs +++ b/packages/backend/native-utils/src/model/entity.rs @@ -4,7 +4,6 @@ pub mod prelude; pub mod abuse_user_report; pub mod access_token; -pub mod ad; pub mod announcement; pub mod announcement_read; pub mod antenna; diff --git a/packages/backend/native-utils/src/model/entity/ad.rs b/packages/backend/native-utils/src/model/entity/ad.rs deleted file mode 100644 index 2cf7a6fc8..000000000 --- a/packages/backend/native-utils/src/model/entity/ad.rs +++ /dev/null @@ -1,26 +0,0 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 - -use sea_orm::entity::prelude::*; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Default)] -#[sea_orm(table_name = "ad")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub id: String, - #[sea_orm(column_name = "createdAt")] - pub created_at: DateTimeWithTimeZone, - #[sea_orm(column_name = "expiresAt")] - pub expires_at: DateTimeWithTimeZone, - pub place: String, - pub priority: String, - pub url: String, - #[sea_orm(column_name = "imageUrl")] - pub image_url: String, - pub memo: String, - pub ratio: i32, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation {} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/packages/backend/native-utils/src/model/entity/prelude.rs b/packages/backend/native-utils/src/model/entity/prelude.rs index a859a9cc3..0cc484727 100644 --- a/packages/backend/native-utils/src/model/entity/prelude.rs +++ b/packages/backend/native-utils/src/model/entity/prelude.rs @@ -2,7 +2,6 @@ pub use super::abuse_user_report::Entity as AbuseUserReport; pub use super::access_token::Entity as AccessToken; -pub use super::ad::Entity as Ad; pub use super::announcement::Entity as Announcement; pub use super::announcement_read::Entity as AnnouncementRead; pub use super::antenna::Entity as Antenna; diff --git a/packages/backend/src/db/postgre.ts b/packages/backend/src/db/postgre.ts index 10ea5b15f..2e24bf670 100644 --- a/packages/backend/src/db/postgre.ts +++ b/packages/backend/src/db/postgre.ts @@ -66,7 +66,6 @@ import { Channel } from "@/models/entities/channel.js"; import { ChannelFollowing } from "@/models/entities/channel-following.js"; import { ChannelNotePining } from "@/models/entities/channel-note-pining.js"; import { RegistryItem } from "@/models/entities/registry-item.js"; -import { Ad } from "@/models/entities/ad.js"; import { PasswordResetRequest } from "@/models/entities/password-reset-request.js"; import { UserPending } from "@/models/entities/user-pending.js"; import { Webhook } from "@/models/entities/webhook.js"; @@ -175,7 +174,6 @@ export const entities = [ ChannelFollowing, ChannelNotePining, RegistryItem, - Ad, PasswordResetRequest, UserPending, Webhook, diff --git a/packages/backend/src/models/entities/ad.ts b/packages/backend/src/models/entities/ad.ts deleted file mode 100644 index 80d54ddd5..000000000 --- a/packages/backend/src/models/entities/ad.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { Entity, Index, Column, PrimaryColumn } from "typeorm"; -import { id } from "../id.js"; - -@Entity() -export class Ad { - @PrimaryColumn(id()) - public id: string; - - @Index() - @Column("timestamp with time zone", { - comment: "The created date of the Ad.", - }) - public createdAt: Date; - - @Index() - @Column("timestamp with time zone", { - comment: "The expired date of the Ad.", - }) - public expiresAt: Date; - - @Column("varchar", { - length: 32, - nullable: false, - }) - public place: string; - - // 今は使われていないが将来的に活用される可能性はある - @Column("varchar", { - length: 32, - nullable: false, - }) - public priority: string; - - @Column("integer", { - default: 1, - nullable: false, - }) - public ratio: number; - - @Column("varchar", { - length: 1024, - nullable: false, - }) - public url: string; - - @Column("varchar", { - length: 1024, - nullable: false, - }) - public imageUrl: string; - - @Column("varchar", { - length: 8192, - nullable: false, - }) - public memo: string; - - constructor(data: Partial) { - if (data == null) return; - - for (const [k, v] of Object.entries(data)) { - (this as any)[k] = v; - } - } -} diff --git a/packages/backend/src/models/index.ts b/packages/backend/src/models/index.ts index 8782d5740..53087fa19 100644 --- a/packages/backend/src/models/index.ts +++ b/packages/backend/src/models/index.ts @@ -60,7 +60,6 @@ import { MutedNote } from "./entities/muted-note.js"; import { ChannelFollowing } from "./entities/channel-following.js"; import { ChannelNotePining } from "./entities/channel-note-pining.js"; import { RegistryItem } from "./entities/registry-item.js"; -import { Ad } from "./entities/ad.js"; import { PasswordResetRequest } from "./entities/password-reset-request.js"; import { UserPending } from "./entities/user-pending.js"; import { InstanceRepository } from "./repositories/instance.js"; @@ -131,5 +130,4 @@ export const ChannelFollowings = db.getRepository(ChannelFollowing); export const ChannelNotePinings = db.getRepository(ChannelNotePining); export const RegistryItems = db.getRepository(RegistryItem); export const Webhooks = db.getRepository(Webhook); -export const Ads = db.getRepository(Ad); export const PasswordResetRequests = db.getRepository(PasswordResetRequest); diff --git a/packages/backend/src/server/api/endpoints.ts b/packages/backend/src/server/api/endpoints.ts index d4bd4a2b1..507faf87e 100644 --- a/packages/backend/src/server/api/endpoints.ts +++ b/packages/backend/src/server/api/endpoints.ts @@ -5,10 +5,6 @@ import * as ep___admin_abuseUserReports from "./endpoints/admin/abuse-user-repor import * as ep___admin_accounts_create from "./endpoints/admin/accounts/create.js"; import * as ep___admin_accounts_delete from "./endpoints/admin/accounts/delete.js"; import * as ep___admin_accounts_hosted from "./endpoints/admin/accounts/hosted.js"; -import * as ep___admin_ad_create from "./endpoints/admin/ad/create.js"; -import * as ep___admin_ad_delete from "./endpoints/admin/ad/delete.js"; -import * as ep___admin_ad_list from "./endpoints/admin/ad/list.js"; -import * as ep___admin_ad_update from "./endpoints/admin/ad/update.js"; import * as ep___admin_announcements_create from "./endpoints/admin/announcements/create.js"; import * as ep___admin_announcements_delete from "./endpoints/admin/announcements/delete.js"; import * as ep___admin_announcements_list from "./endpoints/admin/announcements/list.js"; @@ -351,10 +347,6 @@ const eps = [ ["admin/accounts/create", ep___admin_accounts_create], ["admin/accounts/delete", ep___admin_accounts_delete], ["admin/accounts/hosted", ep___admin_accounts_hosted], - ["admin/ad/create", ep___admin_ad_create], - ["admin/ad/delete", ep___admin_ad_delete], - ["admin/ad/list", ep___admin_ad_list], - ["admin/ad/update", ep___admin_ad_update], ["admin/announcements/create", ep___admin_announcements_create], ["admin/announcements/delete", ep___admin_announcements_delete], ["admin/announcements/list", ep___admin_announcements_list], diff --git a/packages/backend/src/server/api/endpoints/admin/ad/create.ts b/packages/backend/src/server/api/endpoints/admin/ad/create.ts deleted file mode 100644 index db39f3eb2..000000000 --- a/packages/backend/src/server/api/endpoints/admin/ad/create.ts +++ /dev/null @@ -1,46 +0,0 @@ -import define from "../../../define.js"; -import { Ads } from "@/models/index.js"; -import { genId } from "@/misc/gen-id.js"; - -export const meta = { - tags: ["admin"], - - requireCredential: true, - requireModerator: true, -} as const; - -export const paramDef = { - type: "object", - properties: { - url: { type: "string", minLength: 1 }, - memo: { type: "string" }, - place: { type: "string" }, - priority: { type: "string" }, - ratio: { type: "integer" }, - expiresAt: { type: "integer" }, - imageUrl: { type: "string", minLength: 1 }, - }, - required: [ - "url", - "memo", - "place", - "priority", - "ratio", - "expiresAt", - "imageUrl", - ], -} as const; - -export default define(meta, paramDef, async (ps) => { - await Ads.insert({ - id: genId(), - createdAt: new Date(), - expiresAt: new Date(ps.expiresAt), - url: ps.url, - imageUrl: ps.imageUrl, - priority: ps.priority, - ratio: ps.ratio, - place: ps.place, - memo: ps.memo, - }); -}); diff --git a/packages/backend/src/server/api/endpoints/admin/ad/delete.ts b/packages/backend/src/server/api/endpoints/admin/ad/delete.ts deleted file mode 100644 index ee6d314de..000000000 --- a/packages/backend/src/server/api/endpoints/admin/ad/delete.ts +++ /dev/null @@ -1,34 +0,0 @@ -import define from "../../../define.js"; -import { Ads } from "@/models/index.js"; -import { ApiError } from "../../../error.js"; - -export const meta = { - tags: ["admin"], - - requireCredential: true, - requireModerator: true, - - errors: { - noSuchAd: { - message: "No such ad.", - code: "NO_SUCH_AD", - id: "ccac9863-3a03-416e-b899-8a64041118b1", - }, - }, -} as const; - -export const paramDef = { - type: "object", - properties: { - id: { type: "string", format: "misskey:id" }, - }, - required: ["id"], -} as const; - -export default define(meta, paramDef, async (ps, me) => { - const ad = await Ads.findOneBy({ id: ps.id }); - - if (ad == null) throw new ApiError(meta.errors.noSuchAd); - - await Ads.delete(ad.id); -}); diff --git a/packages/backend/src/server/api/endpoints/admin/ad/list.ts b/packages/backend/src/server/api/endpoints/admin/ad/list.ts deleted file mode 100644 index 65944d31e..000000000 --- a/packages/backend/src/server/api/endpoints/admin/ad/list.ts +++ /dev/null @@ -1,32 +0,0 @@ -import define from "../../../define.js"; -import { Ads } from "@/models/index.js"; -import { makePaginationQuery } from "../../../common/make-pagination-query.js"; - -export const meta = { - tags: ["admin"], - - requireCredential: true, - requireModerator: true, -} as const; - -export const paramDef = { - type: "object", - properties: { - limit: { type: "integer", minimum: 1, maximum: 100, default: 10 }, - sinceId: { type: "string", format: "misskey:id" }, - untilId: { type: "string", format: "misskey:id" }, - }, - required: [], -} as const; - -export default define(meta, paramDef, async (ps) => { - const query = makePaginationQuery( - Ads.createQueryBuilder("ad"), - ps.sinceId, - ps.untilId, - ).andWhere("ad.expiresAt > :now", { now: new Date() }); - - const ads = await query.take(ps.limit).getMany(); - - return ads; -}); diff --git a/packages/backend/src/server/api/endpoints/admin/ad/update.ts b/packages/backend/src/server/api/endpoints/admin/ad/update.ts deleted file mode 100644 index 2c7038731..000000000 --- a/packages/backend/src/server/api/endpoints/admin/ad/update.ts +++ /dev/null @@ -1,58 +0,0 @@ -import define from "../../../define.js"; -import { Ads } from "@/models/index.js"; -import { ApiError } from "../../../error.js"; - -export const meta = { - tags: ["admin"], - - requireCredential: true, - requireModerator: true, - - errors: { - noSuchAd: { - message: "No such ad.", - code: "NO_SUCH_AD", - id: "b7aa1727-1354-47bc-a182-3a9c3973d300", - }, - }, -} as const; - -export const paramDef = { - type: "object", - properties: { - id: { type: "string", format: "misskey:id" }, - memo: { type: "string" }, - url: { type: "string", minLength: 1 }, - imageUrl: { type: "string", minLength: 1 }, - place: { type: "string" }, - priority: { type: "string" }, - ratio: { type: "integer" }, - expiresAt: { type: "integer" }, - }, - required: [ - "id", - "memo", - "url", - "imageUrl", - "place", - "priority", - "ratio", - "expiresAt", - ], -} as const; - -export default define(meta, paramDef, async (ps, me) => { - const ad = await Ads.findOneBy({ id: ps.id }); - - if (ad == null) throw new ApiError(meta.errors.noSuchAd); - - await Ads.update(ad.id, { - url: ps.url, - place: ps.place, - priority: ps.priority, - ratio: ps.ratio, - memo: ps.memo, - imageUrl: ps.imageUrl, - expiresAt: new Date(ps.expiresAt), - }); -}); diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index 9abb57b1b..0f3a049c2 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -136,35 +136,6 @@ export const meta = { }, }, }, - ads: { - type: "array", - optional: false, - nullable: false, - items: { - type: "object", - optional: false, - nullable: false, - properties: { - place: { - type: "string", - optional: false, - nullable: false, - }, - url: { - type: "string", - optional: false, - nullable: false, - format: "url", - }, - imageUrl: { - type: "string", - optional: false, - nullable: false, - format: "url", - }, - }, - }, - }, enableEmail: { type: "boolean", optional: false, diff --git a/packages/backend/src/server/api/endpoints/meta.ts b/packages/backend/src/server/api/endpoints/meta.ts index 84a698801..b1f9eee30 100644 --- a/packages/backend/src/server/api/endpoints/meta.ts +++ b/packages/backend/src/server/api/endpoints/meta.ts @@ -2,7 +2,7 @@ import JSON5 from "json5"; import { IsNull, MoreThan } from "typeorm"; import config from "@/config/index.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; -import { Ads, Emojis, Users } from "@/models/index.js"; +import { Emojis, Users } from "@/models/index.js"; import { MAX_NOTE_TEXT_LENGTH, MAX_CAPTION_TEXT_LENGTH } from "@/const.js"; import define from "../define.js"; @@ -228,35 +228,6 @@ export const meta = { }, }, }, - ads: { - type: "array", - optional: false, - nullable: false, - items: { - type: "object", - optional: false, - nullable: false, - properties: { - place: { - type: "string", - optional: false, - nullable: false, - }, - url: { - type: "string", - optional: false, - nullable: false, - format: "url", - }, - imageUrl: { - type: "string", - optional: false, - nullable: false, - format: "url", - }, - }, - }, - }, requireSetup: { type: "boolean", optional: false, @@ -423,12 +394,6 @@ export default define(meta, paramDef, async (ps, me) => { }, }); - const ads = await Ads.find({ - where: { - expiresAt: MoreThan(new Date()), - }, - }); - const response: any = { maintainerName: instance.maintainerName, maintainerEmail: instance.maintainerEmail, @@ -475,16 +440,7 @@ export default define(meta, paramDef, async (ps, me) => { defaultDarkTheme: instance.defaultDarkTheme ? JSON.stringify(JSON5.parse(instance.defaultDarkTheme)) : null, - ads: - instance.privateMode && !me - ? [] - : ads.map((ad) => ({ - id: ad.id, - url: ad.url, - place: ad.place, - ratio: ad.ratio, - imageUrl: ad.imageUrl, - })), + enableEmail: instance.enableEmail, enableTwitterIntegration: instance.enableTwitterIntegration, diff --git a/packages/client/src/components/MkDateSeparatedList.vue b/packages/client/src/components/MkDateSeparatedList.vue index 4958d8770..d84b5ba58 100644 --- a/packages/client/src/components/MkDateSeparatedList.vue +++ b/packages/client/src/components/MkDateSeparatedList.vue @@ -1,7 +1,6 @@ - - diff --git a/packages/client/src/components/index.ts b/packages/client/src/components/index.ts index 7da095e7d..832426c6b 100644 --- a/packages/client/src/components/index.ts +++ b/packages/client/src/components/index.ts @@ -13,7 +13,6 @@ import I18n from "./global/i18n"; import RouterView from "./global/RouterView.vue"; import MkLoading from "./global/MkLoading.vue"; import MkError from "./global/MkError.vue"; -import MkAd from "./global/MkAd.vue"; import MkPageHeader from "./global/MkPageHeader.vue"; import MkSpacer from "./global/MkSpacer.vue"; import MkStickyContainer from "./global/MkStickyContainer.vue"; @@ -32,7 +31,6 @@ export default function (app: App) { app.component("MkUrl", MkUrl); app.component("MkLoading", MkLoading); app.component("MkError", MkError); - app.component("MkAd", MkAd); app.component("MkPageHeader", MkPageHeader); app.component("MkSpacer", MkSpacer); app.component("MkStickyContainer", MkStickyContainer); @@ -53,7 +51,6 @@ declare module "@vue/runtime-core" { MkUrl: typeof MkUrl; MkLoading: typeof MkLoading; MkError: typeof MkError; - MkAd: typeof MkAd; MkPageHeader: typeof MkPageHeader; MkSpacer: typeof MkSpacer; MkStickyContainer: typeof MkStickyContainer; diff --git a/packages/client/src/pages/admin/index.vue b/packages/client/src/pages/admin/index.vue index 5b42219d9..6fe280830 100644 --- a/packages/client/src/pages/admin/index.vue +++ b/packages/client/src/pages/admin/index.vue @@ -218,12 +218,6 @@ const menuDef = $computed(() => [ to: "/admin/announcements", active: currentPage?.route.name === "announcements", }, - { - icon: "ph-money ph-bold ph-lg", - text: i18n.ts.ads, - to: "/admin/ads", - active: currentPage?.route.name === "ads", - }, { icon: "ph-warning-circle ph-bold ph-lg", text: i18n.ts.abuseReports, diff --git a/packages/client/src/pages/admin/promotions.vue b/packages/client/src/pages/admin/promotions.vue deleted file mode 100644 index eb14fa52f..000000000 --- a/packages/client/src/pages/admin/promotions.vue +++ /dev/null @@ -1,158 +0,0 @@ - - - - - diff --git a/packages/client/src/pages/favorites.vue b/packages/client/src/pages/favorites.vue index 84b5979ba..bed79909f 100644 --- a/packages/client/src/pages/favorites.vue +++ b/packages/client/src/pages/favorites.vue @@ -20,7 +20,6 @@ :items="items" :direction="'down'" :no-gap="false" - :ad="false" > - --> - - {{ - i18n.ts.showAds - }} {{ i18n.ts.useBlurEffect }} @@ -298,7 +295,6 @@ const useBlurEffect = computed(defaultStore.makeGetterSetter("useBlurEffect")); const showGapBetweenNotesInTimeline = computed( defaultStore.makeGetterSetter("showGapBetweenNotesInTimeline"), ); -const showAds = computed(defaultStore.makeGetterSetter("showAds")); const advancedMfm = computed(defaultStore.makeGetterSetter("advancedMfm")); const autoplayMfm = computed( defaultStore.makeGetterSetter( @@ -392,7 +388,6 @@ watch( showGapBetweenNotesInTimeline, instanceTicker, overridedDeviceKind, - showAds, showUpdates, swipeOnMobile, swipeOnDesktop, diff --git a/packages/client/src/pages/settings/preferences-backups.vue b/packages/client/src/pages/settings/preferences-backups.vue index dcee4587f..8dd2b05bf 100644 --- a/packages/client/src/pages/settings/preferences-backups.vue +++ b/packages/client/src/pages/settings/preferences-backups.vue @@ -83,7 +83,6 @@ const defaultStoreSaveKeys: (keyof (typeof defaultStore)["state"])[] = [ "overridedDeviceKind", "serverDisconnectedBehavior", "nsfw", - "showAds", "animation", "animatedMfm", "loadRawImages", diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index 3971fb004..8b382948e 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -484,11 +484,6 @@ export const routes = [ name: "announcements", component: page(() => import("./pages/admin/announcements.vue")), }, - { - path: "/ads", - name: "ads", - component: page(() => import("./pages/admin/promotions.vue")), - }, { path: "/database", name: "database", diff --git a/packages/client/src/store.ts b/packages/client/src/store.ts index 25ed55307..97c48db2e 100644 --- a/packages/client/src/store.ts +++ b/packages/client/src/store.ts @@ -102,14 +102,6 @@ export const defaultStore = markRaw( where: "account", default: [], }, - mutedAds: { - where: "account", - default: [] as string[], - }, - showAds: { - where: "account", - default: true, - }, menu: { where: "deviceAccount", default: menuOptions, diff --git a/packages/client/src/ui/deck/widgets-column.vue b/packages/client/src/ui/deck/widgets-column.vue index 6f4090a9e..d5762b539 100644 --- a/packages/client/src/ui/deck/widgets-column.vue +++ b/packages/client/src/ui/deck/widgets-column.vue @@ -11,7 +11,6 @@ >{{ column.name }}
-