Skip to content

Commit

Permalink
1.9.8 (450)
Browse files Browse the repository at this point in the history
  • Loading branch information
denis15yo committed Feb 20, 2025
1 parent d112f26 commit 596b7e2
Show file tree
Hide file tree
Showing 42 changed files with 508 additions and 1,386 deletions.
12 changes: 6 additions & 6 deletions MODULE.bazel.lock

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

21 changes: 18 additions & 3 deletions Nicegram/NGUI/Sources/NicegramSettingsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import AccountContext
import Display
import FeatAiShortcuts
import FeatImagesHubUI
import FeatNicegramHub
import FeatPinnedChats
Expand Down Expand Up @@ -79,6 +80,7 @@ private enum NicegramSettingsControllerSection: Int32 {

private enum EasyToggleType {
case showNicegramButtonInChat
case showAiShortcutsInChat
case sendWithEnter
case showProfileId
case showRegDate
Expand Down Expand Up @@ -541,6 +543,11 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry {
switch (toggleType) {
case .showNicegramButtonInChat:
NGSettings.showNicegramButtonInChat = value
case .showAiShortcutsInChat:
Task {
let updateSettingsUseCase = AiShortcutsModule.shared.updateSettingsUseCase()
await updateSettingsUseCase.set(showInChat: value)
}
case .sendWithEnter:
NGSettings.sendWithEnter = value
case .showProfileId:
Expand Down Expand Up @@ -672,7 +679,7 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry {

// MARK: Entries list

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

var entries: [NicegramSettingsControllerEntry] = []
Expand Down Expand Up @@ -751,6 +758,9 @@ private func nicegramSettingsControllerEntries(presentationData: PresentationDat
entries.append(.easyToggle(toggleIndex, .showNicegramButtonInChat, l("ShowNicegramButtonInChat"), NGSettings.showNicegramButtonInChat))
toggleIndex += 1

entries.append(.easyToggle(toggleIndex, .showAiShortcutsInChat, l("ShowAIShortcutsInChat"), aiShortcutsSettings.showInChat))
toggleIndex += 1

entries.append(.easyToggle(toggleIndex, .sendWithEnter, l("SendWithKb"), NGSettings.sendWithEnter))
toggleIndex += 1

Expand Down Expand Up @@ -940,8 +950,13 @@ public func nicegramSettingsController(context: AccountContext, accountsContexts
} else {
sharingSettingsSignal = .single(nil)
}

let aiShortcutsSettingsSignal = AiShortcutsModule.shared.getSettingsUseCase()
.publisher()
.toSignal()
.skipError()

let signal = combineLatest(context.sharedContext.presentationData, sharedDataSignal, showCallsTab, pinnedChatsSignal, sharingSettingsSignal) |> map { presentationData, sharedData, showCalls, pinnedChats, sharingSettings -> (ItemListControllerState, (ItemListNodeState, Any)) in
let signal = combineLatest(context.sharedContext.presentationData, sharedDataSignal, showCallsTab, pinnedChatsSignal, sharingSettingsSignal, aiShortcutsSettingsSignal) |> map { presentationData, sharedData, showCalls, pinnedChats, sharingSettings, aiShortcutsSettings -> (ItemListControllerState, (ItemListNodeState, Any)) in

let experimentalSettings: ExperimentalUISettings = sharedData.entries[ApplicationSpecificSharedDataKeys.experimentalUISettings]?.get(ExperimentalUISettings.self) ?? ExperimentalUISettings.defaultSettings

Expand All @@ -952,7 +967,7 @@ public func nicegramSettingsController(context: AccountContext, accountsContexts
})
}

let entries = nicegramSettingsControllerEntries(presentationData: presentationData, experimentalSettings: experimentalSettings, showCalls: showCalls, pinnedChats: pinnedChats, sharingSettings: sharingSettings, context: context)
let entries = nicegramSettingsControllerEntries(presentationData: presentationData, experimentalSettings: experimentalSettings, showCalls: showCalls, pinnedChats: pinnedChats, sharingSettings: sharingSettings, aiShortcutsSettings: aiShortcutsSettings, context: context)
let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(l("AppName")), leftNavigationButton: leftNavigationButton, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back))
let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: entries, style: .blocks)

Expand Down
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" : "feat/NCG-7303_spy_on_friends",
"revision" : "2a7c71de73ca9dc7b14bc30d7dbdfd1b93fea928"
"branch" : "feat/att-action-subscribe",
"revision" : "9fdc3f375f2343b9692adaa982192a91fafbdce2"
}
},
{
"identity" : "nicegram-wallet-ios",
"kind" : "remoteSourceControl",
"location" : "[email protected]:mobyrix/nicegram-wallet-ios.git",
"state" : {
"branch" : "feat/NCG-7303_spy_on_friends",
"revision" : "0d12be95114430db63569f04a08ec962733ed2d7"
"branch" : "develop",
"revision" : "564886b840d2331bb80663e1f21cb34796007804"
}
},
{
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: "feat/NCG-7303_spy_on_friends"),
.package(url: "[email protected]:mobyrix/nicegram-wallet-ios.git", branch: "feat/NCG-7303_spy_on_friends")
.package(url: "[email protected]:mobyrix/nicegram-assistant-ios.git", branch: "feat/att-action-subscribe"),
.package(url: "[email protected]:mobyrix/nicegram-wallet-ios.git", branch: "develop")
]
)
4 changes: 2 additions & 2 deletions Telegram/Telegram-iOS/ar.lproj/NiceLocalizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

