Skip to content

Commit

Permalink
1.8.5 (329)
Browse files Browse the repository at this point in the history
  • Loading branch information
denis15yo committed Sep 30, 2024
1 parent f5d548d commit d4b9d2d
Show file tree
Hide file tree
Showing 302 changed files with 2,841 additions and 18,219 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ jobs:
runs-on: macos-14

steps:
- uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.SSH_KEY }}

- name: Add SSH known hosts
run: |
ssh-keyscan bitbucket.org >> ~/.ssh/known_hosts
- uses: actions/checkout@v2
with:
submodules: 'recursive'
Expand All @@ -31,14 +39,8 @@ jobs:
cp -R $GITHUB_WORKSPACE /Users/telegram/
mv /Users/telegram/$(basename $GITHUB_WORKSPACE) /Users/telegram/telegram-ios
- uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.SSH_KEY }}

- name: New testflight build
run: |
ssh-keyscan bitbucket.org >> ~/.ssh/known_hosts
set -x
mkdir -p $BUILD_WORKING_DIR
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ jobs:
runs-on: macos-14

steps:
- uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.SSH_KEY }}

- name: Add SSH known hosts
run: |
ssh-keyscan bitbucket.org >> ~/.ssh/known_hosts
- uses: actions/checkout@v2
with:
submodules: 'recursive'
Expand All @@ -28,14 +36,8 @@ jobs:
cp -R $GITHUB_WORKSPACE /Users/telegram/
mv /Users/telegram/$(basename $GITHUB_WORKSPACE) /Users/telegram/telegram-ios
- uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.SSH_KEY }}

- name: New testflight build
run: |
ssh-keyscan bitbucket.org >> ~/.ssh/known_hosts
set -x
mkdir -p $BUILD_WORKING_DIR
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
url = https://github.com/telegramdesktop/libtgvoip.git
[submodule "submodules/TgVoipWebrtc/tgcalls"]
path = submodules/TgVoipWebrtc/tgcalls
url = https://github.com/TelegramMessenger/tgcalls.git
url = git@bitbucket.org:mobyrix/tgcalls.git
[submodule "third-party/libvpx/libvpx"]
path = third-party/libvpx/libvpx
url = https://github.com/webmproject/libvpx.git
Expand All @@ -26,7 +26,7 @@
# Perhaps the crash is related to the minimum version of iOS (we have iOS 14, telegram has iOS 12).
[submodule "third-party/webrtc/webrtc"]
path = third-party/webrtc/webrtc
url = https://github.com/denis15yo/webrtc.git
url = https://github.com/nicegram/webrtc.git
[submodule "third-party/libx264/x264"]
path = third-party/libx264/x264
url = https://github.com/mirror/x264.git
Expand Down
16 changes: 8 additions & 8 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions Nicegram/NGCallRecorder/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")

swift_library(
name = "NGCallRecorder",
module_name = "NGCallRecorder",
srcs = glob([
"Sources/**/*.swift",
]),
deps = [
"//submodules/ComponentFlow",
"//submodules/Display"
],
visibility = [
"//visibility:public",
],
)
85 changes: 85 additions & 0 deletions Nicegram/NGCallRecorder/Sources/NGRecordIndicatorView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import UIKit
import Display
import ComponentFlow

public class NGRecordIndicatorView: UIView {
private let contentView = UIView()
private let label: UILabel = {
let label = UILabel()
label.textColor = .white
label.font = .systemFont(ofSize: 16.0, weight: .regular)

return label
}()
private let imageView: UIImageView = {
let imageView = UIImageView()
imageView.image = UIImage(bundleImageName: "RecordIndicator")

return imageView
}()
private let textHeight: CGFloat = 20.0
private let sideInset: CGFloat = 8.0
private let verticalInset: CGFloat = 4.0
private let iconSpacing: CGFloat = 4.0
private var actualSize: CGSize = .zero

override init(frame: CGRect) {
super.init(frame: frame)

self.clipsToBounds = true

contentView.clipsToBounds = true
contentView.layer.cornerRadius = (textHeight + verticalInset * 2) / 2
contentView.backgroundColor = UIColor(hexString: "FF453A")

addSubview(contentView)
contentView.addSubview(imageView)
contentView.addSubview(label)
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

public func animateIn() {
self.layer.animateScale(from: 0.001, to: 1.0, duration: 0.3, timingFunction: kCAMediaTimingFunctionSpring)
self.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.15)
}

public func animateOut(completion: @escaping () -> Void) {
self.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { _ in
completion()
})
self.layer.animateScale(from: 1.0, to: 0.001, duration: 0.2, removeOnCompletion: false)
}

