mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix haptic on emoji without sounds
This commit is contained in:
parent
3a865c3e6a
commit
4838bdc126
@ -1699,8 +1699,10 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
let emojiSounds = AnimatedEmojiSoundsConfiguration.with(appConfiguration: appConfiguration, account: item.context.account)
|
let emojiSounds = AnimatedEmojiSoundsConfiguration.with(appConfiguration: appConfiguration, account: item.context.account)
|
||||||
|
var hasSound = false
|
||||||
for (emoji, file) in emojiSounds.sounds {
|
for (emoji, file) in emojiSounds.sounds {
|
||||||
if emoji.strippedEmoji == textEmoji.strippedEmoji {
|
if emoji.strippedEmoji == textEmoji.strippedEmoji {
|
||||||
|
hasSound = true
|
||||||
let mediaManager = item.context.sharedContext.mediaManager
|
let mediaManager = item.context.sharedContext.mediaManager
|
||||||
let mediaPlayer = MediaPlayer(audioSessionManager: mediaManager.audioSession, postbox: item.context.account.postbox, resourceReference: .standalone(resource: file.resource), streamable: .none, video: false, preferSoftwareDecoding: false, enableSound: true, fetchAutomatically: true, ambient: true)
|
let mediaPlayer = MediaPlayer(audioSessionManager: mediaManager.audioSession, postbox: item.context.account.postbox, resourceReference: .standalone(resource: file.resource), streamable: .none, video: false, preferSoftwareDecoding: false, enableSound: true, fetchAutomatically: true, ambient: true)
|
||||||
mediaPlayer.togglePlayPause()
|
mediaPlayer.togglePlayPause()
|
||||||
@ -1728,7 +1730,12 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
animationNode?.play()
|
if !hasSound {
|
||||||
|
if let haptic = haptic, !haptic.active {
|
||||||
|
haptic.start(time: 0.0)
|
||||||
|
}
|
||||||
|
animationNode?.play()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user