Skip to content

Commit

Permalink
readd FlagOption model
Browse files Browse the repository at this point in the history
  • Loading branch information
pelumy committed Sep 17, 2024
1 parent b3d71a3 commit ac2ac82
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Nos.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
03FE3F7D2C87AC9900D25810 /* Event+InlineMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03FE3F7B2C87AC9900D25810 /* Event+InlineMetadata.swift */; };
03FE3F8C2C87BC9500D25810 /* text_note_multiple_media.json in Resources */ = {isa = PBXBuildFile; fileRef = 03FE3F8A2C87BC9500D25810 /* text_note_multiple_media.json */; };
042406F32C907A15008F2A21 /* NosToggle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042406F22C907A15008F2A21 /* NosToggle.swift */; };
04368D622C9A25D900DEAA2E /* FlagOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04368D612C9A25D900DEAA2E /* FlagOption.swift */; };
2D06BB9D2AE249D70085F509 /* ThreadRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D06BB9C2AE249D70085F509 /* ThreadRootView.swift */; };
2D4010A22AD87DF300F93AD4 /* KnownFollowersView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D4010A12AD87DF300F93AD4 /* KnownFollowersView.swift */; };
3A1C296F2B2A537C0020B753 /* Moderation.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 3A1C296E2B2A537C0020B753 /* Moderation.xcstrings */; };
Expand Down Expand Up @@ -641,6 +642,7 @@
03FE3F7B2C87AC9900D25810 /* Event+InlineMetadata.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Event+InlineMetadata.swift"; sourceTree = "<group>"; };
03FE3F8A2C87BC9500D25810 /* text_note_multiple_media.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = text_note_multiple_media.json; sourceTree = "<group>"; };
042406F22C907A15008F2A21 /* NosToggle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NosToggle.swift; sourceTree = "<group>"; };
04368D612C9A25D900DEAA2E /* FlagOption.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlagOption.swift; sourceTree = "<group>"; };
2D06BB9C2AE249D70085F509 /* ThreadRootView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ThreadRootView.swift; sourceTree = "<group>"; };
2D4010A12AD87DF300F93AD4 /* KnownFollowersView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KnownFollowersView.swift; sourceTree = "<group>"; };
3A1C296E2B2A537C0020B753 /* Moderation.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Moderation.xcstrings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1817,6 +1819,7 @@
030742C32B4769F90073839D /* CoreData */,
03E7118B2C936DE5000B6F96 /* OpenGraph */,
C92E7F652C4EFF2600B80638 /* WebSockets */,
04368D612C9A25D900DEAA2E /* FlagOption.swift */,
);
path = Models;
sourceTree = "<group>";
Expand Down Expand Up @@ -2463,6 +2466,7 @@
C9DEC04D29894BED0078B43A /* Author+CoreDataClass.swift in Sources */,
C905B0772A619E99009B8A78 /* LinkPreview.swift in Sources */,
C95D68A7299E6FF000429F86 /* KeyFixture.swift in Sources */,
04368D622C9A25D900DEAA2E /* FlagOption.swift in Sources */,
C94437E629B0DB83004D8C86 /* NotificationsView.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
36 changes: 36 additions & 0 deletions Nos/Models/FlagOption.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import Foundation

/// A model representing a flagging option used in content moderation.
/// - `title`: The title of the flagging option.
/// - `description`: An optional description that provides more detail about the flagging option.
/// - `id`: A unique identifier for the flagging option, based on the `title`.

struct FlagOption: Identifiable {
let title: String
let description: String?
var id: String { title }

/// `FlagOption` instances representing different categories of content that can be flagged.
static let flagContentCategories: [FlagOption] = [
FlagOption(
title: String(localized: .localizable.flagContentSpamTitle),
description: nil
),
FlagOption(
title: String(localized: .localizable.flagContentHarassmentTitle),
description: String(localized: .localizable.flagContentHarassmentDescription)
),
FlagOption(
title: "NSFW",
description: String(localized: .localizable.flagContentNudityDescription)
),
FlagOption(
title: String(localized: .localizable.flagContentIllegalTitle),
description: String(localized: .localizable.flagContentIllegalDescription)
),
FlagOption(
title: String(localized: .localizable.flagContentOtherTitle),
description: String(localized: .localizable.flagContentOtherDescription)
)
]
}

0 comments on commit ac2ac82

Please sign in to comment.