mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 21:45:19 +00:00
Merge commit '7d65af3c9f8c612c1e5dd7ad0ad6867ab411576c'
This commit is contained in:
commit
ca437201b7
@ -368,9 +368,7 @@
|
||||
_scrubberView.delegate = self;
|
||||
_scrubberView.clipsToBounds = false;
|
||||
}
|
||||
|
||||
[self detectFaces];
|
||||
|
||||
|
||||
[self presentTab:_currentTab];
|
||||
}
|
||||
|
||||
|
@ -43,6 +43,18 @@ func _internal_addNoPaidMessagesException(account: Account, peerId: PeerId, refu
|
||||
return account.network.request(Api.functions.account.addNoPaidMessagesException(flags: flags, userId: inputUser))
|
||||
|> `catch` { _ -> Signal<Api.Bool, NoError> in
|
||||
return .single(.boolFalse)
|
||||
} |> mapToSignal { _ in
|
||||
return account.postbox.transaction { transaction -> Void in
|
||||
transaction.updatePeerCachedData(peerIds: Set([peerId]), update: { _, cachedData in
|
||||
if let cachedData = cachedData as? CachedUserData {
|
||||
var settings = cachedData.peerStatusSettings ?? .init()
|
||||
settings.paidMessageStars = nil
|
||||
return cachedData.withUpdatedPeerStatusSettings(settings)
|
||||
}
|
||||
return cachedData
|
||||
})
|
||||
}
|
||||
|> ignoreValues
|
||||
}
|
||||
|> ignoreValues
|
||||
}
|
||||
|
@ -361,6 +361,40 @@ public extension TelegramEngine.EngineData.Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public struct SendPaidMessageStars: TelegramEngineDataItem, TelegramEngineMapKeyDataItem, PostboxViewDataItem {
|
||||
public typealias Result = Optional<StarsAmount>
|
||||
|
||||
fileprivate var id: EnginePeer.Id
|
||||
public var mapKey: EnginePeer.Id {
|
||||
return self.id
|
||||
}
|
||||
|
||||
public init(id: EnginePeer.Id) {
|
||||
self.id = id
|
||||
}
|
||||
|
||||
var key: PostboxViewKey {
|
||||
return .cachedPeerData(peerId: self.id)
|
||||
}
|
||||
|
||||
func extract(view: PostboxView) -> Result {
|
||||
guard let view = view as? CachedPeerDataView else {
|
||||
preconditionFailure()
|
||||
}
|
||||
guard let cachedPeerData = view.cachedPeerData else {
|
||||
return nil
|
||||
}
|
||||
switch cachedPeerData {
|
||||
case let user as CachedUserData:
|
||||
return user.sendPaidMessageStars
|
||||
case let channel as CachedChannelData:
|
||||
return channel.sendPaidMessageStars
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public struct GroupCallDescription: TelegramEngineDataItem, TelegramEngineMapKeyDataItem, PostboxViewDataItem {
|
||||
public typealias Result = Optional<EngineGroupCallDescription>
|
||||
|
@ -470,6 +470,24 @@ public extension Message {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var derivedDataAttribute: DerivedDataMessageAttribute? {
|
||||
for attribute in self.attributes {
|
||||
if let attribute = attribute as? DerivedDataMessageAttribute {
|
||||
return attribute
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var forwardVideoTimestampAttribute: ForwardVideoTimestampAttribute? {
|
||||
for attribute in self.attributes {
|
||||
if let attribute = attribute as? ForwardVideoTimestampAttribute {
|
||||
return attribute
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public extension Message {
|
||||
var reactionsAttribute: ReactionsMessageAttribute? {
|
||||
|
@ -1088,7 +1088,9 @@ public final class OngoingGroupCallContext {
|
||||
}
|
||||
|
||||
func activateIncomingAudio() {
|
||||
#if os(iOS)
|
||||
self.context.activateIncomingAudio()
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user