Merge commit '7d65af3c9f8c612c1e5dd7ad0ad6867ab411576c'

This commit is contained in:
Isaac 2025-02-17 16:37:19 +01:00
commit ca437201b7
5 changed files with 67 additions and 3 deletions

View File

@ -368,9 +368,7 @@
_scrubberView.delegate = self;
_scrubberView.clipsToBounds = false;
}
[self detectFaces];
[self presentTab:_currentTab];
}

View File

@ -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
}

View File

@ -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>

View File

@ -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? {

View File

@ -1088,7 +1088,9 @@ public final class OngoingGroupCallContext {
}
func activateIncomingAudio() {
#if os(iOS)
self.context.activateIncomingAudio()
#endif
}
}