Skip to content

Commit

Permalink
Merge branch 'main' into bdm/1460-mac-autocorrect
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
bryanmontz committed Sep 26, 2024
2 parents c637894 + f126402 commit e06131e
Show file tree
Hide file tree
Showing 14 changed files with 375 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CODEOWNERS

# The default owners for everything in the repo.
* @mplorentz @martindsq @joshuatbrown
* @mplorentz @joshuatbrown
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Release Notes
- Disable autocorrect on NoteComposer when running on macOS. [#1460](https://github.com/planetary-social/nos/issues/1460)

### Internal Changes
- Temporarily remove Martin from the list of CODEOWNERS.

## [0.1.27] - 2024-09-25Z

### Release Notes
- Added the option to preview a note before posting it. [#1399](https://github.com/planetary-social/nos/issues/1399)
- Fixed side menu accessibility issues. [#1444](https://github.com/planetary-social/nos/issues/1444)
Expand All @@ -27,7 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added Delete Account UI. [#80](https://github.com/planetary-social/nos/issues/80)
- Fixed issue where search results weren't sorted properly. [#1485](https://github.com/planetary-social/nos/issues/1485)
- Delete all user data when logging out. [#1534](https://github.com/planetary-social/nos/issues/1534)
- Disable autocorrect on NoteComposer when running on macOS. [#1460](https://github.com/planetary-social/nos/issues/1460)
- Publish empty metadata event and empty contact list on delete account. [#1530](https://github.com/planetary-social/nos/issues/1530)

### Internal Changes
- Use NIP-92 media metadata to display media in the proper orientation. Currently behind the “Enable new media display” feature flag. [#1172](https://github.com/planetary-social/nos/issues/1172)
Expand All @@ -38,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Refactored list row gradient background.
- Added SwiftSoup to parse Open Graph metadata. [#1165](https://github.com/planetary-social/nos/issues/1165)
- Parse Open Graph metadata whenever an event contains a URL, doesn’t have `imeta` tags, and the URL points to an HTML document. [#1425](https://github.com/planetary-social/nos/issues/1425)
- Added a new flow to flag notes. Currently behind the “Enable new moderation flow” feature flag. [#1489](https://github.com/planetary-social/nos/issues/1489)

## [0.1.26] - 2024-09-09Z

Expand Down
8 changes: 4 additions & 4 deletions Nos.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2840,7 +2840,7 @@
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
LOCALIZED_STRING_SWIFTUI_SUPPORT = NO;
MACOSX_DEPLOYMENT_TARGET = 13.3;
MARKETING_VERSION = 0.1.27;
MARKETING_VERSION = 0.2.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.verse.Nos-staging";
PRODUCT_MODULE_NAME = Nos;
PRODUCT_NAME = "$(TARGET_NAME) Staging";
Expand Down Expand Up @@ -3013,7 +3013,7 @@
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
LOCALIZED_STRING_SWIFTUI_SUPPORT = NO;
MACOSX_DEPLOYMENT_TARGET = 13.3;
MARKETING_VERSION = 0.1.27;
MARKETING_VERSION = 0.2.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.verse.Nos-dev";
PRODUCT_MODULE_NAME = Nos;
PRODUCT_NAME = "$(TARGET_NAME) Dev";
Expand Down Expand Up @@ -3283,7 +3283,7 @@
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
LOCALIZED_STRING_SWIFTUI_SUPPORT = NO;
MACOSX_DEPLOYMENT_TARGET = 13.3;
MARKETING_VERSION = 0.1.27;
MARKETING_VERSION = 0.2.0;
PRODUCT_BUNDLE_IDENTIFIER = com.verse.Nos;
PRODUCT_MODULE_NAME = Nos;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -3338,7 +3338,7 @@
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
LOCALIZED_STRING_SWIFTUI_SUPPORT = NO;
MACOSX_DEPLOYMENT_TARGET = 13.3;
MARKETING_VERSION = 0.1.27;
MARKETING_VERSION = 0.2.0;
PRODUCT_BUNDLE_IDENTIFIER = com.verse.Nos;
PRODUCT_MODULE_NAME = Nos;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "Circular Checkmark.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
43 changes: 38 additions & 5 deletions Nos/Assets/Localization/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -4405,24 +4405,24 @@
}
}
},
"flagContentCategoryDescription" : {
"flagContent" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Select a tag for the content"
"value" : "Flag Content"
}
}
}
},
"flagContentFlagPubiclyDescription" : {
"flagContentCategoryDescription" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "This flag will be attributed to your account"
"value" : "Select a tag for the content"
}
}
}
Expand All @@ -4438,6 +4438,17 @@
}
}
},
"flagContentFlagPubiclyDescription" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "This flag will be attributed to your account"
}
}
}
},
"flagContentFlagPubiclyTitle" : {
"extractionState" : "manual",
"localizations" : {
Expand Down Expand Up @@ -4532,7 +4543,7 @@
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Send to Nos or Flag Publicly"
"value" : "Send to Nos or Flag Publicly?"
}
}
}
Expand Down Expand Up @@ -5651,6 +5662,17 @@
}
}
},
"keepOnHelpingUs" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Keep on helping us make Nostr a better place for everyone!"
}
}
}
},
"keys" : {
"extractionState" : "manual",
"localizations" : {
Expand Down Expand Up @@ -12311,6 +12333,17 @@
}
}
},
"thanksForTag" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Thanks for your tag."
}
}
}
},
"thatNameIsTaken" : {
"extractionState" : "manual",
"localizations" : {
Expand Down
55 changes: 42 additions & 13 deletions Nos/Models/FlagOption.swift
Original file line number Diff line number Diff line change
@@ -1,42 +1,53 @@
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.
/// - `info`: An optional message that will be displayed when the user has selected a particular flag.
/// - `id`: A unique identifier for the flagging option, based on the `title`.
struct FlagOption: Identifiable {
struct FlagOption: Identifiable, Equatable {
/// The title of the flagging option.
let title: String

/// An optional description that provides more detail about the flagging option.
let description: String?

/// An optional message that will be displayed when the user has selected a particular flag.
let info: String?

/// A unique identifier for the flagging option, based on the `title`.
var id: String { title }

/// The specific category thet the selected flagging option falls in.
var category: FlagCategory

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

Expand All @@ -45,12 +56,30 @@ struct FlagOption: Identifiable {
FlagOption(
title: String(localized: .localizable.flagContentSendToNosTitle),
description: String(localized: .localizable.flagContentSendToNosDescription),
info: String(localized: .localizable.flagContentSendToNosInfo)
info: String(localized: .localizable.flagContentSendToNosInfo),
category: .privacy(.sendToNos)
),
FlagOption(
title: String(localized: .localizable.flagContentFlagPubiclyTitle),
description: String(localized: .localizable.flagContentFlagPubiclyDescription),
info: nil
info: nil,
category: .privacy(.publicly)
)
]

static func == (lhs: FlagOption, rhs: FlagOption) -> Bool {
lhs.id == rhs.id
}
}

/// Specifies the category associated with a specific flag.
enum FlagCategory {
case report(ReportCategory)
case privacy(SendFlagPrivacy)
}

/// Specifies whether a flag should be sent privately to Nos or made public.
enum SendFlagPrivacy {
case sendToNos
case publicly
}
18 changes: 18 additions & 0 deletions Nos/Models/JSONEvent+Kinds.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@ import Foundation

extension JSONEvent {

/// An event that represents the user's contact list (who they are following) and their relays.
/// - Parameters:
/// - pubKey: The pubkey of the user whose contact list and relays the event represents.
/// - tags: The "p" tags of followed profiles.
/// - relays: Relays the user wishes to associate with their profile.
/// - Returns: The ``JSONEvent`` of the contact list.
static func contactList(pubKey: String, tags: [[String]], relayAddresses: [String]) -> JSONEvent {
let relayStrings = relayAddresses.map { "\"\($0)\":{\"write\":true,\"read\":true}" }
let content = "{" + relayStrings.joined(separator: ",") + "}"

return JSONEvent(
pubKey: pubKey,
kind: .contactList,
tags: tags,
content: content
)
}

/// An event that represents the user's request for all of their published notes to be removed from relays.
/// - Parameters:
/// - pubKey: The public key of the user making the request.
Expand Down
Loading

0 comments on commit e06131e

Please sign in to comment.