|
2 | 2 | import FeatPaywall |
3 | 3 | import NGData |
4 | 4 | import NGUI |
| 5 | +import NGUtils |
5 | 6 | // |
6 | 7 | import Foundation |
7 | 8 | import UIKit |
@@ -182,18 +183,18 @@ extension PeerInfoScreenNode { |
182 | 183 | let supportPeer = Promise<PeerId?>() |
183 | 184 | supportPeer.set(context.engine.peers.supportPeerId()) |
184 | 185 |
|
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: [ |
186 | 187 | 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 | + // |
188 | 191 | }), TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: { [weak self] in |
189 | 192 | guard let self else { |
190 | 193 | return |
191 | 194 | } |
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 | + // |
197 | 198 | })]), in: .window(.root)) |
198 | 199 | case .faq: |
199 | 200 | self.openFaq() |
@@ -348,6 +349,16 @@ extension PeerInfoScreenNode { |
348 | 349 | } |
349 | 350 | } |
350 | 351 |
|
| 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 | + |
351 | 362 | func openFaq(anchor: String? = nil) { |
352 | 363 | self.setupFaqIfNeeded() |
353 | 364 |
|
|
0 commit comments