mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various fixes
This commit is contained in:
parent
0f87a813e9
commit
d44cee406c
@ -336,6 +336,10 @@ final class PeerInputActivityManager {
|
|||||||
timeout = 8.0
|
timeout = 8.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if activity == .choosingSticker {
|
||||||
|
context.removeActivity(peerId: peerId, activity: .typingText, episodeId: nil)
|
||||||
|
}
|
||||||
|
|
||||||
context.addActivity(peerId: peerId, activity: activity, timeout: timeout, episodeId: episodeId, nextUpdateId: &self.nextUpdateId)
|
context.addActivity(peerId: peerId, activity: activity, timeout: timeout, episodeId: episodeId, nextUpdateId: &self.nextUpdateId)
|
||||||
|
|
||||||
if let globalContext = self.globalContext {
|
if let globalContext = self.globalContext {
|
||||||
|
@ -3889,6 +3889,9 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
}
|
}
|
||||||
|> deliverOnMainQueue).start(next: { [weak self] value in
|
|> deliverOnMainQueue).start(next: { [weak self] value in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
|
if value {
|
||||||
|
strongSelf.context.account.updateLocalInputActivity(peerId: activitySpace, activity: .typingText, isPresent: false)
|
||||||
|
}
|
||||||
strongSelf.context.account.updateLocalInputActivity(peerId: activitySpace, activity: .choosingSticker, isPresent: value)
|
strongSelf.context.account.updateLocalInputActivity(peerId: activitySpace, activity: .choosingSticker, isPresent: value)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -523,7 +523,23 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
|||||||
}
|
}
|
||||||
self.updateVisibility()
|
self.updateVisibility()
|
||||||
|
|
||||||
if let animationItems = item.associatedData.additionalAnimatedEmojiStickers[item.message.text.strippedEmoji] {
|
let textEmoji = item.message.text.strippedEmoji
|
||||||
|
var additionalTextEmoji = textEmoji
|
||||||
|
let (basicEmoji, fitz) = item.message.text.basicEmoji
|
||||||
|
if ["💛", "💙", "💚", "💜", "🧡", "🖤"].contains(textEmoji) {
|
||||||
|
additionalTextEmoji = "❤️".strippedEmoji
|
||||||
|
} else if fitz != nil {
|
||||||
|
additionalTextEmoji = basicEmoji
|
||||||
|
}
|
||||||
|
|
||||||
|
var animationItems: [Int: StickerPackItem]?
|
||||||
|
if let items = item.associatedData.additionalAnimatedEmojiStickers[item.message.text.strippedEmoji] {
|
||||||
|
animationItems = items
|
||||||
|
} else if let items = item.associatedData.additionalAnimatedEmojiStickers[additionalTextEmoji] {
|
||||||
|
animationItems = items
|
||||||
|
}
|
||||||
|
|
||||||
|
if let animationItems = animationItems {
|
||||||
for (_, animationItem) in animationItems {
|
for (_, animationItem) in animationItems {
|
||||||
self.disposables.add(freeMediaFileInteractiveFetched(account: item.context.account, fileReference: .standalone(media: animationItem.file)).start())
|
self.disposables.add(freeMediaFileInteractiveFetched(account: item.context.account, fileReference: .standalone(media: animationItem.file)).start())
|
||||||
}
|
}
|
||||||
@ -1405,7 +1421,15 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let textEmoji = item.message.text.strippedEmoji
|
let textEmoji = item.message.text.strippedEmoji
|
||||||
guard let animationItems = item.associatedData.additionalAnimatedEmojiStickers[textEmoji], index < 10, let file = animationItems[index]?.file else {
|
var additionalTextEmoji = textEmoji
|
||||||
|
let (basicEmoji, fitz) = item.message.text.basicEmoji
|
||||||
|
if ["💛", "💙", "💚", "💜", "🧡", "🖤"].contains(textEmoji) {
|
||||||
|
additionalTextEmoji = "❤️".strippedEmoji
|
||||||
|
} else if fitz != nil {
|
||||||
|
additionalTextEmoji = basicEmoji
|
||||||
|
}
|
||||||
|
|
||||||
|
guard let animationItems = item.associatedData.additionalAnimatedEmojiStickers[additionalTextEmoji], index < 10, let file = animationItems[index]?.file else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let source = AnimatedStickerResourceSource(account: item.context.account, resource: file.resource, fitzModifier: nil)
|
let source = AnimatedStickerResourceSource(account: item.context.account, resource: file.resource, fitzModifier: nil)
|
||||||
@ -1564,11 +1588,19 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
|||||||
let text = item.message.text
|
let text = item.message.text
|
||||||
if var firstScalar = text.unicodeScalars.first {
|
if var firstScalar = text.unicodeScalars.first {
|
||||||
var textEmoji = text.strippedEmoji
|
var textEmoji = text.strippedEmoji
|
||||||
let originalTextEmoji = textEmoji
|
var additionalTextEmoji = textEmoji
|
||||||
if beatingHearts.contains(firstScalar.value) {
|
if beatingHearts.contains(firstScalar.value) {
|
||||||
textEmoji = "❤️"
|
textEmoji = "❤️"
|
||||||
firstScalar = UnicodeScalar(heart)!
|
firstScalar = UnicodeScalar(heart)!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let (basicEmoji, fitz) = text.basicEmoji
|
||||||
|
if ["💛", "💙", "💚", "💜", "🧡", "🖤", "❤️"].contains(textEmoji) {
|
||||||
|
additionalTextEmoji = "❤️".strippedEmoji
|
||||||
|
} else if fitz != nil {
|
||||||
|
additionalTextEmoji = basicEmoji
|
||||||
|
}
|
||||||
|
|
||||||
return .optionalAction({
|
return .optionalAction({
|
||||||
var haptic: EmojiHaptic?
|
var haptic: EmojiHaptic?
|
||||||
if let current = self.haptic {
|
if let current = self.haptic {
|
||||||
@ -1585,7 +1617,7 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
|||||||
self.haptic = haptic
|
self.haptic = haptic
|
||||||
}
|
}
|
||||||
|
|
||||||
if let animationItems = item.associatedData.additionalAnimatedEmojiStickers[originalTextEmoji] {
|
if let animationItems = item.associatedData.additionalAnimatedEmojiStickers[additionalTextEmoji] {
|
||||||
let syncAnimations = item.message.id.peerId.namespace == Namespaces.Peer.CloudUser
|
let syncAnimations = item.message.id.peerId.namespace == Namespaces.Peer.CloudUser
|
||||||
let playHaptic = haptic == nil
|
let playHaptic = haptic == nil
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user