Skip to content

Commit

Permalink
Release 1.4.5 (184)
Browse files Browse the repository at this point in the history
  • Loading branch information
denis15yo committed Nov 6, 2023
1 parent 5124481 commit 1fe05bd
Show file tree
Hide file tree
Showing 1,253 changed files with 75,068 additions and 35,649 deletions.
13 changes: 13 additions & 0 deletions Nicegram/AppLovinAdProvider/Sources/AdProviderMock.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import NGAiChat

public class AdProviderMock {
public init() {}
}

extension AdProviderMock: AdProvider {
public func initialize() {}

public func showAd() -> ShowAdResult {
.error(nil)
}
}
2 changes: 1 addition & 1 deletion Nicegram/NGLottie/Sources/LottieViewImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class LottieViewImpl: UIView {
}
}

extension LottieViewImpl: LottieView {
extension LottieViewImpl: LottieViewProtocol {
public func play(completion: @escaping () -> Void) {
animationView.play { _ in
completion()
Expand Down
12 changes: 12 additions & 0 deletions Nicegram/NGUI/Sources/NicegramSettingsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import AccountContext
import Display
import FeatImagesHubUI
import FeatPartners
import Foundation
import ItemListUI
import NGData
Expand Down Expand Up @@ -81,6 +82,7 @@ private enum EasyToggleType {
case showRegDate
case hideReactions
case hideStories
case hidePartnerIntegrations
}


Expand Down Expand Up @@ -541,6 +543,10 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry {
VarSystemNGSettings.hideReactions = value
case .hideStories:
NGSettings.hideStories = value
case .hidePartnerIntegrations:
if #available(iOS 13.0, *) {
Partners.hideIntegrations = value
}
}
})
case let .unblockHeader(text):
Expand Down Expand Up @@ -806,6 +812,12 @@ private func nicegramSettingsControllerEntries(presentationData: PresentationDat
toggleIndex += 1

entries.append(.easyToggle(toggleIndex, .hideStories, l("NicegramSettings.HideStories", locale), NGSettings.hideStories))
toggleIndex += 1

if #available(iOS 13.0, *) {
entries.append(.easyToggle(toggleIndex, .hidePartnerIntegrations, Partners.hideIntegrationsTitle, Partners.hideIntegrations))
toggleIndex += 1
}

entries.append(.shareChannelsInfoToggle(l("NicegramSettings.ShareChannelsInfoToggle", locale), isShareChannelsInfoEnabled()))
entries.append(.shareChannelsInfoNote(l("NicegramSettings.ShareChannelsInfoToggle.Note", locale)))
Expand Down
8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"location" : "git@bitbucket.org:mobyrix/nicegram-assistant-ios.git",
"state" : {
"branch" : "develop",
"revision" : "6ac92187e0dac03bffc786d6bf8378169ed425aa"
"revision" : "42ed26bd295a28a8a800f54583af10f4acdaaf34"
}
},
{
Expand All @@ -51,16 +51,16 @@
"location" : "https://github.com/denis15yo/R.swift.git",
"state" : {
"branch" : "main",
"revision" : "77c0d9c202b9ac83c1992111b76b3fb10468015b"
"revision" : "4a0f8c97f1baa27d165dc801982c55bbf51126e5"
}
},
{
"identity" : "sdwebimage",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SDWebImage/SDWebImage.git",
"state" : {
"revision" : "1f06ef5007b6a580b3873ed2adee19e05d3b215a",
"version" : "5.18.3"
"revision" : "fd1950de05a5ad77cb252fd88576c1e1809ee50d",
"version" : "5.18.4"
}
},
{
Expand Down
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,28 @@ python3 build-system/Make/Make.py \
--configuration=release_arm64
```

## Tips
# FAQ

## Xcode is stuck at "build-request.json not updated yet"

Occasionally, you might observe the following message in your build log:
```
"/Users/xxx/Library/Developer/Xcode/DerivedData/Telegram-xxx/Build/Intermediates.noindex/XCBuildData/xxx.xcbuilddata/build-request.json" not updated yet, waiting...
```

Should this occur, simply cancel the ongoing build and initiate a new one.

## Telegram_xcodeproj: no such package

Following a system restart, the auto-generated Xcode project might encounter a build failure accompanied by this error:
```
ERROR: Skipping '@rules_xcodeproj_generated//generator/Telegram/Telegram_xcodeproj:Telegram_xcodeproj': no such package '@rules_xcodeproj_generated//generator/Telegram/Telegram_xcodeproj': BUILD file not found in directory 'generator/Telegram/Telegram_xcodeproj' of external repository @rules_xcodeproj_generated. Add a BUILD file to a directory to mark it as a package.
```

If you encounter this issue, re-run the project generation steps in the README.


# Tips

## Codesigning is not required for simulator-only builds

Expand Down
21 changes: 17 additions & 4 deletions Telegram/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ bool_flag(
visibility = ["//visibility:public"],
)

bool_flag(
name = "projectIncludeRelease",
build_setting_default = False,
visibility = ["//visibility:public"],
)

config_setting(
name = "disableExtensionsSetting",
flag_values = {
Expand All @@ -89,6 +95,13 @@ config_setting(
},
)

config_setting(
name = "projectIncludeReleaseSetting",
flag_values = {
":projectIncludeRelease": "True",
},
)

bool_flag(
name = "disableStripping",
build_setting_default = False,
Expand Down Expand Up @@ -1232,7 +1245,7 @@ swift_library(
"-warnings-as-errors",
],
deps = [
"//submodules/TelegramUI:TelegramUI",
"//submodules/TelegramUI",
"//submodules/TelegramUI/Components/ShareExtensionContext"
],
)
Expand Down Expand Up @@ -2056,9 +2069,9 @@ xcodeproj(
"Debug": {
"//command_line_option:compilation_mode": "dbg",
},
"Release": {
"//command_line_option:compilation_mode": "opt",
},
#"Release": {
# "//command_line_option:compilation_mode": "opt",
#},
},
default_xcode_configuration = "Debug"

Expand Down
35 changes: 30 additions & 5 deletions Telegram/NotificationService/Sources/NotificationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -722,18 +722,25 @@ private final class NotificationServiceHandler {

let semaphore = DispatchSemaphore(value: 0)
var loggingSettings = LoggingSettings.defaultSettings
let _ = (self.accountManager.transaction { transaction -> LoggingSettings in
if buildConfig.isInternalBuild {
loggingSettings = LoggingSettings(logToFile: true, logToConsole: false, redactSensitiveData: true)
}
let _ = (self.accountManager.transaction { transaction -> LoggingSettings? in
if let value = transaction.getSharedData(SharedDataKeys.loggingSettings)?.get(LoggingSettings.self) {
return value
} else {
return LoggingSettings.defaultSettings
return nil
}
}).start(next: { value in
loggingSettings = value
if let value {
loggingSettings = value
}
semaphore.signal()
})
semaphore.wait()

Logger.shared.log("NotificationService \(episode)", "Logging settings: (logToFile: \(loggingSettings.logToFile))")

Logger.shared.logToFile = loggingSettings.logToFile
Logger.shared.logToConsole = loggingSettings.logToConsole
Logger.shared.redactSensitiveData = loggingSettings.redactSensitiveData
Expand Down Expand Up @@ -1421,15 +1428,24 @@ private final class NotificationServiceHandler {
}
}
}

let wasDisplayed = stateManager.postbox.transaction { transaction -> Bool in
if let messageId {
return _internal_getMessageNotificationWasDisplayed(transaction: transaction, id: messageId)
} else {
return false
}
}

Logger.shared.log("NotificationService \(episode)", "Will fetch media")
let _ = (combineLatest(queue: queue,
fetchMediaSignal
|> timeout(10.0, queue: queue, alternate: .single(nil)),
fetchNotificationSoundSignal
|> timeout(10.0, queue: queue, alternate: .single(nil))
|> timeout(10.0, queue: queue, alternate: .single(nil)),
wasDisplayed
)
|> deliverOn(queue)).start(next: { mediaData, notificationSoundData in
|> deliverOn(queue)).start(next: { mediaData, notificationSoundData, wasDisplayed in
guard let strongSelf = self, let stateManager = strongSelf.stateManager else {
completed()
return
Expand Down Expand Up @@ -1523,6 +1539,15 @@ private final class NotificationServiceHandler {

Logger.shared.log("NotificationService \(episode)", "Updating content to \(content)")

if wasDisplayed {
content = NotificationContent(isLockedMessage: nil)
Logger.shared.log("NotificationService \(episode)", "Was already displayed, skipping content")
} else if let messageId {
let _ = (stateManager.postbox.transaction { transaction -> Void in
_internal_setMessageNotificationWasDisplayed(transaction: transaction, id: messageId)
}).start()
}

updateCurrentContent(content)

completed()
Expand Down
22 changes: 21 additions & 1 deletion Telegram/Share/ShareRootController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import UIKit
import TelegramUI
import BuildConfig
import ShareExtensionContext
import SwiftSignalKit
import Postbox
import TelegramCore

@objc(ShareRootController)
class ShareRootController: UIViewController {
Expand Down Expand Up @@ -46,7 +49,24 @@ class ShareRootController: UIViewController {

let appVersion = (Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String) ?? "unknown"

self.impl = ShareRootControllerImpl(initializationData: ShareRootControllerInitializationData(appBundleId: baseAppBundleId, appBuildType: buildConfig.isAppStoreBuild ? .public : .internal, appGroupPath: appGroupUrl.path, apiId: buildConfig.apiId, apiHash: buildConfig.apiHash, languagesCategory: languagesCategory, encryptionParameters: encryptionParameters, appVersion: appVersion, bundleData: buildConfig.bundleData(withAppToken: nil, signatureDict: nil), useBetaFeatures: !buildConfig.isAppStoreBuild), getExtensionContext: { [weak self] in
self.impl = ShareRootControllerImpl(initializationData: ShareRootControllerInitializationData(appBundleId: baseAppBundleId, appBuildType: buildConfig.isAppStoreBuild ? .public : .internal, appGroupPath: appGroupUrl.path, apiId: buildConfig.apiId, apiHash: buildConfig.apiHash, languagesCategory: languagesCategory, encryptionParameters: encryptionParameters, appVersion: appVersion, bundleData: buildConfig.bundleData(withAppToken: nil, signatureDict: nil), useBetaFeatures: !buildConfig.isAppStoreBuild, makeTempContext: { accountManager, appLockContext, applicationBindings, InitialPresentationDataAndSettings, networkArguments in
return makeTempContext(
sharedContainerPath: appGroupUrl.path,
rootPath: rootPath,
appGroupPath: appGroupUrl.path,
accountManager: accountManager,
appLockContext: appLockContext,
encryptionParameters: ValueBoxEncryptionParameters(
forceEncryptionIfNoSet: false,
key: ValueBoxEncryptionParameters.Key(data: encryptionParameters.0)!,
salt: ValueBoxEncryptionParameters.Salt(data: encryptionParameters.1)!
),
applicationBindings: applicationBindings,
initialPresentationDataAndSettings: InitialPresentationDataAndSettings,
networkArguments: networkArguments,
buildConfig: buildConfig
)
}), getExtensionContext: { [weak self] in
return self?.extensionContext
})
}
Expand Down
Loading

0 comments on commit 1fe05bd

Please sign in to comment.