mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-03 21:16:35 +00:00
Various fixes
This commit is contained in:
parent
db60f2c82d
commit
cd61767f68
@ -854,7 +854,7 @@ public func createGiveawayController(context: AccountContext, updatedPresentatio
|
||||
let expiryDate = calendar.date(byAdding: .day, value: 3, to: calendar.date(from: components)!)!
|
||||
let expiryTime = Int32(expiryDate.timeIntervalSince1970)
|
||||
|
||||
let minDate = currentTime + 60 * 30
|
||||
let minDate = currentTime + 60 * 1
|
||||
let maxDate = currentTime + context.userLimits.maxGiveawayPeriodSeconds
|
||||
|
||||
let initialState: CreateGiveawayControllerState = CreateGiveawayControllerState(mode: .giveaway, subscriptions: initialSubscriptions, time: expiryTime)
|
||||
@ -1099,7 +1099,9 @@ public func createGiveawayController(context: AccountContext, updatedPresentatio
|
||||
let quantity: Int32
|
||||
switch state.mode {
|
||||
case .giveaway:
|
||||
purpose = .giveaway(boostPeer: peerId, additionalPeerIds: state.channels.filter { $0 != peerId }, countries: state.countries, onlyNewSubscribers: state.onlyNewEligible, showWinners: state.showWinners, prizeDescription: state.prizeDescription.isEmpty ? nil : state.prizeDescription, randomId: Int64.random(in: .min ..< .max), untilDate: state.time, currency: currency, amount: amount)
|
||||
let currentTime = Int32(CFAbsoluteTimeGetCurrent() + kCFAbsoluteTimeIntervalSince1970)
|
||||
let untilDate = max(state.time, currentTime + 60)
|
||||
purpose = .giveaway(boostPeer: peerId, additionalPeerIds: state.channels.filter { $0 != peerId }, countries: state.countries, onlyNewSubscribers: state.onlyNewEligible, showWinners: state.showWinners, prizeDescription: state.prizeDescription.isEmpty ? nil : state.prizeDescription, randomId: Int64.random(in: .min ..< .max), untilDate: untilDate, currency: currency, amount: amount)
|
||||
quantity = selectedProduct.giftOption.storeQuantity
|
||||
case .gift:
|
||||
purpose = .giftCode(peerIds: state.peers, boostPeer: peerId, currency: currency, amount: amount)
|
||||
|
||||
@ -230,7 +230,7 @@ private class AdMessagesHistoryContextImpl {
|
||||
self.sponsorInfo = try container.decodeIfPresent(String.self, forKey: .sponsorInfo)
|
||||
self.additionalInfo = try container.decodeIfPresent(String.self, forKey: .additionalInfo)
|
||||
|
||||
self.canReport = try container.decodeIfPresent(Bool.self, forKey: .displayAvatar) ?? false
|
||||
self.canReport = try container.decodeIfPresent(Bool.self, forKey: .canReport) ?? false
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
|
||||
@ -510,9 +510,6 @@ public final class ChatMessageWebpageBubbleContentNode: ChatMessageBubbleContent
|
||||
break
|
||||
}
|
||||
}
|
||||
if adAttribute.displayAvatar && adAttribute.canReport, let profileImage = item.message.author?.smallProfileImage {
|
||||
mediaAndFlags = (TelegramMediaImage(imageId: MediaId(namespace: 0, id: 0), representations: [profileImage], immediateThumbnailData: nil, reference: nil, partialReference: nil, flags: []), [.preferMediaInline])
|
||||
}
|
||||
|
||||
if adAttribute.canReport {
|
||||
titleBadge = item.presentationData.strings.Message_AdWhatIsThis
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user