Skip to content

Commit

Permalink
Release 1.6.4 (265)
Browse files Browse the repository at this point in the history
  • Loading branch information
denis15yo committed Jun 25, 2024
1 parent 758630a commit 4ebec69
Show file tree
Hide file tree
Showing 1,679 changed files with 152,542 additions and 43,735 deletions.
4 changes: 4 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ build --per_file_copt="third-party/webrtc/.*\.cpp$","@-std=c++17"
build --per_file_copt="third-party/webrtc/.*\.cc$","@-std=c++17"
build --per_file_copt="third-party/webrtc/.*\.mm$","@-std=c++17"
build --per_file_copt="submodules/LottieMeshSwift/LottieMeshBinding/Sources/.*\.mm$","@-std=c++17"
build --per_file_copt="submodules/TelegramUI/Components/LottieCpp/Sources/.*\.mm$","@-std=c++17"
build --per_file_copt="submodules/TelegramUI/Components/LottieCpp/Sources/.*\.cpp$","@-std=c++17"
build --per_file_copt="Tests/LottieMetalTest/SoftwareLottieRenderer/Sources/.*\.cpp$","@-std=c++17"
build --per_file_copt="Tests/LottieMetalTest/SoftwareLottieRenderer/Sources/.*\.mm$","@-std=c++17"

build --swiftcopt=-whole-module-optimization

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ public func shouldSubscribeToCopyContent(message: Message) -> Bool {
}

public func routeToNicegramPremiumForCopyContent() {
PremiumUITgHelper.routeToPremium()
PremiumUITgHelper.routeToPremium(
source: .copyProtectedContent
)
}

// MARK: - Bypass setting (Secret Menu)
Expand Down
3 changes: 3 additions & 0 deletions Nicegram/NGData/Sources/NGSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public struct NGSettings {
@NGStorage(key: "showNicegramTab", defaultValue: true)
public static var showNicegramTab: Bool

@NGStorage(key: "showNicegramButtonInChat", defaultValue: true)
public static var showNicegramButtonInChat: Bool

@NGStorage(key: "sendWithEnter", defaultValue: false)
public static var sendWithEnter: Bool

Expand Down
4 changes: 2 additions & 2 deletions Nicegram/NGData/Sources/NGWeb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ extension String {
public func requestApi(_ path: String, pathParams: [String] = [], completion: @escaping (_ apiResult: [String: Any]?) -> Void) {
let startTime = CFAbsoluteTimeGetCurrent()
ngLog("DECLARING REQUEST \(path)")
var urlString = NGENV.ng_api_url + path + "/"
var urlString = "\(NGENV.ng_api_url)/\(path)/"
for param in pathParams {
urlString = urlString + String(param) + "/"
}
Expand All @@ -118,7 +118,7 @@ public func requestApi(_ path: String, pathParams: [String] = [], completion: @e
}

public func getNGSettings(_ userId: Int64, completion: @escaping (_ sync: Bool, _ rreasons: [String], _ allowed: [Int64], _ restricted: [Int64], _ premiumStatus: Bool, _ betaPremiumStatus: Bool) -> Void) {
requestApi("settings", pathParams: [String(userId)], completion: { (apiResponse) -> Void in
requestApi("v7/unblock-feature/settings", pathParams: [String(userId)], completion: { (apiResponse) -> Void in
var syncChats = VARNGAPISETTINGS.SYNC_CHATS
var restricitionReasons = VARNGAPISETTINGS.RESTRICTION_REASONS
var allowedChats = VARNGAPISETTINGS.ALLOWED
Expand Down
14 changes: 10 additions & 4 deletions Nicegram/NGEnv/Sources/NGEnv.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,27 @@ public struct NGEnvObj: Decodable {
public let app_review_login_code: String
public let app_review_login_phone: String
public let premium_bundle: String
public let ng_api_key: String
public let ng_api_url: String
public let moby_key: String
public let privacy_url: String
public let terms_url: String
public let reg_date_url: String
public let reg_date_key: String
public let esim_api_url: String
public let esim_api_key: String
public let referral_bot: String
public let remote_config_cache_duration_seconds: Double
public let tapjoy_api_key: String
public let telegram_auth_bot: String
public let applovin_api_key: String
public let applovin_ad_unit_id: String
public let websocket_url: URL

public let wallet: Wallet
public struct Wallet: Decodable {
public let keychainGroupIdentifier: String
public let walletConnectProjectId: String
public let web3AuthBackupQuestion: String
public let web3AuthClientId: String
public let web3AuthVerifier: String
}
}

func parseNGEnv() -> NGEnvObj {
Expand Down
28 changes: 5 additions & 23 deletions Nicegram/NGLab/Sources/RegDate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import SwiftSignalKit
import NGEnv
import NGDeviceCheck

fileprivate let regDateUrlString = NGENV.reg_date_url
fileprivate let regDateKey = NGENV.reg_date_key

public enum RegDateError {
case generic
case badDeviceToken
Expand Down Expand Up @@ -47,15 +44,12 @@ struct RegDate: Codable {
public func requestRegDate(jsonData: Data) -> Signal<String, RegDateError> {
return Signal { subscriber in
let completed = Atomic<Bool>(value: false)
var request = URLRequest(url: URL(string: regDateUrlString)!)


var request = URLRequest(url: URL(string: "\(NGENV.ng_api_url)/v7/regdate")!)

request.httpMethod = "POST"
request.setValue(regDateKey, forHTTPHeaderField: "x-api-key")
// request.setValue("application/json; charset=utf-8", forHTTPHeaderField: "Content-Type")
// request.setValue(deviceToken, forHTTPHeaderField: "Device-Token")
// request.setValue("\(requestByUserId)", forHTTPHeaderField: "User-Id")
// request.setValue("Bearer \(ngLabData[1])", forHTTPHeaderField: "Authorization")

request.setValue("application/json", forHTTPHeaderField: "Content-Type")

// insert json data to the request
request.httpBody = jsonData as Data
request.timeoutInterval = 10
Expand All @@ -68,18 +62,6 @@ public func requestRegDate(jsonData: Data) -> Signal<String, RegDateError> {
let decoder = JSONDecoder()
let gitData = try decoder.decode(RegDate.self, from: data)
subscriber.putNext(gitData.data.date)
// let json = try JSONSerialization.jsonObject(with: data, options: []) as? [String : Any]
// if let result = String(data: data, encoding: .utf8) {
// if let timeInterval = TimeInterval(result) {
// let date = Date(timeIntervalSince1970: timeInterval)
// subscriber.putNext(date)
// subscriber.putCompletion()
// } else {
// subscriber.putError(.generic)
// }
// } else {
// subscriber.putError(.generic)
// }
} catch {
subscriber.putError(.generic)
}
Expand Down
19 changes: 0 additions & 19 deletions Nicegram/NGOnboarding/BUILD

This file was deleted.

48 changes: 0 additions & 48 deletions Nicegram/NGOnboarding/Sources/OnboardingFlow.swift

This file was deleted.

Loading

0 comments on commit 4ebec69

Please sign in to comment.