mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Update API
This commit is contained in:
@@ -23,7 +23,7 @@ private var dismissedSuggestions: [AccountRecordId: Set<ServerProvidedSuggestion
|
||||
}
|
||||
}
|
||||
|
||||
public func getServerProvidedSuggestions(account: Account) -> Signal<[ServerProvidedSuggestion], NoError> {
|
||||
func _internal_getServerProvidedSuggestions(account: Account) -> Signal<[ServerProvidedSuggestion], NoError> {
|
||||
let key: PostboxViewKey = .preferences(keys: Set([PreferencesKeys.appConfiguration]))
|
||||
return combineLatest(account.postbox.combinedView(keys: [key]), dismissedSuggestionsPromise.get())
|
||||
|> map { views, dismissedSuggestionsValue -> [ServerProvidedSuggestion] in
|
||||
@@ -45,7 +45,7 @@ public func getServerProvidedSuggestions(account: Account) -> Signal<[ServerProv
|
||||
|> distinctUntilChanged
|
||||
}
|
||||
|
||||
public func dismissServerProvidedSuggestion(account: Account, suggestion: ServerProvidedSuggestion) -> Signal<Never, NoError> {
|
||||
func _internal_dismissServerProvidedSuggestion(account: Account, suggestion: ServerProvidedSuggestion) -> Signal<Never, NoError> {
|
||||
if let _ = dismissedSuggestions[account.id] {
|
||||
dismissedSuggestions[account.id]?.insert(suggestion)
|
||||
} else {
|
||||
@@ -63,7 +63,7 @@ public enum PeerSpecificServerProvidedSuggestion: String {
|
||||
case convertToGigagroup = "CONVERT_GIGAGROUP"
|
||||
}
|
||||
|
||||
public func getPeerSpecificServerProvidedSuggestions(postbox: Postbox, peerId: PeerId) -> Signal<[PeerSpecificServerProvidedSuggestion], NoError> {
|
||||
func _internal_getPeerSpecificServerProvidedSuggestions(postbox: Postbox, peerId: PeerId) -> Signal<[PeerSpecificServerProvidedSuggestion], NoError> {
|
||||
return postbox.peerView(id: peerId)
|
||||
|> map { view in
|
||||
if let cachedData = view.cachedData as? CachedChannelData {
|
||||
@@ -76,7 +76,7 @@ public func getPeerSpecificServerProvidedSuggestions(postbox: Postbox, peerId: P
|
||||
|> distinctUntilChanged
|
||||
}
|
||||
|
||||
public func dismissPeerSpecificServerProvidedSuggestion(account: Account, peerId: PeerId, suggestion: PeerSpecificServerProvidedSuggestion) -> Signal<Never, NoError> {
|
||||
func _internal_dismissPeerSpecificServerProvidedSuggestion(account: Account, peerId: PeerId, suggestion: PeerSpecificServerProvidedSuggestion) -> Signal<Never, NoError> {
|
||||
return account.postbox.loadedPeerWithId(peerId)
|
||||
|> mapToSignal { peer -> Signal<Never, NoError> in
|
||||
guard let inputPeer = apiInputPeer(peer) else {
|
||||
|
||||
Reference in New Issue
Block a user