/*Common*/
"Nicegram.PrivacyPolicy" = "سياسة الخصوصية";
"Nicegram.EULA" = "اتفاقية ترخيص المستخدم النهائي
";
"Nicegram.EULA" = "اتفاقية ترخيص المستخدم النهائي\n";

/*ChatFilter*/
"ChatFilter.Bots" = "بوتات";
Expand Down Expand Up @@ -144,6 +143,7 @@
"Gmod.Disable" = "تعطيل وضع المعاينة؟";

"ShowNicegramButtonInChat" = "عرض زر Nicegram في الدردشة";
"ShowAIShortcutsInChat" = "إظهار اختصارات الذكاء الاصطناعي في الدردشة";
"SendWithKb" = "إرسال مع زر «إدخال»";
"NiceFeatures.ShowGmodIcon" = "إظهار أيقونة وضع المعاينة";
"Gmod.OpenChatQ" = "فتح الدردشة؟";
Expand Down
1 change: 1 addition & 0 deletions Telegram/Telegram-iOS/de.lproj/NiceLocalizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"Gmod.Disable" = "Vorschaumodus deaktivieren?";

"ShowNicegramButtonInChat" = "Nicegram-Button im Chat anzeigen";
"ShowAIShortcutsInChat" = "KI-Abkürzungen im Chat anzeigen";
"SendWithKb" = "Mit «Enter» senden";
"NiceFeatures.ShowGmodIcon" = "Icon für Vorschaumodus anzeigen";
"Gmod.OpenChatQ" = "Chat öffnen?";
Expand Down
4 changes: 1 addition & 3 deletions Telegram/Telegram-iOS/en.lproj/NiceLocalizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"Gmod.Disable" = "Disable Preview Mode?";

"ShowNicegramButtonInChat" = "Show Nicegram button in chat";
"ShowAIShortcutsInChat" = "Show AI Shortcuts in Chat";
"SendWithKb" = "Send with «Enter» button";
"NiceFeatures.ShowGmodIcon" = "Show Preview Mode icon";
"Gmod.OpenChatQ" = "Open chat?";
Expand Down Expand Up @@ -240,6 +241,3 @@
/*Stars Purchase*/
"StarsPurchase.GetOnFragment" = "Get on Fragment";
"StarsPurchase.GetOnTelegram" = "Get on Telegram";

/*Spy On Friends*/
"SpyOnFriends.Title" = "Activities";
1 change: 1 addition & 0 deletions Telegram/Telegram-iOS/es.lproj/NiceLocalizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"Gmod.Disable" = "¿Desactivar modo vista previa?";

"ShowNicegramButtonInChat" = "Mostrar botón Nicegram en el chat";
"ShowAIShortcutsInChat" = "Mostrar atajos de IA en el chat";
"SendWithKb" = "Envía con el botón «Intro»";
"NiceFeatures.ShowGmodIcon" = "Mostrar icono de modo vista previa";
"Gmod.OpenChatQ" = "¿Abrir chat?";
Expand Down
1 change: 1 addition & 0 deletions Telegram/Telegram-iOS/fr.lproj/NiceLocalizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"Gmod.Disable" = "Désactiver le mode « Aperçu » ?";

