mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-29 11:25:38 +00:00
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
commit
b4846170f0
@ -24,7 +24,7 @@ public func |> <T, U>(value: T, function: ((T) -> U)) -> U {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final class SubscriberDisposable<T, E>: Disposable, CustomStringConvertible {
|
private final class SubscriberDisposable<T, E>: Disposable, CustomStringConvertible {
|
||||||
private let subscriber: Subscriber<T, E>
|
private weak var subscriber: Subscriber<T, E>?
|
||||||
|
|
||||||
private var lock = pthread_mutex_t()
|
private var lock = pthread_mutex_t()
|
||||||
private var disposable: Disposable?
|
private var disposable: Disposable?
|
||||||
@ -41,15 +41,18 @@ private final class SubscriberDisposable<T, E>: Disposable, CustomStringConverti
|
|||||||
}
|
}
|
||||||
|
|
||||||
func dispose() {
|
func dispose() {
|
||||||
self.subscriber.markTerminatedWithoutDisposal()
|
var subscriber: Subscriber<T, E>?
|
||||||
|
|
||||||
var disposeItem: Disposable?
|
var disposeItem: Disposable?
|
||||||
pthread_mutex_lock(&self.lock)
|
pthread_mutex_lock(&self.lock)
|
||||||
disposeItem = self.disposable
|
disposeItem = self.disposable
|
||||||
|
subscriber = self.subscriber
|
||||||
|
self.subscriber = nil
|
||||||
self.disposable = nil
|
self.disposable = nil
|
||||||
pthread_mutex_unlock(&self.lock)
|
pthread_mutex_unlock(&self.lock)
|
||||||
|
|
||||||
disposeItem?.dispose()
|
disposeItem?.dispose()
|
||||||
|
subscriber?.markTerminatedWithoutDisposal()
|
||||||
}
|
}
|
||||||
|
|
||||||
public var description: String {
|
public var description: String {
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
|
|
||||||
@ -8289,7 +8289,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
|
|||||||
self.postingAvailabilityDisposable?.dispose()
|
self.postingAvailabilityDisposable?.dispose()
|
||||||
|
|
||||||
let canPostStatus: Signal<StoriesUploadAvailability, NoError>
|
let canPostStatus: Signal<StoriesUploadAvailability, NoError>
|
||||||
#if DEBUG
|
#if DEBUG && false
|
||||||
canPostStatus = .single(.available)
|
canPostStatus = .single(.available)
|
||||||
#else
|
#else
|
||||||
canPostStatus = self.context.engine.messages.checkStoriesUploadAvailability(target: .peer(self.peerId))
|
canPostStatus = self.context.engine.messages.checkStoriesUploadAvailability(target: .peer(self.peerId))
|
||||||
@ -8316,7 +8316,9 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
|
|||||||
coordinator?.animateIn()
|
coordinator?.animateIn()
|
||||||
}
|
}
|
||||||
case .channelBoostRequired:
|
case .channelBoostRequired:
|
||||||
let _ = combineLatest(
|
self.postingAvailabilityDisposable?.dispose()
|
||||||
|
|
||||||
|
self.postingAvailabilityDisposable = combineLatest(
|
||||||
queue: Queue.mainQueue(),
|
queue: Queue.mainQueue(),
|
||||||
self.context.engine.data.get(TelegramEngine.EngineData.Item.Peer.Peer(id: self.peerId)),
|
self.context.engine.data.get(TelegramEngine.EngineData.Item.Peer.Peer(id: self.peerId)),
|
||||||
self.context.engine.peers.getChannelBoostStatus(peerId: self.peerId)
|
self.context.engine.peers.getChannelBoostStatus(peerId: self.peerId)
|
||||||
@ -8352,7 +8354,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.hapticFeedback.impact(.light)
|
self.hapticFeedback.impact(.light)
|
||||||
})
|
}).strict()
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -9873,7 +9875,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
|
|||||||
} else if peerInfoCanEdit(peer: self.data?.peer, chatLocation: self.chatLocation, threadData: self.data?.threadData, cachedData: self.data?.cachedData, isContact: self.data?.isContact) {
|
} else if peerInfoCanEdit(peer: self.data?.peer, chatLocation: self.chatLocation, threadData: self.data?.threadData, cachedData: self.data?.cachedData, isContact: self.data?.isContact) {
|
||||||
rightNavigationButtons.append(PeerInfoHeaderNavigationButtonSpec(key: .edit, isForExpandedView: false))
|
rightNavigationButtons.append(PeerInfoHeaderNavigationButtonSpec(key: .edit, isForExpandedView: false))
|
||||||
}
|
}
|
||||||
if let data = self.data, data.accountIsPremium, let channel = data.peer as? TelegramChannel, channel.hasPermission(.postStories) {
|
if let data = self.data, data.accountIsPremium, let channel = data.peer as? TelegramChannel, case .broadcast = channel.info, channel.hasPermission(.postStories) {
|
||||||
rightNavigationButtons.insert(PeerInfoHeaderNavigationButtonSpec(key: .postStory, isForExpandedView: false), at: 0)
|
rightNavigationButtons.insert(PeerInfoHeaderNavigationButtonSpec(key: .postStory, isForExpandedView: false), at: 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user