-
Notifications
You must be signed in to change notification settings - Fork 867
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
498 changed files
with
26,386 additions
and
6,699 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ [email protected]:overtake/tgcalls.git | |
url = [email protected]:desktop-app/tg_owt.git | ||
[submodule "submodules/libprisma"] | ||
path = submodules/libprisma | ||
url = [email protected]:TelegramMessenger/libprisma.git | ||
url=[email protected]:desktop-app/libprisma.git | ||
[submodule "submodules/regex"] | ||
path = submodules/regex | ||
url = [email protected]:boostorg/regex.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?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.app-sandbox</key> | ||
<true/> | ||
<key>com.apple.security.application-groups</key> | ||
<array> | ||
<string>6N38VWS5BX.ru.keepcoder.Telegram.FocusIntents</string> | ||
<string>6N38VWS5BX.ru.keepcoder.Telegram</string> | ||
</array> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// | ||
// FocusIntents.swift | ||
// FocusIntents | ||
// | ||
// Created by Mikhail Filimonov on 25.04.2024. | ||
// Copyright © 2024 Telegram. All rights reserved. | ||
// | ||
|
||
import AppIntents | ||
import OSLog | ||
import TelegramCore | ||
import Postbox | ||
import SwiftSignalKit | ||
import InAppSettings | ||
import ApiCredentials | ||
|
||
|
||
@available(macOS 13, *) | ||
struct FocusFilter: SetFocusFilterIntent { | ||
|
||
@Parameter(title: "Use Dark Mode", description: "Automatically enable dark mode.", default: false) | ||
var alwaysUseDarkMode: Bool | ||
|
||
@Parameter(title: "Set Unable Status", description: "Set your account status to Unable. This feature requires Telegram Premium.", default: false) | ||
var unableStatus: Bool | ||
|
||
|
||
static var title: LocalizedStringResource = "Set Appearance And Status" | ||
|
||
static var description: LocalizedStringResource? = """ | ||
Configure Appearance of app in focus mode | ||
""" | ||
|
||
var displayRepresentation: DisplayRepresentation { | ||
var status: String = "" | ||
if alwaysUseDarkMode { | ||
status += "Dark Mode" | ||
} | ||
if unableStatus { | ||
if status.isEmpty { | ||
status += "Status" | ||
} else { | ||
status += ", Status" | ||
} | ||
} | ||
return DisplayRepresentation(title: "Appearance And Status", | ||
subtitle: LocalizedStringResource(stringLiteral: status)) | ||
} | ||
|
||
|
||
var appContext: FocusFilterAppContext { | ||
return FocusFilterAppContext(notificationFilterPredicate: nil) | ||
} | ||
|
||
static func suggestedFocusFilters(for context: FocusFilterSuggestionContext) async -> [FocusFilter] { | ||
let workFilter = FocusFilter() | ||
workFilter.alwaysUseDarkMode = true | ||
workFilter.unableStatus = true | ||
return [workFilter] | ||
} | ||
|
||
func perform() async throws -> some IntentResult { | ||
let model = AppIntentDataModel(alwaysUseDarkMode: self.alwaysUseDarkMode, useUnableStatus: self.unableStatus) | ||
if let model = model.encoded() { | ||
UserDefaults(suiteName: ApiEnvironment.intentsBundleId)?.set(model, forKey: AppIntentDataModel.key) | ||
} | ||
return .result() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// FocusIntentsExtension.swift | ||
// FocusIntents | ||
// | ||
// Created by Mikhail Filimonov on 25.04.2024. | ||
// Copyright © 2024 Telegram. All rights reserved. | ||
// | ||
|
||
import AppIntents | ||
import OSLog | ||
|
||
|
||
@main | ||
struct FocusIntentsExtension: AppIntentsExtension { | ||
init() { | ||
AppDependencyManager.shared.add(dependency: AppIntentsData.shared) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?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>EXAppExtensionAttributes</key> | ||
<dict> | ||
<key>EXExtensionPointIdentifier</key> | ||
<string>com.apple.appintents-extension</string> | ||
</dict> | ||
<key>SOURCE</key> | ||
<string>${SOURCE}</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.