"ShowNicegramButtonInChat" = "Afficher le bouton Nicegram dans le chat";
"ShowAIShortcutsInChat" = "Afficher les raccourcis IA dans le chat";
"SendWithKb" = "Envoyer avec le bouton « Entrer »";
"NiceFeatures.ShowGmodIcon" = "Afficher l'icône du mode « Aperçu »";
"Gmod.OpenChatQ" = "Ouvrir le chat ?";
Expand Down
4 changes: 2 additions & 2 deletions Telegram/Telegram-iOS/it.lproj/NiceLocalizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@
"NiceFeatures.Use.DataStorage" = "Per favore, usa «%1» per configurare il tuo browser predefinito";
"NiceFeatures.Browser.Header" = "URL";
"NiceFeatures.Browser.UseBrowser" = "Apri link nel browser";
"NiceFeatures.Browser.UseBrowserNotice" = "Nicegram aprirà i link in un browser esterno invece di farlo nell'app.
Il browser selezionato deve essere installato.";
"NiceFeatures.Browser.UseBrowserNotice" = "Nicegram aprirà i link in un browser esterno invece di farlo nell'app.\nIl browser selezionato deve essere installato.";
"ChatFilter.Missed" = "Mancati";

/*Premium*/
Expand Down Expand Up @@ -144,6 +143,7 @@ Il browser selezionato deve essere installato.";
"Gmod.Disable" = "Disabilitare modalità anteprima?";

"ShowNicegramButtonInChat" = "Mostra il pulsante Nicegram nella chat";
"ShowAIShortcutsInChat" = "Mostra scorciatoie IA nella chat";
"SendWithKb" = "Invia con il pulsante «Invio»";
"NiceFeatures.ShowGmodIcon" = "Mostra icona modalità anteprima";
"Gmod.OpenChatQ" = "Aprire chat?";
Expand Down
5 changes: 2 additions & 3 deletions Telegram/Telegram-iOS/ko.lproj/NiceLocalizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@
"Messages.Translate" = "번역";
"Messages.UndoTranslate" = "번역 취소";
"Messages.TranslateError" = "죄송합니다. 번역 할 수 없습니다.";
"Messages.SelectAllFromUser" = "이 사용자에게서 온 모든 메시지 선택

";
"Messages.SelectAllFromUser" = "이 사용자에게서 온 모든 메시지 선택 \n\n";
"Messages.ToLanguage" = "언어";
"Messages.ToLanguage.WithCode" = "언어: %@";
"Messages.TranslateError.ToLanguageNotFound" = "텍스트를 번역할 언어를 결정할 수 없습니다. 수동으로 선택하고 다시 시도하십시오.";
Expand Down Expand Up @@ -145,6 +143,7 @@
"Gmod.Disable" = "미리보기를 사용 중지 하시겠습니까?";

"ShowNicegramButtonInChat" = "채팅에서 Nicegram 버튼 보이기";
"ShowAIShortcutsInChat" = "채팅에서 AI 바로가기 표시";
"SendWithKb" = "«입력»버튼으로 보내기";
"NiceFeatures.ShowGmodIcon" = "미리보기 모드 아이콘 표시";
"Gmod.OpenChatQ" = "대화방 열기";
Expand Down
1 change: 1 addition & 0 deletions Telegram/Telegram-iOS/pl.lproj/NiceLocalizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"Gmod.Disable" = "Wyłączyć tryb Podglądu?";

"ShowNicegramButtonInChat" = "Pokaż przycisk Nicegram w czacie";
"ShowAIShortcutsInChat" = "Pokaż skróty AI w czacie";
"SendWithKb" = "Wyślij za pomocą przycisku «Enter»";
"NiceFeatures.ShowGmodIcon" = "Pokaż ikonę trybu Podglądu";
"Gmod.OpenChatQ" = "Otworzyć czat?";
Expand Down
1 change: 1 addition & 0 deletions Telegram/Telegram-iOS/pt.lproj/NiceLocalizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"Gmod.Disable" = "Desativar modo de pré-visualização?";

"ShowNicegramButtonInChat" = "Mostrar botão Nicegram no chat";
"ShowAIShortcutsInChat" = "Mostrar atalhos de IA no chat";
"SendWithKb" = "Enviar usando o botão «Enter»";
"NiceFeatures.ShowGmodIcon" = "Mostrar ícone do modo pré-visualização";
"Gmod.OpenChatQ" = "Abrir Chat?";
Expand Down
1 change: 1 addition & 0 deletions Telegram/Telegram-iOS/ru.lproj/NiceLocalizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"Gmod.Disable" = "Отключить режим предпросмотра?";

