Fix url parsing

This commit is contained in:
Ali 2021-09-13 22:26:16 +04:00
parent 12f7419b55
commit ed139973e0
3 changed files with 6 additions and 6 deletions

View File

@ -289,13 +289,13 @@ final class ChatMessageWebpageBubbleContentNode: ChatMessageBubbleContentNode {
actionTitle = item.presentationData.strings.Conversation_ViewGroup actionTitle = item.presentationData.strings.Conversation_ViewGroup
case "telegram_message": case "telegram_message":
actionTitle = item.presentationData.strings.Conversation_ViewMessage actionTitle = item.presentationData.strings.Conversation_ViewMessage
case "telegram_voicechat": case "telegram_voicechat", "telegram_livestream", "telegram_videochat":
if let channel = item.message.peers[item.message.id.peerId] as? TelegramChannel, case let .broadcast = channel.info { if let channel = item.message.peers[item.message.id.peerId] as? TelegramChannel, case let .broadcast = channel.info {
title = item.presentationData.strings.Conversation_LiveStream title = item.presentationData.strings.Conversation_LiveStream
} else { } else {
title = item.presentationData.strings.Conversation_VoiceChat title = item.presentationData.strings.Conversation_VoiceChat
} }
if webpage.url.contains("voicechat=") { if webpage.url.contains("voicechat=") || webpage.url.contains("videochat=") || webpage.url.contains("livestream=") {
actionTitle = item.presentationData.strings.Conversation_JoinVoiceChatAsSpeaker actionTitle = item.presentationData.strings.Conversation_JoinVoiceChatAsSpeaker
} else { } else {
actionTitle = item.presentationData.strings.Conversation_JoinVoiceChatAsListener actionTitle = item.presentationData.strings.Conversation_JoinVoiceChatAsListener

View File

@ -624,10 +624,10 @@ func openExternalUrlImpl(context: AccountContext, urlContext: OpenURLContext, ur
game = value game = value
} else if queryItem.name == "post" { } else if queryItem.name == "post" {
post = value post = value
} else if queryItem.name == "voicechat" { } else if queryItem.name == "voicechat" || queryItem.name == "videochat" || queryItem.name == "livestream" {
voiceChat = value voiceChat = value
} }
} else if queryItem.name == "voicechat" { } else if queryItem.name == "voicechat" || queryItem.name == "videochat" || queryItem.name == "livestream" {
voiceChat = "" voiceChat = ""
} }
} }

View File

@ -136,10 +136,10 @@ public func parseInternalUrl(query: String) -> ParsedInternalUrl? {
return .peerName(peerName, .groupBotStart(value)) return .peerName(peerName, .groupBotStart(value))
} else if queryItem.name == "game" { } else if queryItem.name == "game" {
return nil return nil
} else if queryItem.name == "voicechat" { } else if queryItem.name == "voicechat" || queryItem.name == "videochat" || queryItem.name == "livestream" {
return .peerName(peerName, .voiceChat(value)) return .peerName(peerName, .voiceChat(value))
} }
} else if queryItem.name == "voicechat" { } else if queryItem.name == "voicechat" || queryItem.name == "videochat" || queryItem.name == "livestream" {
return .peerName(peerName, .voiceChat(nil)) return .peerName(peerName, .voiceChat(nil))
} }
} }