Skip to content

Commit

Permalink
1.8.9 (373)
Browse files Browse the repository at this point in the history
  • Loading branch information
denis15yo committed Nov 15, 2024
1 parent 9fa00a5 commit e591a36
Show file tree
Hide file tree
Showing 37 changed files with 107 additions and 435 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
build:
runs-on: macos-15
runs-on: macos-14

steps:
- uses: webfactory/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
build:
runs-on: macos-15
runs-on: macos-14

steps:
- uses: webfactory/[email protected]
Expand Down
6 changes: 3 additions & 3 deletions MODULE.bazel.lock

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

3 changes: 1 addition & 2 deletions Nicegram/NGData/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ swift_library(
"//Nicegram/NGRequests:NGRequests",
"//Nicegram/NGLogging:NGLogging",
"//Nicegram/NGEnv:NGEnv",
"//Nicegram/NGAppCache:NGAppCache",
"@swiftpkg_nicegram_assistant_ios//:NGCore",
"//Nicegram/NGAppCache:NGAppCache"
],
visibility = [
"//visibility:public",
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

24 changes: 0 additions & 24 deletions Nicegram/NGData/Sources/Modern/NicegramSettingsModule.swift

This file was deleted.

32 changes: 0 additions & 32 deletions Nicegram/NGData/Sources/Modern/Presentation/GrayscaleLayer.swift

This file was deleted.

This file was deleted.

6 changes: 6 additions & 0 deletions Nicegram/NGData/Sources/NGSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ public struct NGSettings {

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

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

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

public struct NGWebSettings {
Expand Down
96 changes: 57 additions & 39 deletions Nicegram/NGUI/Sources/NicegramSettingsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ private enum EasyToggleType {
case hideReactions
case hideStories
case hideBadgeCounters
case enableAnimationsInChatList
case enableGrayscaleAll
case enableGrayscaleInChatList
case enableGrayscaleInChat
case hideUnreadCounters
case hideMentionNotification
}


Expand Down Expand Up @@ -468,10 +466,8 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry {
return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enabled: true, sectionId: section, style: .blocks, updated: { value in
ngLog("[showTabNames] invoked with \(value)", LOGTAG)
NGSettings.showTabNames = value
let controller = standardTextAlertController(theme: AlertControllerTheme(presentationData: arguments.context.sharedContext.currentPresentationData.with {
$0
}), title: nil, text: l("Common.RestartRequired"), actions: [/* TextAlertAction(type: .destructiveAction, title: l("Common.ExitNow"), action: { preconditionFailure() }),*/ TextAlertAction(type: .genericAction, title: presentationData.strings.Common_OK, action: {})])
arguments.presentController(controller, nil)

showRestartRequiredAlert(with: arguments, presentationData: presentationData)
})

case let .showFeedTab(text, value):
Expand Down Expand Up @@ -548,22 +544,13 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry {
}
case .hideBadgeCounters:
NGSettings.hideBadgeCounters = value
case .enableAnimationsInChatList:
updateNicegramSettings {
$0.disableAnimationsInChatList = !value
}
case .enableGrayscaleAll:
updateNicegramSettings {
$0.grayscaleAll = value
}
case .enableGrayscaleInChatList:
updateNicegramSettings {
$0.grayscaleInChatList = value
}
case .enableGrayscaleInChat:
updateNicegramSettings {
$0.grayscaleInChat = value
}
showRestartRequiredAlert(with: arguments, presentationData: presentationData)
case .hideUnreadCounters:
NGSettings.hideUnreadCounters = value
showRestartRequiredAlert(with: arguments, presentationData: presentationData)
case .hideMentionNotification:
NGSettings.hideMentionNotification = value
showRestartRequiredAlert(with: arguments, presentationData: presentationData)
}
})
case let .unblockHeader(text):
Expand Down Expand Up @@ -657,8 +644,6 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry {
// MARK: Entries list

private func nicegramSettingsControllerEntries(presentationData: PresentationData, experimentalSettings: ExperimentalUISettings, showCalls: Bool, pinnedChats: [PinnedChat], sharingSettings: SharingSettings?, context: AccountContext) -> [NicegramSettingsControllerEntry] {
let nicegramSettings = getNicegramSettings()

var entries: [NicegramSettingsControllerEntry] = []

if !hideUnblock {
Expand Down Expand Up @@ -756,22 +741,37 @@ private func nicegramSettingsControllerEntries(presentationData: PresentationDat

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

entries.append(.easyToggle(toggleIndex, .hideBadgeCounters, l("NicegramSettings.HideBadgeCounters"), NGSettings.hideBadgeCounters))
toggleIndex += 1

entries.append(.easyToggle(toggleIndex, .enableAnimationsInChatList, l("NicegramSettings.EnableAnimationsInChatList"), !nicegramSettings.disableAnimationsInChatList))
toggleIndex += 1

entries.append(.easyToggle(toggleIndex, .enableGrayscaleAll, l("NicegramSettings.EnableGrayscaleAll"), nicegramSettings.grayscaleAll))

entries.append(
.easyToggle(
toggleIndex,
.hideBadgeCounters,
l("NicegramSettings.HideBadgeCounters"),
NGSettings.hideBadgeCounters
)
)
toggleIndex += 1

entries.append(.easyToggle(toggleIndex, .enableGrayscaleInChatList, l("NicegramSettings.EnableGrayscaleInChatList"), nicegramSettings.grayscaleInChatList))

entries.append(
.easyToggle(
toggleIndex,
.hideUnreadCounters,
l("NicegramSettings.HideUnreadCounters"),
NGSettings.hideUnreadCounters
)
)
toggleIndex += 1

entries.append(.easyToggle(toggleIndex, .enableGrayscaleInChat, l("NicegramSettings.EnableGrayscaleInChat"), nicegramSettings.grayscaleInChat))

entries.append(
.easyToggle(
toggleIndex,
.hideMentionNotification,
l("NicegramSettings.HideMentionNotification"),
NGSettings.hideMentionNotification
)
)
toggleIndex += 1

if let sharingSettings {
entries.append(
.shareBotsData(
Expand Down Expand Up @@ -906,3 +906,21 @@ public func updateTabs(with context: AccountContext) {
})
})
}

private func showRestartRequiredAlert(
with arguments: NicegramSettingsControllerArguments,
presentationData: ItemListPresentationData
) {
let controller = standardTextAlertController(
theme: AlertControllerTheme(
presentationData: arguments.context.sharedContext.currentPresentationData.with { $0 }
),
title: nil,
text: l("Common.RestartRequired"),
actions: [
TextAlertAction(type: .genericAction, title: presentationData.strings.Common_OK, action: {})
]
)

arguments.presentController(controller, nil)
}
3 changes: 0 additions & 3 deletions Telegram/Telegram-iOS/ar.lproj/NiceLocalizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,6 @@
"Premium.rememberFolderOnExit" = "تذكر المجلد الحالي عند الخروج";
"NicegramSettings.HideStories" = "إخفاء الستوري";
"NicegramSettings.HideBadgeCounters" = "إخفاء عدادات الشارات";
"NicegramSettings.EnableAnimationsInChatList" = "الرسوم المتحركة في قائمة الدردشة";
"NicegramSettings.EnableGrayscaleInChatList" = "الرمادي في قائمة الدردشة";
"NicegramSettings.EnableGrayscaleInChat" = "الرمادي في الدردشة";

/*Registration Date*/
"NiceFeatures.RegDate.OlderThan" = "أقدم من";
Expand Down
Loading

0 comments on commit e591a36

Please sign in to comment.