"ShowNicegramButtonInChat" = "Показать кнопку Nicegram в чате";
"ShowAIShortcutsInChat" = "Показывать ИИ-ярлыки в чате";
"SendWithKb" = "Отправка кнопкой «Enter»";
"NiceFeatures.ShowGmodIcon" = "Иконка режима предпросмотра";
"Gmod.OpenChatQ" = "Открыть чат?";
Expand Down
4 changes: 2 additions & 2 deletions Telegram/Telegram-iOS/tr.lproj/NiceLocalizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@
"Messages.SelectAllFromUser" = "Bu Kullanıcıdan Olan Bütün Mesajları Seç";
"Messages.ToLanguage" = "Hedef Dil";
"Messages.ToLanguage.WithCode" = "Hedef Dil: %@";
"Messages.TranslateError.ToLanguageNotFound" = "Metni çevirmek istediğiniz dili tespit edemedik. Lütfen manuel olarak seçin ve tekrar deneyin.
";
"Messages.TranslateError.ToLanguageNotFound" = "Metni çevirmek istediğiniz dili tespit edemedik. Lütfen manuel olarak seçin ve tekrar deneyin.\n";
"Messages.ReplyPrivately" = "Özelden Cevapla";
"Messages.DeleteAllSystemMessages" = "Tümünü Sil";

Expand Down Expand Up @@ -144,6 +143,7 @@
"Gmod.Disable" = "Önizleme Modu devre dışı bırakılsın mı?";

"ShowNicegramButtonInChat" = "Sohbette Nicegram Butonunu Göster";
"ShowAIShortcutsInChat" = "Sohbette Yapay Zeka Kısayollarını Göster";
"SendWithKb" = "«Enter» butonu ile gönder";
"NiceFeatures.ShowGmodIcon" = "Önizleme Modu simgesini göster";
"Gmod.OpenChatQ" = "Sohbet açılsın mı?";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"Gmod.Disable" = "关闭幽灵模式?";

"ShowNicegramButtonInChat" = "在聊天中显示 Nicegram 按钮";
"ShowAIShortcutsInChat" = "在聊天中显示AI快捷方式";
"SendWithKb" = "按<回车>发送";
"NiceFeatures.ShowGmodIcon" = "显示幽灵模式图标";
"Gmod.OpenChatQ" = "打开对话?";
Expand Down
3 changes: 2 additions & 1 deletion Telegram/Telegram-iOS/zh-hant.lproj/NiceLocalizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"Common.SupportChatUsername" = "nicegram_tw";
"Common.FAQUrl" = "https://nicegram-tw.gitbook.io/";
"Common.FAQ.Button" = "Nicegram 常見問題";
"IAP.Premium.Title" = "進階版功能";
"IAP.Premium.Title" = "Premium";
"IAP.Premium.Subtitle" = "您無法抗拒的獨特功能!";
"IAP.Premium.Activated" = "已升級進階版!";
"IAP.Common.Restore" = "恢復購買";
Expand Down Expand Up @@ -143,6 +143,7 @@
"Gmod.Disable" = "停用預覽模式?";

"ShowNicegramButtonInChat" = "在聊天中顯示 Nicegram 按鈕";
"ShowAIShortcutsInChat" = "在聊天中顯示AI快捷方式";
"SendWithKb" = "點擊 «Enter» 傳送";
"NiceFeatures.ShowGmodIcon" = "顯示預覽模式圖示";
"Gmod.OpenChatQ" = "開啟對話?";
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import AsyncDisplayKit
import Combine
import Factory
import FeatAttentionEconomy

public class SubscribeButtonClaimApplier {

// MARK: - Dependencies

@Injected(\AttCoreModule.getOngoingActionsUseCase)
private var getOngoingActionsUseCase

// MARK: - Logic

private let claimView = AttClaimAnimationView()

@Published private var apply = true
@Published private var username = ""

private var cancellables = Set<AnyCancellable>()

// MARK: - Lifecycle

public init() {
getOngoingActionsUseCase.publisher()
.combineLatestThreadSafe($apply, $username)
.map { actions, apply, username in
guard apply else {
return false
}

let hasOngoingAction = actions.contains { action in
if case let .subscribe(subscribe) = action.type,
subscribe.username == username {
true
} else {
false
}
}
return hasOngoingAction
}
.receive(on: DispatchQueue.main)
.sink { [weak self] showClaim in
self?.claimView.isHidden = !showClaim
}
.store(in: &cancellables)
}
}

public extension SubscribeButtonClaimApplier {
func update(
buttonNode: ASDisplayNode,
titleNode: ASDisplayNode,
apply: Bool,
interfaceState: ChatPresentationInterfaceState
) {
if claimView.superview == nil {
buttonNode.view.addSubview(claimView)
}

let size = CGSize(width: 20, height: 20)
buttonNode.layoutIfNeeded()
claimView.frame = CGRect(
x: titleNode.frame.maxX + 5,
y: titleNode.frame.midY - size.height / 2,
width: size.width,
height: size.height
)

if self.apply != apply {
self.apply = apply
}

let username = interfaceState.renderedPeer?.peer?.addressName ?? ""
if self.username != username {
self.username = username
}
}
}
Loading

0 comments on commit 596b7e2

Please sign in to comment.