Skip to content

Commit

Permalink
1.8.7 (359)
Browse files Browse the repository at this point in the history
  • Loading branch information
denis15yo committed Oct 31, 2024
1 parent f9a3cbe commit 83888fe
Show file tree
Hide file tree
Showing 60 changed files with 1,311 additions and 253 deletions.
8 changes: 4 additions & 4 deletions MODULE.bazel.lock

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

9 changes: 9 additions & 0 deletions Nicegram/NGData/Sources/NGSettings.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import FeatPremium
import Postbox
import Foundation
import NGAppCache

Expand Down Expand Up @@ -108,6 +109,14 @@ public struct NGSettings {

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

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

@NGStorage(key: "feedPeerId", defaultValue: NGSettings.zeroFeedPeerId)
public static var feedPeerId: PeerId

public static let zeroFeedPeerId: PeerId = .init(namespace: PeerId.Namespace._internalFromInt32Value(0), id: PeerId.Id._internalFromInt64Value(0))
}

public struct NGWebSettings {
Expand Down
12 changes: 12 additions & 0 deletions Nicegram/NGResources/Images.xcassets/feed.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "feed.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"provides-namespace" : true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"images" : [
{
"filename" : "ai-chatbot-light.pdf",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "ai-chatbot-dark.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "original"
}
}
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"images" : [
{
"filename" : "premium-light.pdf",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "premium-dark.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "original"
}
}
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"images" : [
{
"filename" : "settings-light.pdf",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "settings-dark.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "original"
}
}
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"images" : [
{
"filename" : "wallet-light.pdf",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "wallet-dark.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "original"
}
}
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
46 changes: 36 additions & 10 deletions Nicegram/NGUI/Sources/NicegramSettingsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry {
case showCallsTab(String, Bool)
case showNicegramTab
case showTabNames(String, Bool)
case showFeedTab(String, Bool)

case pinnedChatsHeader
case pinnedChat(Int32, PinnedChat)
Expand Down Expand Up @@ -127,7 +128,7 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry {

var section: ItemListSectionId {
switch self {
case .TabsHeader, .showContactsTab, .showCallsTab, .showNicegramTab, .showTabNames:
case .TabsHeader, .showContactsTab, .showCallsTab, .showNicegramTab, .showTabNames, .showFeedTab:
return NicegramSettingsControllerSection.Tabs.rawValue
case .FoldersHeader, .foldersAtBottom, .foldersAtBottomNotice:
return NicegramSettingsControllerSection.Folders.rawValue
Expand Down Expand Up @@ -173,6 +174,9 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry {
case .showTabNames:
return 1600

case .showFeedTab:
return 1650

case .FoldersHeader:
return 1700

Expand Down Expand Up @@ -268,6 +272,13 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry {
} else {
return false
}

case let .showFeedTab(lhsText, lhsVar0Bool):
if case let .showFeedTab(rhsText, rhsVar0Bool) = rhs, lhsText == rhsText, lhsVar0Bool == rhsVar0Bool {
return true
} else {
return false
}

case let .FoldersHeader(lhsText):
if case let .FoldersHeader(rhsText) = rhs, lhsText == rhsText {
Expand Down Expand Up @@ -457,6 +468,13 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry {
arguments.presentController(controller, nil)
})

case let .showFeedTab(text, value):
return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enabled: true, sectionId: section, style: .blocks, updated: { value in
ngLog("[showFeedTab] invoked with \(value)", LOGTAG)
NGSettings.showFeedTab = value
arguments.updateTabs()
})

case let .FoldersHeader(text):
return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: section)

Expand Down Expand Up @@ -632,6 +650,10 @@ private func nicegramSettingsControllerEntries(presentationData: PresentationDat
l("NiceFeatures.Tabs.ShowNames"),
NGSettings.showTabNames
))
entries.append(.showFeedTab(
l("Show Feed Tab"),
NGSettings.showFeedTab
))

entries.append(.FoldersHeader(l("NiceFeatures.Folders.Header")))
entries.append(.foldersAtBottom(
Expand Down Expand Up @@ -817,19 +839,23 @@ public func nicegramSettingsController(context: AccountContext, accountsContexts
controller?.view.window?.rootViewController
}
updateTabsImpl = {
updateTabs(with: context)
}
return controller
}

public func updateTabs(with context: AccountContext) {
_ = updateCallListSettingsInteractively(accountManager: context.sharedContext.accountManager) { settings in
var settings = settings
settings.showTab = !settings.showTab
return settings
}.start(completed: {
_ = updateCallListSettingsInteractively(accountManager: context.sharedContext.accountManager) { settings in
var settings = settings
settings.showTab = !settings.showTab
return settings
}.start(completed: {
_ = updateCallListSettingsInteractively(accountManager: context.sharedContext.accountManager) { settings in
var settings = settings
settings.showTab = !settings.showTab
return settings
}.start(completed: {
ngLog("Tabs refreshed", LOGTAG)
})
ngLog("Tabs refreshed", LOGTAG)
})
}
return controller
})
}
15 changes: 15 additions & 0 deletions Nicegram/NGUtils/Sources/Peer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,18 @@ public func extractPeerId(peer: Peer) -> Int64 {

return Int64(idText) ?? peer.id.id._internalGetInt64Value()
}

public func getMembersCount(cachedPeerData: CachedPeerData?) -> Int? {
guard let cachedPeerData else {
return nil
}

switch cachedPeerData {
case let channel as CachedChannelData:
return channel.participantsSummary.memberCount.flatMap(Int.init)
case let group as CachedGroupData:
return group.participants?.participants.count
default:
return nil
}
}
8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@
"kind" : "remoteSourceControl",
"location" : "[email protected]:mobyrix/nicegram-assistant-ios.git",
"state" : {
"branch" : "develop",
"revision" : "b1d4897f36e71c8faef3a06278d503c42f737e98"
"branch" : "feat/attention-economy",
"revision" : "4308f026a3b0504f9ff9408359677a7014ec6990"
}
},
{
"identity" : "nicegram-wallet-ios",
"kind" : "remoteSourceControl",
"location" : "[email protected]:mobyrix/nicegram-wallet-ios.git",
"state" : {
"branch" : "develop",
"revision" : "ee32c2836b5ba333342d4c73b98561f8f0fb1ae2"
"branch" : "feat/attention-economy",
"revision" : "6b32239cc639c4cd27874b44b4d5426732a84da2"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PackageDescription
let package = Package(
name: "nicegram-package",
dependencies: [
.package(url: "[email protected]:mobyrix/nicegram-assistant-ios.git", branch: "develop"),
.package(url: "[email protected]:mobyrix/nicegram-wallet-ios.git", branch: "develop")
.package(url: "[email protected]:mobyrix/nicegram-assistant-ios.git", branch: "feat/attention-economy"),
.package(url: "[email protected]:mobyrix/nicegram-wallet-ios.git", branch: "feat/attention-economy")
]
)
4 changes: 4 additions & 0 deletions Telegram/Telegram-iOS/en.lproj/NiceLocalizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,7 @@
"NicegramCallRecord.StopAlertButtonCancel" = "Cancel";
"NicegramCallRecord.SavedMessage" = "Recorded Call saved to **Saved Messages**.";

/*Feed*/
"NicegramFeed.Title" = "Feed";
"NicegramFeed.Add" = "Add to Feed";
"NicegramFeed.Remove" = "Remove from Feed";
2 changes: 0 additions & 2 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"project_id": "378913"
"api_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJ3UUVxdmhVM3ZMT2EyWGljbVV5VCIsImp0aSI6IjY0MDRiZTFlOGIyOTVhNzg2ZGEyYmI0MmZmYjAwN2MyYmQ3MmM4MGI0YzJhZGEzNTk4MzBmMjEzZjQ4ZGFhNDkxYTcyNjgwYjJiYzFkOTUyIiwiaWF0IjoxNzIyODYzNDcxLjcwNDc3NywibmJmIjoxNzIyODYzNDcxLjcwNDc3OSwiZXhwIjoxNzU0Mzk5NDcxLjYyOTI5Mywic3ViIjoiMTUyNDUwMTYiLCJzY29wZXMiOlsicHJvamVjdCJdLCJkb21haW4iOm51bGwsImFzc29jaWF0aW9ucyI6WyIqIl0sInNlc3Npb24iOjB9.dLOqTsIngzAsXnrh2PRnzAtZVtosy0dnIPWViL9kVYnxGCGL3LJMPZ_cji-G9aHPhgmxERmBNeMp4Pynw7Y7NbtpT0QmgL9Gn6Ljjd5TTGwwS1UX81m-l69J6wTd1sRufs8X9vIAkxp-3boW7N0BkasBm9gRr_fBlnOFX_yV6mYj-gB5bRxI2CmakUcRVVZFk7hNfRT1LZnn60ghSllSoXM4dGF647Ey_Qm8kgerVqy1cshKc1X8jBKVLTXPTPnIpTESp4pFFbmDUlcnvvLa76FbW-5qBDXjPIEl6ASCqR8pIRV8Bh3n6-oaean7WBb_ZwPkrwxVczGlRd2io8xhVpQq33P6ebSnHp8hZFGS7kYyBZqBRfgzYTBSnNUCTWd-SQJzVeGiqzO-Qodi30X4AA7_nDYNun_soY3ma5sJsdaq2muMKXP2uWV9epLHp-VSTcIWEki0ozZqHKkUVlfzoWhtBKfQbLa5G48LQB9PVgOj3CQ4qgY8FPPdPk29-R_ytnQkXFTHXpudH0Ga_hrM7xtqYNmCttAVYZMGRoFZqH8GZs5KjSG2c0F9-x0554qi0fLgczJDOW15zjwZXRyUtqTD4SGaKQPvtYQn6AxBVRsUlLVUpPH7OLo8Kn7gMu3bx6fJhIURC6kA_Ap9YEgcnMRTuY_pTXSJi3VCJqP2iSw"
"base_path": "."
"base_url": "https://api.crowdin.com"
"preserve_hierarchy": true
Expand Down
2 changes: 1 addition & 1 deletion ng-env.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
prod
test
4 changes: 4 additions & 0 deletions submodules/AccountContext/Sources/AccountContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,10 @@ public protocol AccountContext: AnyObject {
func scheduleGroupCall(peerId: PeerId, parentController: ViewController)
func joinGroupCall(peerId: PeerId, invite: String?, requestJoinAsPeerId: ((@escaping (PeerId?) -> Void) -> Void)?, activeCall: EngineGroupCallDescription)
func requestCall(peerId: PeerId, isVideo: Bool, completion: @escaping () -> Void)
// MARK: Nicegram NCG-6373 Feed tab
var updateFeed: Signal<Void, NoError> { get }
func needUpdateFeed()
//
}

public struct AntiSpamBotConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,5 @@ public protocol PresentationCallManager: AnyObject {
func startRecordCall(with completion: @escaping () -> Void)
func stopRecordCall()
func setupPeer(peer: EnginePeer)
func showRecordSaveToast()
//
}
Loading

0 comments on commit 83888fe

Please sign in to comment.