Merge pull request #219 from mastodon/feature/siri-intent

Add Siri intent for send post
This commit is contained in:
CMK 2021-07-26 20:28:21 +08:00 committed by GitHub
commit cccfc7e9ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 1492 additions and 31 deletions

View File

@ -65,7 +65,7 @@ extension HomeTimelineIndex {
public let domain: String
public let userID: String
public init(domain: String,userID: String) {
public init(domain: String, userID: String) {
self.identifier = UUID().uuidString + "@" + domain
self.domain = domain
self.userID = userID
@ -80,10 +80,20 @@ extension HomeTimelineIndex: Managed {
}
extension HomeTimelineIndex {
public static func predicate(userID: String) -> NSPredicate {
static func predicate(domain: String) -> NSPredicate {
return NSPredicate(format: "%K == %@", #keyPath(HomeTimelineIndex.domain), domain)
}
static func predicate(userID: MastodonUser.ID) -> NSPredicate {
return NSPredicate(format: "%K == %@", #keyPath(HomeTimelineIndex.userID), userID)
}
public static func predicate(domain: String, userID: MastodonUser.ID) -> NSPredicate {
return NSCompoundPredicate(andPredicateWithSubpredicates: [
predicate(domain: domain),
predicate(userID: userID)
])
}
public static func notDeleted() -> NSPredicate {
return NSPredicate(format: "%K == nil", #keyPath(HomeTimelineIndex.deletedAt))

402
Intents.intentdefinition Normal file
View File

@ -0,0 +1,402 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>INEnums</key>
<array>
<dict>
<key>INEnumDisplayName</key>
<string>Post Visibility</string>
<key>INEnumDisplayNameID</key>
<string>Zo4jgJ</string>
<key>INEnumGeneratesHeader</key>
<true/>
<key>INEnumName</key>
<string>PostVisibility</string>
<key>INEnumType</key>
<string>Regular</string>
<key>INEnumValues</key>
<array>
<dict>
<key>INEnumValueDisplayName</key>
<string>unknown</string>
<key>INEnumValueDisplayNameID</key>
<string>cQxbPW</string>
<key>INEnumValueName</key>
<string>unknown</string>
</dict>
<dict>
<key>INEnumValueDisplayName</key>
<string>Public</string>
<key>INEnumValueDisplayNameID</key>
<string>dYQ5NN</string>
<key>INEnumValueIndex</key>
<integer>1</integer>
<key>INEnumValueName</key>
<string>public</string>
</dict>
<dict>
<key>INEnumValueDisplayName</key>
<string>Followers Only</string>
<key>INEnumValueDisplayNameID</key>
<string>ehFLjY</string>
<key>INEnumValueIndex</key>
<integer>2</integer>
<key>INEnumValueName</key>
<string>followersOnly</string>
</dict>
</array>
</dict>
</array>
<key>INIntentDefinitionModelVersion</key>
<string>1.2</string>
<key>INIntentDefinitionNamespace</key>
<string>BvMBE4</string>
<key>INIntentDefinitionSystemVersion</key>
<string>20G71</string>
<key>INIntentDefinitionToolsBuildVersion</key>
<string>12E507</string>
<key>INIntentDefinitionToolsVersion</key>
<string>12.5.1</string>
<key>INIntents</key>
<array>
<dict>
<key>INIntentCategory</key>
<string>share</string>
<key>INIntentConfigurable</key>
<true/>
<key>INIntentDescription</key>
<string>Send Post with text content</string>
<key>INIntentDescriptionID</key>
<string>RHxKOw</string>
<key>INIntentInput</key>
<string>content</string>
<key>INIntentKeyParameter</key>
<string>content</string>
<key>INIntentLastParameterTag</key>
<integer>3</integer>
<key>INIntentManagedParameterCombinations</key>
<dict>
<key>content,visibility</key>
<dict>
<key>INIntentParameterCombinationSupportsBackgroundExecution</key>
<true/>
<key>INIntentParameterCombinationTitle</key>
<string>Post ${content} on Mastodon</string>
<key>INIntentParameterCombinationTitleID</key>
<string>WCIR3D</string>
<key>INIntentParameterCombinationUpdatesLinked</key>
<true/>
</dict>
</dict>
<key>INIntentName</key>
<string>SendPost</string>
<key>INIntentParameterCombinations</key>
<dict>
<key>content</key>
<dict>
<key>INIntentParameterCombinationSubtitle</key>
<string>${content}</string>
<key>INIntentParameterCombinationSubtitleID</key>
<string>ZS1XaK</string>
<key>INIntentParameterCombinationSupportsBackgroundExecution</key>
<true/>
<key>INIntentParameterCombinationTitle</key>
<string>Post</string>
<key>INIntentParameterCombinationTitleID</key>
<string>CsR7G2</string>
</dict>
<key>content,visibility</key>
<dict>
<key>INIntentParameterCombinationIsPrimary</key>
<true/>
<key>INIntentParameterCombinationSubtitle</key>
<string>${content}, ${visibility}</string>
<key>INIntentParameterCombinationSubtitleID</key>
<string>ayoYEb</string>
<key>INIntentParameterCombinationSupportsBackgroundExecution</key>
<true/>
<key>INIntentParameterCombinationTitle</key>
<string>Post</string>
<key>INIntentParameterCombinationTitleID</key>
<string>dUyuGg</string>
</dict>
</dict>
<key>INIntentParameters</key>
<array>
<dict>
<key>INIntentParameterConfigurable</key>
<true/>
<key>INIntentParameterCustomDisambiguation</key>
<true/>
<key>INIntentParameterDisplayName</key>
<string>Text Content</string>
<key>INIntentParameterDisplayNameID</key>
<string>751xkl</string>
<key>INIntentParameterDisplayPriority</key>
<integer>1</integer>
<key>INIntentParameterMetadata</key>
<dict>
<key>INIntentParameterMetadataCapitalization</key>
<string>Sentences</string>
<key>INIntentParameterMetadataDefaultValueID</key>
<string>odzH7f</string>
<key>INIntentParameterMetadataMultiline</key>
<true/>
</dict>
<key>INIntentParameterName</key>
<string>content</string>
<key>INIntentParameterPromptDialogs</key>
<array>
<dict>
<key>INIntentParameterPromptDialogCustom</key>
<true/>
<key>INIntentParameterPromptDialogType</key>
<string>Configuration</string>
</dict>
<dict>
<key>INIntentParameterPromptDialogCustom</key>
<true/>
<key>INIntentParameterPromptDialogFormatString</key>
<string>What content to post?</string>
<key>INIntentParameterPromptDialogFormatStringID</key>
<string>HZSGTr</string>
<key>INIntentParameterPromptDialogType</key>
<string>Primary</string>
</dict>
</array>
<key>INIntentParameterSupportsResolution</key>
<true/>
<key>INIntentParameterTag</key>
<integer>1</integer>
<key>INIntentParameterType</key>
<string>String</string>
</dict>
<dict>
<key>INIntentParameterConfigurable</key>
<true/>
<key>INIntentParameterCustomDisambiguation</key>
<true/>
<key>INIntentParameterDisplayName</key>
<string>Visibility</string>
<key>INIntentParameterDisplayNameID</key>
<string>ZbSjzC</string>
<key>INIntentParameterDisplayPriority</key>
<integer>2</integer>
<key>INIntentParameterEnumType</key>
<string>PostVisibility</string>
<key>INIntentParameterEnumTypeNamespace</key>
<string>BvMBE4</string>
<key>INIntentParameterMetadata</key>
<dict>
<key>INIntentParameterMetadataDefaultValue</key>
<string>public</string>
</dict>
<key>INIntentParameterName</key>
<string>visibility</string>
<key>INIntentParameterPromptDialogs</key>
<array>
<dict>
<key>INIntentParameterPromptDialogCustom</key>
<true/>
<key>INIntentParameterPromptDialogType</key>
<string>Configuration</string>
</dict>
<dict>
<key>INIntentParameterPromptDialogCustom</key>
<true/>
<key>INIntentParameterPromptDialogType</key>
<string>Primary</string>
</dict>
<dict>
<key>INIntentParameterPromptDialogCustom</key>
<true/>
<key>INIntentParameterPromptDialogFormatString</key>
<string>There are ${count} options matching ${visibility}.</string>
<key>INIntentParameterPromptDialogFormatStringID</key>
<string>apSxMG</string>
<key>INIntentParameterPromptDialogType</key>
<string>DisambiguationIntroduction</string>
</dict>
<dict>
<key>INIntentParameterPromptDialogCustom</key>
<true/>
<key>INIntentParameterPromptDialogFormatString</key>
<string>Just to confirm, you wanted ${visibility}?</string>
<key>INIntentParameterPromptDialogFormatStringID</key>
<string>oGiqmY</string>
<key>INIntentParameterPromptDialogType</key>
<string>Confirmation</string>
</dict>
</array>
<key>INIntentParameterSupportsResolution</key>
<true/>
<key>INIntentParameterTag</key>
<integer>3</integer>
<key>INIntentParameterType</key>
<string>Integer</string>
</dict>
</array>
<key>INIntentResponse</key>
<dict>
<key>INIntentResponseCodes</key>
<array>
<dict>
<key>INIntentResponseCodeConciseFormatString</key>
<string>Post was sent successfully.</string>
<key>INIntentResponseCodeConciseFormatStringID</key>
<string>k7dbKQ</string>
<key>INIntentResponseCodeFormatString</key>
<string>Post was sent successfully. </string>
<key>INIntentResponseCodeFormatStringID</key>
<string>ryJLwG</string>
<key>INIntentResponseCodeName</key>
<string>success</string>
<key>INIntentResponseCodeSuccess</key>
<true/>
</dict>
<dict>
<key>INIntentResponseCodeConciseFormatString</key>
<string>Posting failed</string>
<key>INIntentResponseCodeConciseFormatStringID</key>
<string>HdGikU</string>
<key>INIntentResponseCodeFormatString</key>
<string>Posting failed. ${failureReason}</string>
<key>INIntentResponseCodeFormatStringID</key>
<string>gfePDu</string>
<key>INIntentResponseCodeName</key>
<string>failure</string>
</dict>
</array>
<key>INIntentResponseLastParameterTag</key>
<integer>7</integer>
<key>INIntentResponseOutput</key>
<string>post</string>
<key>INIntentResponseParameters</key>
<array>
<dict>
<key>INIntentResponseParameterDisplayName</key>
<string>Post</string>
<key>INIntentResponseParameterDisplayNameID</key>
<string>ZKJSNu</string>
<key>INIntentResponseParameterDisplayPriority</key>
<integer>1</integer>
<key>INIntentResponseParameterName</key>
<string>post</string>
<key>INIntentResponseParameterObjectType</key>
<string>Post</string>
<key>INIntentResponseParameterObjectTypeNamespace</key>
<string>BvMBE4</string>
<key>INIntentResponseParameterTag</key>
<integer>6</integer>
<key>INIntentResponseParameterType</key>
<string>Object</string>
</dict>
<dict>
<key>INIntentResponseParameterDisplayName</key>
<string>Failure Reason</string>
<key>INIntentResponseParameterDisplayNameID</key>
<string>KDNTJ4</string>
<key>INIntentResponseParameterDisplayPriority</key>
<integer>2</integer>
<key>INIntentResponseParameterName</key>
<string>failureReason</string>
<key>INIntentResponseParameterTag</key>
<integer>7</integer>
<key>INIntentResponseParameterType</key>
<string>String</string>
</dict>
</array>
</dict>
<key>INIntentTitle</key>
<string>Post on Mastodon</string>
<key>INIntentTitleID</key>
<string>16wxgf</string>
<key>INIntentType</key>
<string>Custom</string>
<key>INIntentVerb</key>
<string>Post</string>
</dict>
</array>
<key>INTypes</key>
<array>
<dict>
<key>INTypeDisplayName</key>
<string>Post</string>
<key>INTypeDisplayNameID</key>
<string>RxSqsb</string>
<key>INTypeLastPropertyTag</key>
<integer>102</integer>
<key>INTypeName</key>
<string>Post</string>
<key>INTypeProperties</key>
<array>
<dict>
<key>INTypePropertyDefault</key>
<true/>
<key>INTypePropertyDisplayPriority</key>
<integer>1</integer>
<key>INTypePropertyName</key>
<string>identifier</string>
<key>INTypePropertyTag</key>
<integer>1</integer>
<key>INTypePropertyType</key>
<string>String</string>
</dict>
<dict>
<key>INTypePropertyDefault</key>
<true/>
<key>INTypePropertyDisplayPriority</key>
<integer>2</integer>
<key>INTypePropertyName</key>
<string>displayString</string>
<key>INTypePropertyTag</key>
<integer>2</integer>
<key>INTypePropertyType</key>
<string>String</string>
</dict>
<dict>
<key>INTypePropertyDefault</key>
<true/>
<key>INTypePropertyDisplayPriority</key>
<integer>3</integer>
<key>INTypePropertyName</key>
<string>pronunciationHint</string>
<key>INTypePropertyTag</key>
<integer>3</integer>
<key>INTypePropertyType</key>
<string>String</string>
</dict>
<dict>
<key>INTypePropertyDefault</key>
<true/>
<key>INTypePropertyDisplayPriority</key>
<integer>4</integer>
<key>INTypePropertyName</key>
<string>alternativeSpeakableMatches</string>
<key>INTypePropertySupportsMultipleValues</key>
<true/>
<key>INTypePropertyTag</key>
<integer>4</integer>
<key>INTypePropertyType</key>
<string>SpeakableString</string>
</dict>
<dict>
<key>INTypePropertyDisplayName</key>
<string>URL</string>
<key>INTypePropertyDisplayNameID</key>
<string>rM6dvp</string>
<key>INTypePropertyDisplayPriority</key>
<integer>5</integer>
<key>INTypePropertyName</key>
<string>url</string>
<key>INTypePropertyTag</key>
<integer>101</integer>
<key>INTypePropertyType</key>
<string>URL</string>
</dict>
</array>
</dict>
</array>
</dict>
</plist>

View File

@ -1,4 +1,6 @@
{
"NSCameraUsageDescription": "Used to take photo for post status",
"NSPhotoLibraryAddUsageDescription": "Used to save photo into the Photo Library"
}
"NSPhotoLibraryAddUsageDescription": "Used to save photo into the Photo Library",
"NewPostShortcutItemTitle": "New Post",
"SearchShortcutItemTitle": "Search"
}

View File

@ -374,6 +374,13 @@
DB8AF55025C13703002E6C99 /* MainTabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB8AF54F25C13703002E6C99 /* MainTabBarController.swift */; };
DB8AF55D25C138B7002E6C99 /* UIViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB8AF55C25C138B7002E6C99 /* UIViewController.swift */; };
DB8AF56825C13E2A002E6C99 /* HomeTimelineIndex.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB8AF56725C13E2A002E6C99 /* HomeTimelineIndex.swift */; };
DB8FABC726AEC7B2008E5AF4 /* Intents.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DB8FAB9E26AEC3A2008E5AF4 /* Intents.framework */; };
DB8FABCA26AEC7B2008E5AF4 /* IntentHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB8FABC926AEC7B2008E5AF4 /* IntentHandler.swift */; };
DB8FABCE26AEC7B2008E5AF4 /* MastodonIntent.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = DB8FABC626AEC7B2008E5AF4 /* MastodonIntent.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
DB8FABD426AEC7DA008E5AF4 /* Intents.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = DBEB12BF26AEBC2D00A67030 /* Intents.intentdefinition */; settings = {ATTRIBUTES = (no_codegen, ); }; };
DB8FABD526AEC7DC008E5AF4 /* Intents.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = DBEB12BF26AEBC2D00A67030 /* Intents.intentdefinition */; };
DB8FABD726AEC873008E5AF4 /* AppShared.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DB68047F2637CD4C00430867 /* AppShared.framework */; };
DB8FABDC26AEC87B008E5AF4 /* CoreDataStack.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DB89B9EE25C10FD0008580ED /* CoreDataStack.framework */; };
DB9282B225F3222800823B15 /* PickServerEmptyStateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB9282B125F3222800823B15 /* PickServerEmptyStateView.swift */; };
DB92CF7225E7BB98002C1017 /* PollOptionTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB92CF7125E7BB98002C1017 /* PollOptionTableViewCell.swift */; };
DB938EE62623F50700E5B6C1 /* ThreadViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB938EE52623F50700E5B6C1 /* ThreadViewController.swift */; };
@ -455,6 +462,17 @@
DBB525642612C988002F1F29 /* MeProfileViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBB525632612C988002F1F29 /* MeProfileViewModel.swift */; };
DBB5256E2612D5A1002F1F29 /* ProfileStatusDashboardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBB5256D2612D5A1002F1F29 /* ProfileStatusDashboardView.swift */; };
DBB525852612D6DD002F1F29 /* ProfileStatusDashboardMeterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBB525842612D6DD002F1F29 /* ProfileStatusDashboardMeterView.swift */; };
DBB8AB4626AECDE200F6D281 /* SendPostIntentHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBB8AB4526AECDE200F6D281 /* SendPostIntentHandler.swift */; };
DBB8AB4826AED09C00F6D281 /* MastodonSDK in Frameworks */ = {isa = PBXBuildFile; productRef = DBB8AB4726AED09C00F6D281 /* MastodonSDK */; };
DBB8AB4A26AED0B500F6D281 /* APIService.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBB8AB4926AED0B500F6D281 /* APIService.swift */; };
DBB8AB4C26AED11300F6D281 /* APIService+APIError.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB98337E25C9452D00AD9700 /* APIService+APIError.swift */; };
DBB8AB4D26AED12B00F6D281 /* Strings.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB98338525C945ED00AD9700 /* Strings.swift */; };
DBB8AB4E26AED12E00F6D281 /* Assets.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB98338625C945ED00AD9700 /* Assets.swift */; };
DBB8AB4F26AED13F00F6D281 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DB427DDE25BAA00100D1B89D /* Assets.xcassets */; };
DBB8AB5026AED14400F6D281 /* Localizable.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = DB564BCE269F2F83001E39A7 /* Localizable.stringsdict */; };
DBB8AB5126AED14600F6D281 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = DB3D100F25BAA75E00EAA174 /* Localizable.strings */; };
DBB8AB5226AED1B300F6D281 /* APIService+Status+Publish.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBFEF07A26A6BCE8006D7ED1 /* APIService+Status+Publish.swift */; };
DBB8AB5326AED25100F6D281 /* MastodonAuthenticationBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBFEF07626A691FB006D7ED1 /* MastodonAuthenticationBox.swift */; };
DBB9759C262462E1004620BD /* ThreadMetaView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBB9759B262462E1004620BD /* ThreadMetaView.swift */; };
DBBC24A826A52F9000398BB9 /* ComposeToolbarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBBC24A726A52F9000398BB9 /* ComposeToolbarView.swift */; };
DBBC24AA26A5301B00398BB9 /* MastodonSDK in Frameworks */ = {isa = PBXBuildFile; productRef = DBBC24A926A5301B00398BB9 /* MastodonSDK */; };
@ -624,6 +642,27 @@
remoteGlobalIDString = DB89B9ED25C10FD0008580ED;
remoteInfo = CoreDataStack;
};
DB8FABCC26AEC7B2008E5AF4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = DB427DCA25BAA00100D1B89D /* Project object */;
proxyType = 1;
remoteGlobalIDString = DB8FABC526AEC7B2008E5AF4;
remoteInfo = MastodonIntent;
};
DB8FABD926AEC873008E5AF4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = DB427DCA25BAA00100D1B89D /* Project object */;
proxyType = 1;
remoteGlobalIDString = DB68047E2637CD4C00430867;
remoteInfo = AppShared;
};
DB8FABDE26AEC87B008E5AF4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = DB427DCA25BAA00100D1B89D /* Project object */;
proxyType = 1;
remoteGlobalIDString = DB89B9ED25C10FD0008580ED;
remoteInfo = CoreDataStack;
};
DBC6461A26A170AB00B0E31B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = DB427DCA25BAA00100D1B89D /* Project object */;
@ -673,6 +712,7 @@
dstPath = "";
dstSubfolderSpec = 13;
files = (
DB8FABCE26AEC7B2008E5AF4 /* MastodonIntent.appex in Embed App Extensions */,
DBC6461C26A170AB00B0E31B /* ShareActionExtension.appex in Embed App Extensions */,
DBF8AE1A263293E400C9C23C /* NotificationService.appex in Embed App Extensions */,
);
@ -923,7 +963,6 @@
DB3667A7268AE2900027D07F /* ComposeStatusPollItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComposeStatusPollItem.swift; sourceTree = "<group>"; };
DB3D0FED25BAA42200EAA174 /* MastodonSDK */ = {isa = PBXFileReference; lastKnownFileType = folder; path = MastodonSDK; sourceTree = "<group>"; };
DB3D100E25BAA75E00EAA174 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
DB3F693926AA97BD00C883AB /* MetaTextKit */ = {isa = PBXFileReference; lastKnownFileType = folder; name = MetaTextKit; path = ../MetaTextKit; sourceTree = "<group>"; };
DB427DD225BAA00100D1B89D /* Mastodon.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Mastodon.app; sourceTree = BUILT_PRODUCTS_DIR; };
DB427DD525BAA00100D1B89D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
DB427DD725BAA00100D1B89D /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
@ -1075,6 +1114,12 @@
DB8AF54F25C13703002E6C99 /* MainTabBarController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainTabBarController.swift; sourceTree = "<group>"; };
DB8AF55C25C138B7002E6C99 /* UIViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIViewController.swift; sourceTree = "<group>"; };
DB8AF56725C13E2A002E6C99 /* HomeTimelineIndex.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeTimelineIndex.swift; sourceTree = "<group>"; };
DB8FAB9E26AEC3A2008E5AF4 /* Intents.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Intents.framework; path = System/Library/Frameworks/Intents.framework; sourceTree = SDKROOT; };
DB8FABA926AEC3A2008E5AF4 /* IntentsUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IntentsUI.framework; path = System/Library/Frameworks/IntentsUI.framework; sourceTree = SDKROOT; };
DB8FABC626AEC7B2008E5AF4 /* MastodonIntent.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = MastodonIntent.appex; sourceTree = BUILT_PRODUCTS_DIR; };
DB8FABC926AEC7B2008E5AF4 /* IntentHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntentHandler.swift; sourceTree = "<group>"; };
DB8FABCB26AEC7B2008E5AF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
DB8FABD626AEC864008E5AF4 /* MastodonIntent.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MastodonIntent.entitlements; sourceTree = "<group>"; };
DB9282B125F3222800823B15 /* PickServerEmptyStateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PickServerEmptyStateView.swift; sourceTree = "<group>"; };
DB92CF7125E7BB98002C1017 /* PollOptionTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PollOptionTableViewCell.swift; sourceTree = "<group>"; };
DB938EE52623F50700E5B6C1 /* ThreadViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreadViewController.swift; sourceTree = "<group>"; };
@ -1150,6 +1195,8 @@
DBB525632612C988002F1F29 /* MeProfileViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeProfileViewModel.swift; sourceTree = "<group>"; };
DBB5256D2612D5A1002F1F29 /* ProfileStatusDashboardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileStatusDashboardView.swift; sourceTree = "<group>"; };
DBB525842612D6DD002F1F29 /* ProfileStatusDashboardMeterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileStatusDashboardMeterView.swift; sourceTree = "<group>"; };
DBB8AB4526AECDE200F6D281 /* SendPostIntentHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendPostIntentHandler.swift; sourceTree = "<group>"; };
DBB8AB4926AED0B500F6D281 /* APIService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIService.swift; sourceTree = "<group>"; };
DBB9759B262462E1004620BD /* ThreadMetaView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreadMetaView.swift; sourceTree = "<group>"; };
DBBC24A726A52F9000398BB9 /* ComposeToolbarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComposeToolbarView.swift; sourceTree = "<group>"; };
DBBC24AB26A53D9300398BB9 /* ComposeStatusContentTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComposeStatusContentTableViewCell.swift; sourceTree = "<group>"; };
@ -1208,6 +1255,7 @@
DBE3CE0C261D767100430CC6 /* FavoriteViewController+Provider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "FavoriteViewController+Provider.swift"; sourceTree = "<group>"; };
DBE3CE12261D7D4200430CC6 /* StatusTableViewControllerAspect.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusTableViewControllerAspect.swift; sourceTree = "<group>"; };
DBE54AC52636C89F004E7C0B /* NotificationPreference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationPreference.swift; sourceTree = "<group>"; };
DBEB12BF26AEBC2D00A67030 /* Intents.intentdefinition */ = {isa = PBXFileReference; lastKnownFileType = file.intentdefinition; path = Intents.intentdefinition; sourceTree = "<group>"; };
DBF1D24D269DAF5D00C1C08A /* SearchDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchDetailViewController.swift; sourceTree = "<group>"; };
DBF1D250269DB01200C1C08A /* SearchHistoryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchHistoryViewController.swift; sourceTree = "<group>"; };
DBF1D256269DBAC600C1C08A /* SearchDetailViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchDetailViewModel.swift; sourceTree = "<group>"; };
@ -1309,6 +1357,17 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
DB8FABC326AEC7B2008E5AF4 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
DB8FABC726AEC7B2008E5AF4 /* Intents.framework in Frameworks */,
DB8FABDC26AEC87B008E5AF4 /* CoreDataStack.framework in Frameworks */,
DBB8AB4826AED09C00F6D281 /* MastodonSDK in Frameworks */,
DB8FABD726AEC873008E5AF4 /* AppShared.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
DBC6460F26A170AB00B0E31B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@ -1789,6 +1848,8 @@
F4A2A2D7000E477CA459ADA9 /* Pods_AppShared.framework */,
374AA339A20E0FAC75BCDA6D /* Pods_NotificationService.framework */,
A32B0CACBF35F4CC3CFAA043 /* Pods_ShareActionExtension.framework */,
DB8FAB9E26AEC3A2008E5AF4 /* Intents.framework */,
DB8FABA926AEC3A2008E5AF4 /* IntentsUI.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@ -1958,9 +2019,9 @@
DB427DC925BAA00100D1B89D = {
isa = PBXGroup;
children = (
DBEB12BF26AEBC2D00A67030 /* Intents.intentdefinition */,
DBF53F5F25C14E88008AAC7B /* Mastodon.xctestplan */,
DBF53F6025C14E9D008AAC7B /* MastodonSDK.xctestplan */,
DB3F693926AA97BD00C883AB /* MetaTextKit */,
DB3D0FED25BAA42200EAA174 /* MastodonSDK */,
DB427DD425BAA00100D1B89D /* Mastodon */,
DB427DEB25BAA00100D1B89D /* MastodonTests */,
@ -1970,6 +2031,7 @@
DB89B9FC25C10FD0008580ED /* CoreDataStackTests */,
DBF8AE14263293E400C9C23C /* NotificationService */,
DBC6461326A170AB00B0E31B /* ShareActionExtension */,
DB8FABC826AEC7B2008E5AF4 /* MastodonIntent */,
DB427DD325BAA00100D1B89D /* Products */,
1EBA4F56E920856A3FC84ACB /* Pods */,
3FE14AD363ED19AE7FF210A6 /* Frameworks */,
@ -1988,6 +2050,7 @@
DBF8AE13263293E400C9C23C /* NotificationService.appex */,
DB68047F2637CD4C00430867 /* AppShared.framework */,
DBC6461226A170AB00B0E31B /* ShareActionExtension.appex */,
DB8FABC626AEC7B2008E5AF4 /* MastodonIntent.appex */,
);
name = Products;
sourceTree = "<group>";
@ -2519,6 +2582,18 @@
path = Extension;
sourceTree = "<group>";
};
DB8FABC826AEC7B2008E5AF4 /* MastodonIntent */ = {
isa = PBXGroup;
children = (
DB8FABD626AEC864008E5AF4 /* MastodonIntent.entitlements */,
DB8FABC926AEC7B2008E5AF4 /* IntentHandler.swift */,
DBB8AB4526AECDE200F6D281 /* SendPostIntentHandler.swift */,
DBB8AB4B26AED0B800F6D281 /* Service */,
DB8FABCB26AEC7B2008E5AF4 /* Info.plist */,
);
path = MastodonIntent;
sourceTree = "<group>";
};
DB938EEB2623F52600E5B6C1 /* Thread */ = {
isa = PBXGroup;
children = (
@ -2742,6 +2817,14 @@
path = View;
sourceTree = "<group>";
};
DBB8AB4B26AED0B800F6D281 /* Service */ = {
isa = PBXGroup;
children = (
DBB8AB4926AED0B500F6D281 /* APIService.swift */,
);
path = Service;
sourceTree = "<group>";
};
DBBC24BD26A5441A00398BB9 /* ThemeService */ = {
isa = PBXGroup;
children = (
@ -2965,6 +3048,7 @@
DB6804852637CD4C00430867 /* PBXTargetDependency */,
DB6804CA2637CE3000430867 /* PBXTargetDependency */,
DBC6461B26A170AB00B0E31B /* PBXTargetDependency */,
DB8FABCD26AEC7B2008E5AF4 /* PBXTargetDependency */,
);
name = Mastodon;
packageProductDependencies = (
@ -3087,6 +3171,28 @@
productReference = DB89B9F625C10FD0008580ED /* CoreDataStackTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
DB8FABC526AEC7B2008E5AF4 /* MastodonIntent */ = {
isa = PBXNativeTarget;
buildConfigurationList = DB8FABCF26AEC7B2008E5AF4 /* Build configuration list for PBXNativeTarget "MastodonIntent" */;
buildPhases = (
DB8FABC226AEC7B2008E5AF4 /* Sources */,
DB8FABC326AEC7B2008E5AF4 /* Frameworks */,
DB8FABC426AEC7B2008E5AF4 /* Resources */,
);
buildRules = (
);
dependencies = (
DB8FABDA26AEC873008E5AF4 /* PBXTargetDependency */,
DB8FABDF26AEC87B008E5AF4 /* PBXTargetDependency */,
);
name = MastodonIntent;
packageProductDependencies = (
DBB8AB4726AED09C00F6D281 /* MastodonSDK */,
);
productName = MastodonIntent;
productReference = DB8FABC626AEC7B2008E5AF4 /* MastodonIntent.appex */;
productType = "com.apple.product-type.app-extension";
};
DBC6461126A170AB00B0E31B /* ShareActionExtension */ = {
isa = PBXNativeTarget;
buildConfigurationList = DBC6462126A170AB00B0E31B /* Build configuration list for PBXNativeTarget "ShareActionExtension" */;
@ -3171,6 +3277,9 @@
CreatedOnToolsVersion = 12.4;
TestTargetID = DB427DD125BAA00100D1B89D;
};
DB8FABC526AEC7B2008E5AF4 = {
CreatedOnToolsVersion = 12.5.1;
};
DBC6461126A170AB00B0E31B = {
CreatedOnToolsVersion = 12.5.1;
};
@ -3217,6 +3326,7 @@
DB89B9F525C10FD0008580ED /* CoreDataStackTests */,
DBF8AE12263293E400C9C23C /* NotificationService */,
DBC6461126A170AB00B0E31B /* ShareActionExtension */,
DB8FABC526AEC7B2008E5AF4 /* MastodonIntent */,
);
};
/* End PBXProject section */
@ -3273,6 +3383,16 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
DB8FABC426AEC7B2008E5AF4 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
DBB8AB4F26AED13F00F6D281 /* Assets.xcassets in Resources */,
DBB8AB5126AED14600F6D281 /* Localizable.strings in Resources */,
DBB8AB5026AED14400F6D281 /* Localizable.stringsdict in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
DBC6461026A170AB00B0E31B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@ -3700,6 +3820,7 @@
DB4481CC25EE2AFE00BEFB67 /* PollItem.swift in Sources */,
DB44767B260B3B8C00B66B82 /* CustomEmojiPickerInputView.swift in Sources */,
0F20222D261457EE000C64BF /* HashtagTimelineViewModel+LoadOldestState.swift in Sources */,
DB8FABD426AEC7DA008E5AF4 /* Intents.intentdefinition in Sources */,
5B90C462262599800002E742 /* SettingsSectionHeader.swift in Sources */,
DB44768B260B3F2100B66B82 /* CustomEmojiPickerItem.swift in Sources */,
2DF75BA125D0E29D00694EC8 /* StatusProvider+StatusTableViewCellDelegate.swift in Sources */,
@ -3982,6 +4103,22 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
DB8FABC226AEC7B2008E5AF4 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
DB8FABD526AEC7DC008E5AF4 /* Intents.intentdefinition in Sources */,
DBB8AB4E26AED12E00F6D281 /* Assets.swift in Sources */,
DBB8AB4626AECDE200F6D281 /* SendPostIntentHandler.swift in Sources */,
DBB8AB5326AED25100F6D281 /* MastodonAuthenticationBox.swift in Sources */,
DBB8AB4A26AED0B500F6D281 /* APIService.swift in Sources */,
DBB8AB4C26AED11300F6D281 /* APIService+APIError.swift in Sources */,
DBB8AB4D26AED12B00F6D281 /* Strings.swift in Sources */,
DBB8AB5226AED1B300F6D281 /* APIService+Status+Publish.swift in Sources */,
DB8FABCA26AEC7B2008E5AF4 /* IntentHandler.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
DBC6460E26A170AB00B0E31B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@ -4077,6 +4214,21 @@
target = DB89B9ED25C10FD0008580ED /* CoreDataStack */;
targetProxy = DB89BA0125C10FD0008580ED /* PBXContainerItemProxy */;
};
DB8FABCD26AEC7B2008E5AF4 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = DB8FABC526AEC7B2008E5AF4 /* MastodonIntent */;
targetProxy = DB8FABCC26AEC7B2008E5AF4 /* PBXContainerItemProxy */;
};
DB8FABDA26AEC873008E5AF4 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = DB68047E2637CD4C00430867 /* AppShared */;
targetProxy = DB8FABD926AEC873008E5AF4 /* PBXContainerItemProxy */;
};
DB8FABDF26AEC87B008E5AF4 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = DB89B9ED25C10FD0008580ED /* CoreDataStack */;
targetProxy = DB8FABDE26AEC87B008E5AF4 /* PBXContainerItemProxy */;
};
DBC6461B26A170AB00B0E31B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = DBC6461126A170AB00B0E31B /* ShareActionExtension */;
@ -4206,6 +4358,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INTENTS_CODEGEN_LANGUAGE = Swift;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
@ -4262,6 +4415,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INTENTS_CODEGEN_LANGUAGE = Swift;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
@ -4276,6 +4430,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 2E1F6A67FDF9771D3E064FDC /* Pods-Mastodon.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
@ -4303,6 +4458,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 75E3471C898DDD9631729B6E /* Pods-Mastodon.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
@ -4567,6 +4723,90 @@
};
name = Release;
};
DB8FABD026AEC7B2008E5AF4 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = MastodonIntent/MastodonIntent.entitlements;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 5Z4GVSS33P;
INFOPLIST_FILE = MastodonIntent/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.MastodonIntent;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "APP_EXTENSION $(inherited)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
};
DB8FABD126AEC7B2008E5AF4 /* ASDK - Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = MastodonIntent/MastodonIntent.entitlements;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 5Z4GVSS33P;
INFOPLIST_FILE = MastodonIntent/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.MastodonIntent;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "APP_EXTENSION $(inherited)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
name = "ASDK - Debug";
};
DB8FABD226AEC7B2008E5AF4 /* ASDK - Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = MastodonIntent/MastodonIntent.entitlements;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 5Z4GVSS33P;
INFOPLIST_FILE = MastodonIntent/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.MastodonIntent;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "APP_EXTENSION $(inherited)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
name = "ASDK - Release";
};
DB8FABD326AEC7B2008E5AF4 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = MastodonIntent/MastodonIntent.entitlements;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 5Z4GVSS33P;
INFOPLIST_FILE = MastodonIntent/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.MastodonIntent;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "APP_EXTENSION $(inherited)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
};
DBC6461D26A170AB00B0E31B /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 77EE917BC055E6621C0452B6 /* Pods-ShareActionExtension.debug.xcconfig */;
@ -4715,6 +4955,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INTENTS_CODEGEN_LANGUAGE = Swift;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
@ -4730,6 +4971,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = BD7598A87F4497045EDEF252 /* Pods-Mastodon.asdk - release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
@ -4950,6 +5192,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INTENTS_CODEGEN_LANGUAGE = Swift;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
@ -4964,6 +5207,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 1D6D967E77A5357E2C6110D9 /* Pods-Mastodon.asdk - debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
@ -5258,6 +5502,17 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
DB8FABCF26AEC7B2008E5AF4 /* Build configuration list for PBXNativeTarget "MastodonIntent" */ = {
isa = XCConfigurationList;
buildConfigurations = (
DB8FABD026AEC7B2008E5AF4 /* Debug */,
DB8FABD126AEC7B2008E5AF4 /* ASDK - Debug */,
DB8FABD226AEC7B2008E5AF4 /* ASDK - Release */,
DB8FABD326AEC7B2008E5AF4 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
DBC6462126A170AB00B0E31B /* Build configuration list for PBXNativeTarget "ShareActionExtension" */ = {
isa = XCConfigurationList;
buildConfigurations = (
@ -5482,6 +5737,10 @@
package = DBB525062611EAC0002F1F29 /* XCRemoteSwiftPackageReference "Tabman" */;
productName = Tabman;
};
DBB8AB4726AED09C00F6D281 /* MastodonSDK */ = {
isa = XCSwiftPackageProductDependency;
productName = MastodonSDK;
};
DBBC24A926A5301B00398BB9 /* MastodonSDK */ = {
isa = XCSwiftPackageProductDependency;
productName = MastodonSDK;

View File

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB427DD125BAA00100D1B89D"
BuildableName = "Mastodon.app"
BlueprintName = "Mastodon"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "ASDK - Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB427DE725BAA00100D1B89D"
BuildableName = "MastodonTests.xctest"
BlueprintName = "MastodonTests"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB427DF225BAA00100D1B89D"
BuildableName = "MastodonUITests.xctest"
BlueprintName = "MastodonUITests"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB89B9F525C10FD0008580ED"
BuildableName = "CoreDataStackTests.xctest"
BlueprintName = "CoreDataStackTests"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "ASDK - Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB427DD125BAA00100D1B89D"
BuildableName = "Mastodon.app"
BlueprintName = "Mastodon"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "ASDK - Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB427DD125BAA00100D1B89D"
BuildableName = "Mastodon.app"
BlueprintName = "Mastodon"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "ASDK - Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "ASDK - Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB427DD125BAA00100D1B89D"
BuildableName = "Mastodon.app"
BlueprintName = "Mastodon"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB427DE725BAA00100D1B89D"
BuildableName = "MastodonTests.xctest"
BlueprintName = "MastodonTests"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB427DF225BAA00100D1B89D"
BuildableName = "MastodonUITests.xctest"
BlueprintName = "MastodonUITests"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB89B9F525C10FD0008580ED"
BuildableName = "CoreDataStackTests.xctest"
BlueprintName = "CoreDataStackTests"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
disableMainThreadChecker = "YES"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB427DD125BAA00100D1B89D"
BuildableName = "Mastodon.app"
BlueprintName = "Mastodon"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB427DD125BAA00100D1B89D"
BuildableName = "Mastodon.app"
BlueprintName = "Mastodon"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB427DD125BAA00100D1B89D"
BuildableName = "Mastodon.app"
BlueprintName = "Mastodon"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB427DE725BAA00100D1B89D"
BuildableName = "MastodonTests.xctest"
BlueprintName = "MastodonTests"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB427DF225BAA00100D1B89D"
BuildableName = "MastodonUITests.xctest"
BlueprintName = "MastodonUITests"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB89B9F525C10FD0008580ED"
BuildableName = "CoreDataStackTests.xctest"
BlueprintName = "CoreDataStackTests"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB427DD125BAA00100D1B89D"
BuildableName = "Mastodon.app"
BlueprintName = "Mastodon"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB427DD125BAA00100D1B89D"
BuildableName = "Mastodon.app"
BlueprintName = "Mastodon"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DBF8AE12263293E400C9C23C"
BuildableName = "NotificationService.appex"
BlueprintName = "NotificationService"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB427DD125BAA00100D1B89D"
BuildableName = "Mastodon.app"
BlueprintName = "Mastodon"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
askForAppToLaunch = "Yes"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB427DD125BAA00100D1B89D"
BuildableName = "Mastodon.app"
BlueprintName = "Mastodon"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB427DD125BAA00100D1B89D"
BuildableName = "Mastodon.app"
BlueprintName = "Mastodon"
ReferencedContainer = "container:Mastodon.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -7,17 +7,17 @@
<key>AppShared.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>20</integer>
<integer>24</integer>
</dict>
<key>CoreDataStack.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>22</integer>
<integer>21</integer>
</dict>
<key>Mastodon - ASDK.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
<integer>3</integer>
</dict>
<key>Mastodon - RTL.xcscheme_^#shared#^_</key>
<dict>
@ -27,22 +27,37 @@
<key>Mastodon - Release.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>2</integer>
</dict>
<key>Mastodon.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
<key>MastodonIntent.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>23</integer>
</dict>
<key>MastodonIntents.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>35</integer>
</dict>
<key>MastodonIntentsUI.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>34</integer>
</dict>
<key>NotificationService.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>24</integer>
<integer>5</integer>
</dict>
<key>ShareActionExtension.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>23</integer>
<integer>22</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>

View File

@ -91,6 +91,15 @@
"version": "4.2.2"
}
},
{
"package": "MetaTextKit",
"repositoryURL": "https://github.com/TwidereProject/MetaTextKit.git",
"state": {
"branch": null,
"revision": "ccb54189b31d13868d979c33d43566912b765bbd",
"version": "2.1.0"
}
},
{
"package": "Nuke",
"repositoryURL": "https://github.com/kean/Nuke.git",

View File

@ -13,7 +13,7 @@ final public class SceneCoordinator {
private weak var scene: UIScene!
private weak var sceneDelegate: SceneDelegate!
private weak var appContext: AppContext!
private weak var tabBarController: MainTabBarController!
private(set) weak var tabBarController: MainTabBarController!
let id = UUID().uuidString

View File

@ -24,7 +24,7 @@ extension Status.Property {
reblogsCount: NSNumber(value: entity.reblogsCount),
favouritesCount: NSNumber(value: entity.favouritesCount),
repliesCount: entity.repliesCount.flatMap { NSNumber(value: $0) },
url: entity.uri,
url: entity.url ?? entity.uri,
inReplyToID: entity.inReplyToID,
inReplyToAccountID: entity.inReplyToAccountID,
language: entity.language,

View File

@ -26,7 +26,8 @@ extension MetaLabel {
layer.masksToBounds = true
textContainer.lineBreakMode = .byTruncatingTail
textContainer.lineFragmentPadding = 0
let font: UIFont
let textColor: UIColor

View File

@ -44,6 +44,10 @@
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSUserActivityTypes</key>
<array>
<string>SendPostIntent</string>
</array>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
@ -63,6 +67,25 @@
</array>
</dict>
</dict>
<key>UIApplicationShortcutItems</key>
<array>
<dict>
<key>UIApplicationShortcutItemIconSymbolName</key>
<string>square.and.pencil</string>
<key>UIApplicationShortcutItemTitle</key>
<string>NewPostShortcutItemTitle</string>
<key>UIApplicationShortcutItemType</key>
<string>org.joinmastodon.app.new-post</string>
</dict>
<dict>
<key>UIApplicationShortcutItemIconSymbolName</key>
<string>magnifyingglass</string>
<key>UIApplicationShortcutItemTitle</key>
<string>SearchShortcutItemTitle</string>
<key>UIApplicationShortcutItemType</key>
<string>org.joinmastodon.app.search</string>
</dict>
</array>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key>

View File

@ -4,6 +4,8 @@
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.siri</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>group.org.joinmastodon.app</string>

View File

@ -1,2 +1,4 @@
"NSCameraUsageDescription" = "Used to take photo for post status";
"NSPhotoLibraryAddUsageDescription" = "Used to save photo into the Photo Library";
"NSPhotoLibraryAddUsageDescription" = "Used to save photo into the Photo Library";
"NewPostShortcutItemTitle" = "New Post";
"SearchShortcutItemTitle" = "Search";

View File

@ -1,2 +1,4 @@
"NSCameraUsageDescription" = "Used to take photo for post status";
"NSPhotoLibraryAddUsageDescription" = "Used to save photo into the Photo Library";
"NSPhotoLibraryAddUsageDescription" = "Used to save photo into the Photo Library";
"NewPostShortcutItemTitle" = "New Post";
"SearchShortcutItemTitle" = "Search";

View File

@ -1,2 +0,0 @@
"NSCameraUsageDescription" = "Used to take photo for post status";
"NSPhotoLibraryAddUsageDescription" = "Used to save photo into the Photo Library";

View File

@ -18,6 +18,8 @@ final class ComposeViewModel: NSObject {
static let composeContentLimit: Int = 500
var disposeBag = Set<AnyCancellable>()
let id = UUID()
// input
let context: AppContext

View File

@ -99,6 +99,21 @@ final class ReplicaStatusView: UIView {
metaText.textView.textContainer.lineFragmentPadding = 0
metaText.textView.textContainerInset = .zero
metaText.textView.layer.masksToBounds = false
metaText.paragraphStyle = {
let style = NSMutableParagraphStyle()
style.lineSpacing = 5
style.paragraphSpacing = 8
return style
}()
metaText.textAttributes = [
.font: UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 17, weight: .regular)),
.foregroundColor: Asset.Colors.Label.primary.color,
]
metaText.linkAttributes = [
.font: UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 17, weight: .semibold)),
.foregroundColor: Asset.Colors.brandBlue.color,
]
return metaText
}()

View File

@ -120,9 +120,10 @@ final class HomeTimelineViewModel: NSObject {
.sink { [weak self] activeMastodonAuthentication in
guard let self = self else { return }
guard let mastodonAuthentication = activeMastodonAuthentication else { return }
let activeMastodonUserID = mastodonAuthentication.userID
let domain = mastodonAuthentication.domain
let userID = mastodonAuthentication.userID
let predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [
HomeTimelineIndex.predicate(userID: activeMastodonUserID),
HomeTimelineIndex.predicate(domain: domain, userID: userID),
HomeTimelineIndex.notDeleted()
])
self.timelinePredicate.value = predicate

View File

@ -440,6 +440,7 @@ extension ProfileHeaderView {
bringSubviewToFront(bannerContainerView)
bringSubviewToFront(nameContainerStackView)
bioMetaText.textView.delegate = self
bioMetaText.textView.linkDelegate = self
let avatarImageViewSingleTapGestureRecognizer = UITapGestureRecognizer.singleTapGestureRecognizer
@ -522,6 +523,19 @@ extension ProfileHeaderView {
}
}
// MARK: - UITextViewDelegate
extension ProfileHeaderView: UITextViewDelegate {
func textView(_ textView: UITextView, shouldInteractWith textAttachment: NSTextAttachment, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
switch textView {
case bioMetaText.textView:
return false
default:
assertionFailure()
return true
}
}
}
// MARK: - MetaTextViewDelegate
extension ProfileHeaderView: MetaTextViewDelegate {
func metaTextView(_ metaTextView: MetaTextView, didSelectMeta meta: Meta) {

View File

@ -101,7 +101,7 @@ extension SearchResultViewModel.State {
maxID: nil,
minID: nil,
excludeUnreviewed: nil,
resolve: nil,
resolve: true,
limit: nil,
offset: _offset,
following: nil

View File

@ -160,7 +160,7 @@ extension SearchResultTableViewCell {
let metaContent = PlaintextMetaContent(string: name)
_titleLabel.configure(content: metaContent)
}
_subTitleLabel.text = account.acct
_subTitleLabel.text = "@" + account.acct
}
func config(with account: MastodonUser) {
@ -173,14 +173,15 @@ extension SearchResultTableViewCell {
let metaContent = PlaintextMetaContent(string: account.displayNameWithFallback)
_titleLabel.configure(content: metaContent)
}
_subTitleLabel.text = account.acct
_subTitleLabel.text = "@" + account.acct
}
func config(with tag: Mastodon.Entity.Tag) {
configure(with: AvatarConfigurableViewConfiguration(avatarImageURL: nil))
let image = UIImage(systemName: "number.circle.fill", withConfiguration: UIImage.SymbolConfiguration(pointSize: 34, weight: .regular))!.withRenderingMode(.alwaysTemplate)
_imageView.image = image
_titleLabel.text = "#" + tag.name
let metaContent = PlaintextMetaContent(string: "#" + tag.name)
_titleLabel.configure(content: metaContent)
guard let histories = tag.history else {
_subTitleLabel.text = ""
return
@ -195,7 +196,8 @@ extension SearchResultTableViewCell {
configure(with: AvatarConfigurableViewConfiguration(avatarImageURL: nil))
let image = UIImage(systemName: "number.circle.fill", withConfiguration: UIImage.SymbolConfiguration(pointSize: 34, weight: .regular))!.withRenderingMode(.alwaysTemplate)
_imageView.image = image
_titleLabel.text = "# " + tag.name
let metaContent = PlaintextMetaContent(string: "#" + tag.name)
_titleLabel.configure(content: metaContent)
guard let histories = tag.histories?.sorted(by: {
$0.createAt.compare($1.createAt) == .orderedAscending
}) else {

View File

@ -40,7 +40,7 @@ extension APIService {
// MARK: - LocalizedError
extension APIService.APIError: LocalizedError {
var errorDescription: String? {
public var errorDescription: String? {
switch errorReason {
case .authenticationMissing: return "Fail to Authenticatie"
case .badRequest: return "Bad Request"

View File

@ -19,11 +19,13 @@ extension APIService {
private static let clientName = "Mastodon for iOS"
#endif
private static let appWebsite = "https://joinmastodon.org/apps"
func createApplication(domain: String) -> AnyPublisher<Mastodon.Response.Content<Mastodon.Entity.Application>, Error> {
let query = Mastodon.API.App.CreateQuery(
clientName: APIService.clientName,
redirectURIs: MastodonAuthenticationController.callbackURL,
website: nil
website: APIService.appWebsite
)
return Mastodon.API.App.create(
session: session,

View File

@ -104,7 +104,17 @@ extension APIService {
APIService.CoreData.merge(status: oldStatus, entity: entity.reblog ?? entity, requestMastodonUser: requestMastodonUser, domain: mastodonAuthenticationBox.domain, networkDate: response.networkDate)
switch reblogKind {
case .undoReblog:
// update reblogged status
oldStatus.update(reblogsCount: NSNumber(value: max(0, oldStatus.reblogsCount.intValue - 1)))
// remove reblog from statuses
let reblogFroms = oldStatus.reblogFrom?.filter { status in
return status.author.domain == domain && status.author.id == requestMastodonUserID
} ?? Set()
reblogFroms.forEach { reblogFrom in
managedObjectContext.delete(reblogFrom)
}
default:
break
}

View File

@ -130,6 +130,19 @@ extension AuthenticationService {
appAuthorization: Mastodon.API.OAuth.Authorization(accessToken: mastodonAuthentication.appAccessToken),
userAuthorization: Mastodon.API.OAuth.Authorization(accessToken: mastodonAuthentication.userAccessToken)
)
// remove home timeline indexes
let homeTimelineIndexRequest = HomeTimelineIndex.sortedFetchRequest
homeTimelineIndexRequest.predicate = HomeTimelineIndex.predicate(
domain: mastodonAuthentication.domain,
userID: mastodonAuthentication.userID
)
let homeTimelineIndexes = managedObjectContext.safeFetch(homeTimelineIndexRequest)
for homeTimelineIndex in homeTimelineIndexes {
managedObjectContext.delete(homeTimelineIndex)
}
// remove user authentication
managedObjectContext.delete(mastodonAuthentication)
isSignOut = true
}

View File

@ -7,6 +7,7 @@
import os.log
import Foundation
import Intents
import Combine
import CoreData
import CoreDataStack
@ -52,7 +53,7 @@ extension StatusPublishService {
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s: composeViewModelDidUpdate", ((#file as NSString).lastPathComponent), #line, #function)
self.composeViewModelDidUpdatePublisher.send()
switch state {
case is ComposeViewModel.PublishState.Finish:
self.remove(composeViewModel: composeViewModel)

View File

@ -5,6 +5,7 @@
// Created by MainasuK Cirno on 2021/1/22.
//
import os.log
import UIKit
import Combine
import CoreDataStack
@ -25,6 +26,9 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var fpsIndicator: FPSIndicator?
#endif
var savedShortCutItem: UIApplicationShortcutItem?
let logger = Logger(subsystem: "SceneDelegate", category: "logic")
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = scene as? UIWindowScene else { return }
@ -55,6 +59,11 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
sceneCoordinator.setup()
sceneCoordinator.setupOnboardingIfNeeds(animated: false)
window.makeKeyAndVisible()
if let shortcutItem = connectionOptions.shortcutItem {
// Save it off for later when we become active.
savedShortCutItem = shortcutItem
}
UserDefaults.shared.observe(\.customUserInterfaceStyle, options: [.initial, .new]) { [weak self] defaults, _ in
guard let self = self else { return }
@ -84,6 +93,11 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
// trigger status filter update
AppContext.shared.statusFilterService.filterUpdatePublisher.send()
if let shortcutItem = savedShortCutItem {
_ = handler(shortcutItem: shortcutItem)
savedShortCutItem = nil
}
}
func sceneWillResignActive(_ scene: UIScene) {
@ -103,7 +117,40 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
AppContext.shared.audioPlaybackService.pauseIfNeed()
}
}
extension SceneDelegate {
func windowScene(_ windowScene: UIWindowScene, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) {
completionHandler(handler(shortcutItem: shortcutItem))
}
private func handler(shortcutItem: UIApplicationShortcutItem) -> Bool {
logger.debug("\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): \(shortcutItem.type)")
switch shortcutItem.type {
case "org.joinmastodon.app.new-post":
if coordinator?.tabBarController.topMost is ComposeViewController {
logger.debug("\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): composing…")
} else {
let composeViewModel = ComposeViewModel(context: AppContext.shared, composeKind: .post)
coordinator?.present(scene: .compose(viewModel: composeViewModel), from: nil, transition: .modal(animated: true, completion: nil))
logger.debug("\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): present compose scene")
}
case "org.joinmastodon.app.search":
coordinator?.switchToTabBar(tab: .search)
logger.debug("\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): select search tab")
if let searchViewController = coordinator?.tabBarController.topMost as? SearchViewController {
searchViewController.searchBarTapPublisher.send()
logger.debug("\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): trigger search")
}
default:
assertionFailure()
break
}
return true
}
}
#if DEBUG

42
MastodonIntent/Info.plist Normal file
View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>MastodonIntent</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>IntentsRestrictedWhileLocked</key>
<array/>
<key>IntentsRestrictedWhileProtectedDataUnavailable</key>
<array/>
<key>IntentsSupported</key>
<array>
<string>SendPostIntent</string>
</array>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.intents-service</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).IntentHandler</string>
</dict>
</dict>
</plist>

View File

@ -0,0 +1,23 @@
//
// IntentHandler.swift
// MastodonIntent
//
// Created by Cirno MainasuK on 2021-7-26.
//
import Intents
class IntentHandler: INExtension {
override func handler(for intent: INIntent) -> Any {
// This is the default implementation. If you want different objects to handle different intents,
// you can override this and return the handler you want for that particular intent.
switch intent {
case is SendPostIntent:
return SendPostIntentHandler()
default:
return self
}
}
}

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.org.joinmastodon.app</string>
</array>
</dict>
</plist>

View File

@ -0,0 +1,99 @@
//
// SendPostIntentHandler.swift
// MastodonIntent
//
// Created by Cirno MainasuK on 2021-7-26.
//
import Foundation
import Intents
import Combine
import CoreData
import CoreDataStack
import MastodonSDK
final class SendPostIntentHandler: NSObject, SendPostIntentHandling {
var disposeBag = Set<AnyCancellable>()
lazy var coreDataStack = CoreDataStack()
lazy var managedObjectContext = coreDataStack.persistentContainer.viewContext
func handle(intent: SendPostIntent, completion: @escaping (SendPostIntentResponse) -> Void) {
managedObjectContext.performAndWait {
let request = MastodonAuthentication.sortedFetchRequest
let authentications = (try? self.managedObjectContext.fetch(request)) ?? []
let _authentication = authentications.sorted(by: { $0.activedAt > $1.activedAt }).first
guard let authentication = _authentication else {
let failureReason = APIService.APIError.implicit(.authenticationMissing).errorDescription ?? "Fail to Send Post"
completion(SendPostIntentResponse.failure(failureReason: failureReason))
return
}
let box = MastodonAuthenticationBox(
domain: authentication.domain,
userID: authentication.userID,
appAuthorization: .init(accessToken: authentication.appAccessToken),
userAuthorization: .init(accessToken: authentication.userAccessToken)
)
let visibility: Mastodon.Entity.Status.Visibility = {
switch intent.visibility {
case .unknown: return .public
case .public: return .public
case .followersOnly: return .private
}
}()
let query = Mastodon.API.Statuses.PublishStatusQuery(
status: intent.content,
mediaIDs: nil,
pollOptions: nil,
pollExpiresIn: nil,
inReplyToID: nil,
sensitive: nil,
spoilerText: nil,
visibility: visibility
)
APIService.shared.publishStatus(
domain: box.domain,
query: query,
mastodonAuthenticationBox: box
)
.sink { _completion in
switch _completion {
case .failure(let error):
let failureReason = error.localizedDescription
completion(SendPostIntentResponse.failure(failureReason: failureReason))
case .finished:
break
}
} receiveValue: { response in
let post = Post(identifier: response.value.id, display: intent.content ?? "")
post.url = URL(string: response.value.url ?? response.value.uri)
let result = SendPostIntentResponse(code: .success, userActivity: nil)
result.post = post
completion(result)
}
.store(in: &disposeBag)
}
}
func resolveContent(for intent: SendPostIntent, with completion: @escaping (INStringResolutionResult) -> Void) {
guard let content = intent.content, !content.isEmpty else {
completion(.needsValue())
return
}
completion(.success(with: content))
}
func resolveVisibility(for intent: SendPostIntent, with completion: @escaping (PostVisibilityResolutionResult) -> Void) {
completion(.success(with: intent.visibility))
}
}

View File

@ -0,0 +1,33 @@
//
// APIService.swift
// MastodonIntent
//
// Created by Cirno MainasuK on 2021-7-26.
//
import os.log
import Foundation
import Combine
import CoreData
import CoreDataStack
import MastodonSDK
// Replica APIService for share extension
final class APIService {
var disposeBag = Set<AnyCancellable>()
static let shared = APIService()
// internal
let session: URLSession
// output
let error = PassthroughSubject<APIError, Never>()
private init() {
self.session = URLSession(configuration: .default)
}
}