mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-05-12 08:31:34 +02:00
chore: migrate to new version + fixed several critical bugs
- Migrated project to latest Telegram iOS base (v12.3.2+) - Fixed circular dependency between GhostModeManager and MiscSettingsManager - Fixed multiple Bazel build configuration errors (select() default conditions) - Fixed duplicate type definitions in PeerInfoScreen - Fixed swiftmodule directory resolution in build scripts - Added Ghostgram Settings tab in main Settings menu with all 5 features - Cleared sensitive credentials from config.json (template-only now) - Excluded bazel-cache from version control
This commit is contained in:
@@ -1663,7 +1663,7 @@ public func universalServiceMessageString(presentationData: (PresentationTheme,
|
||||
case .stars:
|
||||
priceString = strings.Notification_StarsGiftOffer_OfferYou_Stars(Int32(clamping: amount.amount.value))
|
||||
case .ton:
|
||||
priceString = "\(amount.amount) TON"
|
||||
priceString = formatTonAmountText(amount.amount.value, dateTimeFormat: dateTimeFormat) + " TON"
|
||||
}
|
||||
|
||||
attributedString = addAttributesToStringWithRanges(strings.Notification_StarsGiftOffer_OfferYou(peerName, priceString, giftTitle)._tuple, body: bodyAttributes, argumentAttributes: attributes)
|
||||
@@ -1673,7 +1673,7 @@ public func universalServiceMessageString(presentationData: (PresentationTheme,
|
||||
case .stars:
|
||||
priceString = strings.Notification_StarsGiftOffer_Offer_Stars(Int32(clamping: amount.amount.value))
|
||||
case .ton:
|
||||
priceString = "\(amount.amount) TON"
|
||||
priceString = formatTonAmountText(amount.amount.value, dateTimeFormat: dateTimeFormat) + " TON"
|
||||
}
|
||||
|
||||
attributedString = addAttributesToStringWithRanges(strings.Notification_StarsGiftOffer_Offer(peerName, priceString, giftTitle)._tuple, body: bodyAttributes, argumentAttributes: attributes)
|
||||
@@ -1696,7 +1696,7 @@ public func universalServiceMessageString(presentationData: (PresentationTheme,
|
||||
case .stars:
|
||||
priceString = strings.Notification_StarsGiftOffer_ExpiredYou_Stars(Int32(clamping: amount.amount.value))
|
||||
case .ton:
|
||||
priceString = "\(amount.amount) TON"
|
||||
priceString = formatTonAmountText(amount.amount.value, dateTimeFormat: dateTimeFormat) + " TON"
|
||||
}
|
||||
|
||||
var attributes = peerMentionsAttributes(primaryTextColor: primaryTextColor, peerIds: peerIds)
|
||||
@@ -1709,7 +1709,7 @@ public func universalServiceMessageString(presentationData: (PresentationTheme,
|
||||
case .stars:
|
||||
priceString = strings.Notification_StarsGiftOffer_Expired_Stars(Int32(clamping: amount.amount.value))
|
||||
case .ton:
|
||||
priceString = "\(amount.amount) TON"
|
||||
priceString = formatTonAmountText(amount.amount.value, dateTimeFormat: dateTimeFormat) + " TON"
|
||||
}
|
||||
|
||||
let timeString = "[TODO]"
|
||||
@@ -1730,7 +1730,7 @@ public func universalServiceMessageString(presentationData: (PresentationTheme,
|
||||
case .stars:
|
||||
priceString = strings.Notification_StarsGiftOffer_Rejected_Stars(Int32(clamping: amount.amount.value))
|
||||
case .ton:
|
||||
priceString = "\(amount.amount) TON"
|
||||
priceString = formatTonAmountText(amount.amount.value, dateTimeFormat: dateTimeFormat) + " TON"
|
||||
}
|
||||
|
||||
var attributes = peerMentionsAttributes(primaryTextColor: primaryTextColor, peerIds: peerIds)
|
||||
@@ -1764,6 +1764,35 @@ public func universalServiceMessageString(presentationData: (PresentationTheme,
|
||||
resultTitleString = strings.Conversation_StoryExpiredMentionTextOutgoing(compactPeerName)
|
||||
}
|
||||
attributedString = addAttributesToStringWithRanges(resultTitleString._tuple, body: bodyAttributes, argumentAttributes: [0: boldAttributes])
|
||||
} else if let dice = media as? TelegramMediaDice, let gameOutcome = dice.gameOutcome {
|
||||
if let value = dice.value {
|
||||
let rawString: String
|
||||
if message.author?.id == accountPeerId {
|
||||
if value == 1, let tonAmount = dice.tonAmount {
|
||||
let value = formatTonAmountText(tonAmount, dateTimeFormat: dateTimeFormat)
|
||||
rawString = strings.Conversation_EmojiStake_LostYou(value).string
|
||||
} else {
|
||||
let value = formatTonAmountText(gameOutcome.tonAmount, dateTimeFormat: dateTimeFormat)
|
||||
rawString = strings.Conversation_EmojiStake_WonYou(value).string
|
||||
}
|
||||
} else {
|
||||
let compactPeerName = message.peers[message.id.peerId].flatMap(EnginePeer.init)?.compactDisplayTitle ?? ""
|
||||
if value == 1, let tonAmount = dice.tonAmount {
|
||||
let value = formatTonAmountText(tonAmount, dateTimeFormat: dateTimeFormat)
|
||||
rawString = strings.Conversation_EmojiStake_Lost(compactPeerName, value).string
|
||||
} else {
|
||||
let value = formatTonAmountText(gameOutcome.tonAmount, dateTimeFormat: dateTimeFormat)
|
||||
rawString = strings.Conversation_EmojiStake_Won(compactPeerName, value).string
|
||||
}
|
||||
}
|
||||
|
||||
let attributedText = NSMutableAttributedString(string: rawString, font: titleFont, textColor: primaryTextColor)
|
||||
if let range = attributedText.string.range(of: "$") {
|
||||
attributedText.addAttribute(ChatTextInputAttributes.customEmoji, value: ChatTextInputTextCustomEmojiAttribute(interactivelySelectedFromPackId: nil, fileId: 0, file: nil, custom: .ton(tinted: true)), range: NSRange(range, in: attributedText.string))
|
||||
attributedText.addAttribute(.baselineOffset, value: 1.5, range: NSRange(range, in: attributedText.string))
|
||||
}
|
||||
attributedString = attributedText
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user