Skip to content

Commit ad200c9

Browse files
committed
2.4.3 (650)
1 parent 0acd311 commit ad200c9

4 files changed

Lines changed: 39 additions & 10 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Postbox
2+
import TelegramCore
3+
4+
public extension PeerId {
5+
static var nicegramSupportBot: PeerId {
6+
.init(
7+
namespace: ._internalFromInt32Value(0),
8+
id: ._internalFromInt64Value(7381687765)
9+
)
10+
}
11+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Foundation
2+
3+
public extension String {
4+
var replacingTelegramWithNicrgram: String {
5+
return self.replacingOccurrences(of: "Telegram", with: "Nicrgram")
6+
}
7+
}

Package.resolved

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreenSettingsActions.swift

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import FeatPaywall
33
import NGData
44
import NGUI
5+
import NGUtils
56
//
67
import Foundation
78
import UIKit
@@ -182,18 +183,18 @@ extension PeerInfoScreenNode {
182183
let supportPeer = Promise<PeerId?>()
183184
supportPeer.set(context.engine.peers.supportPeerId())
184185

185-
self.controller?.present(textAlertController(context: self.context, updatedPresentationData: self.controller?.updatedPresentationData, title: nil, text: self.presentationData.strings.Settings_FAQ_Intro, actions: [
186+
self.controller?.present(textAlertController(context: self.context, updatedPresentationData: self.controller?.updatedPresentationData, title: nil, text: self.presentationData.strings.Settings_FAQ_Intro.replacingTelegramWithNicrgram, actions: [
186187
TextAlertAction(type: .genericAction, title: presentationData.strings.Settings_FAQ_Button, action: { [weak self] in
187-
self?.openFaq()
188+
// Nicegram, open nicegram FAQ
189+
self?.openNicegramFaq()
190+
//
188191
}), TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: { [weak self] in
189192
guard let self else {
190193
return
191194
}
192-
self.supportPeerDisposable.set((supportPeer.get() |> take(1) |> deliverOnMainQueue).startStrict(next: { [weak self] peerId in
193-
if let strongSelf = self, let peerId = peerId {
194-
push(strongSelf.context.sharedContext.makeChatController(context: strongSelf.context, chatLocation: .peer(id: peerId), subject: nil, botStart: nil, mode: .standard(.default), params: nil))
195-
}
196-
}))
195+
// Nicegram, open nicegram support bot
196+
push(self.context.sharedContext.makeChatController(context: self.context, chatLocation: .peer(id: .nicegramSupportBot), subject: nil, botStart: nil, mode: .standard(.default), params: nil))
197+
//
197198
})]), in: .window(.root))
198199
case .faq:
199200
self.openFaq()
@@ -348,6 +349,16 @@ extension PeerInfoScreenNode {
348349
}
349350
}
350351

352+
// Nicegram
353+
func openNicegramFaq() {
354+
let nicegramFAQUrl = ResolvedUrl.externalUrl("https://nicegram.app/faq")
355+
self.context.sharedContext.openResolvedUrl(nicegramFAQUrl, context: self.context, urlContext: .generic, navigationController: self.controller?.navigationController as? NavigationController, forceExternal: false, forceUpdate: false, openPeer: { peer, navigation in
356+
}, sendFile: nil, sendSticker: nil, sendEmoji: nil, requestMessageActionUrlAuth: nil, joinVoiceChat: nil, present: { [weak self] controller, arguments in
357+
self?.controller?.push(controller)
358+
}, dismissInput: {}, contentContext: nil, progress: nil, completion: nil)
359+
}
360+
//
361+
351362
func openFaq(anchor: String? = nil) {
352363
self.setupFaqIfNeeded()
353364

0 commit comments

Comments
 (0)