public func update(
text: String,
constrainedWidth: CGFloat = 75.0,
transition: ComponentTransition
) -> CGSize {
label.text = text

let iconSize = self.imageView.image?.size ?? CGSize(width: 20.0, height: 20.0)

let maxSize = CGSize(width: constrainedWidth, height: CGFloat.greatestFiniteMagnitude)
let boundingRect = text.boundingRect(
with: maxSize,
options: .usesLineFragmentOrigin,
attributes: [.font: label.font ?? UIFont()],
context: nil
)
let textSize = CGSize(width: ceil(max(boundingRect.width, 35.0)), height: textHeight)

let size = CGSize(width: iconSize.width + iconSpacing + textSize.width + sideInset * 2.0, height: textSize.height + verticalInset * 2.0)
actualSize = size.width > actualSize.width ? size : actualSize

transition.setFrame(view: self.contentView, frame: CGRect(origin: CGPoint(), size: size))

transition.setFrame(view: self.imageView, frame: CGRect(origin: CGPoint(x: floorToScreenPixels((size.height - iconSize.height) * 0.5) + 4.0, y: verticalInset + floorToScreenPixels((textSize.height - iconSize.height) * 0.5)), size: iconSize))

transition.setFrame(view: self.label, frame: CGRect(origin: CGPoint(x: sideInset + iconSize.width + iconSpacing, y: verticalInset), size: textSize))

return actualSize
}
}
7 changes: 7 additions & 0 deletions Nicegram/NGData/Sources/NGSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ public struct NGSettings {

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

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

public struct NGWebSettings {
Expand Down Expand Up @@ -135,9 +138,13 @@ public var VarNGSharedSettings = NGSharedSettings()

public func isPremium() -> Bool {
if #available(iOS 13.0, *) {
#if DEBUG
return true
#else
return PremiumContainer.shared
.getPremiumStatusUseCase()
.hasPremiumOnDevice()
#endif
} else {
return false
}
Expand Down
41 changes: 41 additions & 0 deletions Nicegram/NGResources/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
load("//Config:buck_rule_macros.bzl", "static_library")


apple_asset_catalog(
name = "NGUIAssets",
dirs = [
"Images.xcassets",
],
visibility = ["PUBLIC"],
)

static_library(
name = "NGUI",
srcs = glob([
"Sources/**/*.swift",
]),
deps = [
"//submodules/AccountContext:AccountContext",
"//submodules/Display:Display#shared",
"//submodules/ItemListUI:ItemListUI",
"//submodules/Postbox:Postbox#shared",
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared",
"//submodules/TelegramCore:TelegramCore#shared",
"//submodules/TelegramNotices:TelegramNotices",
"//submodules/TelegramPresentationData:TelegramPresentationData",
"//submodules/TelegramUIPreferences:TelegramUIPreferences",
"//submodules/PresentationDataUtils:PresentationDataUtils",
"//submodules/PeersNearbyIconNode:PeersNearbyIconNode",
"//submodules/TelegramPermissionsUI:TelegramPermissionsUI",
"//submodules/UndoUI:UndoUI",
"//submodules/ContextUI:ContextUI",
"//Nicegram/NGData:NGData",
"//Nicegram/NGLogging:NGLogging",
"//Nicegram/NGStrings:NGStrings",
"//Nicegram/NGIAP:NGIAP"
],
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
"$SDKROOT/System/Library/Frameworks/StoreKit.framework",
],
)
21 changes: 21 additions & 0 deletions Nicegram/NGResources/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")


filegroup(
name = "NGImagesAssets",
srcs = glob(["Images.xcassets/**"]),
visibility = ["//visibility:public"],
)

swift_library(
name = "NGResources",
module_name = "NGResources",
srcs = glob([
"Sources/**/*.swift",
]),
deps = [
],
visibility = [
"//visibility:public",
],
)
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "docviewer_24.pdf",
"filename" : "record_indicator.pdf",
"idiom" : "universal"
}
],
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "premium_30.pdf",
"filename" : "record_save.pdf",
"idiom" : "universal"
}
],
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "boostoff_24.pdf",
"filename" : "record_start.pdf",
"idiom" : "universal"
}
],
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "givstars.pdf",
"filename" : "record_stop.pdf",
"idiom" : "universal"
}
],
Expand Down
Binary file not shown.
2 changes: 2 additions & 0 deletions Nicegram/NGResources/Sources/dummy.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@


7 changes: 0 additions & 7 deletions Nicegram/NGUI/BUILD
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")


filegroup(
name = "NGUIAssets",
srcs = glob(["Images.xcassets/**"]),
visibility = ["//visibility:public"],
)

swift_library(
name = "NGUI",
module_name = "NGUI",
Expand Down
Loading

0 comments on commit d4b9d2d

Please sign in to comment.