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
case "telegram_message":
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 {
title = item.presentationData.strings.Conversation_LiveStream
} else {
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
} else {
actionTitle = item.presentationData.strings.Conversation_JoinVoiceChatAsListener

View File

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

View File

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